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

Parse failure with block comment in struct definition #56

Closed
fredrikekre opened this issue Oct 11, 2022 · 1 comment · Fixed by #153
Closed

Parse failure with block comment in struct definition #56

fredrikekre opened this issue Oct 11, 2022 · 1 comment · Fixed by #153
Labels
bug Something isn't working

Comments

@fredrikekre
Copy link

Source:

struct Foo
    bar::Int
    #= const =# ibaz::Int
end

Playground:

struct_definition [0, 0] - [3, 3]
  name: identifier [0, 7] - [0, 10]
  typed_expression [1, 4] - [2, 25]
    typed_expression [1, 4] - [2, 20]
      identifier [1, 4] - [1, 7]
      ERROR [1, 9] - [1, 12]
        identifier [1, 9] - [1, 12]
      block_comment [2, 4] - [2, 15]
      identifier [2, 16] - [2, 20]
    identifier [2, 22] - [2, 25]

Note the i in front of baz -- I discovered this since my real member name started with i. If I remove it the parser trips up at another location, which seems pretty weird, but not sure if it has some significance.

Source:

struct Foo
    bar::Int
    #= const =# baz::Int
end

Playground:

struct_definition [0, 0] - [3, 3]
  name: identifier [0, 7] - [0, 10]
  typed_expression [1, 4] - [2, 24]
    typed_expression [1, 4] - [1, 12]
      identifier [1, 4] - [1, 7]
      identifier [1, 9] - [1, 12]
    block_comment [2, 4] - [2, 15]
    ERROR [2, 16] - [2, 19]
      identifier [2, 16] - [2, 19]
    identifier [2, 21] - [2, 24]
@savq savq added the bug Something isn't working label Jun 24, 2023
@fredrikekre
Copy link
Author

Still an issue but the i doesn't matter anymore:

struct Foo
    bar::Int
    #= const =# baz::Int
end
(struct_definition) ; [1:1 - 4:3]
 name: (identifier) ; [1:8 - 10]
 (typed_expression) ; [2:5 - 3:24]
  (typed_expression) ; [2:5 - 12]
   (identifier) ; [2:5 - 7]
   (identifier) ; [2:10 - 12]
  (block_comment) ; [3:5 - 15]
  (ERROR) ; [3:17 - 19]
  (identifier) ; [3:22 - 24]

@savq savq mentioned this issue Sep 26, 2024
@savq savq closed this as completed in #153 Nov 5, 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

Successfully merging a pull request may close this issue.

2 participants