Skip to content

Commit

Permalink
Improve position and error recovery
Browse files Browse the repository at this point in the history
  • Loading branch information
b-studios committed Aug 16, 2023
1 parent 5b8aad9 commit 1aae2e9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions effekt/shared/src/main/scala/effekt/Parser.scala
Original file line number Diff line number Diff line change
Expand Up @@ -476,8 +476,8 @@ class EffektParsers(positions: Positions) extends EffektLexers(positions) {

lazy val int = integerLiteral.flatMap { n =>
try { val number = n.toInt;
success(IntLit(number))
} catch { case e => error("Not a 32bit integer literal.") }
success(IntLit(number).withPositionOf(n))
} catch { case e => failure("Not a 32bit integer literal.") }
}
lazy val bool = `true` ^^^ BooleanLit(true) | `false` ^^^ BooleanLit(false)
lazy val unit = literal("()") ^^^ UnitLit()
Expand Down

0 comments on commit 1aae2e9

Please sign in to comment.