aboutsummaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorLi Jin <dragon-fly@qq.com>2022-07-13 14:46:55 +0800
committerLi Jin <dragon-fly@qq.com>2022-07-13 14:46:55 +0800
commita1d341085eed96d567329a30f2cf57c95fe6f071 (patch)
tree37d359a02b99cf94fa52cfc43eb9c5c80ecfeb89 /spec
parentaa194667c7cb7bb70f2a58477555d1419ae33eb0 (diff)
downloadyuescript-a1d341085eed96d567329a30f2cf57c95fe6f071.tar.gz
yuescript-a1d341085eed96d567329a30f2cf57c95fe6f071.tar.bz2
yuescript-a1d341085eed96d567329a30f2cf57c95fe6f071.zip
auto add search path for cmd tools.
Diffstat (limited to 'spec')
-rw-r--r--spec/inputs/macro-export.yue2
-rw-r--r--spec/inputs/macro-teal.yue2
-rw-r--r--spec/inputs/macro.yue3
-rw-r--r--spec/inputs/teal-lang.yue5
-rw-r--r--spec/outputs/macro.lua2
5 files changed, 3 insertions, 11 deletions
diff --git a/spec/inputs/macro-export.yue b/spec/inputs/macro-export.yue
index adc71da..ff0d273 100644
--- a/spec/inputs/macro-export.yue
+++ b/spec/inputs/macro-export.yue
@@ -1,5 +1,3 @@
1$ -> package.path = "?.lua;./spec/inputs/?.lua"
2
3import "macro-todo" as $ 1import "macro-todo" as $
4 2
5import "macro-todo" as {$, :$todo} 3import "macro-todo" as {$, :$todo}
diff --git a/spec/inputs/macro-teal.yue b/spec/inputs/macro-teal.yue
index 951e882..a443614 100644
--- a/spec/inputs/macro-teal.yue
+++ b/spec/inputs/macro-teal.yue
@@ -2,7 +2,7 @@ $ ->
2 import "yue" as {:options} 2 import "yue" as {:options}
3 if options.tl_enabled 3 if options.tl_enabled
4 options.target_extension = "tl" 4 options.target_extension = "tl"
5 package.path ..= "?.lua;./spec/lib/?.lua" 5 package.path ..= ";./spec/lib/?.lua"
6 6
7macro to_lua = (code)-> 7macro to_lua = (code)->
8 "require('yue').to_lua(#{code}, reserve_line_number:false, same_module:true)" 8 "require('yue').to_lua(#{code}, reserve_line_number:false, same_module:true)"
diff --git a/spec/inputs/macro.yue b/spec/inputs/macro.yue
index e4b0fc8..7bbb06d 100644
--- a/spec/inputs/macro.yue
+++ b/spec/inputs/macro.yue
@@ -1,6 +1,3 @@
1$ ->
2 package.path = "?.lua;./spec/inputs/?.lua"
3
4import "macro-export" as { 1import "macro-export" as {
5 $, -- import all macros 2 $, -- import all macros
6 $config: $myconfig, -- rename macro $config to $myconfig 3 $config: $myconfig, -- rename macro $config to $myconfig
diff --git a/spec/inputs/teal-lang.yue b/spec/inputs/teal-lang.yue
index 68b2dd1..b28c915 100644
--- a/spec/inputs/teal-lang.yue
+++ b/spec/inputs/teal-lang.yue
@@ -1,7 +1,4 @@
1$ -> 1import "macro-teal" as $
2 package.path = "?.lua;./spec/inputs/?.lua"
3
4import "macro-teal" as {$}
5 2
6$local "a:{string:number}", {value:123} 3$local "a:{string:number}", {value:123}
7$local "b:number", a.value 4$local "b:number", a.value
diff --git a/spec/outputs/macro.lua b/spec/outputs/macro.lua
index 5917f43..c19b2d7 100644
--- a/spec/outputs/macro.lua
+++ b/spec/outputs/macro.lua
@@ -277,7 +277,7 @@ print((setmetatable({
277 return 998 277 return 998
278 end 278 end
279})) 279}))
280print("current line: " .. tostring(271)); 280print("current line: " .. tostring(268));
281-- TODO 281-- TODO
282do 282do
283 print(1) 283 print(1)