Skip to content

Allow whitespace before CallArguments (fixes #421) #422

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

Merged
merged 1 commit into from
Aug 9, 2019

Conversation

Pike
Copy link
Contributor

@Pike Pike commented Aug 8, 2019

This is picking up the tests for projectfluent/fluent#281,
and adjusts the parser to pass those tests.

I'm not happy with the peek, but this is what makes the tests pass.

@Pike Pike requested a review from zbraniecki August 8, 2019 11:33
@@ -685,13 +687,15 @@ class FluentParser {

if (ps.isIdentifierStart()) {
const id = this.getIdentifier(ps);
ps.peekBlank();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alternatively, you could store the ptr, skipBlank and then only take currentChar === "." if stored_ptr == ptr.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's like re-implementing peek, that doesn't smell right. If I'd want to change this, I'd look for ways to structure the code so that I could just eat the whitespace, because there's no grammar structure that doesn't allow it.

But then I didn't want to invest my brain in that, too.

This is picking up the tests for projectfluent/fluent#281,
and adjusts the parser to pass those tests.
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.

2 participants