Renamed "export" to "external"
This commit is contained in:
parent
4e7b652014
commit
602aacf8d8
@ -84,16 +84,16 @@ immediately
|
|||||||
return Lua(tree.source, lhs, " = ", rhs, ";");
|
return Lua(tree.source, lhs, " = ", rhs, ";");
|
||||||
|
|
||||||
immediately
|
immediately
|
||||||
compile [export %var <- %value] to
|
compile [external %var <- %value] to
|
||||||
%var_lua <- (%var as lua)
|
%var_lua <- (%var as lua)
|
||||||
assume %var_lua.is_value or barf "Invalid target for assignment: \(%var's source code)"
|
assume %var_lua.is_value or barf "Invalid target for assignment: \(%var's source code)"
|
||||||
%value_lua <- (%value as lua)
|
%value_lua <- (%value as lua)
|
||||||
assume %value_lua.is_value or barf "Invalid value for assignment: \(%value's source code)"
|
assume %value_lua.is_value or barf "Invalid value for assignment: \(%value's source code)"
|
||||||
return: Lua "\(%var_lua) = \(%value_lua);"
|
return: Lua "\(%var_lua) = \(%value_lua);"
|
||||||
|
|
||||||
compile [exporting %exported %body] to
|
compile [with external %externs %body] to
|
||||||
%body_lua <- (%body as lua statements)
|
%body_lua <- (%body as lua statements)
|
||||||
lua> "\%body_lua:remove_free_vars(\(%exported.value));"
|
lua> "\%body_lua:remove_free_vars(\(%externs.value));"
|
||||||
return %body_lua
|
return %body_lua
|
||||||
|
|
||||||
compile [with %assignments %body] to
|
compile [with %assignments %body] to
|
||||||
|
@ -19,18 +19,18 @@ assume (({}'s id) is not ({}'s id)) or barf "Identity check failed."
|
|||||||
|
|
||||||
<-{%foozle:"outer",%y:"outer"}
|
<-{%foozle:"outer",%y:"outer"}
|
||||||
action [set global x local y]
|
action [set global x local y]
|
||||||
export %foozle <- "inner"
|
external %foozle <- "inner"
|
||||||
%y <- "inner"
|
%y <- "inner"
|
||||||
set global x local y
|
set global x local y
|
||||||
assume ((%foozle = "inner") and (%y = "outer")) or barf "export failed."
|
assume ((%foozle = "inner") and (%y = "outer")) or barf "external failed."
|
||||||
|
|
||||||
<-{%foozle:"outer",%y:"outer"}
|
<-{%foozle:"outer",%y:"outer"}
|
||||||
action [set global x local y]
|
action [set global x local y]
|
||||||
exporting [%foozle]
|
with external [%foozle]
|
||||||
%foozle <- "inner"
|
%foozle <- "inner"
|
||||||
%y <- "inner"
|
%y <- "inner"
|
||||||
set global x local y
|
set global x local y
|
||||||
assume ((%foozle = "inner") and (%y = "outer")) or barf "exporting failed."
|
assume ((%foozle = "inner") and (%y = "outer")) or barf "'with external' failed."
|
||||||
|
|
||||||
<-{%x:1,%y:2}
|
<-{%x:1,%y:2}
|
||||||
with {%z:nil, %x:999}
|
with {%z:nil, %x:999}
|
||||||
@ -45,7 +45,7 @@ assume ((5 wrapped around 2) = 1) or barf "mod not working"
|
|||||||
assume (1 <= 2 < 3) or barf "chained operator fail."
|
assume (1 <= 2 < 3) or barf "chained operator fail."
|
||||||
%value <- -999
|
%value <- -999
|
||||||
action [flipflop]
|
action [flipflop]
|
||||||
export %value <- (-%value)
|
external %value <- (-%value)
|
||||||
return %value
|
return %value
|
||||||
assume (not (1 < (flipflop) < 1)) or barf "3-way inequality evaluated middle term twice"
|
assume (not (1 < (flipflop) < 1)) or barf "3-way inequality evaluated middle term twice"
|
||||||
assume (((yes) and (yes)) = (yes))
|
assume (((yes) and (yes)) = (yes))
|
||||||
|
Loading…
Reference in New Issue
Block a user