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

reserved "field_name" incorrectly reports as error #11

Closed
coder3101 opened this issue Jul 19, 2024 · 0 comments · Fixed by #12
Closed

reserved "field_name" incorrectly reports as error #11

coder3101 opened this issue Jul 19, 2024 · 0 comments · Fixed by #12
Labels
bug Something isn't working

Comments

@coder3101
Copy link
Owner

coder3101 commented Jul 19, 2024

Reserved fields show as syntax error:

syntax = "proto3";

package test;

message Foo {
	reserved 1;
	reserved "baz"; // shows as syntax error
	int bar = 2;
}

despite reported tree-sitter AST not contains any error nodes.

(source_file ; [0, 0] - [9, 0]
  (syntax) ; [0, 0] - [0, 18]
  (package ; [2, 0] - [2, 13]
    (full_ident ; [2, 8] - [2, 12]
      (identifier))) ; [2, 8] - [2, 12]
  (message ; [4, 0] - [8, 1]
    (message_name ; [4, 8] - [4, 11]
      (identifier)) ; [4, 8] - [4, 11]
    (message_body ; [4, 12] - [8, 1]
      (reserved ; [5, 1] - [5, 12]
        (ranges ; [5, 10] - [5, 11]
          (range ; [5, 10] - [5, 11]
            (int_lit ; [5, 10] - [5, 11]
              (decimal_lit))))) ; [5, 10] - [5, 11]
      (reserved ; [6, 1] - [6, 16]
        (field_names ; [6, 10] - [6, 15]
          (string))) ; [6, 10] - [6, 15]
      (field ; [7, 1] - [7, 13]
        (type ; [7, 1] - [7, 4]
          (message_or_enum_type ; [7, 1] - [7, 4]
            (identifier))) ; [7, 1] - [7, 4]
        (identifier) ; [7, 5] - [7, 8]
        (field_number ; [7, 11] - [7, 12]
          (int_lit ; [7, 11] - [7, 12]
            (decimal_lit))))))) ; [7, 11] - [7, 12]

@coder3101 coder3101 added the bug Something isn't working label Jul 19, 2024
@coder3101 coder3101 linked a pull request Jul 20, 2024 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant