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

struct's modifiers are too sensitive to order #361

Open
danzat opened this issue Dec 9, 2024 · 0 comments
Open

struct's modifiers are too sensitive to order #361

danzat opened this issue Dec 9, 2024 · 0 comments

Comments

@danzat
Copy link

danzat commented Dec 9, 2024

For example, the following generates a parse error (ref is not adjacent to struct):

ref partial struct S {}

Error:

compilation_unit [0, 0] - [2, 0]
  ERROR [0, 0] - [0, 20]
    variable_declaration [0, 0] - [0, 18]
      type: ref_type [0, 0] - [0, 11]
        type: identifier [0, 4] - [0, 11]
      variable_declarator [0, 12] - [0, 18]
        name: identifier [0, 12] - [0, 18]
  global_statement [0, 21] - [0, 23]
    block [0, 21] - [0, 23]

Whereas (ref is adjacent to struct):

partial ref struct S {}

Is fine:

compilation_unit [0, 0] - [1, 0]
  struct_declaration [0, 0] - [0, 23]
    modifier [0, 0] - [0, 7]
    name: identifier [0, 19] - [0, 20]
    body: declaration_list [0, 21] - [0, 23]

It's enough to have just one such error in a file to completely mess up its parsing.

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

No branches or pull requests

1 participant