Skip to content

Commit

Permalink
[refactor] Move the AST utils into taichi.lang.ast (taichi-dev#3063)
Browse files Browse the repository at this point in the history
  • Loading branch information
k-ye authored Oct 2, 2021
1 parent 21ea0fe commit 323735f
Show file tree
Hide file tree
Showing 9 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion python/taichi/lang/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from taichi.core.util import locale_encode
from taichi.core.util import ti_core as _ti_core
from taichi.lang import impl, types
from taichi.lang.ast.transformer import TaichiSyntaxError
from taichi.lang.enums import Layout
from taichi.lang.exception import InvalidOperationError
from taichi.lang.impl import *
Expand All @@ -20,7 +21,6 @@
from taichi.lang.sparse_matrix import SparseMatrix, SparseMatrixBuilder
from taichi.lang.sparse_solver import SparseSolver
from taichi.lang.struct import Struct
from taichi.lang.transformer import TaichiSyntaxError
from taichi.lang.type_factory_impl import type_factory
from taichi.lang.util import (has_pytorch, is_taichi_class, python_scope,
taichi_scope, to_numpy_type, to_pytorch_type,
Expand Down
1 change: 1 addition & 0 deletions python/taichi/lang/ast/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import ast

from taichi.lang import impl
from taichi.lang.ast_resolver import ASTResolver
from taichi.lang.ast.symbol_resolver import ASTResolver
from taichi.lang.exception import TaichiSyntaxError

import taichi as ti
Expand Down
2 changes: 1 addition & 1 deletion python/taichi/lang/expr_builder.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import ast
import warnings

from taichi.lang.ast.symbol_resolver import ASTResolver
from taichi.lang.ast_builder_utils import *
from taichi.lang.ast_resolver import ASTResolver
from taichi.lang.exception import TaichiSyntaxError

import taichi as ti
Expand Down
4 changes: 2 additions & 2 deletions python/taichi/lang/kernel_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
import numpy as np
from taichi.core.util import ti_core as _ti_core
from taichi.lang import impl, util
from taichi.lang.ast_checker import KernelSimplicityASTChecker
from taichi.lang.ast.checkers import KernelSimplicityASTChecker
from taichi.lang.ast.transformer import ASTTransformerTotal
from taichi.lang.exception import TaichiSyntaxError
from taichi.lang.kernel_arguments import (any_arr, sparse_matrix_builder,
template)
from taichi.lang.ndarray import Ndarray
from taichi.lang.shell import _shell_pop_print, oinspect
from taichi.lang.transformer import ASTTransformerTotal
from taichi.misc.util import obsolete
from taichi.type import primitive_types

Expand Down
2 changes: 1 addition & 1 deletion python/taichi/lang/stmt_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
import copy

from taichi.lang import impl
from taichi.lang.ast.symbol_resolver import ASTResolver
from taichi.lang.ast_builder_utils import *
from taichi.lang.ast_resolver import ASTResolver
from taichi.lang.exception import TaichiSyntaxError
from taichi.lang.expr_builder import build_expr, build_exprs
from taichi.lang.util import to_taichi_type
Expand Down
2 changes: 1 addition & 1 deletion tests/python/test_ast_resolver.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import ast
from collections import namedtuple

from taichi.lang.ast_resolver import ASTResolver
from taichi.lang.ast.symbol_resolver import ASTResolver


def test_ast_resolver_basic():
Expand Down

0 comments on commit 323735f

Please sign in to comment.