Skip to content

Commit

Permalink
man merge
Browse files Browse the repository at this point in the history
  • Loading branch information
marsninja committed May 1, 2024
2 parents 340d53c + 471f6f5 commit 98913b6
Show file tree
Hide file tree
Showing 38 changed files with 843 additions and 121 deletions.
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[flake8]
exclude = fixtures, __jac_gen__, build, examples, vendor
exclude = fixtures, __jac_gen__, build, examples, vendor, generated
plugins = flake8_import_order, flake8_docstrings, flake8_comprehensions, flake8_bugbear, flake8_annotations, pep8_naming, flake8_simplify
max-line-length = 120
ignore = E203, W503, ANN101, ANN102
8 changes: 2 additions & 6 deletions jaclang/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,9 @@

jac_import = JacFeature.jac_import

__all__ = [
"jac_import",
"lark",
"mypy",
"pluggy",
]
pm.register(JacFeatureDefaults)
pm.register(JacBuiltin)
pm.register(JacCmdDefaults)
pm.load_setuptools_entrypoints("jac")

__all__ = ["jac_import", "lark", "mypy", "pluggy"]
2 changes: 1 addition & 1 deletion jaclang/cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ def debug(filename: str, main: bool = True, cache: bool = False) -> None:


@cmd_registry.register
def graph(
def dot(
filename: str,
initial: str = "",
depth: int = -1,
Expand Down
5 changes: 3 additions & 2 deletions jaclang/compiler/passes/main/fuse_typeinfo_pass.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,16 @@

from __future__ import annotations

import os
import traceback
from typing import Callable, TypeVar

import jaclang.compiler.absyntree as ast
from jaclang.compiler.passes import Pass
from jaclang.settings import settings
from jaclang.utils.helpers import pascal_to_snake
from jaclang.vendor.mypy.nodes import Node as VNode # bit of a hack


import mypy.nodes as MypyNodes # noqa N812
import mypy.types as MypyTypes # noqa N812
from mypy.checkexpr import Type as MyType
Expand All @@ -29,7 +30,7 @@ class FuseTypeInfoPass(Pass):
node_type_hash: dict[MypyNodes.Node | VNode, MyType] = {}

def __debug_print(self, *argv: object) -> None:
if "FuseTypeInfoDebug" in os.environ:
if settings.fuse_type_info_debug:
print("FuseTypeInfo::", *argv)

def __call_type_handler(
Expand Down
4 changes: 2 additions & 2 deletions jaclang/compiler/passes/main/import_pass.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

import ast as py_ast
import importlib.util
import os
import sys
from os import path
from typing import Optional
Expand All @@ -16,6 +15,7 @@
import jaclang.compiler.absyntree as ast
from jaclang.compiler.passes import Pass
from jaclang.compiler.passes.main import SubNodeTabPass
from jaclang.settings import settings
from jaclang.utils.helpers import import_target_to_relative_path


Expand Down Expand Up @@ -49,7 +49,7 @@ def enter_module(self, node: ast.Module) -> None:
self.annex_impl(mod)
i.sub_module = mod
i.add_kids_right([mod], pos_update=False)
elif lang == "py" and os.environ.get("JAC_PROC_DEBUG", False):
elif lang == "py" and settings.jac_proc_debug:
mod = self.import_py_module(node=i, mod_path=node.loc.mod_path)
i.sub_module = mod
i.add_kids_right([mod], pos_update=False)
Expand Down
Loading

0 comments on commit 98913b6

Please sign in to comment.