Swift tests depend on Xcode (via xcrun) so only run them on Macs.
This also bumps the maven-surefire-plugin version to 2.19.1, because
2.12.4 crashes when it sees an empty <include> block.
init is the name of the instance initializer function in Swift, so generating
a grammar with that name causes problems, since it is generated into
function names on the parser.
I thought that renaming this would be a problem for other targets, but it
doesn't look like it, and actually the convention of using type_ rather than
type is already in use in this file. Match this by adopting init_ as the
name, and regenerate the tests to match.
This was initially handled in https://github.com/janyou/ANTLR-Swift-Target
(using the name initIt instead of init).
This comes from https://github.com/janyou/ANTLR-Swift-Target and is
marked Copyright (c) 2016 janyou on top of the BSD license and Copyrights
for Terence Parr and Sam Harwell derived from the original ANTLR source.
Incorrect code was generated for $e.v in a rule like this one:
e returns [int v] ::=
INT {$v = $INT.int;}
| '(' e ')' {$v = $e.v;}
;
After parsing "(99)" the result would have v == 0 instead of 99.
- Had to adjust a comparison <= 0 to the new unsigned EOF.
- For testing: extended the runtime tests to all C++ tests.
- Install uuid-dev in Travis CI in order to be able to build the C++ runtime.
- Switched most symbolic signed constants to unsigned variants. Redefined EOF in particular to become (size)-1, to avoid having to use signed token type values.
- Introduced INVALID_INDEX for all previous -1 values to indicate e.g. not found indexes etc.
- Added 2 helpers to convert between symbolic and numeric form (mostly for intervals and toString()).
- Removed many no longer needed type casts to size_t.
- Updated templates for these changes.
- Limited runtime tests to C++ tests only, to see how Travis CI copes with that.
- Had to take back some of the message beautifying, as this won't match expected runtime test output.
- Updated C++ test stg file for recent runtime changes. Regenerated tests (only one file changed actually).
- Reworked C++ test preparation. The C++ runtime is now built on first invocation of a test. This works only on Linux + OSX/macOS. Windows needs extra handling.
the old paths contained a / at the beginning of the path e.g. "/C:/" but the expected path is "C:/" and due to this all test for the targets javascript, python and c# failed on windows.
No need to use shared_ptr for management. Listeners are, like the other main classes (parser, lexer, input stream etc.) provided by the application and hence managed there.
In order to lower the overhead when passing around Token instances via smart pointers and because the ownership is clear (token streams own them), these instances can be passed as raw pointers.
All shared_ptr<> now use const& for function parameters to avoid constant copies + locks. Ownership and lifetime control is still ensured by the owning containers. Code templates have been updated as well.
- Changed namespace chain (org::antlr::v4::runtime) to just antlr4 in all files.
- Fixed runtime tests for that.
- Added conversion of the xpath code, which compiles now (no tests, tho, as there are runtime tests for it).
- Removed TestRig stuff. That doesn't work in C++.
* "go install" the Go runtime inside a temporary GOPATH directory.
* Remove unnecessary GOPATH variable elements.
* Change some instances of stringly typing to strongly typing.
* Remove a few pointless indirections.
* Cleanup erase helper methods, make eraseFiles (eraseDirectory)
static and recursive (used by @AfterClass as well).
* Other minor cleanups.
* => this works on travis now and is about twice as fast! :)
- Avoiding double semicolons is tricky with the kind of rule nesting. Previous changes for that caused the tests to break as there were semicolons missing then.
- VS complained about the shift code generated using 1L as base, which is signed. Changed that to 1ULL, which is what is actually intended.
- Reverted the change to avoid a warning in RuleSempredFunction() in Cpp.stg as the fix didn't work 100%. We need a different solution.
- Fixed all disabled tests and enabled them.
- Some more adjustments of the test template + target template was needed.
- Worked on semicolon usage in Cpp.stg to avoid double semicolons. Might need more work, tho.