Commit Graph

449 Commits

Author SHA1 Message Date
Ewan Mellor e77d690e36
Report errors in ANTLRFileStream.
Change the initializer to ANTLRFileStream so that it throws any errors that
occur while reading the file.  Previously, it was just dropping any errors on
the floor (inside Utils.readFile).

Remove Utils.readFile, it's not used anywhere else.
2017-11-10 18:06:12 -08:00
Ewan Mellor 6c11160b51
Remove tokenNames / getTokenNames from the Recognizer interface.
This has been ported over from the Java code, but it was deprecated there.
There's no point having it in the Swift runtime because we don't have the
legacy code to support.  Also, it wasn't implemented properly, so it
never worked.

Remove {DFA,IntervalSet}.toString(_:[String?]?)
and the inits in ParserInterpreter and DFASerializer for the same reason.
Switch the unit tests to use the alternate toString(_:Vocabulary).
2017-10-25 13:28:40 -07:00
Ewan Mellor 39c01f6da7
Update the Swift tests for Swift Package Manager 4.0.
SwiftPM has changed its default layout for new packages (i.e. when we
use "swift package init --type executable" during the test).  It now is
<projectName>/Sources/<projectName>/main.swift, so we need to adjust the
paths appropriately.

This includes a small change to print stdout as well as stderr if a
unit test fails to build.  swift-build-tool takes the compiler subprocess's
stderr and puts it on stdout.  *sheesh*  This meant that we were losing
critical error messages.
2017-10-20 10:12:47 -07:00
Niels Basjes ac9f75303e Fixed empty CodePointCharStream throwing exception on getText. Fixes #1949 2017-08-02 14:30:46 +02:00
Sam Harwell 0803c74eb2 Report InputMismatchException with original context information
Fixes #1922
2017-07-27 18:34:13 -05:00
Eric Vergnaud 5e0eee056d oops, forgot to flag the dotnet tests 2017-06-28 23:39:54 +08:00
Eric Vergnaud 32fc500102 Fix typo and rebalance 2017-06-27 07:43:59 +08:00
Eric Vergnaud 0e573fb0a5 categorise tests to fix Travis timeout 2017-06-27 00:50:49 +08: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 dbff375c54 fix failing test 2017-06-25 14:13:18 +08:00
Eric Vergnaud 2e56ccfe19 simplify test 2017-06-25 14:13:01 +08:00
Eric Vergnaud 94ca69b727 add test for #1925 2017-06-25 10:13:58 +08:00
alimg 405dc20488 add parser error test case to replicate the Python formatting issue 2017-06-20 16:48:08 +03:00
Hanzhou Shi f15d9a31a3 revert one trivial change in go test. 2017-06-03 22:57:22 -07:00
Hanzhou Shi 77eddc8e76 fix linker issue on travis ubuntu 2017-06-03 22:57:21 -07:00
Hanzhou Shi e8962dad7e reads SWIFT_HOME from environment variables. 2017-06-03 22:57:21 -07:00
Hanzhou Shi 3095de982e All tests passing. But slow. 2017-06-03 22:57:21 -07:00
Hanzhou Shi 8cbd7c0693 Get parser tests working. 2017-06-03 22:57:21 -07:00
Hanzhou Shi 6acec92866 Refactoring swift test framework. 2017-06-03 22:57:21 -07:00
Terence Parr f2ee752a58 Merge pull request #1848 from davesisson/master
Fix tests for PR #1844.
2017-05-12 09:18:46 -07:00
David Sisson e9dd953cf1 Fixed another occurrence of NewFileInputStream. 2017-04-29 19:55:32 -07:00
David Sisson 81b8078860 updated 2017-04-29 17:52:21 -07:00
David Sisson f41ce7fed4 Fix tests for PR #1844. 2017-04-29 17:27:08 -07:00
Dong Xie e94b3acaed [dotnet] fix again for the test speed up 2017-04-28 16:18:36 +01:00
Dong Xie 5fffe4bb2e [dotnet] try to get test run faster; update from 1.0.1 to 1.0.3; fix test dir removal not recursive 2017-04-27 17:23:48 +01:00
Terence Parr efc0a14879 Merge pull request #1810 from xied75/dotnetcore
[dotnet] update to .netcore v1.0.1; add osx build
2017-04-17 09:55:32 -07:00
Terence Parr 9519bfc36f Merge pull request #1818 from parrt/fix-1815-again
Fixes #1815 (for real this time!)
2017-04-06 14:36:22 -07:00
parrt f858cd5948 Fixes #1815 (for real this time!). Fix text set for erroneous escapes so tool doesn't fail later. Remove some duplicate error messages. Add test for #1815. 2017-04-06 14:34:37 -07:00
Dong Xie da4987dc38 [dotnet] update to .netcore v1.0.1; add osx build 2017-04-04 15:26:40 +01:00
Hanzhou Shi 07048fe787 Fixing unit tests. 2017-04-02 09:41:55 -07:00
parrt 62baf4bd0a [maven-release-plugin] prepare for next development iteration 2017-03-30 14:11:59 -07:00
parrt d4d7e3d3bc [maven-release-plugin] prepare release 4.7 2017-03-30 14:11:49 -07:00
parrt b5648f405b tweak documentation about various targets 2017-03-30 10:44:28 -07:00
Terence Parr 6e474eb43e Merge pull request #1776 from bhamiltoncx/js-char-streams
New JavaScript CharStreams functions
2017-03-29 14:38:41 -07:00
Terence Parr 828461337f Merge pull request #1775 from bhamiltoncx/csharp-char-streams
New C# CharStreams static factory class
2017-03-29 14:37:06 -07:00
Ben Hamilton 200379802a Tidy comments and add tests to ensure UTF-16 and UTF-32 support Unicode code points > U+FFF 2017-03-29 10:06:08 -07:00
Ben Hamilton ab0655598e Improve memory usage of CodePointCharStream: Use 8-bit, 16-bit, or 32-bit buffer 2017-03-27 16:46:42 -07:00
parrt eb49080720 add test showing cost to load from a file where we know the size. Add test of small file to load as well. 2017-03-27 11:34:23 -07:00
parrt 4ca382c9b0 add dependence on JOL http://hg.openjdk.java.net/code-tools/jol to compute buffer sizes. Dumps footprint now too. 2017-03-26 13:27:57 -07:00
parrt 00d5781bee update sample lexer timing numbers after IntervalSet binary search update. 2017-03-24 14:01:21 -07:00
parrt 9cf26d0163 add my results to Ben's, small cleanup. 2017-03-24 13:45:37 -07:00
parrt da71ea375f add legacy ascii *load* back. separate out stream locate time / mem overhead from load tests. 2017-03-24 13:39:20 -07:00
Ben Hamilton b2869ee0d7 Fix TimeLexerSpeed when run from jar 2017-03-23 14:18:17 -07:00
parrt 0713128d04 add size information to the load for streams 2017-03-23 10:54:19 -07:00
Ben Hamilton f72e22550c charstreams-js 2017-03-22 11:03:16 -07:00
Ben Hamilton 307df9c68d New C# CharStreams static factory class 2017-03-20 13:07:08 -07:00
parrt 648f517da0 add more load times 2017-03-17 14:08:25 -07:00
parrt b961c86143 add load times 2017-03-17 13:37:01 -07:00
parrt aa177cf415 Forgot to add UTF-8 encoding to legacy. 2017-03-17 13:09:11 -07:00
parrt 553742e149 rm deadcode 2017-03-17 12:07:01 -07:00
parrt 251d27493e add lexer speed tests for new unicode streams 2017-03-17 12:06:07 -07:00
Terence Parr 1f6a329692 Merge pull request #1765 from bhamiltoncx/unicode-cleanup-and-doc
Tidy up CharStreams and add new doc/unicode.md
2017-03-16 17:03:06 -07:00
Ben Hamilton 4f2168600d Tidy up CharStreams API. Add new doc/unicode.md 2017-03-16 17:01:46 -06:00
parrt ae3aadce3f change whitespace for new wildcard test; messed up in python. 2017-03-15 14:10:55 -07:00
parrt d966702d63 add wildcard test. 2017-03-15 09:33:15 -07:00
Dong Xie e49b0977f5 fix #1725; get dotnet target test run 2017-03-04 01:42:44 +00:00
Ivan Kochurkin b07528796e Removed runtime CharSetWithMissingEndRange test. 2017-03-03 13:42:09 +03:00
parrt 3df19fbcc8 make format consistent with most of antlr project 2017-03-02 10:38:48 -08: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
parrt e1101caffa resolve conflict 2017-02-17 11:08:15 -08:00
parrt f8e7a2cf08 merge in dotnet stuff 2017-02-17 11:02:52 -08:00
Terence Parr 877f6a396b Merge pull request #1659 from bhamiltoncx/js-use-code-points-for-tests
JavaScript: Allow Unicode code points > U+FFFF in tests
2017-02-16 09:53:43 -08:00
Terence Parr b3f5d1e3d1 Merge pull request #1658 from bhamiltoncx/csharp-use-output-file
C#: Write test output to a file
2017-02-16 09:53:16 -08:00
Ben Hamilton c35bbabc16 PR #1658: Also write stderr to file 2017-02-16 09:44:40 -08:00
Ben Hamilton cd7700939c Use code points for JS tests 2017-02-14 15:26:54 -08:00
Ben Hamilton cd922eb74c Python 2/3 runtime and test harness support for writing test output to file 2017-02-14 15:00:52 -08:00
David Neumann e967463e91 Merge branch 'master' into master 2017-02-14 11:20:02 +01:00
Terence Parr 287f17b796 Merge pull request #1652 from bhamiltoncx/csharp-lexer-parser-output-file
C# support for lexer and parser output to a file
2017-02-13 15:10:54 -08:00
Terence Parr 9b7e2a81ce Merge pull request #1651 from bhamiltoncx/python-lexer-parser-output-file
Python 2 and Python 3 support for lexer and parser output to a file
2017-02-13 15:10:19 -08:00
Terence Parr 51f6ad69b6 Merge pull request #1649 from bhamiltoncx/test-output-reading
New class TestOutputReading to mimic StreamVacuum for tests which write to a file
2017-02-13 15:07:28 -08:00
Terence Parr aa58ba5a2e Merge pull request #1648 from bhamiltoncx/file-encoding-utf-8
Ensure unit tests are run with file.encoding=UTF-8
2017-02-13 15:06:19 -08:00
Terence Parr 3cbc2af0cc Merge pull request #1655 from lionelplessis/fix-#1298-for-csharp
Fix #1298 for CSharp
2017-02-13 10:29:47 -08:00
Terence Parr ae5250685d Merge pull request #1637 from bhamiltoncx/char-streams
Make BaseJavaTest and TestRig work with Unicode values > U+FFFF
2017-02-10 14:11:34 -08:00
Ben Hamilton 6611c1ae27 C# runtime and test harness support for writing test output to file 2017-02-10 13:37:44 -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 cf3b513a58 New TestOutputReading runtime-testsuite class 2017-02-10 11:30:05 -08:00
Ben Hamilton 11aa20c5e7 Ensure tests are run with file.encoding=UTF-8 2017-02-10 11:28:06 -08:00
lionelplessis 895681044e Fix #1298 for CSharp 2017-02-10 17:55:10 +01:00
Ben Hamilton 499e44b03a Pass through source name 2017-01-30 14:16:33 -08:00
Terence Parr 3e61421e59 Merge pull request #1636 from bhamiltoncx/stream-vacuum-utf8
Consolidate multiple copies of StreamVacuum, make use UTF-8
2017-01-30 13:29:32 -08:00
Ben Hamilton 0f52b7c0d9 CharStreams 2017-01-30 10:09:56 -08:00
Ben Hamilton (Ben Gertzfield) f0947f4365 Update copyright in StreamVacuum.java 2017-01-30 09:56:02 -07:00
Ben Hamilton eb54507e42 Consolidate multiple copies of StreamVacuum, make use UTF-8 2017-01-30 08:53:09 -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
Terence Parr b4508d26b2 Merge pull request #1629 from bhamiltoncx/fix-writing-unicode-in-tests
Fix writing Unicode values in runtime tests
2017-01-29 13:02:19 -08:00
Terence Parr bd8a367398 Merge pull request #1627 from bhamiltoncx/utf8-code-point-decoder
New class UTF8CodePointDecoder
2017-01-29 12:54:58 -08:00
Terence Parr 508d2f988f Merge pull request #1626 from bhamiltoncx/new-code-point-char-stream
New class CodePointCharStream (alternative to ANTLRInputStream)
2017-01-29 12:50:44 -08:00
Terence Parr 37adfd4e30 Merge pull request #1625 from bhamiltoncx/integer-list-unicode
New method IntegerList.toCharArray()
2017-01-29 10:38:29 -08:00
Terence Parr bf4fa40ff9 Merge pull request #1606 from hanjoes/spm
Tweak Repo to use SwiftPackageManager.
2017-01-29 10:31:53 -08:00
Terence Parr f5a2b5b509 Merge pull request #1594 from wxio/master
Remove lower case formatting on Go types & super import
2017-01-29 10:31:20 -08:00
Dong Xie 95db50d540 [dotnet] target: use project reference in json instead of nupkg; fix for tests 2017-01-27 15:16:28 +00:00
Ben Hamilton 77067674b9 Fix writing Unicode values in runtime tests 2017-01-25 15:29:33 -08:00
Ben Hamilton 558aa7b011 UTF8CodePointDecoder 2017-01-24 15:23:03 -08:00
Ben Hamilton 212a948656 CodePointCharStream 2017-01-24 13:12:28 -08:00
Ben Hamilton bbf8476c8e New method IntegerList.toCharArray() 2017-01-24 11:30:50 -08:00
Dong Xie 8a08a6ed56 [csharp] dotnet test files added, test passing 2017-01-24 16:21:13 +00:00
Ben Gertzfield cf8fba0715 Look in /usr/local/bin before /usr/bin for mono 2017-01-23 14:09:28 -08:00
Hanzhou Shi 91d8d13b05 Fix travis build. 2017-01-18 23:40:56 -08:00
Johannes Kohnen 5e9ecae281 Change StringType to lower case for Go target.
*  See antlr/antlr4#1594
2017-01-11 22:36:17 +11:00