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

Update the tokeniser to differentiate between unquoted strings and function names #640

Merged
merged 3 commits into from
Feb 23, 2017

Conversation

rodjek
Copy link
Owner

@rodjek rodjek commented Feb 23, 2017

Currently, when the tokeniser hits a function call like lookup('foo'), it splits it into a series of tokens like :NAME, :LPAREN, :SSTRING, :RPAREN. While this is technically correct, it makes it harder for us to differentiate between an unquoted string and a function name when examining the tokenised file.

My proposed change introduces a new :FUNCTION_NAME token type, which is evaluated before :NAME token regex and simply checks if this value is followed immediately by an :LPAREN.

As a result of this change, we can fix issues like #634 without having add any corner cases to the check logic.

Fixes #634

@rnelson0 rnelson0 merged commit bbb5da6 into master Feb 23, 2017
@rnelson0 rnelson0 deleted the issue-634 branch February 23, 2017 23:21
@rodjek rodjek modified the milestone: 2.2.0 Mar 27, 2017
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.

unquoted file mode & mode should be represented as a 4 digit when file mode is done by a lookup
2 participants