Slightly reworked lexer to for a few directives:

'opt' and several other directives ('printt', 'fail' etc.) no longer causes a syntax error when unquoted.
'include', 'incdir' and 'incbin' and 'output' with '<pathname>' quotes no longer cause syntax error.
This commit is contained in:
2021-08-06 10:06:48 +02:00
parent 2c3daf28f7
commit ddf78ec210
10 changed files with 68 additions and 19 deletions
@@ -22,4 +22,14 @@ internal class OtherDirectivesTest : AbstractParsingTest() {
internal fun if_defined_block(@MyTestCase testCase: ParsingTestExtension.IParsingTestCase) {
testGoodSyntax(testCase, "\tIFD DEBUG ; cause a crash\n illegal\n ENDC\n")
}
@Test
internal fun kalms_include_file_special_quote(@MyTestCase testCase: ParsingTestExtension.IParsingTestCase) {
testGoodSyntax(testCase, " include\t<Engine/A500/System/Copper.i>")
}
@Test
internal fun opt_directive(@MyTestCase testCase: ParsingTestExtension.IParsingTestCase) {
testGoodSyntax(testCase, " opt o+,w-")
}
}
@@ -6,7 +6,6 @@ Assembly File: a.asm
PsiElement(M68kTokenType.COLON)(':')
PsiElement(M68kTokenType.OTHER_DIRECTIVE)('incbin')
PsiWhiteSpace(' ')
M68kRefExprImpl(REF_EXPR)
M68kSymbolReferenceImpl(SYMBOL_REFERENCE)
PsiElement(M68kTokenType.SYMBOL)('Convertedassets\scroller_howto.raw.BPL')
M68kLiteralExprImpl(LITERAL_EXPR)
PsiElement(M68kTokenType.STRINGLIT)('Convertedassets\scroller_howto.raw.BPL')
PsiElement(M68kTokenType.EOL)('\n')
@@ -0,0 +1,8 @@
Assembly File: a.asm
PsiWhiteSpace(' ')
M68kStatementImpl(STATEMENT)
M68kPreprocessorDirectiveImpl(PREPROCESSOR_DIRECTIVE)
PsiElement(M68kTokenType.OTHER_DIRECTIVE)('include')
PsiWhiteSpace('\t')
M68kLiteralExprImpl(LITERAL_EXPR)
PsiElement(M68kTokenType.STRINGLIT)('<Engine/A500/System/Copper.i>')
@@ -0,0 +1,11 @@
Assembly File: a.asm
PsiWhiteSpace(' ')
M68kStatementImpl(STATEMENT)
M68kPreprocessorDirectiveImpl(PREPROCESSOR_DIRECTIVE)
PsiElement(M68kTokenType.OTHER_DIRECTIVE)('opt')
PsiWhiteSpace(' ')
M68kLiteralExprImpl(LITERAL_EXPR)
PsiElement(M68kTokenType.STRINGLIT)('o+')
PsiElement(M68kTokenType.SEPARATOR)(',')
M68kLiteralExprImpl(LITERAL_EXPR)
PsiElement(M68kTokenType.STRINGLIT)('w-')