This commit is contained in:
Dmitry Kurinskiy 2021-04-16 20:20:52 +03:00 committed by GitHub
parent e2621f0008
commit 2d1427b124
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 8 deletions

View File

@ -1,8 +1,11 @@
service Local("smth"):
getString: -> string
service Test("test"):
getBool: -> bool
getList: -> []string
func join() -> string:
app <- Local.getString()
on "app.user_list.peer_id":
res <- Local.getString()
<- res
func f():
list <- Test.getList()
for user <- list:
on "peer" via "relay":
isOnline <- Test.getBool()
if isOnline:
Test.getBool()

View File

@ -10,7 +10,15 @@ import LiftParser._
case class ForExpr[F[_]](item: Name[F], iterable: Value[F], par: Option[F[Unit]]) extends Expr[F]
object ForExpr extends Expr.AndIndented(Expr.defer(OnExpr), ParExpr, CallArrowExpr, AbilityIdExpr) {
object ForExpr
extends Expr.AndIndented(
Expr.defer(OnExpr),
ParExpr,
CallArrowExpr,
AbilityIdExpr,
Expr.defer(IfExpr),
Expr defer ElseOtherwiseExpr
) {
override def p[F[_]: LiftParser: Comonad]: P[ForExpr[F]] =
((`for` *> ` ` *> Name.p[F] <* ` <- `) ~ Value.`value`[F] ~ (` ` *> `par`.lift).?).map {