From 088688122ebb4323181a17fa0fd9701707ec00ff Mon Sep 17 00:00:00 2001 From: Karol Stasiak Date: Mon, 4 Nov 2019 14:26:01 +0100 Subject: [PATCH] #6 Improve semicolon comment parsing --- src/main/scala/millfork/parser/MfParser.scala | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/scala/millfork/parser/MfParser.scala b/src/main/scala/millfork/parser/MfParser.scala index 07a0db1f..f6aea14e 100644 --- a/src/main/scala/millfork/parser/MfParser.scala +++ b/src/main/scala/millfork/parser/MfParser.scala @@ -64,7 +64,7 @@ abstract class MfParser[T](fileId: String, input: String, currentDirectory: Stri val EOL: P[Unit] = P(HWS ~ ("\r\n" | "\r" | "\n" | semicolon | comment).opaque("") ~ AWS).opaque("") - val EOL_asm: P[Unit] = P(HWS ~ ("\r\n" | "\r" | "\n" | semicolon | comment).opaque("") ~ AWS).opaque("") + val EOL_asm: P[Unit] = P(HWS ~ ("\r\n" | "\r" | "\n" | semicolonComment | comment).opaque("") ~ AWS_asm).opaque("") val EOLOrComma: P[Unit] = P(HWS ~ ("\r\n" | "\r" | "\n" | "," | semicolon | comment).opaque("") ~ AWS).opaque("") @@ -664,6 +664,10 @@ object MfParser { val letter: P[String] = P(CharIn("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_").!) + val mosOpcodeLetter: P[String] = P(CharIn("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz012").!) + + val octalDigit: P[String] = P(CharIn("01234567").!) + val letterOrDigit: P[Unit] = P(CharIn("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_.$1234567890")) val lettersOrDigits: P[String] = P(CharsWhileIn("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_.$1234567890", min = 0).!)