From 600bfce0c1cd168be8fad3696e1596952bbe3bc7 Mon Sep 17 00:00:00 2001 From: Karol Stasiak Date: Wed, 13 Jan 2021 14:38:59 +0100 Subject: [PATCH] Allow new lines after = --- src/main/scala/millfork/parser/MfParser.scala | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/scala/millfork/parser/MfParser.scala b/src/main/scala/millfork/parser/MfParser.scala index 62a32be2..b1dd1eda 100644 --- a/src/main/scala/millfork/parser/MfParser.scala +++ b/src/main/scala/millfork/parser/MfParser.scala @@ -227,7 +227,7 @@ abstract class MfParser[T](fileId: String, input: String, currentDirectory: Stri optimizationHints <- optimizationHintsDeclaration ~/ HWS alignment2 <- alignmentDeclaration(fastAlignmentForFunctions).? ~/ HWS addr <- ("@" ~/ HWS ~/ mfExpression(1, false)).?.opaque("
") ~ HWS - initialValue <- ("=" ~/ HWS ~/ mfExpression(1, false)).? ~/ HWS // TODO + initialValue <- ("=" ~/ AWS ~/ mfExpression(1, false)).? ~/ HWS // TODO } yield { if (alignment1.isDefined && alignment2.isDefined) log.error(s"Cannot define the alignment multiple times", Some(p)) val alignment = alignment1.orElse(alignment2) @@ -406,7 +406,7 @@ abstract class MfParser[T](fileId: String, input: String, currentDirectory: Stri val aliasDefinition: P[Seq[AliasDefinitionStatement]] = for { p <- position() name <- "alias" ~ !letterOrDigit ~/ SWS ~ identifier ~ HWS - target <- "=" ~/ HWS ~/ identifier ~/ HWS + target <- "=" ~/ AWS ~/ identifier ~/ HWS important <- "!".!.? ~/ HWS } yield Seq(AliasDefinitionStatement(name, target, important.isDefined).pos(p)) @@ -439,7 +439,7 @@ abstract class MfParser[T](fileId: String, input: String, currentDirectory: Stri optimizationHints <- optimizationHintsDeclaration ~/ HWS alignment2 <- alignmentDeclaration(fastAlignmentForFunctions).? ~/ HWS addr <- ("@" ~/ HWS ~/ mfExpression(1, false)).? ~/ HWS - contents <- ("=" ~/ HWS ~/ arrayContents).? ~/ HWS + contents <- ("=" ~/ AWS ~/ arrayContents).? ~/ HWS } yield { if (alignment1.isDefined && alignment2.isDefined) log.error(s"Cannot define the alignment multiple times", Some(p)) val alignment = alignment1.orElse(alignment2) @@ -759,7 +759,7 @@ abstract class MfParser[T](fileId: String, input: String, currentDirectory: Stri val enumVariant: P[(String, Option[Expression])] = for { name <- identifier ~/ HWS - value <- ("=" ~/ HWS ~/ mfExpression(1, false)).? ~ HWS + value <- ("=" ~/ AWS ~/ mfExpression(1, false)).? ~ HWS } yield name -> value val enumVariants: P[List[(String, Option[Expression])]] =