Arthur Stolyar
d3cece14fd
Fix spaceSkip after inXJSChildExpression
2014-09-09 01:56:30 +03:00
Arthur Stolyar
ae9fae6c76
Fix in child XJS MemberExpression
2014-09-09 01:06:52 +03:00
Ingvar Stepanyan
3086621905
Merge branch 'master' into jsx.
2014-09-08 23:58:19 +03:00
Ingvar Stepanyan
10553cbced
Make token format compatible with Esprima and Mozilla-styled locations.
...
* Tokens are now instances of single exported constructor Token.
* Token objects are compatible with Esprima (only `type` format is different).
* Added token.loc in format of node.loc (Mozilla).
* Deprecated token.startLoc & token.endLoc.
* Updated comment generation example.
Also added ability to pass arrays in `onToken`/`onComment` where
tokens/comments will be collected in Esprima's format so you can
simply pass those arrays to `escodegen.attachComments`.
Updated docs and comment attachment example.
2014-09-08 12:20:08 +02:00
Ingvar Stepanyan
5c89414c5a
Final polishing after rebase.
2014-09-05 17:23:03 +03:00
Ingvar Stepanyan
35c8f104bd
Spread attribute support and small optimizations.
...
Conflicts:
acorn.js
docs/acorn.html
package.json
test/tests.js
2014-09-05 17:01:42 +03:00
Max Schaefer
a246bf83d0
Do not throw syntax error if strict mode function has same name as one of its parameters.
2014-09-05 15:59:57 +02:00
Ingvar Stepanyan
95a1231c6d
Metadata & docs updates.
...
Conflicts:
.gitignore
README.md
acorn.js
index.html
package.json
2014-09-05 16:54:29 +03:00
Max Schaefer
7da3b6f1fd
Fix start position for HTML comments and add tests.
2014-09-05 15:53:36 +02:00
Ingvar Stepanyan
daf9e82ab5
Final fixes for spaces.
...
Conflicts:
acorn.js
2014-09-05 16:50:23 +03:00
Ingvar Stepanyan
7560ba4c94
Fixed in-tag spaces in hacky way (to be refactored).
...
Conflicts:
acorn.js
2014-09-05 16:49:07 +03:00
Ingvar Stepanyan
292942c1d8
Small refactoring related to handling XJSText.
...
Conflicts:
acorn.js
2014-09-05 16:48:50 +03:00
Ingvar Stepanyan
4ed5087bea
Revert space counting after the opening tag in favor of better fix since this one introduces extra parsing error.
...
Conflicts:
acorn.js
2014-09-05 16:48:40 +03:00
Ingvar Stepanyan
77e05c4edc
Fixed XJSEmptyExpression location tracking.
2014-09-05 16:47:57 +03:00
Ingvar Stepanyan
3253f56602
Fixed skipping spaces at the beginning of JSX contents.
...
Conflicts:
acorn.js
2014-09-05 16:47:57 +03:00
Ingvar Stepanyan
2c3740c159
Fixed nesting elements in attributes.
2014-09-05 16:43:17 +03:00
Ingvar Stepanyan
5d2ace2f58
Added JSX text and string literal parsing.
2014-09-05 16:43:17 +03:00
Ingvar Stepanyan
22e8f7b90e
Added basic attribute and element nesting support.
2014-09-05 16:43:16 +03:00
Ingvar Stepanyan
6091a0cf55
Added JSX-specific identifier parsing.
...
Conflicts:
acorn.js
2014-09-05 16:43:16 +03:00
Ingvar Stepanyan
b4c5d1f2e9
Added support for namespaces and member expressions in tag names.
2014-09-05 16:42:29 +03:00
Ingvar Stepanyan
283d47c038
Started porting JSX support from esprima-fb.
...
Conflicts:
acorn.js
test/tests.js
2014-09-05 16:42:29 +03:00
Marijn Haverbeke
40f1c67161
Remove trailing whitespace from acorn.js
2014-08-21 18:12:04 +02:00
Max Schaefer
1ca2115294
Remove unused local variables.
2014-08-21 18:10:48 +02:00
Marijn Haverbeke
e58f401b82
Bump version number post 0.7
2014-08-14 13:25:01 +02:00
Marijn Haverbeke
fe767e4cd8
Mark version 0.7.0
2014-08-14 13:24:24 +02:00
Ingvar Stepanyan
372e1d42f3
Split ES6 Template logic from main functionality.
2014-08-14 12:48:50 +02:00
Ingvar Stepanyan
1bf8c1420f
Added example for comments attachment.
...
* Fixed `onToken` & `tokenize` to return `startLoc` & `endLoc`
in token object only when `options.locations` is `true`.
* Fixed `onToken` tests.
* Added example for generating comments with escodegen.
2014-07-31 14:01:39 +03:00
Ingvar Stepanyan
be11e04383
Added onToken support.
2014-07-31 14:01:39 +03:00
Ingvar Stepanyan
278ac258df
Moved inTemplate initializer to appropriate place.
2014-07-31 14:01:38 +03:00
Marijn Haverbeke
73a890d6be
More nuanced attribution in comment
2014-07-29 15:18:59 +02:00
Ingvar Stepanyan
de48f8434d
Fixes for ES3 compatibility.
2014-07-29 14:41:50 +02:00
Ingvar Stepanyan
f0579c3e56
Renamed _multiplyModulo to _modulo as it's left as the only purpose of this token.
2014-07-29 14:41:50 +02:00
Ingvar Stepanyan
ff9c3550a4
Allow computed class method names (as per ariya/esprima#271 ).
2014-07-29 14:41:49 +02:00
Ingvar Stepanyan
acbef8557f
Treat line ending after yield keyword as end of YieldExpression
...
(as per http://people.mozilla.org/~jorendorff/es6-draft.html#sec-generator-function-definitions-runtime-semantics-evaluation ).
2014-07-29 14:41:45 +02:00
Ingvar Stepanyan
9d552efe45
Added Generator Comprehension support.
2014-07-29 14:41:44 +02:00
Ingvar Stepanyan
711d21ec5a
Simplified name clash test.
2014-07-29 14:41:44 +02:00
Ingvar Stepanyan
8d30ad6196
Added separate token for star ('*') as it may have special meaning.
...
Fixed name clash check.
Moved check functions to single place.
2014-07-29 14:41:38 +02:00
Ingvar Stepanyan
7aab3539ce
Cleaning up + performance improvement by using hash objects for name clash checks.
2014-07-29 14:41:38 +02:00
Ingvar Stepanyan
67615ffd41
Simplified newline check in strings.
2014-07-29 14:41:38 +02:00
Ingvar Stepanyan
1955e94925
Removed keywords that are not actual keywords
...
as per https://people.mozilla.org/~jorendorff/es6-draft.html#sec-keywords in favor of "magic" identifiers.
2014-07-29 14:41:33 +02:00
Ingvar Stepanyan
82b9f30fc9
Allow some keywords to be treated as identifier names; update ecmaVersion in benchmark.
2014-07-29 14:41:32 +02:00
Ingvar Stepanyan
eb7ccea743
Stricter tokVal -> tokType comparisons.
2014-07-29 14:41:32 +02:00
Ingvar Stepanyan
3ee9e288a2
Forbid spread element in sequence expressions.
2014-07-29 14:41:32 +02:00
Ingvar Stepanyan
8f96965d36
Added yield support (completed generators).
2014-07-29 14:41:32 +02:00
Ingvar Stepanyan
b8a3300a21
Added function * support (part of generators feature).
2014-07-29 14:41:32 +02:00
Ingvar Stepanyan
4f24e13fd5
Added template string support.
2014-07-29 14:41:32 +02:00
Ingvar Stepanyan
26818e1f36
Removed module-related tests and implemented corresponding alternatives support.
...
`module ModuleName { ... }` was removed from spec in favor of separate files.
`module LocalName from '...'` is being replaced with `import * as LocalName from '...'` as per http://jsmodules.io/ and https://twitter.com/domenic/status/492735387140243456 (c) @domenic.
2014-07-29 14:41:29 +02:00
Ingvar Stepanyan
b38c15a94b
Added export declaration support.
...
See http://people.mozilla.org/~jorendorff/es6-draft.html#sec-exports , ariya/esprima#216 , square/es6-module-transpiler#63 for latest decisions on `export default 42` vs `export default = 42` (first wins, so returning AST as it was in older Esprima Harmony and used by https://github.com/square/es6-module-transpiler/ ).
2014-07-29 14:41:24 +02:00
Ingvar Stepanyan
bcc97e2d52
Array Comprehensions as per latest ES6 drafts.
2014-07-29 14:41:18 +02:00
Ingvar Stepanyan
648f3159cc
Added for (..of..) support and guard against for (let var=.. in|of ..) loops.
2014-07-29 14:41:09 +02:00