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

ES6 support #110

Closed
wants to merge 61 commits into from
Closed

ES6 support #110

wants to merge 61 commits into from

Conversation

RReverser
Copy link
Member

Working features:

  • Unicode Code Point Escape Sequences (\u{ABCDEF}).
  • Numeric Literals (octal, binary).
  • Arrow Functions.
  • Spread Element.
  • Classes.
  • Destructuring assignments.
  • Computed object properties.
  • Object methods.
  • Shorthand object properties.
  • for (... of ...) loops.
  • Array Comprehensions.
  • Modules. (newest specs)
  • Template Strings.
  • Generators.
  • Generator Comprehensions.

Closes #78.

Added Property type to ObjectExpression properties.
Reserved ES6 properties in Property type.
testFail message fixes for object methods.
… method functions (node's location should include arguments).
@vendethiel
Copy link

Wow. Nice work.

@RReverser RReverser changed the title Complete ES6 support ES6 support Jul 27, 2014
@@ -1,4 +1,5 @@
Copyright (C) 2012-2014 by Marijn Haverbeke <marijnh@gmail.com>
Copyright (C) 2014 by Ingvar Stepanyan <me@rreverser.com>
Copy link
Member

Choose a reason for hiding this comment

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

Are you okay with a copyright by Marijn Haverbeke and others combined with an AUTHORS file (generated from the git history) that lists all individual contributors, re-generated on every release? Adding everyone to LICENSE individually by hand is going to A) create a noisy license, and B) produce a lot of commit noise.

@marijnh
Copy link
Member

marijnh commented Jul 28, 2014

Awesome work. See my nitpicks in the comments. (I don't expect you to fix the license thing, I just want your feedback -- I have a similar set-up to generate an AUTHORS file in CodeMirror, and can easily copy that to this repo.)

One thing I was wondering about is why the template string tokenizing is integrated with the normal tokenizing. Wouldn't it make more sense to branch right at the start of readToken, and keep the two apart, since they do very different things?

Are you interested in updating util/walk.js to handle the newly introduced node types? (And maybe acorn_loose.js, if you have another big block of time to burn on this...)

@RReverser
Copy link
Member Author

One thing I was wondering about is why the template string tokenizing is integrated with the normal tokenizing. Wouldn't it make more sense to branch right at the start of readToken, and keep the two apart, since they do very different things?

Was thinking about this, but figured out that it might produce more abstractions where it's not really needed since templates are pretty much like strings, special characters should be treated in the same way and the only differences are 1) not skipping spaces and 2) stopping on ${ inside template string and producing it as a separate token. Let me try to refactor existing solution somewhat later.

Are you interested in updating util/walk.js to handle the newly introduced node types? (And maybe acorn_loose.js, if you have another big block of time to burn on this...)

I'll definitely add types to util/walk.js (probably as separate PR), but not sure yet about "another big block of time" for error-tolerant parser. Let me look into it more precisely so I could answer this question.

@marijnh
Copy link
Member

marijnh commented Jul 29, 2014

I've merged this. Champagne all around.

Next time, observe the standard git commit message style where you put a short message (<80chars preferably) at the top line, followed by a blank line, and then further details. That way, tools that summarize the commits won't show huge long lines of text (they'll include anything up to the first empty line).

Please create new pull requests for further changes.

@marijnh marijnh closed this Jul 29, 2014
@marijnh
Copy link
Member

marijnh commented Jul 29, 2014

There appears to still be a problem with the Travis setup. I haven't looked into it yet.

@RReverser
Copy link
Member Author

There appears to still be a problem with the Travis setup. I haven't looked into it yet.

Looks like you just didn't turn on support for this repo on the Travis side.

@RReverser
Copy link
Member Author

List of CodeMirror contributors. Updated before every release.

Could you please fix project name in AUTHORS file?

@marijnh
Copy link
Member

marijnh commented Jul 29, 2014

Done and done. Though Travis seems to be hung on a slow NPM download or something like that.

@RReverser
Copy link
Member Author

Yeah, it has kind of significant delays on free repos, but still better that nothing.

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.

Support for some ES6 features
4 participants