mirror of
https://github.com/fluencelabs/hackethberlin
synced 2025-04-24 17:02:18 +00:00
:=: for ref
This commit is contained in:
parent
863f3491cb
commit
577c7a5509
@ -14,6 +14,9 @@ sealed trait InlineExpr[T] extends Expr[T] with Expr.ToInlineVyper {
|
||||
|
||||
def :=:(name: Symbol): Free[Expr, Expr.Ref[T]] =
|
||||
Free.liftF[Expr, Expr.Ref[T]](Expr.Assign[T](Expr.Ref[T](name.name, boxedValue), this))
|
||||
|
||||
def :=:(ref: Expr.Ref[T]): Free[Expr, Expr.Ref[T]] =
|
||||
Free.liftF[Expr, Expr.Ref[T]](Expr.Assign[T](ref, this))
|
||||
}
|
||||
|
||||
object Expr {
|
||||
|
@ -51,6 +51,7 @@ object MakeVyperApp extends App {
|
||||
for {
|
||||
c ← 'c :=: `++`(args.ref('a), args.ref('b))
|
||||
d ← 'd :=: `++`(args.ref('b), c)
|
||||
_ ← d :=: c
|
||||
sum ← `++`(args.ref('a), d).toReturn
|
||||
} yield sum
|
||||
}
|
||||
@ -65,5 +66,5 @@ object MakeVyperApp extends App {
|
||||
func(recordStruct.ref('record_address) :: HNil).toVyper
|
||||
)
|
||||
|
||||
println(s"MMMMMACRO\n\n ${new MyContract("abc", 123).toAST.toVyper}")
|
||||
// println(s"MMMMMACRO\n\n ${new MyContract("abc", 123).toAST.toVyper}")
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user