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

lfx pre test adding expression syntax rules and refine test cases #10

Merged
merged 2 commits into from
May 17, 2024

Conversation

Vishalk91-4
Copy link
Contributor

@Vishalk91-4 Vishalk91-4 commented May 14, 2024

1. Does this PR affect any open issues?(Y/N) and add issue references (e.g. "fix #123", "re #123".):

  • N
  • Y
re #8

2. What is the scope of this PR (e.g. component or file name):

In the test/corpus I did add test cases for unary expressions, conditonal expressions and slice expressions.

3. Provide a description of the PR(e.g. more details, effects, motivations or doc link):

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Other

4. Are there any breaking changes?(Y/N) and describe the breaking changes(e.g. more details, motivations or doc link):

  • N
  • Y

5. Are there test cases for these changes?(Y/N) select and add more details, references or doc links:

  • Unit test
  • Integration test
  • Benchmark (add benchmark stats below)
  • Manual test (add detailed scripts or steps below)
  • Other

@Peefy
Copy link
Contributor

Peefy commented May 15, 2024

You can refer the following docs, impls and avoid submitting syntax unrelated to KCL.

@Vishalk91-4
Copy link
Contributor Author

You can refer the following docs, impls and avoid submitting syntax unrelated to KCL.

Sorry, mistakenly overlooked that
Will change things nd submit those relatd to KCL

@Vishalk91-4
Copy link
Contributor Author

Vishalk91-4 commented May 15, 2024

You can refer the following docs, impls and avoid submitting syntax unrelated to KCL.

Just to confirm @Peefy
Do we have to add the remaining expression, statements,.. in grammar.js and add the tests for them in test/corpus/

@Peefy
Copy link
Contributor

Peefy commented May 15, 2024

Just to confirm @Peefy Do we have to add the remaining expression, statements,.. in grammar.js and add the tests for them in test/corpus/

Yes. Different expressions and syntax are added to grammar.js, which are relatively independent. Add/modify syntax one by one and add test cases in test/corpus/. You can view the pass status and diff of test cases in CI https://github.com/kcl-lang/tree-sitter-kcl/actions/runs/9085992382/job/24979088541?pr=10

@Daksh-10
Copy link
Contributor

Is there any documentation of what should be the output for the expressions when the syntax tree is drawn for them. For example,
image
Here, how would we know, that we need to specify a string like this for 'kcl' language.

@Peefy
Copy link
Contributor

Peefy commented May 17, 2024

Hello @Daksh-10 , do you mean the tree-sitter grammar for the KCL string? https://github.com/kcl-lang/tree-sitter-kcl/blob/main/grammar.js#L660

If you want to know how tree-sitter grammar syntax and principle, you can refer https://tree-sitter.github.io/

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

@Peefy Peefy merged commit 51bd515 into kcl-lang:main May 17, 2024
2 checks passed
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