Commit Graph

81 Commits

Author SHA1 Message Date
jkmar 6326725270 [Python2] return result instead of None in visitor 2018-01-01 20:29:40 +01:00
parrt d674274f99 update setup.py to use setuptools not distutils 2017-12-10 12:28:05 -08:00
parrt 763a1242b7 update version number and tweak doc 2017-12-08 12:47:11 -08:00
Eric Vergnaud 44031b544d fix #2031 2017-09-30 17:07:40 +08:00
Renata Hodovan 6e02088e6a Python: add public getter to parsers to access syntax error count.
ANTLR parsers in Java are allowed to access the number of encountered
syntax errors via the getNumberOfSyntaxErrors method. However, the
Python variants must use the protected _syntaxErrors member to get this
value. The patch defines the same getter for Python targets too.
2017-07-18 18:29:36 +02:00
alimg 60cce436c2 Merge branch 'master' of https://github.com/antlr/antlr4 into py-input-mismatch-error 2017-06-25 19:02:26 +03:00
Eric Vergnaud ff4ffa613b Fix ATN deserialisation for unicode chars FFFE and FFFF 2017-06-25 12:05:57 +08:00
alimg f0d1a093ed Python: fix reported input alternatives are not in par with Java version 2017-06-19 18:55:48 +03:00
parrt 930e31d470 Merge branch 'master' of github.com:antlr/antlr4 2017-03-30 11:07:02 -07:00
parrt e6a9adf276 update 4.6 -> 4.7 in files 2017-03-30 11:06:44 -07:00
parrt b5648f405b tweak documentation about various targets 2017-03-30 10:44:28 -07:00
parrt 6215f18ec3 rename 4.6.1 to 4.7 everywhere 2017-02-23 14:48:58 -08:00
Ben Hamilton fd4246cf3f Implement new extended Unicode escape \u{10ABCD}. Bump UUID. Add lots more tests. 2017-02-23 09:39:44 -08:00
Ben Hamilton 760d3eff82 Use generator expressions instead of list comprehensions 2017-02-18 11:55:49 -08:00
Ben Hamilton 7b9b0835b8 Python 2.7 InputStream: Properly support Unicode code points 2017-02-18 11:54:11 -08:00
Ben Hamilton b190b6eca6 MAX_CHAR_VALUE to 0x10FFFF 2017-02-16 09:46:09 -08:00
Ben Hamilton 2c447a2b75 Python 2 and Python 3 support for lexer and parser output to a file instead of stdout 2017-02-10 13:11:24 -08:00
Ben Hamilton 2defcc3e1f Change default encoding back to 'ascii'. Specify encoding=utf-8 and errors=replace in Python2/Python3 test templates. 2017-01-30 08:45:48 -08:00
Ben Hamilton 99ed4b6de6 Python StdinStream/FileStream -> UTF-8 2017-01-30 07:32:30 -08:00
Eric Vergnaud f02d8c1a4b fix #1584 2017-01-19 21:44:56 +08:00
parrt 2629433830 bump version to 4.6.1 in all files. 2016-12-28 12:03:43 -08:00
Terence Parr b57843d983 Merge pull request #1546 from sharwell/fix-1545
Fix multiple problems with optional block bypass at end of rule
2016-12-27 21:47:12 -08:00
Sam Harwell 24b20e236f Remove redundant isExpectedToken check
We know by the time this check was reached that neither EPSILON nor the LL(1)
symbol are in the lookahead set from the current state. Since EPSILON is not
included, the state cannot see to the end of the rule and thus nextTokens
contains the complete set of valid LL(1) symbols from the current state. It is
therefore impossible for the LL(1) symbol to be "expected" when considering
lookahead with full context.
2016-12-27 17:21:25 -06:00
Ivan Kochurkin 03a75a5ce6 fix error "'CommonToken' object has no attribute 'stopIndex' in Python{2|3}" #1529. 2016-12-24 18:22:48 +03:00
Sam Harwell 8b21cc3dfb Fix DefaultErrorStrategy.sync handling of end of rule
This change updates the default sync() strategy to match the strategy used
for selecting an alternative when prediction leaves the decision rule prior
to reaching a syntax error.

Closes #1545
2016-12-23 16:28:46 -06:00
Eric Vergnaud 4125fbad8a grr... 2016-12-21 19:28:38 +08:00
Eric Vergnaud 6398a06fba fixes #1530 and #1531 2016-12-20 23:27:08 +08:00
Eric Vergnaud e15e88a049 fix unicode issue 2016-12-13 21:33:19 +08:00
Terence Parr 6a20919cb7 Merge pull request #1476 from renatahodovan/python-target-1472
Implement the fix of #1298 for Python targets.
2016-12-11 14:49:28 -08:00
Terence Parr c7e27664c2 Merge pull request #1471 from renatahodovan/visit-error-node
Call visitErrorNodes properly in Python targets.
2016-12-11 14:48:21 -08:00
Renata Hodovan 58d51450d4 Implement the fix of #1298 for Python targets.
The patch adapts the fix in PR #1472 for Python targets.
2016-12-10 02:41:08 +01:00
Terence Parr 82372aae2c Merge pull request #1460 from renatahodovan/intervalset-range-fix
Fix AttributeError when trying to write an immutable variable in Python.
2016-12-09 16:05:11 -08:00
Renata Hodovan bd09023209 Call visitErrorNodes properly in Python targets.
The consume method of the Parser class calls visitTerminal on both
TerminalNodes and ErrorNodes even if the comment above states that
ErrorNodes should be visited by visitErrorNodes. This behaviour
is also inconsitent with the Java target. The patch fixes this in
both Python targets.
2016-12-09 19:41:23 +01:00
parrt 2c99f187a0 make it read "Copyright (c) 2012-2016 The ANTLR Project" 2016-12-08 11:43:06 -08:00
parrt 1b1a9862c4 contributors->authors 2016-12-08 11:43:06 -08:00
parrt 61e8eba4fc fix typo 2016-12-08 11:43:06 -08:00
parrt 76d421a89e add copyrights on Python2 2016-12-08 11:40:30 -08:00
parrt f597069728 Update copyright on Python2 2016-12-08 11:40:30 -08:00
parrt 2bad631cce fix typo in copyright 2016-12-08 11:40:30 -08:00
parrt efc3f82f38 rm redundant license files 2016-12-08 11:40:30 -08:00
Renata Hodovan a7227b4499 Fix AttributeError when trying to write an immutable variable in Python.
The `removeOne` function of IntervalSet tries to directly
rewrite the start field of an immutable range variable when
splitting an existing interval. This causes AttributeError which
is fixed by the patch.
2016-12-08 11:05:00 +01:00
Vladi Lyga 8b60373c43 fix: enable to access interval as a list 2016-11-30 17:16:35 +02:00
Vladi Lyga f50fb7df15 Fix error when Interval is rewritten with a tuple 2016-11-30 13:55:54 +02:00
Vladi Lyga 377f2f5c89 Merge remote-tracking branch 'antlr4/master' 2016-11-30 11:31:24 +02:00
Vladi Lyga 238b55a0b6 Extensive TokenStreamRewriter tests + many python2 runtime fixes.
Including fix for https://github.com/antlr/antlr4/issues/550
2016-11-30 11:27:04 +02:00
Eric Vergnaud ccde4051bd fixed the 2 failing tests with left recursion optimisation 2016-11-30 00:40:01 +08:00
Eric Vergnaud ec5f64a459 start migrating, but 2 tests are failing 2016-11-29 00:05:13 +08:00
Eric Vergnaud 3026c3cc94 start migrating 2016-11-28 23:05:43 +08:00
parrt aeaba48a0b pull in lygav python impl of TokenStreamRewriter 2016-11-22 12:34:46 -08:00
Terence Parr 37ff8a3161 Merge pull request #1248 from renatahodovan/configset-contains
Fix comparisons in ATNConfigSet.__contains__ of Python targets.
2016-11-21 10:08:51 -08:00