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

Add missing CoffeeScript keywords and reserved words #1061

Merged
merged 2 commits into from
May 28, 2019

Conversation

edemaine
Copy link
Contributor

@edemaine edemaine commented Jan 9, 2019

Added missing keywords:

  • until, loop, do, yield (old ones),
  • debugger (an obscure one inhereted from JavaScript), and
  • await, import, export (added in CoffeeScript 2).

Added missing reserved words based on RESERVED list in CoffeeScript source code. (Previously there were no reserved words.)

See https://coffeescript.org/annotated-source/lexer.html#constants

I also made in and of into operators, as they can be used in arbitrary context, not just in for loops, and also to be consistent with not (currently an operator). Before this PR, the not in operator formats rather inconsistently:
image

As a bonus, this last change fixes #1056.

Not addressed by this PR: for ... from doesn't highlight from (which is not a keyword), and for own doesn't highlight own (also not a keyword). Should I add these to operators, or add more complex rules to capture the context where they actually matter? This PR or another PR? Actually, same for import ... as which javascript.rb seems to just call a keyword (which is not correct -- you can assign as = 5 in JS and CS).

Added missing keywords: `until`, `loop`, `do`, `yield` (old ones),
`debugger` (an obscure one inhereted from JavaScript), and
`await`, `import`, `export` (added in CoffeeScript 2).

Added missing reserved words based on RESERVED list in CoffeeScript source code.
(Previously there were no reserved words.)

See https://coffeescript.org/annotated-source/lexer.html#constants
@pyrmont
Copy link
Contributor

pyrmont commented May 28, 2019

@edemaine Thanks for submitting this! We've recently updated our Travis configuration. Would you be able to do a force push to kick off a new round of testing?

You should be able to do something like:

$ git commit --amend
$ git push --force

@pyrmont pyrmont added the author-action The PR has been reviewed but action by the author is needed label May 28, 2019
@edemaine
Copy link
Contributor Author

@pyrmont Done!

@pyrmont
Copy link
Contributor

pyrmont commented May 28, 2019

Thanks!

@pyrmont pyrmont merged commit 4ca2e67 into rouge-ruby:master May 28, 2019
@pyrmont pyrmont removed the author-action The PR has been reviewed but action by the author is needed label May 28, 2019
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.

Is "in" a keyword or word operator?
2 participants