Skip to content

Commit 4f95ea7

Browse files
committed
fix antlr lexer
1 parent d77b904 commit 4f95ea7

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

java/grammars/org/antlr/codebuff/ANTLRv4Lexer.g4

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,7 @@ tokens {
7575

7676
@Override
7777
public Token emit() {
78-
if (_type == ID) {
79-
String firstChar = _input.getText(Interval.of(_tokenStartCharIndex, _tokenStartCharIndex));
80-
if (Character.isUpperCase(firstChar.charAt(0))) {
81-
_type = TOKEN_REF;
82-
} else {
83-
_type = RULE_REF;
84-
}
85-
78+
if (_type == TOKEN_REF || _type==RULE_REF ) {
8679
if (_currentRuleType == Token.INVALID_TYPE) { // if outside of rule def
8780
_currentRuleType = _type; // set to inside lexer or parser rule
8881
}

0 commit comments

Comments
 (0)