diff options
author | gjoranv <gv@oath.com> | 2018-12-06 13:13:57 +0100 |
---|---|---|
committer | gjoranv <gv@oath.com> | 2018-12-06 14:19:01 +0100 |
commit | 9820f82abab66b045f6ce65c03477903180f61b4 (patch) | |
tree | efb0ce12a49e8eca52058196193b36ddf6d7373c /vespajlib | |
parent | 49de3f5478c4a44c8f5cebcb15062eb6289ddd35 (diff) |
Update to latest ph-javacc-maven-plugin.
- Update FastCharStream method names to follow changes in
generated CharStream class.
- Update expected test output due to improvements in generated
code.
- Improve ability to debug tests by more clearly printing out
the diff between expected and actual output.
Diffstat (limited to 'vespajlib')
-rw-r--r-- | vespajlib/src/main/java/com/yahoo/javacc/FastCharStream.java | 10 | ||||
-rw-r--r-- | vespajlib/src/test/java/com/yahoo/javacc/FastCharStreamTestCase.java | 8 |
2 files changed, 9 insertions, 9 deletions
diff --git a/vespajlib/src/main/java/com/yahoo/javacc/FastCharStream.java b/vespajlib/src/main/java/com/yahoo/javacc/FastCharStream.java index 57376734030..96dc03865e3 100644 --- a/vespajlib/src/main/java/com/yahoo/javacc/FastCharStream.java +++ b/vespajlib/src/main/java/com/yahoo/javacc/FastCharStream.java @@ -49,21 +49,21 @@ public class FastCharStream { readPos -= amount; } - public char BeginToken() throws IOException { + public char beginToken() throws IOException { tokenPos = readPos; return readChar(); } - public String GetImage() { + public String getImage() { return inputStr.substring(tokenPos, readPos); } @SuppressWarnings("UnusedParameters") - public char[] GetSuffix(int len) { + public char[] getSuffix(int len) { throw new UnsupportedOperationException(); } - public void Done() { + public void done() { } @@ -73,7 +73,7 @@ public class FastCharStream { public void setTrackLineColumn(boolean tlc) { trackLineColumn = tlc; } - public boolean getTrackLineColumn() { return trackLineColumn; } + public boolean isTrackLineColumn() { return trackLineColumn; } public String formatException(String parseException) { int errPos = findErrPos(parseException); diff --git a/vespajlib/src/test/java/com/yahoo/javacc/FastCharStreamTestCase.java b/vespajlib/src/test/java/com/yahoo/javacc/FastCharStreamTestCase.java index d8f7b6e9e7e..5d768ee3b93 100644 --- a/vespajlib/src/test/java/com/yahoo/javacc/FastCharStreamTestCase.java +++ b/vespajlib/src/test/java/com/yahoo/javacc/FastCharStreamTestCase.java @@ -79,7 +79,7 @@ public class FastCharStreamTestCase { @Test public void requireThatSuffixIsNotSupported() { try { - new FastCharStream("foo").GetSuffix(0); + new FastCharStream("foo").getSuffix(0); fail(); } catch (UnsupportedOperationException e) { @@ -89,7 +89,7 @@ public class FastCharStreamTestCase { @Test public void requireThatDoneDoesNotThrowException() { FastCharStream input = new FastCharStream("foo"); - input.Done(); + input.done(); } @Test @@ -99,7 +99,7 @@ public class FastCharStreamTestCase { input.readChar(); input.readChar(); input.readChar(); - assertEquals('b', input.BeginToken()); + assertEquals('b', input.beginToken()); assertEquals(5, input.getBeginColumn()); assertEquals(-1, input.getBeginLine()); assertEquals(6, input.getEndColumn()); @@ -108,7 +108,7 @@ public class FastCharStreamTestCase { assertEquals('r', input.readChar()); assertEquals(8, input.getEndColumn()); assertEquals(-1, input.getEndLine()); - assertEquals("bar", input.GetImage()); + assertEquals("bar", input.getImage()); } @Test |