aboutsummaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorLi Jin <dragon-fly@qq.com>2023-06-29 10:58:56 +0800
committerLi Jin <dragon-fly@qq.com>2023-06-29 10:58:56 +0800
commitc98c6053635ddfca7aab15b268b0f2c1fcc0c6ef (patch)
treedcacf24e010346eb03e834d8081eb81e26f5c7ff /spec
parent51faef5288a64a84b8f8e5cea8631c7518b94411 (diff)
downloadyuescript-c98c6053635ddfca7aab15b268b0f2c1fcc0c6ef.tar.gz
yuescript-c98c6053635ddfca7aab15b268b0f2c1fcc0c6ef.tar.bz2
yuescript-c98c6053635ddfca7aab15b268b0f2c1fcc0c6ef.zip
fix issue #139.
Diffstat (limited to 'spec')
-rw-r--r--spec/inputs/goto.yue8
-rw-r--r--spec/inputs/import.yue2
-rw-r--r--spec/outputs/import.lua34
3 files changed, 22 insertions, 22 deletions
diff --git a/spec/inputs/goto.yue b/spec/inputs/goto.yue
index 61584ca..3f3ae89 100644
--- a/spec/inputs/goto.yue
+++ b/spec/inputs/goto.yue
@@ -16,10 +16,10 @@ do
16do 16do
17 for z = 1, 10 17 for z = 1, 10
18 for y = 1, 10 do for x = 1, 10 18 for y = 1, 10 do for x = 1, 10
19 if x^2 + y^2 == z^2 19 if x^2 + y^2 == z^2
20 print 'found a Pythagorean triple:', x, y, z 20 print 'found a Pythagorean triple:', x, y, z
21 print 'now trying next z...' 21 print 'now trying next z...'
22 goto zcontinue 22 goto zcontinue
23 ::zcontinue:: 23 ::zcontinue::
24 24
25do 25do
diff --git a/spec/inputs/import.yue b/spec/inputs/import.yue
index fe5caf5..73e05d2 100644
--- a/spec/inputs/import.yue
+++ b/spec/inputs/import.yue
@@ -7,7 +7,7 @@ import x, \y, z from items
7 7
8import master, \ghost from find "mytable" 8import master, \ghost from find "mytable"
9 9
10_table_0 = 232 10_obj_0 = 232
11 11
12import something from a table 12import something from a table
13 13
diff --git a/spec/outputs/import.lua b/spec/outputs/import.lua
index f8d6ef0..19d332a 100644
--- a/spec/outputs/import.lua
+++ b/spec/outputs/import.lua
@@ -22,18 +22,18 @@ do
22 end 22 end
23 end)() 23 end)()
24end 24end
25local _table_0 = 232 25local _obj_0 = 232
26local something 26local something
27do 27do
28 local _obj_0 = a(table) 28 local _obj_1 = a(table)
29 something = _obj_0.something 29 something = _obj_1.something
30end 30end
31if indent then 31if indent then
32 local okay, well 32 local okay, well
33 do 33 do
34 local _obj_0 = tables[100] 34 local _obj_1 = tables[100]
35 okay, well = _obj_0.okay, (function() 35 okay, well = _obj_1.okay, (function()
36 local _base_0 = _obj_0 36 local _base_0 = _obj_1
37 local _fn_0 = _base_0.well 37 local _fn_0 = _base_0.well
38 return _fn_0 and function(...) 38 return _fn_0 and function(...)
39 return _fn_0(_base_0, ...) 39 return _fn_0(_base_0, ...)
@@ -66,13 +66,13 @@ do
66 local Player = require("player") 66 local Player = require("player")
67 local C, Ct, Cmt 67 local C, Ct, Cmt
68 do 68 do
69 local _obj_0 = require("lpeg") 69 local _obj_1 = require("lpeg")
70 C, Ct, Cmt = _obj_0.C, _obj_0.Ct, _obj_0.Cmt 70 C, Ct, Cmt = _obj_1.C, _obj_1.Ct, _obj_1.Cmt
71 end 71 end
72 local one, two, ch 72 local one, two, ch
73 do 73 do
74 local _obj_0 = require("export") 74 local _obj_1 = require("export")
75 one, two, ch = _obj_0[1], _obj_0[2], _obj_0.Something.umm[1] 75 one, two, ch = _obj_1[1], _obj_1[2], _obj_1.Something.umm[1]
76 end 76 end
77 local Another = require("export").Another 77 local Another = require("export").Another
78end 78end
@@ -84,8 +84,8 @@ end
84do 84do
85 local func, ifVar 85 local func, ifVar
86 do 86 do
87 local _obj_0 = require("org.package.module") 87 local _obj_1 = require("org.package.module")
88 func, ifVar = _obj_0["function"], _obj_0["if"] 88 func, ifVar = _obj_1["function"], _obj_1["if"]
89 end 89 end
90end 90end
91do 91do
@@ -93,14 +93,14 @@ do
93 local index = getmetatable(require("m")).__index 93 local index = getmetatable(require("m")).__index
94 local f, c 94 local f, c
95 do 95 do
96 local _obj_0 = require("m") 96 local _obj_1 = require("m")
97 f = _obj_0.e 97 f = _obj_1.e
98 c = getmetatable(_obj_0).__pairs 98 c = getmetatable(_obj_1).__pairs
99 end 99 end
100 local d = require("m").c 100 local d = require("m").c
101 local g, i 101 local g, i
102 do 102 do
103 local _obj_0 = require("m") 103 local _obj_1 = require("m")
104 g, i = _obj_0[1], getmetatable(_obj_0[2]).__close 104 g, i = _obj_1[1], getmetatable(_obj_1[2]).__close
105 end 105 end
106end 106end