Skip to content

Commit

Permalink
Fix RsLexer state and token name conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
waleedyaseen committed Oct 15, 2023
1 parent fc629fb commit 86874a5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/main/gen/io/runescript/plugin/lang/lexer/_RsLexer.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import com.intellij.lexer.FlexLexer;
import com.intellij.psi.TokenType;
import com.intellij.psi.tree.IElementType;
import it.unimi.dsi.fastutil.ints.IntArrayList;
import io.runescript.plugin.lang.psi.RsTokenTypes;import it.unimi.dsi.fastutil.ints.IntArrayList;
import it.unimi.dsi.fastutil.ints.IntStack;

import java.util.List;
Expand Down Expand Up @@ -655,7 +655,7 @@ else if (zzAtEOF) {
switch (zzLexicalState) {
case BLOCK_COMMENT: {
popState();
return BLOCK_COMMENT;
return RsTokenTypes.BLOCK_COMMENT;
} // fall though
case 133: break;
default:
Expand Down Expand Up @@ -886,7 +886,7 @@ else if (zzAtEOF) {
case 86: break;
case 37:
{ popState();
return BLOCK_COMMENT;
return RsTokenTypes.BLOCK_COMMENT;
}
// fall through
case 87: break;
Expand All @@ -901,7 +901,7 @@ else if (zzAtEOF) {
// fall through
case 89: break;
case 40:
{ return BLOCK_COMMENT;
{ return RsTokenTypes.BLOCK_COMMENT;
}
// fall through
case 90: break;
Expand Down
7 changes: 4 additions & 3 deletions src/main/grammars/RuneScript.flex
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package io.runescript.plugin.lang.lexer;
import com.intellij.lexer.FlexLexer;
import com.intellij.psi.TokenType;
import com.intellij.psi.tree.IElementType;
import io.runescript.plugin.lang.psi.RsTokenTypes;
import it.unimi.dsi.fastutil.ints.IntArrayList;
import it.unimi.dsi.fastutil.ints.IntStack;

Expand Down Expand Up @@ -65,19 +66,19 @@ INCOMPLETE_TAG = "<"(shad|col|str|u|img)"="
<BLOCK_COMMENT> {
"*/" {
popState();
return BLOCK_COMMENT;
return RsTokenTypes.BLOCK_COMMENT;
}
<<EOF>> {
popState();
return BLOCK_COMMENT;
return RsTokenTypes.BLOCK_COMMENT;
}
[\s\S] { }
}

<YYINITIAL,STRING_INTERPOLATION> {

// Comments
"/**/" { return BLOCK_COMMENT; }
"/**/" { return RsTokenTypes.BLOCK_COMMENT; }
"/*" { pushState(BLOCK_COMMENT); }

{LINE_COMMENT} { return LINE_COMMENT; }
Expand Down

0 comments on commit 86874a5

Please sign in to comment.