forked from jasder/antlr
Remove unnecessary methods ParseTreeMatch.getText() and failed() (use getTree().getText() and !succeeded() instead)
This commit is contained in:
parent
72675075cf
commit
2a9a716c53
|
@ -100,18 +100,6 @@ public class ParseTreeMatch {
|
|||
return mismatchedNode;
|
||||
}
|
||||
|
||||
/** Return the text of the entire subtree matched. It does not include
|
||||
* whitespace stripped by the lexer.
|
||||
*/
|
||||
public String getText() {
|
||||
return tree.getText();
|
||||
}
|
||||
|
||||
/** Did the tree vs pattern fail to match? */
|
||||
public boolean failed() {
|
||||
return mismatchedNode!=null;
|
||||
}
|
||||
|
||||
/** Did the tree vs pattern match? */
|
||||
public boolean succeeded() {
|
||||
return mismatchedNode==null;
|
||||
|
|
|
@ -214,7 +214,7 @@ public class TestParseTreeMatcher extends BaseTest {
|
|||
assertEquals("[y]", m.getAll("b").toString());
|
||||
assertEquals("[x, y, z]", m.getAll("ID").toString()); // ordered
|
||||
|
||||
assertEquals("xyz;", m.getText()); // whitespace stripped by lexer
|
||||
assertEquals("xyz;", m.getTree().getText()); // whitespace stripped by lexer
|
||||
|
||||
assertNull(m.get("undefined"));
|
||||
assertEquals("[]", m.getAll("undefined").toString());
|
||||
|
|
Loading…
Reference in New Issue