@@ -45,13 +45,13 @@ class EffektLexers extends Parsers {
4545
4646 lazy val ident =
4747 (not(anyKeyword) ~> name
48- | failure(" Expected an identifier" )
49- )
48+ | failure(" Expected an identifier" )
49+ )
5050
5151 lazy val identRef =
5252 (not(anyKeyword) ~> qualifiedName
53- | failure(" Expected an identifier" )
54- )
53+ | failure(" Expected an identifier" )
54+ )
5555
5656 lazy val `=` = literal(" =" )
5757 lazy val `:` = literal(" :" )
@@ -316,8 +316,8 @@ class CoreParsers(names: Names) extends EffektLexers {
316316
317317 lazy val featureFlag : P [FeatureFlag ] =
318318 (" else" ^^ { _ => FeatureFlag .Default (Span .missing) }
319- | ident ^^ (id => FeatureFlag .NamedFeatureFlag (id, Span .missing))
320- )
319+ | ident ^^ (id => FeatureFlag .NamedFeatureFlag (id, Span .missing))
320+ )
321321
322322
323323 lazy val externBody = multilineString | stringLiteral
@@ -342,33 +342,33 @@ class CoreParsers(names: Names) extends EffektLexers {
342342 // Definitions
343343 // -----------
344344 lazy val toplevel : P [Toplevel ] =
345- ( `val` ~> id ~ maybeTypeAnnotation ~ (`=` ~/> stmt) ^^ {
346- case (name ~ tpe ~ binding) => Toplevel .Val (name, tpe.getOrElse(binding.tpe), binding)
347- }
348- | `def` ~> id ~ (`=` ~/> block) ^^ Toplevel .Def .apply
349- | `def` ~> id ~ parameters ~ (`=` ~> stmt) ^^ {
345+ ( `val` ~> id ~ maybeTypeAnnotation ~ (`=` ~/> stmt) ^^ {
346+ case (name ~ tpe ~ binding) => Toplevel .Val (name, tpe.getOrElse(binding.tpe), binding)
347+ }
348+ | `def` ~> id ~ (`=` ~/> block) ^^ Toplevel .Def .apply
349+ | `def` ~> id ~ parameters ~ (`=` ~> stmt) ^^ {
350350 case name ~ (tparams, cparams, vparams, bparams) ~ body =>
351351 Toplevel .Def (name, BlockLit (tparams, cparams, vparams, bparams, body))
352352 }
353- | failure(" Expected a definition." )
354- )
353+ | failure(" Expected a definition." )
354+ )
355355
356356
357357 // Statements
358358 // ----------
359359 lazy val stmt : P [Stmt ] =
360360 ( `{` ~/> stmts <~ `}`
361- | `return` ~> expr ^^ Stmt .Return .apply
362- | `reset` ~> blockLit ^^ Stmt .Reset .apply
363- | `shift` ~> maybeParens(blockVar) ~ blockLit ^^ Stmt .Shift .apply
364- | `resume` ~> maybeParens(blockVar) ~ stmt ^^ Stmt .Resume .apply
365- | block ~ (`.` ~> id ~ (`:` ~> blockType)).? ~ maybeTypeArgs ~ valueArgs ~ blockArgs ^^ {
361+ | `return` ~> expr ^^ Stmt .Return .apply
362+ | `reset` ~> blockLit ^^ Stmt .Reset .apply
363+ | `shift` ~> maybeParens(blockVar) ~ blockLit ^^ Stmt .Shift .apply
364+ | `resume` ~> maybeParens(blockVar) ~ stmt ^^ Stmt .Resume .apply
365+ | block ~ (`.` ~> id ~ (`:` ~> blockType)).? ~ maybeTypeArgs ~ valueArgs ~ blockArgs ^^ {
366366 case (recv ~ Some (method ~ tpe) ~ targs ~ vargs ~ bargs) => Invoke (recv, method, tpe, targs, vargs, bargs)
367367 case (recv ~ None ~ targs ~ vargs ~ bargs) => App (recv, targs, vargs, bargs)
368368 }
369- | (`if` ~> `(` ~/> expr <~ `)`) ~ stmt ~ (`else` ~> stmt) ^^ Stmt .If .apply
370- | `region` ~> blockLit ^^ Stmt .Region .apply
371- | `<>` ~> `@` ~> (stringLiteral <~ `:`) ~ (integerLiteral <~ `:`) ~ integerLiteral ^^ {
369+ | (`if` ~> `(` ~/> expr <~ `)`) ~ stmt ~ (`else` ~> stmt) ^^ Stmt .If .apply
370+ | `region` ~> blockLit ^^ Stmt .Region .apply
371+ | `<>` ~> `@` ~> (stringLiteral <~ `:`) ~ (integerLiteral <~ `:`) ~ integerLiteral ^^ {
372372 case (name ~ from ~ to) =>
373373 val source = if (name.startsWith(" file://" )) {
374374 kiama.util.FileSource (name.stripPrefix(" file://" ))
@@ -379,9 +379,9 @@ class CoreParsers(names: Names) extends EffektLexers {
379379 }
380380 Hole (effekt.source.Span (source, from.toInt, to.toInt))
381381 }
382- | `<>` ^^^ Hole (effekt.source.Span .missing)
383- | (expr <~ `match`) ~/ (`{` ~> many(clause) <~ `}`) ~ (`else` ~> stmt).? ^^ Stmt .Match .apply
384- )
382+ | `<>` ^^^ Hole (effekt.source.Span .missing)
383+ | (expr <~ `match`) ~/ (`{` ~> many(clause) <~ `}`) ~ (`else` ~> stmt).? ^^ Stmt .Match .apply
384+ )
385385
386386 lazy val stmts : P [Stmt ] =
387387 ( (`let` ~ `!` ~/> id) ~ (`=` ~/> maybeParens(blockVar)) ~ maybeTypeArgs ~ valueArgs ~ blockArgs ~ stmts ^^ {
0 commit comments