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

Fix unmatched characters in Puppet lexer #1288

Merged
merged 3 commits into from
Jul 30, 2019

Conversation

pyrmont
Copy link
Contributor

@pyrmont pyrmont commented Jul 30, 2019

The Puppet lexer does not match . or |, two valid characters. This PR fixes this bug.

The Puppet lexer does not match `.` or `|`, two valid characters. This
commit fixes this bug.
@pyrmont pyrmont added the needs-review The PR needs to be reviewed label Jul 30, 2019
@pyrmont
Copy link
Contributor Author

pyrmont commented Jul 30, 2019

The error was discovered during code review for #903.

@ananace, would you be able to have a look over this and see if you think it's still missing anything? I'm not familiar enough with Puppet to be the best judge.

@ananace
Copy link
Contributor

ananace commented Jul 30, 2019

It looks quite reasonable to me.

The only thing I can see that the current lexer wouldn't handle properly is complex string interpolations, things like;

notice("This computer has the following partitions:\n${facts["partitions"].map |$k,$v| { "$k mounted at ${v["mount"]} (${v["size"]})\n" }.join}")

(Though as this is a very niche use-case, it's probably not worth spending much time on if it's not a simple solution)

@pyrmont
Copy link
Contributor Author

pyrmont commented Jul 30, 2019

@ananace Yeah, that seems like something not worth worrying too much about at this stage. Thanks for looking at this so quickly—I'll merge this in and then rebase #903.

@pyrmont pyrmont merged commit 4b00453 into rouge-ruby:master Jul 30, 2019
@jneen
Copy link
Member

jneen commented Jul 30, 2019

String interpolations shouldn't be difficult! It's what the stack model was made for :]

@pyrmont
Copy link
Contributor Author

pyrmont commented Jul 30, 2019

@jneen But I'm lazy :P

@pyrmont pyrmont removed the needs-review The PR needs to be reviewed label Jul 30, 2019
@pyrmont pyrmont deleted the bugfix.puppet-missed-chars branch January 8, 2020 20:08
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 this pull request may close these issues.

None yet

3 participants