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

fix: the panic output information of "invalid binary operation" is formatted using PanicInfo. #38

Merged
merged 2 commits into from
May 26, 2022

Conversation

zong-zhe
Copy link
Contributor

fix: the panic output information of "invalid binary operation" is formatted using PanicInfo.

  1. call the method "struct_token_error" in "do_parse_simple_expr" to format the panic message.
  2. add method "supported_xx()" in ast.BinOp, ast.CmpOp and ast.BinOrCmpOp for easy access to the supported operations list.
  3. adjusted the parameter type of method "struct_token_error" to fit the return value of method "supported_xx()".
  4. add test case.
  • 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.

…rmatted using PanicInfo.

1. call the method "struct_token_error" in "do_parse_simple_expr" to format the panic message.
2. add method "supported_xx()" in ast.BinOp, ast.CmpOp and ast.BinOrCmpOp for easy access to the supported operations list.
3. adjusted the parameter type of method "struct_token_error" to fit the return value of method "supported_xx()".
4. add test case.
@zong-zhe zong-zhe requested review from chai2010 and Peefy May 26, 2022 02:52
kclvm/ast/src/ast.rs Outdated Show resolved Hide resolved
kclvm/ast/src/ast.rs Outdated Show resolved Hide resolved
kclvm/ast/src/ast.rs Outdated Show resolved Hide resolved
@zong-zhe zong-zhe requested a review from Peefy May 26, 2022 03:23
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

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

@zong-zhe zong-zhe merged commit d2b931d into main May 26, 2022
@zong-zhe zong-zhe linked an issue May 31, 2022 that may be closed by this pull request
@zong-zhe zong-zhe deleted the dev/zong-zhe/fix_parse_bin_cmp_op branch June 2, 2022 02:11
eminaktas pushed a commit to eminaktas/kcl that referenced this pull request Oct 17, 2024
feat: add new sample, clickhouse-operator
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.

An unhandled syntax error was found in the kclvm-parser.parse_expr.
3 participants