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

Detect keywords Vs Identifiers ambiguity. #557

Closed
bd82 opened this issue Sep 11, 2017 · 2 comments
Closed

Detect keywords Vs Identifiers ambiguity. #557

bd82 opened this issue Sep 11, 2017 · 2 comments
Milestone

Comments

@bd82
Copy link
Member

bd82 commented Sep 11, 2017

We have the strings of the keywords. either those strings are passed directly as strings
or as simple regExps which we can extract the string from.

So we can check if any pattern could match these keywords
And if so validate that the longer_alt property is used correctly.

@bd82
Copy link
Member Author

bd82 commented Oct 16, 2017

I think this should be split up into several different validations.

  1. Unreachable Token - e.g: an Identifier appearing before a keyword.

  2. Missing longer_alt property - e.g:

    • a keyword appearing before an identifier.
    • An Integer Token appearing before a decimal Token (although we cannot easily detect this).

The missing longer_alt property can be automatically fixed in most cases simply by adding it.

  • If multiple longer_alt properties must be added than it is an error.
  • If the token already has a longer_alt property we should not validate it as we assume the user knows what they are doing.
  • It should also be possible to define the longer_alt property as Lexer.NA to explicitly
    tell the Lexer to ignore this validation, thus providing backward compatible behavior.

@bd82
Copy link
Member Author

bd82 commented Nov 10, 2017

detecting Missing longer_alt property requires more in depth regExp analysis.

@bd82 bd82 closed this as completed Nov 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant