Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump deps #466

Merged
merged 6 commits into from
Jan 29, 2025
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
scala: [3.5.2]
scala: [3.6.2]
java: [temurin@21]
runs-on: ${{ matrix.os }}
steps:
Expand Down
2 changes: 1 addition & 1 deletion .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = 3.8.4
version = 3.8.6
runner.dialect = "scala3"

maxColumn = 100
Expand Down
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
inThisBuild(
Seq(
scalaVersion := "3.5.2",
scalaVersion := "3.6.2",
versionScheme := Some("early-semver"),

// Github Workflow
Expand Down
2 changes: 1 addition & 1 deletion cli/shared/src/main/scala/grox/cli/FileReader.scala
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ trait FileReader[F[_]]:

object FileReader:

def instance[F[_]: Files: Concurrent]: FileReader[F] = path =>
def instance[F[_]: {Files, Concurrent}]: FileReader[F] = path =>
Files[F]
.readAll(fs2.io.file.Path(path))
.through(fs2.text.utf8.decode[F])
Expand Down
4 changes: 2 additions & 2 deletions cli/shared/src/main/scala/grox/cli/Main.scala
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ object Main
case CLI.Command.Evaluate(file) => reader.read(file).map(Command.Evaluate(_))
case CLI.Command.Run(file) => reader.read(file).map(Command.Execute(_))

def eval[F[_]: Functor: Console: Concurrent](exec: Executor[F]): Command => F[String] =
def eval[F[_]: {Console, Concurrent}](exec: Executor[F]): Command => F[String] =
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)
Expand All @@ -46,7 +46,7 @@ object Main
.parse
.map(config =>
val level = if config.debug then Level.Debug else Level.Error
Logger.root.clearHandlers().withHandler(minimumLevel = Some(level)).replace()
val _ = Logger.root.clearHandlers().withHandler(minimumLevel = Some(level)).replace()
Executor
.module[IO]
.use(exec =>
Expand Down
4 changes: 2 additions & 2 deletions compiler/shared/src/main/scala/grox/Executor.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ trait Executor[F[_]]:

object Executor:

def instance[F[_]: MonadThrow: Scribe](
def instance[F[_]: {MonadThrow, Scribe}](
using scanner: Scanner[F],
parser: Parser[F],
interpreter: Interpreter[F],
Expand Down Expand Up @@ -48,7 +48,7 @@ object Executor:
yield stmts
Stream.eval(stmts).flatMap(xs => executor.execute(xs))

def module[F[_]: MonadThrow: Sync: Scribe]: Resource[F, Executor[F]] =
def module[F[_]: {Sync, Scribe}]: Resource[F, Executor[F]] =
given Scanner[F] = Scanner.instance[F]
given Parser[F] = Parser.instance[F]
for
Expand Down
12 changes: 7 additions & 5 deletions compiler/shared/src/main/scala/grox/Interpreter.scala
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,15 @@ object Interpreter:
result <- evaluateWithState(state)(expr)
yield result

enum RuntimeError(location: Span, msg: String) extends NoStackTrace:
enum RuntimeError(val location: Span, val msg: String) extends NoStackTrace:
override def toString = msg
case MustBeNumbers(location: Span) extends RuntimeError(location, "Operands must be numbers.")
case MustBeNumbersOrStrings(location: Span)
case MustBeNumbers(override val location: Span)
extends RuntimeError(location, "Operands must be numbers.")
case MustBeNumbersOrStrings(override val location: Span)
extends RuntimeError(location, "Operands must be two numbers or two strings")
case DivisionByZero(location: Span) extends RuntimeError(location, "Division by zerro")
case VariableNotFound(location: Span, name: String)
case DivisionByZero(override val location: Span)
extends RuntimeError(location, "Division by zerro")
case VariableNotFound(override val location: Span, name: String)
extends RuntimeError(location, "Variable not found")

type EvaluationResult = Either[RuntimeError, LiteralType]
Expand Down
2 changes: 1 addition & 1 deletion compiler/shared/src/main/scala/grox/State.scala
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import cats.implicits.catsSyntaxEither
object State:
def apply(): State = State(Map.empty[String, LiteralType], enclosing = None)

enum StateError(msg: String) extends NoStackTrace:
enum StateError(val msg: String) extends NoStackTrace:
case UndefinedVariableError(variable: String)
extends StateError(s"Undefined variable: '$variable'.")

Expand Down
2 changes: 1 addition & 1 deletion compiler/shared/src/main/scala/grox/Token.scala
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ object Token:
LessEqual(()),
)

given Functor[Token] with
given Functor[Token]:

def map[A, B](token: Token[A])(f: A => B): Token[B] = token match
case Identifier(l, a) => Identifier(l, f(a))
Expand Down
4 changes: 2 additions & 2 deletions project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ object Dependencies {

val catsCore = Def.setting("org.typelevel" %%% "cats-core" % "2.13.0")
val catsEffect = Def.setting("org.typelevel" %%% "cats-effect" % "3.5.7")
val catsParse = Def.setting("org.typelevel" %%% "cats-parse" % "1.0.0")
val catsParse = Def.setting("org.typelevel" %%% "cats-parse" % "1.1.0")

val fs2 = Def.setting("co.fs2" %%% "fs2-core" % fs2Version)
val fs2IO = Def.setting("co.fs2" %%% "fs2-io" % fs2Version)
Expand All @@ -20,7 +20,7 @@ object Dependencies {
val scribe = Def.setting("com.outr" %%% "scribe" % scribeVersion)
val scribeCats = Def.setting("com.outr" %%% "scribe-cats" % scribeVersion)

val tyrian = Def.setting("io.indigoengine" %%% "tyrian-io" % "0.11.0")
val tyrian = Def.setting("io.indigoengine" %%% "tyrian-io" % "0.12.0")

val munit = Def.setting("org.scalameta" %%% "munit" % "1.1.0" % Test)
val munitCatsEffect = Def.setting("org.typelevel" %%% "munit-cats-effect" % "2.0.0" % Test)
Expand Down