add scalafmt, use only one nil

This commit is contained in:
DieMyst 2023-10-30 17:50:57 +07:00
parent bd0ca60fdc
commit 6da87e3478
5 changed files with 10 additions and 8 deletions

View File

@ -62,9 +62,9 @@ runner {
}
}
rewrite {
rules = [
SortImports
]
}
rewrite.rules = [Imports]
rewrite.imports.sort = ascii
rewrite.imports.groups = [
["aqua\\..*"]
]
#runner.dialect = scala3

View File

@ -34,7 +34,6 @@ object ValueRaw {
val ParticleTimestamp: LiteralRaw = LiteralRaw("%timestamp%", ScalarType.u64)
val Nil: LiteralRaw = LiteralRaw("[]", StreamType(BottomType))
val VarNil: VarRaw = VarRaw("nil", StreamType(BottomType))
/**
* Type of error value

View File

@ -78,6 +78,9 @@ class ValuesAlgebra[S[_], Alg[_]: Monad](using
case l @ LiteralToken(_, t) =>
LiteralRaw(l.value, t).some.pure[Alg]
case VarToken(name) if name.value == ValueRaw.Nil.value =>
ValueRaw.Nil.some.pure[Alg]
case VarToken(name) =>
N.read(name, mustBeDefined = false).flatMap {
case Some(t) =>

View File

@ -134,7 +134,7 @@ class NamesInterpreter[S[_], X](using
override def assign(name: Name[S], value: ValueRaw): SX[Boolean] =
value match {
case ValueRaw.Nil | ValueRaw.VarNil =>
case ValueRaw.Nil =>
report
.error(
name,

View File

@ -15,7 +15,7 @@ import org.scalatest.matchers.should.Matchers
class AssignmentSemSpec extends AnyFlatSpec with Matchers with Inside {
import Utils.{*, given}
import Utils.{given, *}
val program: Prog[State[CompilerState[cats.Id], *], Raw] = {
val expr = ClosureExpr(Name[Id]("closure"), None)