mirror of
https://github.com/KarolS/millfork.git
synced 2025-01-11 12:29:46 +00:00
Allow new lines after =
This commit is contained in:
parent
9feda54d92
commit
600bfce0c1
@ -227,7 +227,7 @@ abstract class MfParser[T](fileId: String, input: String, currentDirectory: Stri
|
|||||||
optimizationHints <- optimizationHintsDeclaration ~/ HWS
|
optimizationHints <- optimizationHintsDeclaration ~/ HWS
|
||||||
alignment2 <- alignmentDeclaration(fastAlignmentForFunctions).? ~/ HWS
|
alignment2 <- alignmentDeclaration(fastAlignmentForFunctions).? ~/ HWS
|
||||||
addr <- ("@" ~/ HWS ~/ mfExpression(1, false)).?.opaque("<address>") ~ HWS
|
addr <- ("@" ~/ HWS ~/ mfExpression(1, false)).?.opaque("<address>") ~ HWS
|
||||||
initialValue <- ("=" ~/ HWS ~/ mfExpression(1, false)).? ~/ HWS // TODO
|
initialValue <- ("=" ~/ AWS ~/ mfExpression(1, false)).? ~/ HWS // TODO
|
||||||
} yield {
|
} yield {
|
||||||
if (alignment1.isDefined && alignment2.isDefined) log.error(s"Cannot define the alignment multiple times", Some(p))
|
if (alignment1.isDefined && alignment2.isDefined) log.error(s"Cannot define the alignment multiple times", Some(p))
|
||||||
val alignment = alignment1.orElse(alignment2)
|
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 {
|
val aliasDefinition: P[Seq[AliasDefinitionStatement]] = for {
|
||||||
p <- position()
|
p <- position()
|
||||||
name <- "alias" ~ !letterOrDigit ~/ SWS ~ identifier ~ HWS
|
name <- "alias" ~ !letterOrDigit ~/ SWS ~ identifier ~ HWS
|
||||||
target <- "=" ~/ HWS ~/ identifier ~/ HWS
|
target <- "=" ~/ AWS ~/ identifier ~/ HWS
|
||||||
important <- "!".!.? ~/ HWS
|
important <- "!".!.? ~/ HWS
|
||||||
} yield Seq(AliasDefinitionStatement(name, target, important.isDefined).pos(p))
|
} 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
|
optimizationHints <- optimizationHintsDeclaration ~/ HWS
|
||||||
alignment2 <- alignmentDeclaration(fastAlignmentForFunctions).? ~/ HWS
|
alignment2 <- alignmentDeclaration(fastAlignmentForFunctions).? ~/ HWS
|
||||||
addr <- ("@" ~/ HWS ~/ mfExpression(1, false)).? ~/ HWS
|
addr <- ("@" ~/ HWS ~/ mfExpression(1, false)).? ~/ HWS
|
||||||
contents <- ("=" ~/ HWS ~/ arrayContents).? ~/ HWS
|
contents <- ("=" ~/ AWS ~/ arrayContents).? ~/ HWS
|
||||||
} yield {
|
} yield {
|
||||||
if (alignment1.isDefined && alignment2.isDefined) log.error(s"Cannot define the alignment multiple times", Some(p))
|
if (alignment1.isDefined && alignment2.isDefined) log.error(s"Cannot define the alignment multiple times", Some(p))
|
||||||
val alignment = alignment1.orElse(alignment2)
|
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 {
|
val enumVariant: P[(String, Option[Expression])] = for {
|
||||||
name <- identifier ~/ HWS
|
name <- identifier ~/ HWS
|
||||||
value <- ("=" ~/ HWS ~/ mfExpression(1, false)).? ~ HWS
|
value <- ("=" ~/ AWS ~/ mfExpression(1, false)).? ~ HWS
|
||||||
} yield name -> value
|
} yield name -> value
|
||||||
|
|
||||||
val enumVariants: P[List[(String, Option[Expression])]] =
|
val enumVariants: P[List[(String, Option[Expression])]] =
|
||||||
|
Loading…
x
Reference in New Issue
Block a user