diff --git a/.travis.yml b/.travis.yml index 760f36be4..495a8ae50 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,161 +18,6 @@ stages: matrix: include: - - os: linux - compiler: clang - jdk: openjdk7 - env: - - TARGET=cpp - - CXX=g++-5 - - GROUP=LEXER - stage: main-test - addons: - apt: - sources: - - ubuntu-toolchain-r-test - - llvm-toolchain-precise-3.7 - packages: - - g++-5 - - uuid-dev - - clang-3.7 - - os: linux - compiler: clang - jdk: openjdk7 - env: - - TARGET=cpp - - CXX=g++-5 - - GROUP=PARSER - stage: main-test - addons: - apt: - sources: - - ubuntu-toolchain-r-test - - llvm-toolchain-precise-3.7 - packages: - - g++-5 - - uuid-dev - - clang-3.7 - - os: linux - compiler: clang - jdk: openjdk7 - env: - - TARGET=cpp - - CXX=g++-5 - - GROUP=RECURSION - stage: main-test - addons: - apt: - sources: - - ubuntu-toolchain-r-test - - llvm-toolchain-precise-3.7 - packages: - - g++-5 - - uuid-dev - - clang-3.7 - - os: osx - compiler: clang - osx_image: xcode10.1 - env: - - TARGET=cpp - - GROUP=LEXER - stage: extended-test - - os: osx - compiler: clang - osx_image: xcode10.1 - env: - - TARGET=cpp - - GROUP=PARSER - stage: extended-test - - os: osx - compiler: clang - osx_image: xcode10.1 - env: - - TARGET=cpp - - GROUP=RECURSION - stage: extended-test - - os: osx - compiler: clang - osx_image: xcode10.1 - env: - - TARGET=swift - - GROUP=LEXER - stage: main-test - - os: osx - compiler: clang - osx_image: xcode10.1 - env: - - TARGET=swift - - GROUP=PARSER - stage: main-test - - os: osx - compiler: clang - osx_image: xcode10.1 - env: - - TARGET=swift - - GROUP=RECURSION - stage: main-test - - os: linux - dist: xenial - compiler: clang - env: - - TARGET=swift - - GROUP=ALL - stage: extended-test - - os: osx - osx_image: xcode10.1 - env: - - TARGET=dotnet - - GROUP=LEXER - stage: extended-test - - os: osx - osx_image: xcode10.1 - env: - - TARGET=dotnet - - GROUP=PARSER - stage: extended-test - - os: osx - osx_image: xcode10.1 - env: - - TARGET=dotnet - - GROUP=RECURSION - stage: extended-test - - os: linux - jdk: openjdk7 - env: TARGET=java - stage: extended-test - - os: linux - jdk: openjdk8 - env: TARGET=java - stage: extended-test - - os: linux - jdk: oraclejdk8 - env: TARGET=java - stage: smoke-test - - os: linux - jdk: openjdk7 - env: TARGET=csharp - stage: main-test - - os: linux - jdk: oraclejdk8 - dist: trusty - env: - - TARGET=dotnet - - GROUP=LEXER - stage: extended-test - - os: linux - jdk: openjdk8 - dist: trusty - env: - - TARGET=dotnet - - GROUP=PARSER - stage: extended-test - - os: linux - jdk: oraclejdk8 - dist: trusty - env: - - TARGET=dotnet - - GROUP=RECURSION - stage: extended-test - os: linux jdk: openjdk7 env: TARGET=python2 @@ -187,16 +32,6 @@ matrix: packages: - python3.6 stage: main-test - - os: linux - dist: trusty - jdk: openjdk8 - env: TARGET=javascript - stage: main-test - - os: linux - dist: trusty - jdk: openjdk8 - env: TARGET=go - stage: main-test before_install: - f="./.travis/before-install-$TRAVIS_OS_NAME-$TARGET.sh"; ! [ -x "$f" ] || "$f" diff --git a/runtime/Python2/src/antlr4/BufferedTokenStream.py b/runtime/Python2/src/antlr4/BufferedTokenStream.py index 8b6222f0e..f541e773e 100644 --- a/runtime/Python2/src/antlr4/BufferedTokenStream.py +++ b/runtime/Python2/src/antlr4/BufferedTokenStream.py @@ -285,7 +285,7 @@ class BufferedTokenStream(TokenStream): elif stop is None or stop >= len(self.tokens): stop = len(self.tokens) - 1 if start < 0 or stop < 0 or stop= 0 and self.startIndex < self.input.size(): - symbol = self.input.getText((self.startIndex,self.startIndex)) + symbol = self.input.getText(self.startIndex,self.startIndex) # TODO symbol = Utils.escapeWhitespace(symbol, false); return u"LexerNoViableAltException" + symbol diff --git a/runtime/Python3/src/antlr4/atn/ParserATNSimulator.py b/runtime/Python3/src/antlr4/atn/ParserATNSimulator.py index 5f932dbea..9948f4be3 100644 --- a/runtime/Python3/src/antlr4/atn/ParserATNSimulator.py +++ b/runtime/Python3/src/antlr4/atn/ParserATNSimulator.py @@ -1607,17 +1607,15 @@ class ParserATNSimulator(ATNSimulator): def reportAttemptingFullContext(self, dfa:DFA, conflictingAlts:set, configs:ATNConfigSet, startIndex:int, stopIndex:int): if ParserATNSimulator.debug or ParserATNSimulator.retry_debug: - interval = (startIndex, stopIndex + 1) print("reportAttemptingFullContext decision=" + str(dfa.decision) + ":" + str(configs) + - ", input=" + self.parser.getTokenStream().getText(interval)) + ", input=" + self.parser.getTokenStream().getText(startIndex, stopIndex)) if self.parser is not None: self.parser.getErrorListenerDispatch().reportAttemptingFullContext(self.parser, dfa, startIndex, stopIndex, conflictingAlts, configs) def reportContextSensitivity(self, dfa:DFA, prediction:int, configs:ATNConfigSet, startIndex:int, stopIndex:int): if ParserATNSimulator.debug or ParserATNSimulator.retry_debug: - interval = (startIndex, stopIndex + 1) print("reportContextSensitivity decision=" + str(dfa.decision) + ":" + str(configs) + - ", input=" + self.parser.getTokenStream().getText(interval)) + ", input=" + self.parser.getTokenStream().getText(startIndex, stopIndex)) if self.parser is not None: self.parser.getErrorListenerDispatch().reportContextSensitivity(self.parser, dfa, startIndex, stopIndex, prediction, configs) @@ -1641,9 +1639,8 @@ class ParserATNSimulator(ATNSimulator): # } # i++; # } - interval = (startIndex, stopIndex + 1) print("reportAmbiguity " + str(ambigAlts) + ":" + str(configs) + - ", input=" + self.parser.getTokenStream().getText(interval)) + ", input=" + self.parser.getTokenStream().getText(startIndex, stopIndex)) if self.parser is not None: self.parser.getErrorListenerDispatch().reportAmbiguity(self.parser, dfa, startIndex, stopIndex, exact, ambigAlts, configs) diff --git a/runtime/Python3/src/antlr4/error/DiagnosticErrorListener.py b/runtime/Python3/src/antlr4/error/DiagnosticErrorListener.py index 7f983deb9..32ac14b63 100644 --- a/runtime/Python3/src/antlr4/error/DiagnosticErrorListener.py +++ b/runtime/Python3/src/antlr4/error/DiagnosticErrorListener.py @@ -46,7 +46,7 @@ class DiagnosticErrorListener(ErrorListener): buf.write(": ambigAlts=") buf.write(str(self.getConflictingAlts(ambigAlts, configs))) buf.write(", input='") - buf.write(recognizer.getTokenStream().getText((startIndex, stopIndex))) + buf.write(recognizer.getTokenStream().getText(startIndex, stopIndex)) buf.write("'") recognizer.notifyErrorListeners(buf.getvalue()) @@ -57,7 +57,7 @@ class DiagnosticErrorListener(ErrorListener): buf.write("reportAttemptingFullContext d=") buf.write(self.getDecisionDescription(recognizer, dfa)) buf.write(", input='") - buf.write(recognizer.getTokenStream().getText((startIndex, stopIndex))) + buf.write(recognizer.getTokenStream().getText(startIndex, stopIndex)) buf.write("'") recognizer.notifyErrorListeners(buf.getvalue()) @@ -67,7 +67,7 @@ class DiagnosticErrorListener(ErrorListener): buf.write("reportContextSensitivity d=") buf.write(self.getDecisionDescription(recognizer, dfa)) buf.write(", input='") - buf.write(recognizer.getTokenStream().getText((startIndex, stopIndex))) + buf.write(recognizer.getTokenStream().getText(startIndex, stopIndex)) buf.write("'") recognizer.notifyErrorListeners(buf.getvalue()) diff --git a/runtime/Python3/src/antlr4/error/ErrorStrategy.py b/runtime/Python3/src/antlr4/error/ErrorStrategy.py index 5ec4ae68e..d7538b607 100644 --- a/runtime/Python3/src/antlr4/error/ErrorStrategy.py +++ b/runtime/Python3/src/antlr4/error/ErrorStrategy.py @@ -243,7 +243,7 @@ class DefaultErrorStrategy(ErrorStrategy): if e.startToken.type==Token.EOF: input = "" else: - input = tokens.getText((e.startToken, e.offendingToken)) + input = tokens.getText(e.startToken, e.offendingToken) else: input = "" msg = "no viable alternative at input " + self.escapeWSAndQuote(input)