diff options
author | Haibo Huang <hhb@google.com> | 2018-08-28 13:51:54 -0700 |
---|---|---|
committer | Haibo Huang <hhb@google.com> | 2018-08-28 21:00:58 +0000 |
commit | b7f974f39180d46da516fb24eb2b1ca67d56089c (patch) | |
tree | 5f5626f8cde04eb9b6492d7dab0a6f2279d52e6d /runtime/Python | |
parent | bbed35ef4bfde5c3ed2fb5001998b747ce8020a4 (diff) | |
download | antlr-b7f974f39180d46da516fb24eb2b1ca67d56089c.tar.gz |
Update antlr to 3.5.2
1. Add post_update.sh to preserve build.gradle.
2. Add the patches/fix_infinite_recursion.diff to fix infinite
recursion.
3. Run tools/external_updater/updater.sh update antlr
(Should we upgrade to v4?)
Test: m javac-check RUN_ERROR_PRONE=true
Change-Id: Idafdb1cf6cf2310d983be612f36c5e6596a6e23f
Diffstat (limited to 'runtime/Python')
-rw-r--r-- | runtime/Python/antlr3/dottreegen.py | 2 | ||||
-rw-r--r-- | runtime/Python/antlr3/streams.py | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/runtime/Python/antlr3/dottreegen.py b/runtime/Python/antlr3/dottreegen.py index 827d4ec..41415b1 100644 --- a/runtime/Python/antlr3/dottreegen.py +++ b/runtime/Python/antlr3/dottreegen.py @@ -157,7 +157,7 @@ class DOTTreeGenerator(object): uniqueName = "n%d" % self.getNodeNumber(t) nodeST.setAttribute("name", uniqueName) if text is not None: - text = text.replace('"', r'\\"') + text = text.replace('"', r'\"') nodeST.setAttribute("text", text) return nodeST diff --git a/runtime/Python/antlr3/streams.py b/runtime/Python/antlr3/streams.py index c9ba7ca..84016bd 100644 --- a/runtime/Python/antlr3/streams.py +++ b/runtime/Python/antlr3/streams.py @@ -784,8 +784,8 @@ class CommonTokenStream(TokenStream): if self.p == -1: self.fillBuffer() - if stop is None or stop >= len(self.tokens): - stop = len(self.tokens) - 1 + if stop is None or stop > len(self.tokens): + stop = len(self.tokens) if start is None or stop < 0: start = 0 |