Permalink
Browse files

FIxed confusion of lexer and terminal rule names

  • Loading branch information...
1 parent 25c81cf commit 805a96beb12492fe909887133dabcab73d35af94 jkohnlein committed May 25, 2010
@@ -64,7 +64,7 @@ protected void assertTokens(T value, TokenSource tokenSource, String escapedStri
if (!escapedString.equals(token.getText())) {
throw createTokenContentMismatchException(value, escapedString, token);
}
- if (!getRuleName().equals(getRuleName(token))) {
+ if (!getRuleName().toUpperCase().equals(getRuleName(token))) {
throw createTokenTypeMismatchException(value, escapedString, token);
}
T reparsedValue = toValue(token.getText(), null);
@@ -109,6 +109,7 @@ protected Lexer getLexer() {
return null;
}
+ // TODO: rename to getLexerRuleName() on next API change
protected String getRuleName(Token token) {
String result = getTokenDefMap().get(token.getType());
return result.substring("RULE_".length());

0 comments on commit 805a96b

Please sign in to comment.