Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ d6c20f6667501540187ce151520bffd8153dfebb

# Scala Steward: Reformat with scalafmt 3.8.4
1905817532354164256d03f48eee35829ff5c585

# Scala Steward: Reformat with scalafmt 3.9.10
e0c5a39f7bcd5046ee9414b9b8d0e5f6cbb55422
2 changes: 1 addition & 1 deletion .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = "3.9.6"
version = "3.9.10"
runner.dialect = "scala3"

maxColumn = 100
Expand Down
2 changes: 1 addition & 1 deletion cli/shared/src/main/scala/grox/cli/Main.scala
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ object Main
case Command.Scan(str) => exec.scan(str).map(tokens => tokens.mkString("\n"))
case Command.Parse(str) => exec.parse(str).map(_.show)
case Command.Evaluate(str) => exec.evaluate(str).map(_.toString)
case Command.Execute(str) =>
case Command.Execute(str) =>
exec.execute(str).evalMap(Console[F].println).compile.drain.as("Done")

given FileReader[IO] = FileReader.instance[IO]
Expand Down
2 changes: 1 addition & 1 deletion compiler/shared/src/main/scala/grox/Interpreter.scala
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ object Interpreter:
case Expr.LessEqual(tag, l, r) => evaluateBinary(env)(lessOrEqual(tag))(l, r)
case Expr.Equal(tag, l, r) => evaluateBinary(env)(equal)(l, r)
case Expr.NotEqual(tag, l, r) => evaluateBinary(env)(notEqual)(l, r)
case Expr.And(_, l, r) => evaluateWithState(env)(l)
case Expr.And(_, l, r) => evaluateWithState(env)(l)
.flatMap(lres => if !lres.isTruthy then lres.pure[F] else evaluateWithState(env)(r))
case Expr.Or(_, l, r) => evaluateWithState(env)(l)
.flatMap(lres => if lres.isTruthy then lres.pure[F] else evaluateWithState(env)(r))
Expand Down
2 changes: 1 addition & 1 deletion compiler/shared/src/main/scala/grox/Scanner.scala
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ object Scanner:
val parser = token.rep.map(_.toList)

def parse(str: String): Either[Error, List[Token[Span]]] = parser.parse(str) match
case Right("", ls) => Right(ls)
case Right("", ls) => Right(ls)
case Right(rest, ls) =>
val idx = str.indexOf(rest)
val lm = LocationMap(str)
Expand Down
4 changes: 2 additions & 2 deletions compiler/shared/src/test/scala/grox/ExprParserCheck.scala
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class ExprParserCheck extends munit.CatsEffectSuite with munit.ScalaCheckSuite:
test("produce an equal numeric expression"):
forAllF(numericGen) { expr =>
parse(expr.flatten) match
case Left(_) => IO(assert(false))
case Left(_) => IO(assert(false))
case Right(parsedExpr) => (evaluate(expr).attempt, evaluate(parsedExpr).attempt).mapN:
case (Left(e1), Left(e2)) => assert(e1 == e2)
case (Right(v1: Double), Right(v2: Double)) => assert(math.abs(v1 - v2) < 0.01)
Expand All @@ -47,7 +47,7 @@ class ExprParserCheck extends munit.CatsEffectSuite with munit.ScalaCheckSuite:
test("produce an equal logical expression"):
forAllF(logicalGen) { expr =>
parse(expr.flatten) match
case Left(_) => IO(assert(false))
case Left(_) => IO(assert(false))
case Right(parsedExpr) =>
(evaluate(expr), evaluate(parsedExpr)).mapN((x, y) => assert(x == y))
}
2 changes: 1 addition & 1 deletion kantan/shared/src/main/scala/kantan/parsers/Parser.scala
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ trait Parser[Token, +A]:
run(state) match
case Result.Ok(consumed, parsed, state, msg) => f.lift(parsed.value) match
case Some(b) => Result.Ok(consumed, parsed.copy(value = b), state, msg)
case None => Result.Error(
case None => Result.Error(
false,
msg.copy(input = Message.Input.None, pos = parsed.start),
)
Expand Down