Remove unnecessary methods ParseTreeMatch.getText() and failed() (use getTree().getText() and !succeeded() instead)

This commit is contained in:
Sam Harwell 2013-12-19 18:59:40 -06:00
parent 72675075cf
commit 2a9a716c53
2 changed files with 1 additions and 13 deletions

View File

@ -100,18 +100,6 @@ public class ParseTreeMatch {
return mismatchedNode; 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? */ /** Did the tree vs pattern match? */
public boolean succeeded() { public boolean succeeded() {
return mismatchedNode==null; return mismatchedNode==null;

View File

@ -214,7 +214,7 @@ public class TestParseTreeMatcher extends BaseTest {
assertEquals("[y]", m.getAll("b").toString()); assertEquals("[y]", m.getAll("b").toString());
assertEquals("[x, y, z]", m.getAll("ID").toString()); // ordered 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")); assertNull(m.get("undefined"));
assertEquals("[]", m.getAll("undefined").toString()); assertEquals("[]", m.getAll("undefined").toString());