mirror of
https://github.com/fluencelabs/aqua.git
synced 2024-12-04 14:40:17 +00:00
add scalafmt, use only one nil
This commit is contained in:
parent
bd0ca60fdc
commit
6da87e3478
@ -62,9 +62,9 @@ runner {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
rewrite {
|
rewrite.rules = [Imports]
|
||||||
rules = [
|
rewrite.imports.sort = ascii
|
||||||
SortImports
|
rewrite.imports.groups = [
|
||||||
|
["aqua\\..*"]
|
||||||
]
|
]
|
||||||
}
|
|
||||||
#runner.dialect = scala3
|
#runner.dialect = scala3
|
||||||
|
@ -34,7 +34,6 @@ object ValueRaw {
|
|||||||
val ParticleTimestamp: LiteralRaw = LiteralRaw("%timestamp%", ScalarType.u64)
|
val ParticleTimestamp: LiteralRaw = LiteralRaw("%timestamp%", ScalarType.u64)
|
||||||
|
|
||||||
val Nil: LiteralRaw = LiteralRaw("[]", StreamType(BottomType))
|
val Nil: LiteralRaw = LiteralRaw("[]", StreamType(BottomType))
|
||||||
val VarNil: VarRaw = VarRaw("nil", StreamType(BottomType))
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Type of error value
|
* Type of error value
|
||||||
|
@ -78,6 +78,9 @@ class ValuesAlgebra[S[_], Alg[_]: Monad](using
|
|||||||
case l @ LiteralToken(_, t) =>
|
case l @ LiteralToken(_, t) =>
|
||||||
LiteralRaw(l.value, t).some.pure[Alg]
|
LiteralRaw(l.value, t).some.pure[Alg]
|
||||||
|
|
||||||
|
case VarToken(name) if name.value == ValueRaw.Nil.value =>
|
||||||
|
ValueRaw.Nil.some.pure[Alg]
|
||||||
|
|
||||||
case VarToken(name) =>
|
case VarToken(name) =>
|
||||||
N.read(name, mustBeDefined = false).flatMap {
|
N.read(name, mustBeDefined = false).flatMap {
|
||||||
case Some(t) =>
|
case Some(t) =>
|
||||||
|
@ -134,7 +134,7 @@ class NamesInterpreter[S[_], X](using
|
|||||||
|
|
||||||
override def assign(name: Name[S], value: ValueRaw): SX[Boolean] =
|
override def assign(name: Name[S], value: ValueRaw): SX[Boolean] =
|
||||||
value match {
|
value match {
|
||||||
case ValueRaw.Nil | ValueRaw.VarNil =>
|
case ValueRaw.Nil =>
|
||||||
report
|
report
|
||||||
.error(
|
.error(
|
||||||
name,
|
name,
|
||||||
|
@ -15,7 +15,7 @@ import org.scalatest.matchers.should.Matchers
|
|||||||
|
|
||||||
class AssignmentSemSpec extends AnyFlatSpec with Matchers with Inside {
|
class AssignmentSemSpec extends AnyFlatSpec with Matchers with Inside {
|
||||||
|
|
||||||
import Utils.{*, given}
|
import Utils.{given, *}
|
||||||
|
|
||||||
val program: Prog[State[CompilerState[cats.Id], *], Raw] = {
|
val program: Prog[State[CompilerState[cats.Id], *], Raw] = {
|
||||||
val expr = ClosureExpr(Name[Id]("closure"), None)
|
val expr = ClosureExpr(Name[Id]("closure"), None)
|
||||||
|
Loading…
Reference in New Issue
Block a user