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

bug: Some tests fail #3

Open
2 tasks done
dmitry-salin opened this issue May 18, 2024 · 0 comments
Open
2 tasks done

bug: Some tests fail #3

dmitry-salin opened this issue May 18, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@dmitry-salin
Copy link

dmitry-salin commented May 18, 2024

Did you check existing issues?

  • I have read all the tree-sitter docs if it relates to using the parser
  • I have searched the existing issues of tree-sitter-python

Tree-Sitter CLI Version, if relevant (output of tree-sitter --version)

tree-sitter 0.22.6

Describe the bug

I found that some features broke some tests. We must not forget to fix this.

e83c91d breaks:

  1. ✗ An error before a string literal
@@ -924,7 +924,10 @@ module.exports = grammar({
     attribute: $ => prec(PREC.call, seq(
       field('object', $.primary_expression),
       '.',
-      field('attribute', $.identifier),
+      choice(
+        field('attribute', $.identifier),
+        seq($.string_start, $.string_content, $.string_end),
+      ),
     )),

3d7c53b breaks:
45. ✗ Lists

@@ -749,8 +765,7 @@ module.exports = grammar({
       $.none,
       $.unary_operator,
       $.attribute,
-      $.subscript,
-      $.call,
+      choice(prec.dynamic(-1, $.subscript), prec.dynamic(1, $.call)),
       $.list,
       $.list_comprehension,
       $.dictionary,
 (edited)

Steps To Reproduce/Bad Parse Tree

  1. Run tree-sitter test

Expected Behavior/Parse Tree

All tests passed.

Repro

No response

@dmitry-salin dmitry-salin added the bug Something isn't working label May 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant