From 8d7977927fce6cdd86d81dd6f12c2637075ebaea Mon Sep 17 00:00:00 2001 From: chrisly42 Date: Fri, 6 Aug 2021 12:16:11 +0200 Subject: [PATCH] Added M68kIncludeFileProvider, but dunno what it's actually for. --- .../plugins/m68k/parser/M68kParser.java | 26 ++++---- .../m68k/psi/M68kPreprocessorDirective.java | 3 + .../m68k/psi/M68kPreprocessorKeyword.java | 6 ++ .../intellij/plugins/m68k/psi/M68kTypes.java | 3 + .../plugins/m68k/psi/M68kVisitor.java | 4 ++ .../impl/M68kPreprocessorDirectiveImpl.java | 6 ++ .../psi/impl/M68kPreprocessorKeywordImpl.java | 27 +++++++++ .../plugins/m68k/M68kFileElementType.kt | 2 +- .../intellij/plugins/m68k/lexer/LexerUtil.kt | 9 +++ .../platon42/intellij/plugins/m68k/m68k.bnf | 4 +- .../plugins/m68k/psi/M68kLiteralExprMixin.kt | 14 +---- .../m68k/scanner/M68kIncludeFileProvider.kt | 59 +++++++++++++++++++ src/main/resources/META-INF/plugin.xml | 1 + .../scanner/M68kIncludeFileProviderTest.kt | 37 ++++++++++++ .../dc_b_with_strings_and_global_label.txt | 3 +- .../directives/dc_w_with_some_numbers.txt | 3 +- src/test/resources/parser/directives/even.txt | 3 +- .../parser/directives/if_defined_block.txt | 6 +- .../parser/directives/include_file.txt | 3 +- .../directives/include_file_unquoted.txt | 3 +- .../kalms_include_file_special_quote.txt | 3 +- .../parser/directives/opt_directive.txt | 3 +- .../current_pc_symbol_relative_expression.txt | 3 +- .../if_with_single_equals_comparison.txt | 3 +- 24 files changed, 199 insertions(+), 35 deletions(-) create mode 100644 src/main/gen/de/platon42/intellij/plugins/m68k/psi/M68kPreprocessorKeyword.java create mode 100644 src/main/gen/de/platon42/intellij/plugins/m68k/psi/impl/M68kPreprocessorKeywordImpl.java create mode 100644 src/main/java/de/platon42/intellij/plugins/m68k/scanner/M68kIncludeFileProvider.kt create mode 100644 src/test/java/de/platon42/intellij/plugins/m68k/scanner/M68kIncludeFileProviderTest.kt diff --git a/src/main/gen/de/platon42/intellij/plugins/m68k/parser/M68kParser.java b/src/main/gen/de/platon42/intellij/plugins/m68k/parser/M68kParser.java index 19f7344..df6a287 100644 --- a/src/main/gen/de/platon42/intellij/plugins/m68k/parser/M68kParser.java +++ b/src/main/gen/de/platon42/intellij/plugins/m68k/parser/M68kParser.java @@ -817,14 +817,14 @@ public class M68kParser implements PsiParser, LightPsiParser { } /* ********************************************************** */ - // Label? (DATA_DIRECTIVE | OTHER_DIRECTIVE) + // Label? PreprocessorKeyword // PreprocessorOperands? public static boolean PreprocessorDirective(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "PreprocessorDirective")) return false; boolean r; Marker m = enter_section_(b, l, _NONE_, PREPROCESSOR_DIRECTIVE, ""); r = PreprocessorDirective_0(b, l + 1); - r = r && PreprocessorDirective_1(b, l + 1); + r = r && PreprocessorKeyword(b, l + 1); r = r && PreprocessorDirective_2(b, l + 1); exit_section_(b, l, m, r, false, null); return r; @@ -837,15 +837,6 @@ public class M68kParser implements PsiParser, LightPsiParser { return true; } - // DATA_DIRECTIVE | OTHER_DIRECTIVE - private static boolean PreprocessorDirective_1(PsiBuilder b, int l) { - if (!recursion_guard_(b, l, "PreprocessorDirective_1")) return false; - boolean r; - r = consumeToken(b, DATA_DIRECTIVE); - if (!r) r = consumeToken(b, OTHER_DIRECTIVE); - return r; - } - // PreprocessorOperands? private static boolean PreprocessorDirective_2(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "PreprocessorDirective_2")) return false; @@ -853,6 +844,19 @@ public class M68kParser implements PsiParser, LightPsiParser { return true; } + /* ********************************************************** */ + // DATA_DIRECTIVE | OTHER_DIRECTIVE + public static boolean PreprocessorKeyword(PsiBuilder b, int l) { + if (!recursion_guard_(b, l, "PreprocessorKeyword")) return false; + if (!nextTokenIs(b, "", DATA_DIRECTIVE, OTHER_DIRECTIVE)) return false; + boolean r; + Marker m = enter_section_(b, l, _NONE_, PREPROCESSOR_KEYWORD, ""); + r = consumeToken(b, DATA_DIRECTIVE); + if (!r) r = consumeToken(b, OTHER_DIRECTIVE); + exit_section_(b, l, m, r, false, null); + return r; + } + /* ********************************************************** */ // expr static boolean PreprocessorOperand(PsiBuilder b, int l) { diff --git a/src/main/gen/de/platon42/intellij/plugins/m68k/psi/M68kPreprocessorDirective.java b/src/main/gen/de/platon42/intellij/plugins/m68k/psi/M68kPreprocessorDirective.java index eea5d71..56d6d31 100644 --- a/src/main/gen/de/platon42/intellij/plugins/m68k/psi/M68kPreprocessorDirective.java +++ b/src/main/gen/de/platon42/intellij/plugins/m68k/psi/M68kPreprocessorDirective.java @@ -14,6 +14,9 @@ public interface M68kPreprocessorDirective extends M68kPsiElement { @Nullable M68kLocalLabel getLocalLabel(); + @NotNull + M68kPreprocessorKeyword getPreprocessorKeyword(); + @NotNull List getExprList(); diff --git a/src/main/gen/de/platon42/intellij/plugins/m68k/psi/M68kPreprocessorKeyword.java b/src/main/gen/de/platon42/intellij/plugins/m68k/psi/M68kPreprocessorKeyword.java new file mode 100644 index 0000000..2e194e6 --- /dev/null +++ b/src/main/gen/de/platon42/intellij/plugins/m68k/psi/M68kPreprocessorKeyword.java @@ -0,0 +1,6 @@ +// This is a generated file. Not intended for manual editing. +package de.platon42.intellij.plugins.m68k.psi; + +public interface M68kPreprocessorKeyword extends M68kPsiElement { + +} diff --git a/src/main/gen/de/platon42/intellij/plugins/m68k/psi/M68kTypes.java b/src/main/gen/de/platon42/intellij/plugins/m68k/psi/M68kTypes.java index 1063464..5fa34b7 100644 --- a/src/main/gen/de/platon42/intellij/plugins/m68k/psi/M68kTypes.java +++ b/src/main/gen/de/platon42/intellij/plugins/m68k/psi/M68kTypes.java @@ -58,6 +58,7 @@ public interface M68kTypes { IElementType OPERAND_SIZE = new M68kElementType("OPERAND_SIZE"); IElementType PAREN_EXPR = new M68kElementType("PAREN_EXPR"); IElementType PREPROCESSOR_DIRECTIVE = new M68kElementType("PREPROCESSOR_DIRECTIVE"); + IElementType PREPROCESSOR_KEYWORD = new M68kElementType("PREPROCESSOR_KEYWORD"); IElementType PROGRAM_COUNTER_INDIRECT_WITH_DISPLACEMENT_NEW_ADDRESSING_MODE = new M68kElementType("PROGRAM_COUNTER_INDIRECT_WITH_DISPLACEMENT_NEW_ADDRESSING_MODE"); IElementType PROGRAM_COUNTER_INDIRECT_WITH_DISPLACEMENT_OLD_ADDRESSING_MODE = new M68kElementType("PROGRAM_COUNTER_INDIRECT_WITH_DISPLACEMENT_OLD_ADDRESSING_MODE"); IElementType PROGRAM_COUNTER_INDIRECT_WITH_INDEX_NEW_ADDRESSING_MODE = new M68kElementType("PROGRAM_COUNTER_INDIRECT_WITH_INDEX_NEW_ADDRESSING_MODE"); @@ -233,6 +234,8 @@ public interface M68kTypes { return new M68kParenExprImpl(node); } else if (type == PREPROCESSOR_DIRECTIVE) { return new M68kPreprocessorDirectiveImpl(node); + } else if (type == PREPROCESSOR_KEYWORD) { + return new M68kPreprocessorKeywordImpl(node); } else if (type == PROGRAM_COUNTER_INDIRECT_WITH_DISPLACEMENT_NEW_ADDRESSING_MODE) { return new M68kProgramCounterIndirectWithDisplacementNewAddressingModeImpl(node); } else if (type == PROGRAM_COUNTER_INDIRECT_WITH_DISPLACEMENT_OLD_ADDRESSING_MODE) { diff --git a/src/main/gen/de/platon42/intellij/plugins/m68k/psi/M68kVisitor.java b/src/main/gen/de/platon42/intellij/plugins/m68k/psi/M68kVisitor.java index 09523ad..16b2da3 100644 --- a/src/main/gen/de/platon42/intellij/plugins/m68k/psi/M68kVisitor.java +++ b/src/main/gen/de/platon42/intellij/plugins/m68k/psi/M68kVisitor.java @@ -131,6 +131,10 @@ public class M68kVisitor extends PsiElementVisitor { visitPsiElement(o); } + public void visitPreprocessorKeyword(@NotNull M68kPreprocessorKeyword o) { + visitPsiElement(o); + } + public void visitProgramCounterIndirectWithDisplacementNewAddressingMode(@NotNull M68kProgramCounterIndirectWithDisplacementNewAddressingMode o) { visitAddressingMode(o); // visitWithDisplacement(o); diff --git a/src/main/gen/de/platon42/intellij/plugins/m68k/psi/impl/M68kPreprocessorDirectiveImpl.java b/src/main/gen/de/platon42/intellij/plugins/m68k/psi/impl/M68kPreprocessorDirectiveImpl.java index 2377da7..f4b5db5 100644 --- a/src/main/gen/de/platon42/intellij/plugins/m68k/psi/impl/M68kPreprocessorDirectiveImpl.java +++ b/src/main/gen/de/platon42/intellij/plugins/m68k/psi/impl/M68kPreprocessorDirectiveImpl.java @@ -39,6 +39,12 @@ public class M68kPreprocessorDirectiveImpl extends ASTWrapperPsiElement implemen return PsiTreeUtil.getChildOfType(this, M68kLocalLabel.class); } + @Override + @NotNull + public M68kPreprocessorKeyword getPreprocessorKeyword() { + return notNullChild(PsiTreeUtil.getChildOfType(this, M68kPreprocessorKeyword.class)); + } + @Override @NotNull public List getExprList() { diff --git a/src/main/gen/de/platon42/intellij/plugins/m68k/psi/impl/M68kPreprocessorKeywordImpl.java b/src/main/gen/de/platon42/intellij/plugins/m68k/psi/impl/M68kPreprocessorKeywordImpl.java new file mode 100644 index 0000000..a7fa9c1 --- /dev/null +++ b/src/main/gen/de/platon42/intellij/plugins/m68k/psi/impl/M68kPreprocessorKeywordImpl.java @@ -0,0 +1,27 @@ +// This is a generated file. Not intended for manual editing. +package de.platon42.intellij.plugins.m68k.psi.impl; + +import com.intellij.extapi.psi.ASTWrapperPsiElement; +import com.intellij.lang.ASTNode; +import com.intellij.psi.PsiElementVisitor; +import de.platon42.intellij.plugins.m68k.psi.M68kPreprocessorKeyword; +import de.platon42.intellij.plugins.m68k.psi.M68kVisitor; +import org.jetbrains.annotations.NotNull; + +public class M68kPreprocessorKeywordImpl extends ASTWrapperPsiElement implements M68kPreprocessorKeyword { + + public M68kPreprocessorKeywordImpl(@NotNull ASTNode node) { + super(node); + } + + public void accept(@NotNull M68kVisitor visitor) { + visitor.visitPreprocessorKeyword(this); + } + + @Override + public void accept(@NotNull PsiElementVisitor visitor) { + if (visitor instanceof M68kVisitor) accept((M68kVisitor) visitor); + else super.accept(visitor); + } + +} diff --git a/src/main/java/de/platon42/intellij/plugins/m68k/M68kFileElementType.kt b/src/main/java/de/platon42/intellij/plugins/m68k/M68kFileElementType.kt index 721ef09..ab39b86 100644 --- a/src/main/java/de/platon42/intellij/plugins/m68k/M68kFileElementType.kt +++ b/src/main/java/de/platon42/intellij/plugins/m68k/M68kFileElementType.kt @@ -10,7 +10,7 @@ class M68kFileElementType private constructor() : ILightStubFileElementType removeSurrounding("\"") + startsWith('\'') -> removeSurrounding("'") + startsWith('<') -> removeSurrounding("<", ">") + else -> this + } + } } \ No newline at end of file diff --git a/src/main/java/de/platon42/intellij/plugins/m68k/m68k.bnf b/src/main/java/de/platon42/intellij/plugins/m68k/m68k.bnf index 6241b2c..0e5a720 100644 --- a/src/main/java/de/platon42/intellij/plugins/m68k/m68k.bnf +++ b/src/main/java/de/platon42/intellij/plugins/m68k/m68k.bnf @@ -173,7 +173,9 @@ AsmOp ::= MNEMONIC OperandSize? { methods = [getMnemonic getOpSize] } -PreprocessorDirective ::= Label? (DATA_DIRECTIVE | OTHER_DIRECTIVE) +PreprocessorKeyword ::= (DATA_DIRECTIVE | OTHER_DIRECTIVE) + +PreprocessorDirective ::= Label? PreprocessorKeyword PreprocessorOperands? MacroPlainLine ::= MACRO_LINE diff --git a/src/main/java/de/platon42/intellij/plugins/m68k/psi/M68kLiteralExprMixin.kt b/src/main/java/de/platon42/intellij/plugins/m68k/psi/M68kLiteralExprMixin.kt index 04a36c7..1e469f6 100644 --- a/src/main/java/de/platon42/intellij/plugins/m68k/psi/M68kLiteralExprMixin.kt +++ b/src/main/java/de/platon42/intellij/plugins/m68k/psi/M68kLiteralExprMixin.kt @@ -2,21 +2,13 @@ package de.platon42.intellij.plugins.m68k.psi import com.intellij.extapi.psi.ASTWrapperPsiElement import com.intellij.lang.ASTNode +import de.platon42.intellij.plugins.m68k.lexer.LexerUtil abstract class M68kLiteralExprMixin(node: ASTNode) : ASTWrapperPsiElement(node), M68kLiteralExpr { override fun getValue(): Any? { val childNode = firstChild.node when (childNode.elementType) { - M68kTypes.STRINGLIT -> { - return text.run { - when { - startsWith('"') -> removeSurrounding("\"") - startsWith('\'') -> removeSurrounding("'") - startsWith('<') -> removeSurrounding(">") - else -> this - } - } - } + M68kTypes.STRINGLIT -> LexerUtil.unquoteString(childNode.text) M68kTypes.DECIMAL -> { try { return childNode.text.toInt() @@ -46,6 +38,6 @@ abstract class M68kLiteralExprMixin(node: ASTNode) : ASTWrapperPsiElement(node), } } } - return text + return childNode.text } } \ No newline at end of file diff --git a/src/main/java/de/platon42/intellij/plugins/m68k/scanner/M68kIncludeFileProvider.kt b/src/main/java/de/platon42/intellij/plugins/m68k/scanner/M68kIncludeFileProvider.kt new file mode 100644 index 0000000..35aa042 --- /dev/null +++ b/src/main/java/de/platon42/intellij/plugins/m68k/scanner/M68kIncludeFileProvider.kt @@ -0,0 +1,59 @@ +package de.platon42.intellij.plugins.m68k.scanner + +import com.intellij.openapi.fileTypes.FileType +import com.intellij.openapi.fileTypes.FileTypeRegistry +import com.intellij.openapi.vfs.VirtualFile +import com.intellij.psi.impl.include.FileIncludeInfo +import com.intellij.psi.impl.include.FileIncludeProvider +import com.intellij.psi.impl.source.tree.LightTreeUtil +import com.intellij.util.Consumer +import com.intellij.util.PathUtilRt +import com.intellij.util.indexing.FileContent +import com.intellij.util.indexing.PsiDependentFileContent +import de.platon42.intellij.plugins.m68k.M68kFileType.Companion.INSTANCE +import de.platon42.intellij.plugins.m68k.lexer.LexerUtil +import de.platon42.intellij.plugins.m68k.psi.M68kTypes + +class M68kIncludeFileProvider : FileIncludeProvider() { + + override fun getId(): String { + return "mc68000_include" + } + + override fun acceptFile(file: VirtualFile): Boolean { + return FileTypeRegistry.getInstance().isFileOfType(file, INSTANCE) + } + + override fun registerFileTypesUsedForIndexing(fileTypeSink: Consumer) { + fileTypeSink.consume(INSTANCE) + } + + override fun getIncludeInfos(content: FileContent): Array { + if (content.contentAsText.indexOfAny(listOf("include", "incbin"), ignoreCase = true) < 0) return emptyArray() + + val tree = (content as PsiDependentFileContent).lighterAST + val statements = LightTreeUtil.getChildrenOfType(tree, tree.root, M68kTypes.STATEMENT).asSequence() + .mapNotNull { LightTreeUtil.firstChildOfType(tree, it, M68kTypes.PREPROCESSOR_DIRECTIVE) } + .mapNotNull { + val keywordNode = LightTreeUtil.firstChildOfType(tree, it, M68kTypes.PREPROCESSOR_KEYWORD) ?: return@mapNotNull null + val keyword = LightTreeUtil.toFilteredString(tree, keywordNode, null) + if (keyword.equals("include", true) || keyword.equals("incbin", true)) { + keyword to it + } else { + null + } + } + .mapNotNull { + val pathNode = LightTreeUtil.firstChildOfType(tree, it.second, M68kTypes.LITERAL_EXPR) ?: return@mapNotNull null + val path = LexerUtil.unquoteString(LightTreeUtil.toFilteredString(tree, pathNode, null)).replace("\\", "/") + if (it.first.equals("include", true)) { + FileIncludeInfo(path) + } else { + FileIncludeInfo(PathUtilRt.getFileName(path), path, 0, true) + } + } + .toList() + + return statements.toTypedArray() + } +} \ No newline at end of file diff --git a/src/main/resources/META-INF/plugin.xml b/src/main/resources/META-INF/plugin.xml index 1a1ee5a..2baf78a 100644 --- a/src/main/resources/META-INF/plugin.xml +++ b/src/main/resources/META-INF/plugin.xml @@ -46,6 +46,7 @@ + + incbin "data/ease_x.bin" + include fx\fx_angle_only.S + """ + ) + val includedFiles = FileIncludeManager.getManager(myFixture.project).getIncludedFiles(myFixture.file.virtualFile, true, true) + assertThat(includedFiles).extracting(VirtualFile::getName) + .containsExactlyInAnyOrder("completeme.asm", "macros.i", "fx_angle_only.S", "custom.i", "exec.i", "execbase.i") + } +} \ No newline at end of file diff --git a/src/test/resources/parser/directives/dc_b_with_strings_and_global_label.txt b/src/test/resources/parser/directives/dc_b_with_strings_and_global_label.txt index 3420969..8a8d13a 100644 --- a/src/test/resources/parser/directives/dc_b_with_strings_and_global_label.txt +++ b/src/test/resources/parser/directives/dc_b_with_strings_and_global_label.txt @@ -5,7 +5,8 @@ Assembly File: a.asm PsiElement(M68kTokenType.GLOBAL_LABEL_DEF)('foo') PsiElement(M68kTokenType.COLON)(':') PsiWhiteSpace(' ') - PsiElement(M68kTokenType.DATA_DIRECTIVE)('dc.b') + M68kPreprocessorKeywordImpl(PREPROCESSOR_KEYWORD) + PsiElement(M68kTokenType.DATA_DIRECTIVE)('dc.b') PsiWhiteSpace(' ') M68kLiteralExprImpl(LITERAL_EXPR) PsiElement(M68kTokenType.STRINGLIT)(''It could be good!'') diff --git a/src/test/resources/parser/directives/dc_w_with_some_numbers.txt b/src/test/resources/parser/directives/dc_w_with_some_numbers.txt index e65b697..2163cdf 100644 --- a/src/test/resources/parser/directives/dc_w_with_some_numbers.txt +++ b/src/test/resources/parser/directives/dc_w_with_some_numbers.txt @@ -2,7 +2,8 @@ Assembly File: a.asm PsiWhiteSpace(' ') M68kStatementImpl(STATEMENT) M68kPreprocessorDirectiveImpl(PREPROCESSOR_DIRECTIVE) - PsiElement(M68kTokenType.DATA_DIRECTIVE)('dc.w') + M68kPreprocessorKeywordImpl(PREPROCESSOR_KEYWORD) + PsiElement(M68kTokenType.DATA_DIRECTIVE)('dc.w') PsiWhiteSpace(' ') M68kLiteralExprImpl(LITERAL_EXPR) PsiElement(M68kTokenType.DECIMAL)('0') diff --git a/src/test/resources/parser/directives/even.txt b/src/test/resources/parser/directives/even.txt index 7ab7147..6318908 100644 --- a/src/test/resources/parser/directives/even.txt +++ b/src/test/resources/parser/directives/even.txt @@ -2,7 +2,8 @@ Assembly File: a.asm PsiWhiteSpace('\t') M68kStatementImpl(STATEMENT) M68kPreprocessorDirectiveImpl(PREPROCESSOR_DIRECTIVE) - PsiElement(M68kTokenType.DATA_DIRECTIVE)('even') + M68kPreprocessorKeywordImpl(PREPROCESSOR_KEYWORD) + PsiElement(M68kTokenType.DATA_DIRECTIVE)('even') PsiWhiteSpace(' ') PsiComment(M68kTokenType.COMMENT)('; align to even address') PsiElement(M68kTokenType.EOL)('\n') \ No newline at end of file diff --git a/src/test/resources/parser/directives/if_defined_block.txt b/src/test/resources/parser/directives/if_defined_block.txt index 09de4ee..a3ff31c 100644 --- a/src/test/resources/parser/directives/if_defined_block.txt +++ b/src/test/resources/parser/directives/if_defined_block.txt @@ -2,7 +2,8 @@ Assembly File: a.asm PsiWhiteSpace('\t') M68kStatementImpl(STATEMENT) M68kPreprocessorDirectiveImpl(PREPROCESSOR_DIRECTIVE) - PsiElement(M68kTokenType.OTHER_DIRECTIVE)('IFD') + M68kPreprocessorKeywordImpl(PREPROCESSOR_KEYWORD) + PsiElement(M68kTokenType.OTHER_DIRECTIVE)('IFD') PsiWhiteSpace(' ') M68kRefExprImpl(REF_EXPR) M68kSymbolReferenceImpl(SYMBOL_REFERENCE) @@ -19,5 +20,6 @@ Assembly File: a.asm PsiWhiteSpace(' ') M68kStatementImpl(STATEMENT) M68kPreprocessorDirectiveImpl(PREPROCESSOR_DIRECTIVE) - PsiElement(M68kTokenType.OTHER_DIRECTIVE)('ENDC') + M68kPreprocessorKeywordImpl(PREPROCESSOR_KEYWORD) + PsiElement(M68kTokenType.OTHER_DIRECTIVE)('ENDC') PsiElement(M68kTokenType.EOL)('\n') \ No newline at end of file diff --git a/src/test/resources/parser/directives/include_file.txt b/src/test/resources/parser/directives/include_file.txt index a65b134..9b93bda 100644 --- a/src/test/resources/parser/directives/include_file.txt +++ b/src/test/resources/parser/directives/include_file.txt @@ -2,7 +2,8 @@ Assembly File: a.asm PsiWhiteSpace(' ') M68kStatementImpl(STATEMENT) M68kPreprocessorDirectiveImpl(PREPROCESSOR_DIRECTIVE) - PsiElement(M68kTokenType.OTHER_DIRECTIVE)('include') + M68kPreprocessorKeywordImpl(PREPROCESSOR_KEYWORD) + PsiElement(M68kTokenType.OTHER_DIRECTIVE)('include') PsiWhiteSpace(' ') M68kLiteralExprImpl(LITERAL_EXPR) PsiElement(M68kTokenType.STRINGLIT)('"exec/execbase.i"') diff --git a/src/test/resources/parser/directives/include_file_unquoted.txt b/src/test/resources/parser/directives/include_file_unquoted.txt index 245dd65..440b525 100644 --- a/src/test/resources/parser/directives/include_file_unquoted.txt +++ b/src/test/resources/parser/directives/include_file_unquoted.txt @@ -4,7 +4,8 @@ Assembly File: a.asm M68kGlobalLabelImpl(GLOBAL_LABEL) PsiElement(M68kTokenType.GLOBAL_LABEL_DEF)('howto') PsiElement(M68kTokenType.COLON)(':') - PsiElement(M68kTokenType.OTHER_DIRECTIVE)('incbin') + M68kPreprocessorKeywordImpl(PREPROCESSOR_KEYWORD) + PsiElement(M68kTokenType.OTHER_DIRECTIVE)('incbin') PsiWhiteSpace(' ') M68kLiteralExprImpl(LITERAL_EXPR) PsiElement(M68kTokenType.STRINGLIT)('Convertedassets\scroller_howto.raw.BPL') diff --git a/src/test/resources/parser/directives/kalms_include_file_special_quote.txt b/src/test/resources/parser/directives/kalms_include_file_special_quote.txt index 65bfc6e..4431d4e 100644 --- a/src/test/resources/parser/directives/kalms_include_file_special_quote.txt +++ b/src/test/resources/parser/directives/kalms_include_file_special_quote.txt @@ -2,7 +2,8 @@ Assembly File: a.asm PsiWhiteSpace(' ') M68kStatementImpl(STATEMENT) M68kPreprocessorDirectiveImpl(PREPROCESSOR_DIRECTIVE) - PsiElement(M68kTokenType.OTHER_DIRECTIVE)('include') + M68kPreprocessorKeywordImpl(PREPROCESSOR_KEYWORD) + PsiElement(M68kTokenType.OTHER_DIRECTIVE)('include') PsiWhiteSpace('\t') M68kLiteralExprImpl(LITERAL_EXPR) PsiElement(M68kTokenType.STRINGLIT)('') \ No newline at end of file diff --git a/src/test/resources/parser/directives/opt_directive.txt b/src/test/resources/parser/directives/opt_directive.txt index 20daacc..6e1f79b 100644 --- a/src/test/resources/parser/directives/opt_directive.txt +++ b/src/test/resources/parser/directives/opt_directive.txt @@ -2,7 +2,8 @@ Assembly File: a.asm PsiWhiteSpace(' ') M68kStatementImpl(STATEMENT) M68kPreprocessorDirectiveImpl(PREPROCESSOR_DIRECTIVE) - PsiElement(M68kTokenType.OTHER_DIRECTIVE)('opt') + M68kPreprocessorKeywordImpl(PREPROCESSOR_KEYWORD) + PsiElement(M68kTokenType.OTHER_DIRECTIVE)('opt') PsiWhiteSpace(' ') M68kLiteralExprImpl(LITERAL_EXPR) PsiElement(M68kTokenType.STRINGLIT)('o+') diff --git a/src/test/resources/parser/expressions/current_pc_symbol_relative_expression.txt b/src/test/resources/parser/expressions/current_pc_symbol_relative_expression.txt index 76db0b5..8021b3c 100644 --- a/src/test/resources/parser/expressions/current_pc_symbol_relative_expression.txt +++ b/src/test/resources/parser/expressions/current_pc_symbol_relative_expression.txt @@ -2,7 +2,8 @@ Assembly File: a.asm PsiWhiteSpace(' ') M68kStatementImpl(STATEMENT) M68kPreprocessorDirectiveImpl(PREPROCESSOR_DIRECTIVE) - PsiElement(M68kTokenType.DATA_DIRECTIVE)('dc.w') + M68kPreprocessorKeywordImpl(PREPROCESSOR_KEYWORD) + PsiElement(M68kTokenType.DATA_DIRECTIVE)('dc.w') PsiWhiteSpace(' ') M68kBinarySubExprImpl(BINARY_SUB_EXPR) M68kRefExprImpl(REF_EXPR) diff --git a/src/test/resources/parser/expressions/if_with_single_equals_comparison.txt b/src/test/resources/parser/expressions/if_with_single_equals_comparison.txt index eacac77..0407aec 100644 --- a/src/test/resources/parser/expressions/if_with_single_equals_comparison.txt +++ b/src/test/resources/parser/expressions/if_with_single_equals_comparison.txt @@ -2,7 +2,8 @@ Assembly File: a.asm PsiWhiteSpace(' ') M68kStatementImpl(STATEMENT) M68kPreprocessorDirectiveImpl(PREPROCESSOR_DIRECTIVE) - PsiElement(M68kTokenType.OTHER_DIRECTIVE)('IF') + M68kPreprocessorKeywordImpl(PREPROCESSOR_KEYWORD) + PsiElement(M68kTokenType.OTHER_DIRECTIVE)('IF') PsiWhiteSpace(' ') M68kBinaryCmpEqExprImpl(BINARY_CMP_EQ_EXPR) M68kRefExprImpl(REF_EXPR)