Range check; apparently string literal map not set when we create interp vs code gen.
This commit is contained in:
parent
81e8df8119
commit
d4275ab53a
|
@ -566,7 +566,10 @@ public class Grammar implements AttributeResolver {
|
|||
String[] tokenNames = new String[numTokens+1];
|
||||
for (String tokenName : tokenNameToTypeMap.keySet()) {
|
||||
Integer ttype = tokenNameToTypeMap.get(tokenName);
|
||||
if ( tokenName!=null && tokenName.startsWith(AUTO_GENERATED_TOKEN_NAME_PREFIX) ) {
|
||||
if ( tokenName!=null &&
|
||||
tokenName.startsWith(AUTO_GENERATED_TOKEN_NAME_PREFIX) &&
|
||||
ttype < typeToStringLiteralList.size() )
|
||||
{
|
||||
tokenName = typeToStringLiteralList.get(ttype);
|
||||
}
|
||||
if ( ttype>0 ) tokenNames[ttype] = tokenName;
|
||||
|
|
Loading…
Reference in New Issue