mirror of
https://github.com/fluencelabs/aqua.git
synced 2024-12-04 14:40:17 +00:00
Fix for greedy XOR tags (#412)
This commit is contained in:
parent
740a9ba653
commit
d5d7b8b5fd
20
aqua-src/test.aqua
Normal file
20
aqua-src/test.aqua
Normal file
@ -0,0 +1,20 @@
|
||||
import "@fluencelabs/aqua-ipfs/ipfs.aqua"
|
||||
|
||||
service Console("run-console"):
|
||||
print(res: IpfsGetResult)
|
||||
|
||||
service ConsoleOp("run-console"):
|
||||
print(arr: []string)
|
||||
|
||||
|
||||
func something(node: string) -> string:
|
||||
service_id: *string
|
||||
on HOST_PEER_ID:
|
||||
res <- Ipfs.get("1234")
|
||||
if res.error == "":
|
||||
service_id <<- "0x"
|
||||
else:
|
||||
service_id <<- "1x"
|
||||
ConsoleOp.print(service_id)
|
||||
Console.print(res)
|
||||
<- service_id!
|
@ -129,11 +129,10 @@ object TagInliner extends Logging {
|
||||
case RestrictionTag(name, isStream) =>
|
||||
pure(RestrictionModel(name, isStream))
|
||||
|
||||
case SeqTag => pure(SeqModel)
|
||||
case _: SeqGroupTag => pure(SeqModel)
|
||||
case ParTag.Detach => pure(DetachModel)
|
||||
case _: ParGroupTag => pure(ParModel)
|
||||
case XorTag | XorTag.LeftBiased =>
|
||||
// TODO should we do smth with XorTag.LeftBiased?
|
||||
pure(XorModel)
|
||||
case _: NoExecTag => none
|
||||
case _ =>
|
||||
|
@ -42,6 +42,10 @@ sealed trait GroupTag extends RawTag
|
||||
|
||||
sealed trait SeqGroupTag extends GroupTag
|
||||
|
||||
object SeqGroupTag extends SeqGroupTag {
|
||||
override def toString: String = "SeqGroup"
|
||||
}
|
||||
|
||||
sealed trait ParGroupTag extends GroupTag
|
||||
|
||||
case object SeqTag extends SeqGroupTag {
|
||||
|
@ -48,7 +48,7 @@ trait RawTagGivens {
|
||||
case (XorTag, XorTag) =>
|
||||
y.copy(tail = (x.tail, y.tail).mapN(_ ++ _))
|
||||
case (XorTag.LeftBiased, XorTag) =>
|
||||
SeqTag.wrap(y.copy(tail = (x.tail, y.tail).mapN(_ ++ _)))
|
||||
SeqGroupTag.wrap(y.copy(tail = (x.tail, y.tail).mapN(_ ++ _)))
|
||||
case (XorTag, ParTag) => XorParTag(x, y).leaf
|
||||
case (_, ParTag | XorTag) =>
|
||||
SeqTag.wrap(y.copy(tail = y.tail.map(_.prepend(x))))
|
||||
|
0
npm/error.js
Normal file → Executable file
0
npm/error.js
Normal file → Executable file
0
npm/index.js
Normal file → Executable file
0
npm/index.js
Normal file → Executable file
@ -2,7 +2,7 @@ package aqua.semantics
|
||||
|
||||
import aqua.raw.RawContext
|
||||
import aqua.parser.Ast
|
||||
import aqua.raw.ops.{Call, CallServiceTag, FuncOp, OnTag, ParTag, RawTag, SeqTag}
|
||||
import aqua.raw.ops.{Call, CallServiceTag, FuncOp, OnTag, ParTag, RawTag, SeqGroupTag, SeqTag}
|
||||
import aqua.parser.Parser
|
||||
import aqua.parser.lift.{LiftParser, Span}
|
||||
import aqua.raw.value.{LiteralRaw, ValueRaw}
|
||||
@ -11,6 +11,7 @@ import org.scalatest.flatspec.AnyFlatSpec
|
||||
import org.scalatest.matchers.should.Matchers
|
||||
import cats.~>
|
||||
import cats.data.Chain
|
||||
import cats.syntax.show.*
|
||||
|
||||
class SemanticsSpec extends AnyFlatSpec with Matchers {
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user