Skip to content
This repository has been archived by the owner on Sep 12, 2024. It is now read-only.

Commit

Permalink
Lint fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
marsninja committed Nov 17, 2023
1 parent fd33789 commit 788c6c8
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 16 deletions.
1 change: 0 additions & 1 deletion jaclang/jac/absyntree.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import pprint
from typing import Any, Callable, Generic, Optional, Sequence, Type, TypeVar

from jaclang.jac import jac_lark as jl
from jaclang.jac.codeloc import CodeGenTarget, CodeLocInfo
from jaclang.jac.constant import Constants as Con, EdgeDir
from jaclang.jac.constant import Tokens as Tok
Expand Down
7 changes: 1 addition & 6 deletions jaclang/jac/passes/tool/fuse_comments_pass.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,15 @@
This is a pass for formatting Jac code.
"""

from typing import Any, List, Tuple

import jaclang.jac.absyntree as ast
from jaclang.jac.constant import Constants as Con
from jaclang.jac.constant import Tokens as Tok
from jaclang.jac.passes import Pass


class FuseCommentsPass(Pass):
"""JacFormat Pass format Jac code."""

def before_pass(self) -> None:
"""Before pass."""
self.all_tokens: list[ast.Token] = []
self.comments: list[ast.Token] = (
self.ir.source.comments if isinstance(self.ir, ast.Module) else []
Expand All @@ -36,7 +33,6 @@ def after_pass(self) -> None:
chomp[0].is_inline = chomp[0].is_inline or (
self.all_tokens[i].loc.first_line == chomp[0].loc.first_line
)
# print(chomp[0].is_inline)
if i == len(self.all_tokens) - 1:
if len(chomp):
new_tokens.append(self.all_tokens[i])
Expand All @@ -49,7 +45,6 @@ def after_pass(self) -> None:
)
or (self.all_tokens[i].loc.first_line > chomp[0].loc.first_line)
):
# print(chomp[0].is_inline)
new_tokens.append(chomp[0])
chomp = chomp[1:]
if not len(chomp):
Expand Down
3 changes: 2 additions & 1 deletion jaclang/jac/passes/tool/schedules.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
from typing import Type

from ..ir_pass import Pass
from jaclang.jac.passes.main.sub_node_tab_pass import SubNodeTabPass

from jaclang.jac.passes.main.sub_node_tab_pass import SubNodeTabPass # noqa: I100
from jaclang.jac.passes.main.import_pass import ImportPass # noqa: I100
from jaclang.jac.passes.main.sym_tab_build_pass import SymTabBuildPass # noqa: I100
from jaclang.jac.passes.main.def_impl_match_pass import DeclDefMatchPass # noqa: I100
Expand Down
9 changes: 1 addition & 8 deletions jaclang/jac/passes/tool/tests/test_fuse_comments_pass.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
"""Test ast build pass module."""
import ast as ast3


from jaclang.jac.passes.main import PyastGenPass
from jaclang.jac.passes.main.schedules import py_code_gen as without_format
from jaclang.jac.passes.tool import JacFormatPass
from jaclang.jac.transpiler import jac_file_to_pass, jac_str_to_pass
from jaclang.utils.test import TestCase


class FuseCommentsPassTests:
Expand All @@ -20,4 +13,4 @@ def setUp(self) -> None:

def test_simple(self) -> None:
"""Basic test for pass."""
code1 = f"with entry #* hi *# {{print('hi');}}"
# code1 = f"with entry #* hi *# {{print('hi');}}"

0 comments on commit 788c6c8

Please sign in to comment.