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

Comments not allowed in module usage. #2200

Closed
Spatenheinz opened this issue Jun 27, 2024 · 1 comment · Fixed by #2201
Closed

Comments not allowed in module usage. #2200

Spatenheinz opened this issue Jun 27, 2024 · 1 comment · Fixed by #2201

Comments

@Spatenheinz
Copy link
Contributor

This fails parsing

mod foo #breaking comment

I dont see anything that should be problematic with this approach?
Specifically I can see that modules are only matched when:

          Some(Keyword::Mod)
            if self.next_are(&[Identifier, Identifier, StringToken])
              || self.next_are(&[Identifier, Identifier, Identifier, StringToken])
              || self.next_are(&[Identifier, Identifier, Eof])
              || self.next_are(&[Identifier, Identifier, Eol])
              || self.next_are(&[Identifier, QuestionMark]) =>

Is there a reason to explicitly match on Eof and Eol?
Also what does the triple indentifier, StringToken match?

@casey casey linked a pull request Jun 27, 2024 that will close this issue
@casey
Copy link
Owner

casey commented Jun 27, 2024

Good catch! Fixed in #2201.

Identifier, Identifier, Identifier, StringToken catches this case, which uses a shell-expanded string:

mod foo x"$HELLO/bar.just"

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 a pull request may close this issue.

2 participants