Commit Graph

2768 Commits

Author SHA1 Message Date
Thomas 3534089ddf Fix formating 2019-05-14 08:57:18 +02:00
Thomas 409b207bf1 Fix formating 2019-05-14 08:57:01 +02:00
Thomas c57996e589 Fix formating 2019-05-14 08:56:48 +02:00
Thomas 264db10290 Revert "Typo fix in XPath #2464"
This reverts commit d9c51b1525.
2019-05-13 22:38:49 +02:00
Thomas e7660d6cfa Align overlap condition on java implementation 2019-05-13 22:38:06 +02:00
Thomas 6fbc156f6c Align overlap condition on java implementation 2019-05-13 22:33:43 +02:00
Thomas 9a6b4e8fe8 Align overlap condition on java implementation 2019-05-13 22:33:16 +02:00
Thomas 0b0e521a8d Align overlap condition on java implementation 2019-05-13 22:25:42 +02:00
Thomas 17d626bc73 Align overlap condition on java implementation 2019-05-13 22:23:06 +02:00
Thomas f3184e9c8d Align overlap condition on java implementation 2019-05-13 22:19:19 +02:00
Thomas d9c51b1525 Typo fix in XPath #2464 2019-05-08 15:01:31 +02:00
Thomas 8d48f1a851 Fix overlaping condition 2019-05-08 14:26:11 +02:00
Terence Parr dade65a895
Merge pull request #2463 from youkaichao/python/test
update test script
2019-02-23 08:57:40 -08:00
Ralu de58c28a24
Fix off by one error in getChild 2019-02-06 10:41:38 +01:00
You Kaichao 45a4cdc67b update test script 2019-01-04 09:17:36 +08:00
You Kaichao 18e2a605c1 update python runtime doc 2019-01-03 19:29:56 +08:00
You Kaichao 157afd1a8d update code on updated master 2019-01-02 19:06:36 +08:00
Eric Vergnaud 90854967ca fix broken API calls 2019-01-01 15:04:20 +01:00
Eric Vergnaud 3ad118f87e fix invalid test sequence 2019-01-01 13:31:01 +01:00
Eric Vergnaud cccf6e87da Fix API inconsistency, where getText would expect a tuple named interval, leading to lots of confusion 2019-01-01 13:20:23 +01:00
Eric Vergnaud 108854f986 remove misleading API 2019-01-01 13:19:38 +01:00
Terence Parr 6808f9c4b4
Merge pull request #2447 from WalterCouto/test2
Change bitset upperbound to another higher arbitrary value to allow f…
2018-12-26 09:26:13 -07:00
Terence Parr fa19ded837
Merge pull request #2446 from WalterCouto/test
C++ avoid warning in visual studio build due to clang specific directive
2018-12-21 12:01:22 -07:00
Terence Parr fa466c42a1
Merge pull request #2445 from WalterCouto/master
C++: fix bug in PredictionContext::mergeArrays
2018-12-21 12:01:08 -07:00
Terence Parr ce3b5a4cb4
Merge pull request #2176 from niccroad/atnsimulator_memleak
This resolves the recently opened issue 2175 (a memory leak).
2018-12-21 12:00:36 -07:00
WalterCouto 6195ec749b Change bitset upperbound to another higher arbitrary value to allow for larger number of rules
We had a complex grammar file hit past this upperbound.  One solution is to put this up higher, another is to refactor into a container that can grow.
2018-12-20 11:18:16 -05:00
WalterCouto 2d28400234 C++ avoid warning in visual studio build due to clang specific directive
The revently added clang directive cause a new warning for Visual Studio build. Need to include the new code with a directive checking for visual studio
2018-12-20 11:02:35 -05:00
WalterCouto 936db23a40 C++ runtime version of previousTokenOnChannel doesn't handle edge case correctly #2343
<!--
Before submitting an issue to ANTLR, please check off these boxes:

- [x] I am not submitting a question on how to use ANTLR; instead, go to [antlr4-discussion google group](https://groups.google.com/forum/#!forum/antlr-discussion) or ask at [stackoverflow](http://stackoverflow.com/questions/tagged/antlr4)
- [ x] I have done a search of the existing issues to make sure I'm not sending in a duplicate

Please include information about the expected behavior, actual behavior, and the smallest grammar or code that reproduces the behavior. If appropriate, please indicate the code generation targets such as Java, C#, ...  Pointers into offending code regions are also very welcome.
-->
As documented previousTokenOnChannel, should "return -1 if there are no tokens on channel between i and 0."  but the C++ version of the runtime returns 0 not -1 as can be seen below:

```
while (true) {
    Token *token = _tokens[i].get();
    if (token->getType() == Token::EOF || token->getChannel() == channel) {
      return i;
    }

    if (i == 0)
      break;
    i--;
  }
```

Looking at the Java implementation, it would seem the C++ code should instead be:
```
while (true) {
    Token *token = _tokens[i].get();
    if (token->getType() == Token::EOF || token->getChannel() == channel) {
      return i;
    }

    if (i == 0)
      return -1;
    i--;
  }
```
This bug causes getHiddenTokensToLeft() to miss hidden tokens that come before the first non-hidden token.  There would also be a potential bug in CommonTokenStream::LB as the "< 0" case would never happen.
2018-12-20 10:24:49 -05:00
WalterCouto 27c8eb5c6a C++: fix bug in PredictionContext::mergeArrays
In the orignal PredictionContext::mergeArrays there was a bug on Line 281 where the logic differs from java: It currently is:
bool both$ = payload == EMPTY_RETURN_STATE && a_parent && b_parent;
and should instead match java as:
bool both$ = payload == EMPTY_RETURN_STATE && !a_parent && !b_parent;
2018-12-20 10:07:59 -05:00
parrt 70d9ddcd0a [maven-release-plugin] prepare for next development iteration 2018-12-18 10:35:34 -08:00
parrt be58ebffde [maven-release-plugin] prepare release 4.7.2 2018-12-18 10:35:24 -08:00
parrt 8fab6b98b3 [maven-release-plugin] rollback the release of 4.7.2 2018-12-18 10:33:52 -08:00
parrt 573cb86705 [maven-release-plugin] prepare release 4.7.2 2018-12-18 10:31:44 -08:00
parrt 9f6dfb1809 Merge branch 'master' of github.com:antlr/antlr4 2018-12-17 14:43:34 -08:00
Terence Parr 96890a3505
Merge branch 'master' into patch-1 2018-12-17 15:40:30 -07:00
parrt 38a95da397 manual edits of 4.7.1 -> 4.7.2 2018-12-17 14:32:39 -08:00
ralf 7fdec95d15 added virtual dtor to polymorphic class template ParseTreeProperty 2018-11-29 10:44:47 +01:00
Eric Vergnaud 56186d9e9f fix NPE 2018-11-26 01:03:36 +08:00
Terence Parr 0308999f06
Merge pull request #2413 from nxtstep/fix/mutex-free
[Swift-runtime] Make sure mutexes are being freed accordingly
2018-11-18 09:13:57 -08:00
Eric Vergnaud 77c830e6e1 fix #1955 for Javascript 2018-11-18 19:44:33 +08:00
Eric Vergnaud 43e529ca73 fix #1955 for Python 2018-11-18 19:41:47 +08:00
Eric Vergnaud f6537bf4ac fix #1955 for Chsarp 2018-11-18 19:31:47 +08:00
Terence Parr d714d7ba9c
Merge pull request #2409 from amykyta3/master
Fix install dependency for 'typing' library in python3.4
2018-11-17 09:30:40 -08:00
Terence Parr 6080a0639c
Merge pull request #2411 from ewanmellor/swift-fix-2369
[Swift] Syntax error in antlr4/runtime/Swift/boot.py
2018-11-16 08:48:09 -08:00
nxtstep 4e744043a3 Make sure mutexes are being freed accordingly 2018-11-16 17:26:52 +01:00
Ewan Mellor 9d29f116cb
[Swift] Syntax error in antlr4/runtime/Swift/boot.py
Make boot.py work under both Python 2 and 3.  This fixes #2369.

Add an extra exception handler, for neater error messages.
2018-11-15 21:49:58 -08:00
Ewan Mellor 0f1614dd99
[Swift] Tidy-ups around addDFAEdge.
Do some tidy-ups around addDFAEdge, improving the handling of nils so that
we're not forcing or nil-checking so much.
2018-11-15 21:25:47 -08:00
Ewan Mellor 8f42439943
[Swift] Remove unused constructors.
Remove unused constructors from ATNConfig and DFAState, and merge two
by using a default parameter instead.
2018-11-15 21:25:47 -08:00
Ewan Mellor 176d92d373
[Swift] Tighten up the permissions on lots of fields
Tighten up the permissions on lots of fields, for debuggability.
2018-11-15 21:25:47 -08:00
Ewan Mellor 623fe00fb7
[Swift] Change a whole bunch of "final var" to "let".
I think that there was some confusion when the original port from Java
was done, because "final" in Java is not the same as "final" in Swift.
2018-11-15 21:25:47 -08:00