Marijn Haverbeke
dd89c6e112
Make loose parser work with minor interface changes introduced by modularization
2015-03-20 12:04:33 +01:00
Marijn Haverbeke
a75a685610
Add a startsExpr property to token types, use it to properly parse yield
...
Issue #219
2015-03-19 12:34:41 +01:00
Ingvar Stepanyan
0473c368e6
[es6][estree] Add support for sourceType: script|module modes.
...
+ Fix list of keywords and reserved words in ES6.
2015-03-18 13:42:49 +02:00
Ingvar Stepanyan
024a98431d
[estree] Add SuperExpression.
...
(we're almost there)
2015-03-17 23:01:42 +02:00
Ingvar Stepanyan
876e774bfe
[estree] Align method kinds.
...
[loose] Split parseObj and parseClass.
2015-03-17 22:36:34 +02:00
Ingvar Stepanyan
34050d3917
Support for for (const ...).
...
Fixes #213 .
Also changes API to pass token type to `parseVar` to reduce string comparison ops.
2015-03-10 11:36:15 +02:00
Ingvar Stepanyan
ff60ee4fdb
[estree] Align export ... representations.
2015-03-10 10:37:00 +02:00
Ingvar Stepanyan
722bc65e79
[estree] Align Import specifiers.
2015-03-10 02:27:24 +02:00
Marijn Haverbeke
0df2affdfe
Move loose parser to object style
...
Drop dependency on tokenizer interface
2015-03-05 17:22:06 +01:00
Marijn Haverbeke
6bd1013f2c
Use uniform object type for node types
...
Speeds things up by about 9% on io.js 1.3
2015-03-05 15:59:12 +01:00
Marijn Haverbeke
9a617a59e4
[loose parser] Don't tokenize ellipsis when ecmaVersion < 6
...
Issue marijnh/tern#493
2015-02-17 14:41:33 +01:00
Ingvar Stepanyan
6eb177582d
Fix export default declarations.
...
Closes #184 .
2015-01-27 16:21:41 +02:00
Ingvar Stepanyan
e4a97ab877
Finalized destructuring support in loose parser; fixed startNodeAt.
2015-01-27 15:53:16 +02:00
Ingvar Stepanyan
5d96bbd781
Simplify & fix rest argument validity checks.
2015-01-24 13:38:14 +02:00
Ingvar Stepanyan
f0569147e6
Avoid extra call and arg in parseExpression for single-expression case.
2015-01-23 21:48:33 +02:00
Ingvar Stepanyan
41ad304955
Introduce helpers for contextual keywords.
2015-01-23 21:36:16 +02:00
Ingvar Stepanyan
917de714b1
Switch from Function.{rest,defaults} to AssignmentPattern and RestElement.
...
Closes #182 .
2015-01-23 15:29:37 +02:00
Ingvar Stepanyan
38609ae26d
Closes #205 .
2015-01-23 14:14:02 +02:00
Ingvar Stepanyan
2e55540bbe
Fix {start,end}Loc -> loc.{start,end} in acorn_loose; remove forceRegexp.
2015-01-22 18:53:45 +02:00
Ingvar Stepanyan
caa5da6ce1
Improve spread element parsing (fix allowed contexts and error locations).
2015-01-21 23:51:40 +02:00
Marijn Haverbeke
a1d2561cfa
Restore patch 9f7cb552648829796ab4d6836d08246e95f16b9d to original shape
...
And make loose parser handle stray class semicolons
Issue #190
2015-01-20 12:02:30 +01:00
Marijn Haverbeke
3e513fc6a8
Kill finishNodeAt in acorn_loose as well
...
Issue #200
2015-01-17 22:22:26 +01:00
Ingvar Stepanyan
6dee98d1b9
Adapt ES6 template handling to new tokenizer.
...
Avoid need for:
* extra `templates` array in favor of new `tokContext`;
* special location handling for first & last template elements;
* separate `_templateContinued` token in favor of same `_template`.
Adds:
* token types for backQuote and dollarBraceL instead of skipping them
so they can be handled (i.e. highlighted differently).
2015-01-17 22:21:22 +01:00
Marijn Haverbeke
0f55a53a7d
[loose parser] Fetch token before comment when tokenizer raises unterminated comment error
...
Closes #197
2015-01-13 22:18:55 +01:00
Marijn Haverbeke
1b8069e48c
Restore onToken functionality for loose parser
2015-01-13 09:53:42 +01:00
Ingvar Stepanyan
bc2e01aa03
Allow static as method name in class ( fixes #192 ).
...
Add uncommitted tests for #191 .
2015-01-09 15:31:01 +02:00
Ingvar Stepanyan
4d4a76588c
Parse assignment patterns in-place in certain contexts.
...
* Parsing assignables without extra transform step when possible (speed-up).
* Added support for shorthand defaults in such certain contexts (issue #181 ).
2015-01-08 20:19:48 +02:00
Marijn Haverbeke
0897901f1f
Slight cleanup of '/' disambiguation
...
Issue #189
2015-01-06 11:03:50 +01:00
Marijn Haverbeke
b6b085ac8e
Make tokenizer independent of parser (with regards to '/' disambiguation)
...
Issue #189
2015-01-06 10:58:52 +01:00
Marijn Haverbeke
459a169262
Make tests pass again for loose parser
...
Issue #181
2015-01-04 22:34:42 +01:00
Ingvar Stepanyan
0084ac14ae
Fixed #186 .
2014-12-30 13:42:37 +02:00
Ingvar Stepanyan
e37c07248e
Added optional support for hashbang directives.
...
Fixes #180 .
2014-12-17 19:58:38 +02:00
Marijn Haverbeke
97f4e9a026
[loose parser] Make unclosed objects / lists span to the start of the next node
...
That way, whitespace at their end is considered part of them,
and Tern can recognize when the cursor is inside of them.
2014-12-17 11:53:20 +01:00
Marijn Haverbeke
75b58c07d4
[loose parser] Improve autoclosing of expression lists
2014-12-15 17:32:38 +01:00
Marijn Haverbeke
6915519498
Give TemplateElements a narrower range
...
Issue #169
2014-12-11 17:44:45 +01:00
Marijn Haverbeke
91e5ac0fdd
Make loose parser parse template strings
2014-12-11 14:30:24 +01:00
Marijn Haverbeke
249e6961f8
Make tests pass for loose parser
...
Define Program node extent to be the whole program, make
both parser and the tests conform to this.
Fix a bunch of bugs in the loose parser's handling of corner
cases.
Issue #151
2014-11-12 17:05:19 +01:00
Ingvar Stepanyan
96ccdb05fa
Web-driver support for loose parser + small fixes.
...
* Added support for acorn_loose and grouped log to web-driver.
* Removed unused copy-pasted `parseTemplate` from loose parser.
* Throw non-SyntaxError errors immediately (as those are generic).
2014-11-12 16:19:16 +01:00
Ingvar Stepanyan
6bf8311061
Loose: fix #33 .
2014-11-12 16:19:16 +01:00
Ingvar Stepanyan
2419de74dc
Loose: Fix regex after tokenizer changes in #144 .
2014-11-12 16:19:16 +01:00
Ingvar Stepanyan
fc2e96fa01
Loose: respect optional semicolons in break/continue/class/import/export.
2014-11-12 16:19:16 +01:00
Ingvar Stepanyan
d4565fed53
Loose: ES6 import, export.
...
Removed "kind" from tests for ES6 import/export as it's
left only for backward compatibility.
2014-11-12 16:19:15 +01:00
Ingvar Stepanyan
4647f966eb
Loose: don't silently skip missed elements in expr list.
2014-11-12 16:19:15 +01:00
Ingvar Stepanyan
aa96edf769
Loose: support for-of without var.
2014-11-12 16:19:15 +01:00
Ingvar Stepanyan
1589a959fa
Loose: yield support.
2014-11-12 16:19:15 +01:00
Ingvar Stepanyan
bdce88c184
Loose: for-of statement.
2014-11-12 16:19:15 +01:00
Ingvar Stepanyan
992fc0503d
Loose: arrow functions.
2014-11-12 16:19:15 +01:00
Ingvar Stepanyan
ede10a079c
Loose: class support.
2014-11-12 16:19:15 +01:00
Ingvar Stepanyan
c6b6ef389e
Loose: Remove own tabSize initialization in favor of defaultOptions.
2014-11-12 16:19:15 +01:00
Ingvar Stepanyan
9cdc6809ce
Loose: fix pattern+defaults case in function params.
2014-11-12 16:19:15 +01:00