13320 Commits

Author SHA1 Message Date
Marijn Haverbeke
d55b6dee4a Update lastEnd in tokenizer interface
The hack for parsing --> depends on it.

Closes #84
2014-01-17 10:09:15 +01:00
Marijn Haverbeke
d973261940 [loose parser] Make sure VariableDeclaration nodes have at least one decl
Closes marijnh/tern#255
2013-12-09 17:55:16 +01:00
Marijn Haverbeke
e6ff440e9f [walker] Handle catch scopes more accurately in scopeVisitor 2013-11-28 16:56:14 +01:00
Marijn Haverbeke
b1623b10c1 Note non-reentrancy of parser in onComment docs
Closes #80
2013-11-20 10:59:12 +01:00
Marijn Haverbeke
baaa16cee7 Make sure syntax errors in regular expressions raise conforming exceptions
Just letting the error from new RegExp through creates an exception missing the
pos/loc/raisedAt properties.

Issue #82
Issue #81
2013-11-20 10:56:28 +01:00
Marijn Haverbeke
dd456e3ad5 Fix bug causing comments after 'use strict' to be handled twice
Closes #76
2013-11-11 11:25:59 +01:00
Marijn Haverbeke
cb79f13d3d [README] Search/replace gone bad 2013-11-04 16:53:28 +01:00
Marijn Haverbeke
6be7a84649 Work around broken Markdown implementation on github
Not that I can blame anyone for making mistakes implementing a
poorly specified mess like markdown.
2013-11-04 16:52:34 +01:00
Marijn Haverbeke
5ec47cf80d Rewrite README 2013-11-04 16:43:07 +01:00
Aparajita Fishman
3b05fcf16c docco is wonderful, but it isn't exactly the most concise way of figuring out how to use acorn. Here's a real README.
Fixed a typo in the options comments.
2013-11-04 15:39:22 +01:00
Marijn Haverbeke
456f099cbe Bump version for added option 2013-10-15 13:12:07 +02:00
Marijn Haverbeke
356e0be759 Add directSourceFile option 2013-10-15 13:08:56 +02:00
Aparajita Fishman
824eb798f9 More descriptive names for binop token type 2013-10-12 18:04:09 +02:00
Aparajita Fishman
9ff4981ca2 More concise way of slicing off the last character 2013-10-12 18:00:19 +02:00
Aparajita Fishman
6e6c7b0af4 Just being consistent with quote usage 2013-10-10 23:45:40 +02:00
Marijn Haverbeke
987fb51feb Bump version number post-0.4.0 2013-10-10 10:41:19 +02:00
Marijn Haverbeke
1ed25992a7 Mark release 0.4 2013-10-10 10:40:31 +02:00
Aparajita Fishman
389c9b225b Fixed: tokLineStart and tokCurLine have no meaning if options.locations is false.
Everywhere else (except one place which is a bug) those variables only appear within an `if (options.locations)` block.
2013-10-10 09:59:16 +02:00
Marijn Haverbeke
b7972ad95c Remove invalid of tokLineStart
This is only tracked when locations are on, so it can't be used
unconditionally.

Closes #71
2013-10-10 09:58:23 +02:00
Aparajita Fishman
6fd79e50fb Fixed: skipSpace did not consider 8232 and 8233 as eol, but elsewhere it was.
Both readString and skipLineComment considered 8232/8233 as eol, but skipSpace itself would not increment the line counters if they were found.

Previously 8232/8233 were listed in nonASCIIwhitespace, but since that is only used within skipSpace and those values are checked separately, they could be removed from nonASCIIwhitespace.
2013-10-08 16:33:40 +02:00
Marijn Haverbeke
22c3161b6e Fix wrong end position for VariableDeclaration nodes
It should include the semicolon.

Closes #67
2013-10-02 20:39:51 +02:00
Aparajita Fishman
b7417cec8c Just want to be a little clearer what is happening to the node var declared earlier. 2013-10-01 17:33:01 +02:00
Marijn Haverbeke
83bfd6c536 Different approach to working around html comment issue 2013-09-11 12:23:25 +02:00
Marijn Haverbeke
3d932fcfba Add .gitignore and .tern-project 2013-09-09 22:11:12 +02:00
Marijn Haverbeke
36d001a4be Work around docco leaving in a <!-- comment start
Closes #66
2013-09-09 22:10:24 +02:00
Martin Carlberg
ba8da57d16 Use correct paragraph separator for newline
0x2089(8329) is Subscript nine
0x2028(8232) is Line separator
0x2029(8233) is Paragraph separator
2013-09-09 11:35:33 +02:00
Marijn Haverbeke
b998d5e22d Add support for bizarro <!-- and --> behavior
Issue #62
2013-09-06 10:52:04 +02:00
Aparajita Fishman
411b29791b Formatting
Just being consistent.

In every other place where a between comparison is done, the lower limit is on the left. It's a whole lot easier to see it's a between comparison when the limits are in order.
2013-09-05 10:33:03 +02:00
Aparajita Fishman
cfbbeebe8b Fixed: replace absolute with relative require, remove unsupported --trackComments from usage.
Unless I'm missing something, the simple relative path "../acorn.js" is exactly equivalent to the absolute path being constructed in the old code.
2013-09-03 17:51:46 +02:00
Marijn Haverbeke
c152be4a2e Improve error message for ++/re/
Closes #54
2013-08-28 16:22:30 +02:00
Marijn Haverbeke
6659f7a033 Fix special case to handle regexps that start with =
Closes #55
2013-08-28 10:35:21 +02:00
Marijn Haverbeke
2ace0fa8dc Further refine parseExprList indentation heuristic
Closes marijnh/tern#221
2013-08-27 12:52:02 +02:00
Marijn Haverbeke
6113324cd2 Fix bug with parsing slash after operator-keyword property
Closes #53
2013-08-25 15:01:20 +02:00
Jürg Lehni
097b4162da Pass on 'this' as root scope, for better inclusion of Acorn inside Paper.js
Use same approach as Esprima.
2013-07-26 08:59:07 +02:00
Jiaxing Wang
a84e21e0ff Line number start from 1 after getToken.jumpTo() 2013-07-11 12:28:58 +02:00
Jiaxing Wang
16b54e0698 parseMaybeUnary() doesn't need parameter @noIn 2013-07-11 08:20:05 +02:00
Jiaxing Wang
567f3ca32a Remove redundant if conditions that are tested above 2013-07-11 08:20:04 +02:00
Marijn Haverbeke
328d0e514c Linting 2013-07-08 09:07:10 +02:00
Marijn Haverbeke
d3b9eb177a Always attach a guardedHandlers property to TryStatements
Closes #48
2013-07-08 09:03:23 +02:00
Marijn Haverbeke
67c48229b9 Bump version number post-0.3.1 2013-06-11 12:44:35 +02:00
Marijn Haverbeke
d2673d465a Release 0.3.1 to fix release-making-script screwup in 0.3.0 2013-06-11 12:43:56 +02:00
Marijn Haverbeke
7e248c7e3b Mark release 0.3.0 2013-06-11 12:41:03 +02:00
Marijn Haverbeke
2372b12df7 [loose parser] Refine closing heuristic for expression lists
Issue marijnh/tern#171
2013-06-10 18:02:17 +02:00
Marijn Haverbeke
3ca3aa5a25 Run a lint pass, clean up lots of small issues 2013-06-10 16:52:22 +02:00
Marijn Haverbeke
6fe123947b Prefix keywords with underscore in tokTypes object 2013-06-10 15:47:29 +02:00
Marijn Haverbeke
314327537a Add charset to script link that includes test suite
So that browsers don't get confused by the utf-8 sequences.
2013-06-08 20:36:50 +02:00
Marijn Haverbeke
adf16e33c0 Don't assume options object has a hasOwnProperty method
Closes #43
2013-06-08 20:36:44 +02:00
Marijn Haverbeke
c979446572 [package.json] Use 'repository' rather than 'repositories' field
Apparently the second is no longer supported in npm 1.2 (?).

Closes #42
2013-05-21 14:36:49 +02:00
Marijn Haverbeke
38f0e80547 Include diacritical combining marks in identifier character set
Closes marijn/tern#157
2013-05-21 09:07:50 +02:00
Marijn Haverbeke
6dd35f870a [loose parser] Fix bug in continued-expression closing
When the continued expression sat on column 1 after a non-whitespace char,
the heuristic would consider it the start of the line, even though it wasn't.

Issue marijnh/tern#141
2013-05-15 12:03:00 +02:00