Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: adjusted some macros in kclvm-parser and add some methods in kclvm-ast #20

Merged
merged 1 commit into from
May 20, 2022

Conversation

zong-zhe
Copy link
Contributor

refactor: adjusted some macros in kclvm-parser and add some methods in kclvm-ast

Note:

  1. Adjusted the position of some macros in kclvm-parser.

What:

  1. Move some util macros for ast from kclvm-parser to kclvm-ast,
    and add some new util methods in kclvm-ast.

How:

  1. Move macros "node_ref", "expr_as" and "stmt_as" form from
    kclvm-parser/mod.rs to kclvm-ast/lib.rs
  2. Add method "build_assign_node" in kclvm-ast/lib.rs in order to
    construct an AssignStmt
  3. Add method "filter_schema_stmt_from_module" in kclvm-ast/ast.rs
    in order to select all "SchemaStmt" in "Module".
  4. Add method "TryFrom<...>" in kclvm-ast/ast.rs for "StringLit" and
    "NameConstant" in order to convert from rust string and bool to
    kclvm ast.

Why:

  1. Adjust the structure of the kclvm-ast and add some util methods to
    continuously enrich the infrastructure of KCLVM to support the
    development.
  • With pull requests:
    • Open your pull request against main
    • Your pull request should have no more than two commits, if not you should squash them.
    • It should pass all tests in the available continuous integration systems such as GitHub Actions.
    • You should add/modify tests to cover your proposed code changes.
    • If your pull request contains a new feature, please document it on the README.

@zong-zhe zong-zhe requested review from chai2010 and Peefy May 19, 2022 09:35
kclvm/ast/src/ast.rs Outdated Show resolved Hide resolved
@zong-zhe zong-zhe force-pushed the dev/zong-zhe/add_utils_to_ast branch from a79c63a to ad3f991 Compare May 19, 2022 10:09
Peefy
Peefy previously approved these changes May 19, 2022
Copy link
Contributor

@Peefy Peefy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

…n kclvm-ast.

Note:
1. Adjusted the position of some macros in kclvm-parser.

What:
1. Move some util macros for ast from kclvm-parser to kclvm-ast,
   and add some new util methods in kclvm-ast.

How:
1. Move macros "node_ref", "expr_as" and "stmt_as" form from
   kclvm-parser/mod.rs to kclvm-ast/lib.rs
2. Add method "build_assign_node" in kclvm-ast/lib.rs in order to
   construct an AssignStmt
3. Add method "filter_schema_stmt_from_module" in kclvm-ast/ast.rs
   in order to select all "SchemaStmt" in "Module".
4. Add method "TryFrom<...>" in kclvm-ast/ast.rs for "StringLit" and
   "NameConstant" in order to convert from rust string and bool to
   kclvm ast.

Why:
1. Adjust the structure of the kclvm-ast and add some util methods to
   continuously enrich the infrastructure of KCLVM to support the
   development.
Copy link
Contributor

@Peefy Peefy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@chai2010 chai2010 self-requested a review May 20, 2022 02:22
Copy link
Contributor

@chai2010 chai2010 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@chai2010 chai2010 merged commit 080c28b into main May 20, 2022
@Peefy Peefy deleted the dev/zong-zhe/add_utils_to_ast branch May 22, 2022 07:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants