Skip to content

Commit

Permalink
move unpythonic.syntax.astcompat to mcpyrate.astcompat
Browse files Browse the repository at this point in the history
  • Loading branch information
Technologicat committed Sep 27, 2024
1 parent faab516 commit d0162c6
Show file tree
Hide file tree
Showing 11 changed files with 10 additions and 98 deletions.
87 changes: 0 additions & 87 deletions unpythonic/syntax/astcompat.py

This file was deleted.

2 changes: 1 addition & 1 deletion unpythonic/syntax/autocurry.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@

from mcpyrate.quotes import macros, q, a, h # noqa: F401

from mcpyrate.astcompat import TypeAlias
from mcpyrate.quotes import is_captured_value
from mcpyrate.walkers import ASTTransformer

from .astcompat import TypeAlias
from .util import (suggest_decorator_index, isx, has_curry, sort_lambda_decorators)

from ..dynassign import dyn
Expand Down
2 changes: 1 addition & 1 deletion unpythonic/syntax/autoref.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
from mcpyrate.quotes import macros, q, u, n, a, h # noqa: F401

from mcpyrate import gensym, parametricmacro
from mcpyrate.astcompat import getconstant
from mcpyrate.astfixers import fix_ctx
from mcpyrate.quotes import is_captured_value
from mcpyrate.walkers import ASTTransformer

from .astcompat import getconstant
from .nameutil import isx
from .util import ExpandedAutorefMarker
from .letdoutil import isdo, islet, ExpandedDoView, ExpandedLetView
Expand Down
2 changes: 1 addition & 1 deletion unpythonic/syntax/lambdatools.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from mcpyrate.quotes import macros, q, u, n, a, h # noqa: F401

from mcpyrate import gensym
from mcpyrate.astcompat import getconstant, Str, NamedExpr
from mcpyrate.expander import MacroExpander
from mcpyrate.quotes import is_captured_value
from mcpyrate.splicing import splice_expression
Expand All @@ -25,7 +26,6 @@
from ..misc import namelambda
from ..symbol import sym

from .astcompat import getconstant, Str, NamedExpr
from .letdo import _implicit_do, _do
from .letdoutil import islet, isenvassign, UnexpandedLetView, UnexpandedEnvAssignView, ExpandedDoView
from .nameutil import getname
Expand Down
2 changes: 1 addition & 1 deletion unpythonic/syntax/lazify.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@

from mcpyrate.quotes import macros, q, u, a, h # noqa: F401

from mcpyrate.astcompat import TypeAlias
from mcpyrate.astfixers import fix_ctx
from mcpyrate.quotes import capture_as_macro, is_captured_value
from mcpyrate.unparser import unparse
from mcpyrate.walkers import ASTTransformer

from .astcompat import TypeAlias
from .util import (suggest_decorator_index, sort_lambda_decorators, detect_lambda,
isx, getname, is_decorator)
from .letdoutil import islet, isdo, ExpandedLetView
Expand Down
2 changes: 1 addition & 1 deletion unpythonic/syntax/letdoutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
import sys

from mcpyrate import unparse
from mcpyrate.astcompat import getconstant, Str, NamedExpr
from mcpyrate.core import Done

from .astcompat import getconstant, Str, NamedExpr
from .nameutil import isx, getname

letf_name = "letter" # must match what ``unpythonic.syntax.letdo._let_expr_impl`` uses in its output.
Expand Down
3 changes: 1 addition & 2 deletions unpythonic/syntax/scopeanalyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,10 @@
Import, ImportFrom, Try, ListComp, SetComp, GeneratorExp,
DictComp, Store, Del, Global, Nonlocal)

from mcpyrate.astcompat import TryStar, MatchStar, MatchMapping, MatchClass, MatchAs
from mcpyrate.core import Done
from mcpyrate.walkers import ASTTransformer, ASTVisitor

from .astcompat import TryStar, MatchStar, MatchMapping, MatchClass, MatchAs

from ..it import uniqify

def isnewscope(tree):
Expand Down
2 changes: 1 addition & 1 deletion unpythonic/syntax/tailtools.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
from mcpyrate.quotes import macros, q, u, n, a, h # noqa: F401

from mcpyrate import gensym
from mcpyrate.astcompat import getconstant, NameConstant, TryStar
from mcpyrate.quotes import capture_as_macro, is_captured_value
from mcpyrate.utils import NestingLevelTracker
from mcpyrate.walkers import ASTTransformer, ASTVisitor

from .astcompat import getconstant, NameConstant, TryStar
from .ifexprs import aif, it
from .letdoutil import isdo, islet, ExpandedLetView, ExpandedDoView
from .util import (isx, isec,
Expand Down
2 changes: 1 addition & 1 deletion unpythonic/syntax/tests/test_letdoutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from ...syntax import macros, test, test_raises, warn, the # noqa: F401
from ...test.fixtures import session, testset

from mcpyrate.astcompat import getconstant, Num
from mcpyrate.quotes import macros, q, n # noqa: F401, F811
from mcpyrate.metatools import macros, expandrq # noqa: F811

Expand All @@ -16,7 +17,6 @@

from mcpyrate import unparse

from ...syntax.astcompat import getconstant, Num
from ...syntax.letdoutil import (canonize_bindings,
isenvassign, islet, isdo,
UnexpandedEnvAssignView,
Expand Down
2 changes: 1 addition & 1 deletion unpythonic/syntax/tests/test_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
from ...syntax import macros, do, local, test, test_raises, fail, the # noqa: F401
from ...test.fixtures import session, testset

from mcpyrate.astcompat import getconstant, Num, Str
from mcpyrate.quotes import macros, q, n, h # noqa: F401, F811
from mcpyrate.metatools import macros, expandrq # noqa: F401, F811

from ...syntax.astcompat import getconstant, Num, Str
from ...syntax.util import (isec, detect_callec,
detect_lambda,
is_decorator, has_tco, has_curry, has_deco,
Expand Down
2 changes: 1 addition & 1 deletion unpythonic/syntax/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@

from ast import Call, Lambda, FunctionDef, AsyncFunctionDef, If, stmt

from mcpyrate.astcompat import getconstant
from mcpyrate.core import add_postprocessor
from mcpyrate.markers import ASTMarker, delete_markers
from mcpyrate.quotes import is_captured_value
from mcpyrate.walkers import ASTTransformer, ASTVisitor

from .astcompat import getconstant
from .letdoutil import isdo, ExpandedDoView
from .nameutil import isx, getname

Expand Down

0 comments on commit d0162c6

Please sign in to comment.