Added M68kLexerPrefs (preliminary). Added support for optional space-introducing comments.

This commit is contained in:
2021-07-17 16:49:50 +02:00
parent 618a4eee01
commit 349372f6b3
17 changed files with 771 additions and 536 deletions
@@ -12,6 +12,7 @@ import com.intellij.psi.tree.IFileElementType;
import com.intellij.psi.tree.TokenSet;
import de.platon42.intellij.plugins.m68k.M68kFileElementType;
import de.platon42.intellij.plugins.m68k.lexer.M68kLexer;
import de.platon42.intellij.plugins.m68k.lexer.M68kLexerPrefs;
import de.platon42.intellij.plugins.m68k.psi.M68kFile;
import de.platon42.intellij.plugins.m68k.psi.M68kTypes;
import org.jetbrains.annotations.NotNull;
@@ -20,12 +21,19 @@ public class M68kParserDefinition implements ParserDefinition {
public static final TokenSet STRING_LITERALS = TokenSet.create(M68kTypes.STRINGLIT);
public static final TokenSet COMMENTS = TokenSet.create(M68kTypes.COMMENT);
private M68kLexerPrefs lexerPrefs = new M68kLexerPrefs(); // TODO make this configurable
public M68kParserDefinition() {
}
public M68kLexerPrefs getLexerPrefs() {
return lexerPrefs;
}
@Override
public @NotNull Lexer createLexer(Project project) {
return new M68kLexer();
// TODO take prefs from project somehow
return new M68kLexer(lexerPrefs);
}
@Override