Commit 80c8dbb6 authored by Arthur Bit-Monnot's avatar Arthur Bit-Monnot

Allow time to be represented as arbitrary integers.

parent 992ffac7
......@@ -100,8 +100,8 @@ package object full {
}
case class Interval(start: StaticExpr, end: StaticExpr) {
require(start.typ.isSubtypeOf(Type.Time))
require(end.typ.isSubtypeOf(Type.Time))
require(start.typ.isSubtypeOf(Type.Integers))
require(end.typ.isSubtypeOf(Type.Integers))
override def toString: String = s"[$start, $end]"
}
......
......@@ -350,7 +350,8 @@ abstract class AnmlParser(val initialContext: Ctx) {
val expr: Parser[full.Expr] =
timedSymExpr | staticExpr
val timepoint: P[StaticExpr] = staticExpr.filter(_.typ.isSubtypeOf(Type.Time))
val timepoint: P[StaticExpr] =
staticExpr.namedFilter(_.typ.isSubtypeOf(Type.Integers), "of-type-integer")
val interval: Parser[Interval] =
("[" ~/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment