Skip to content

Commit

Permalink
please set intellij idea scala2 hightlight to compiler
Browse files Browse the repository at this point in the history
  • Loading branch information
mio-19 committed Oct 24, 2024
1 parent d6621cc commit 7b983e6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ object Scala {
case StringTerm(s, _) => Lit.String(s)
case SymbolTerm(s, _) => Lit.Symbol(Symbol(s))
case BooleanTerm(b, _) => Lit.Boolean(b)
case UnitTerm(_) => Lit.Unit()
case _ => throw new NotImplementedError(s"not implemented ${term.getClass.getName} $term")
}

Expand Down
14 changes: 10 additions & 4 deletions syntax/src/main/scala/chester/syntax/core/Term.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1230,11 +1230,17 @@ case class Annotation(
}
}

// TODO: tuple?
def UnitType(meta: OptionTermMeta) =
ObjectType(Vector.empty, meta = meta)
def UnitTerm(meta: OptionTermMeta) =
ObjectTerm(Vector.empty, meta = meta)
TupleType(Vector.empty, meta = meta)
object UnitTerm {
def unapply(x: Any): Option[OptionTermMeta] = x match {
case TupleTerm(Vector(), meta) => Some(meta)
case _ => None
}
def apply(meta: OptionTermMeta) =
TupleTerm(Vector.empty, meta = meta)

}

case class FieldTerm(
name: Name,
Expand Down

0 comments on commit 7b983e6

Please sign in to comment.