diff --git a/README.md b/README.md
index b1574cd..9ea405f 100644
--- a/README.md
+++ b/README.md
@@ -71,9 +71,10 @@ make it work with JUnit 5. Feel free to use the code (in package ```de.platon42.
### V0.2 (unreleased)
-- Added (same) icon for plugin as for file type.
+- Cosmetics: Added (same) icon for plugin as for file type.
- Performance improvement: Use Word-Index for global labels and symbols instead of iterating over the file.
- Performance improvement: Use Stub-Index for global labels and symbols.
+- Bugfix: No longer reports a syntax error when file lacks terminating End-Of-Line
### V0.1 (20-Jul-21)
diff --git a/build.gradle b/build.gradle
index 43c6367..675f821 100644
--- a/build.gradle
+++ b/build.gradle
@@ -48,9 +48,10 @@ patchPluginXml {
setChangeNotes("""
V0.2 (xx-Jul-21)
- - Added (same) icon for plugin as for file type.
+
- Cosmetics: Added (same) icon for plugin as for file type.
- Performance improvement: Use Word-Index for global labels and symbols instead of iterating over the file.
- Performance improvement: Use Stub-Index for global labels and symbols.
+
- Bugfix: No longer reports a syntax error when file lacks terminating End-Of-Line
V0.1 (20-Jul-21)
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 b74597a..4c00a0a 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
@@ -1051,14 +1051,14 @@ public class M68kParser implements PsiParser, LightPsiParser {
}
/* ********************************************************** */
- // !<> statement EOL
+ // !<> statement (<>|EOL)
static boolean line(PsiBuilder b, int l) {
if (!recursion_guard_(b, l, "line")) return false;
boolean r;
Marker m = enter_section_(b);
r = line_0(b, l + 1);
r = r && statement(b, l + 1);
- r = r && consumeToken(b, EOL);
+ r = r && line_2(b, l + 1);
exit_section_(b, m, null, r);
return r;
}
@@ -1073,6 +1073,17 @@ public class M68kParser implements PsiParser, LightPsiParser {
return r;
}
+ // <>|EOL
+ private static boolean line_2(PsiBuilder b, int l) {
+ if (!recursion_guard_(b, l, "line_2")) return false;
+ boolean r;
+ Marker m = enter_section_(b);
+ r = eof(b, l + 1);
+ if (!r) r = consumeToken(b, EOL);
+ exit_section_(b, m, null, r);
+ return r;
+ }
+
/* ********************************************************** */
// Assignment
// | PreprocessorDirective
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 7e53a4b..86435e7 100644
--- a/src/main/java/de/platon42/intellij/plugins/m68k/m68k.bnf
+++ b/src/main/java/de/platon42/intellij/plugins/m68k/m68k.bnf
@@ -118,7 +118,7 @@
M68kFile ::= line*
-private line ::= !<> statement EOL
+private line ::= !<> statement (<>|EOL)
statement ::= (Assignment
| PreprocessorDirective
diff --git a/src/test/java/de/platon42/intellij/plugins/m68k/parser/BasicAsmInstTest.kt b/src/test/java/de/platon42/intellij/plugins/m68k/parser/BasicAsmInstTest.kt
index 10804e6..61c4433 100644
--- a/src/test/java/de/platon42/intellij/plugins/m68k/parser/BasicAsmInstTest.kt
+++ b/src/test/java/de/platon42/intellij/plugins/m68k/parser/BasicAsmInstTest.kt
@@ -13,13 +13,14 @@ internal class BasicAsmInstTest : AbstractParsingTest() {
@ParserResultFile("basic_block_of_code")
internal fun parser_can_parse_basic_block_of_code(@MyTestCase testCase: ParsingTestExtension.IParsingTestCase) {
testGoodSyntax(
- testCase, "\tadd.l d0,d0\n"
- + "\tmoveq #10,d1\n"
- + " rts\n"
- + "\n"
- + "; comment\n"
- + " jmp\tresetcode ; unreachable\n"
- + " \n"
+ testCase, "\tadd.l d0,d0\n"
+ + "\tmoveq #10,d1\n"
+ + " rts\n"
+ + "\n"
+ + "; comment\n"
+ + " jmp\tresetcode ; unreachable\n"
+ + " \n"
+ + "eoflabel"
)
}
}
\ No newline at end of file
diff --git a/src/test/resources/parser/basic/basic_block_of_code.txt b/src/test/resources/parser/basic/basic_block_of_code.txt
index f088839..0df9046 100644
--- a/src/test/resources/parser/basic/basic_block_of_code.txt
+++ b/src/test/resources/parser/basic/basic_block_of_code.txt
@@ -53,4 +53,7 @@ Assembly File: a.asm
PsiComment(M68kTokenType.COMMENT)('; unreachable')
PsiElement(M68kTokenType.EOL)('\n')
PsiWhiteSpace(' ')
- PsiWhiteSpace('\n')
\ No newline at end of file
+ PsiWhiteSpace('\n')
+ M68kStatementImpl(STATEMENT)
+ M68kGlobalLabelImpl(GLOBAL_LABEL)
+ PsiElement(M68kTokenType.GLOBAL_LABEL_DEF)('eoflabel')
\ No newline at end of file