diff options
Diffstat (limited to 'spec')
| -rw-r--r-- | spec/inputs/whitespace.yue | 13 | ||||
| -rw-r--r-- | spec/outputs/codes_from_doc_de.lua | 58 | ||||
| -rw-r--r-- | spec/outputs/codes_from_doc_en.lua | 58 | ||||
| -rw-r--r-- | spec/outputs/codes_from_doc_id-id.lua | 58 | ||||
| -rw-r--r-- | spec/outputs/codes_from_doc_pt-br.lua | 58 | ||||
| -rw-r--r-- | spec/outputs/codes_from_doc_zh.lua | 58 | ||||
| -rw-r--r-- | spec/outputs/whitespace.lua | 5 |
7 files changed, 308 insertions, 0 deletions
diff --git a/spec/inputs/whitespace.yue b/spec/inputs/whitespace.yue index d0acdde..18e1628 100644 --- a/spec/inputs/whitespace.yue +++ b/spec/inputs/whitespace.yue | |||
| @@ -246,4 +246,17 @@ do | |||
| 246 | -- init xd | 246 | -- init xd |
| 247 | close xd = <close>: => | 247 | close xd = <close>: => |
| 248 | 248 | ||
| 249 | |||
| 250 | do | ||
| 251 | { | ||
| 252 | numbers: [ | ||
| 253 | first | ||
| 254 | second | ||
| 255 | ] | ||
| 256 | properties: | ||
| 257 | :color | ||
| 258 | |||
| 259 | -- dsd | ||
| 260 | } = obj2 | ||
| 261 | |||
| 249 | nil | 262 | nil |
diff --git a/spec/outputs/codes_from_doc_de.lua b/spec/outputs/codes_from_doc_de.lua index d8115ee..28ed4e7 100644 --- a/spec/outputs/codes_from_doc_de.lua +++ b/spec/outputs/codes_from_doc_de.lua | |||
| @@ -939,6 +939,35 @@ _class_0 = setmetatable({ | |||
| 939 | }) | 939 | }) |
| 940 | _base_0.__class = _class_0 | 940 | _base_0.__class = _class_0 |
| 941 | Inventory = _class_0 | 941 | Inventory = _class_0 |
| 942 | local User | ||
| 943 | do | ||
| 944 | local _class_0 | ||
| 945 | local _base_0 = { | ||
| 946 | __tostring = function(self) | ||
| 947 | return "User(" .. tostring(self.name) .. ")" | ||
| 948 | end | ||
| 949 | } | ||
| 950 | if _base_0.__index == nil then | ||
| 951 | _base_0.__index = _base_0 | ||
| 952 | end | ||
| 953 | _class_0 = setmetatable({ | ||
| 954 | __init = function(self, name) | ||
| 955 | self.name = name | ||
| 956 | end, | ||
| 957 | __base = _base_0, | ||
| 958 | __name = "User" | ||
| 959 | }, { | ||
| 960 | __index = _base_0, | ||
| 961 | __call = function(cls, ...) | ||
| 962 | local _self_0 = setmetatable({ }, _base_0) | ||
| 963 | cls.__init(_self_0, ...) | ||
| 964 | return _self_0 | ||
| 965 | end | ||
| 966 | }) | ||
| 967 | _base_0.__class = _class_0 | ||
| 968 | User = _class_0 | ||
| 969 | end | ||
| 970 | print(tostring(User("Yue"))) | ||
| 942 | local inv = Inventory() | 971 | local inv = Inventory() |
| 943 | inv:add_item("T-Shirt") | 972 | inv:add_item("T-Shirt") |
| 944 | inv:add_item("Hose") | 973 | inv:add_item("Hose") |
| @@ -1559,6 +1588,35 @@ _class_0 = setmetatable({ | |||
| 1559 | }) | 1588 | }) |
| 1560 | _base_0.__class = _class_0 | 1589 | _base_0.__class = _class_0 |
| 1561 | Inventory = _class_0 | 1590 | Inventory = _class_0 |
| 1591 | local User | ||
| 1592 | do | ||
| 1593 | local _class_0 | ||
| 1594 | local _base_0 = { | ||
| 1595 | __tostring = function(self) | ||
| 1596 | return "User(" .. tostring(self.name) .. ")" | ||
| 1597 | end | ||
| 1598 | } | ||
| 1599 | if _base_0.__index == nil then | ||
| 1600 | _base_0.__index = _base_0 | ||
| 1601 | end | ||
| 1602 | _class_0 = setmetatable({ | ||
| 1603 | __init = function(self, name) | ||
| 1604 | self.name = name | ||
| 1605 | end, | ||
| 1606 | __base = _base_0, | ||
| 1607 | __name = "User" | ||
| 1608 | }, { | ||
| 1609 | __index = _base_0, | ||
| 1610 | __call = function(cls, ...) | ||
| 1611 | local _self_0 = setmetatable({ }, _base_0) | ||
| 1612 | cls.__init(_self_0, ...) | ||
| 1613 | return _self_0 | ||
| 1614 | end | ||
| 1615 | }) | ||
| 1616 | _base_0.__class = _class_0 | ||
| 1617 | User = _class_0 | ||
| 1618 | end | ||
| 1619 | print(tostring(User("Yue"))) | ||
| 1562 | local inv = Inventory() | 1620 | local inv = Inventory() |
| 1563 | inv:add_item("T-Shirt") | 1621 | inv:add_item("T-Shirt") |
| 1564 | inv:add_item("Hose") | 1622 | inv:add_item("Hose") |
diff --git a/spec/outputs/codes_from_doc_en.lua b/spec/outputs/codes_from_doc_en.lua index 66fb0b7..1fdc56d 100644 --- a/spec/outputs/codes_from_doc_en.lua +++ b/spec/outputs/codes_from_doc_en.lua | |||
| @@ -939,6 +939,35 @@ _class_0 = setmetatable({ | |||
| 939 | }) | 939 | }) |
| 940 | _base_0.__class = _class_0 | 940 | _base_0.__class = _class_0 |
| 941 | Inventory = _class_0 | 941 | Inventory = _class_0 |
| 942 | local User | ||
| 943 | do | ||
| 944 | local _class_0 | ||
| 945 | local _base_0 = { | ||
| 946 | __tostring = function(self) | ||
| 947 | return "User(" .. tostring(self.name) .. ")" | ||
| 948 | end | ||
| 949 | } | ||
| 950 | if _base_0.__index == nil then | ||
| 951 | _base_0.__index = _base_0 | ||
| 952 | end | ||
| 953 | _class_0 = setmetatable({ | ||
| 954 | __init = function(self, name) | ||
| 955 | self.name = name | ||
| 956 | end, | ||
| 957 | __base = _base_0, | ||
| 958 | __name = "User" | ||
| 959 | }, { | ||
| 960 | __index = _base_0, | ||
| 961 | __call = function(cls, ...) | ||
| 962 | local _self_0 = setmetatable({ }, _base_0) | ||
| 963 | cls.__init(_self_0, ...) | ||
| 964 | return _self_0 | ||
| 965 | end | ||
| 966 | }) | ||
| 967 | _base_0.__class = _class_0 | ||
| 968 | User = _class_0 | ||
| 969 | end | ||
| 970 | print(tostring(User("Yue"))) | ||
| 942 | local inv = Inventory() | 971 | local inv = Inventory() |
| 943 | inv:add_item("t-shirt") | 972 | inv:add_item("t-shirt") |
| 944 | inv:add_item("pants") | 973 | inv:add_item("pants") |
| @@ -1559,6 +1588,35 @@ _class_0 = setmetatable({ | |||
| 1559 | }) | 1588 | }) |
| 1560 | _base_0.__class = _class_0 | 1589 | _base_0.__class = _class_0 |
| 1561 | Inventory = _class_0 | 1590 | Inventory = _class_0 |
| 1591 | local User | ||
| 1592 | do | ||
| 1593 | local _class_0 | ||
| 1594 | local _base_0 = { | ||
| 1595 | __tostring = function(self) | ||
| 1596 | return "User(" .. tostring(self.name) .. ")" | ||
| 1597 | end | ||
| 1598 | } | ||
| 1599 | if _base_0.__index == nil then | ||
| 1600 | _base_0.__index = _base_0 | ||
| 1601 | end | ||
| 1602 | _class_0 = setmetatable({ | ||
| 1603 | __init = function(self, name) | ||
| 1604 | self.name = name | ||
| 1605 | end, | ||
| 1606 | __base = _base_0, | ||
| 1607 | __name = "User" | ||
| 1608 | }, { | ||
| 1609 | __index = _base_0, | ||
| 1610 | __call = function(cls, ...) | ||
| 1611 | local _self_0 = setmetatable({ }, _base_0) | ||
| 1612 | cls.__init(_self_0, ...) | ||
| 1613 | return _self_0 | ||
| 1614 | end | ||
| 1615 | }) | ||
| 1616 | _base_0.__class = _class_0 | ||
| 1617 | User = _class_0 | ||
| 1618 | end | ||
| 1619 | print(tostring(User("Yue"))) | ||
| 1562 | local inv = Inventory() | 1620 | local inv = Inventory() |
| 1563 | inv:add_item("t-shirt") | 1621 | inv:add_item("t-shirt") |
| 1564 | inv:add_item("pants") | 1622 | inv:add_item("pants") |
diff --git a/spec/outputs/codes_from_doc_id-id.lua b/spec/outputs/codes_from_doc_id-id.lua index 6caf79c..2201dee 100644 --- a/spec/outputs/codes_from_doc_id-id.lua +++ b/spec/outputs/codes_from_doc_id-id.lua | |||
| @@ -939,6 +939,35 @@ _class_0 = setmetatable({ | |||
| 939 | }) | 939 | }) |
| 940 | _base_0.__class = _class_0 | 940 | _base_0.__class = _class_0 |
| 941 | Inventory = _class_0 | 941 | Inventory = _class_0 |
| 942 | local User | ||
| 943 | do | ||
| 944 | local _class_0 | ||
| 945 | local _base_0 = { | ||
| 946 | __tostring = function(self) | ||
| 947 | return "User(" .. tostring(self.name) .. ")" | ||
| 948 | end | ||
| 949 | } | ||
| 950 | if _base_0.__index == nil then | ||
| 951 | _base_0.__index = _base_0 | ||
| 952 | end | ||
| 953 | _class_0 = setmetatable({ | ||
| 954 | __init = function(self, name) | ||
| 955 | self.name = name | ||
| 956 | end, | ||
| 957 | __base = _base_0, | ||
| 958 | __name = "User" | ||
| 959 | }, { | ||
| 960 | __index = _base_0, | ||
| 961 | __call = function(cls, ...) | ||
| 962 | local _self_0 = setmetatable({ }, _base_0) | ||
| 963 | cls.__init(_self_0, ...) | ||
| 964 | return _self_0 | ||
| 965 | end | ||
| 966 | }) | ||
| 967 | _base_0.__class = _class_0 | ||
| 968 | User = _class_0 | ||
| 969 | end | ||
| 970 | print(tostring(User("Yue"))) | ||
| 942 | local inv = Inventory() | 971 | local inv = Inventory() |
| 943 | inv:add_item("t-shirt") | 972 | inv:add_item("t-shirt") |
| 944 | inv:add_item("pants") | 973 | inv:add_item("pants") |
| @@ -1559,6 +1588,35 @@ _class_0 = setmetatable({ | |||
| 1559 | }) | 1588 | }) |
| 1560 | _base_0.__class = _class_0 | 1589 | _base_0.__class = _class_0 |
| 1561 | Inventory = _class_0 | 1590 | Inventory = _class_0 |
| 1591 | local User | ||
| 1592 | do | ||
| 1593 | local _class_0 | ||
| 1594 | local _base_0 = { | ||
| 1595 | __tostring = function(self) | ||
| 1596 | return "User(" .. tostring(self.name) .. ")" | ||
| 1597 | end | ||
| 1598 | } | ||
| 1599 | if _base_0.__index == nil then | ||
| 1600 | _base_0.__index = _base_0 | ||
| 1601 | end | ||
| 1602 | _class_0 = setmetatable({ | ||
| 1603 | __init = function(self, name) | ||
| 1604 | self.name = name | ||
| 1605 | end, | ||
| 1606 | __base = _base_0, | ||
| 1607 | __name = "User" | ||
| 1608 | }, { | ||
| 1609 | __index = _base_0, | ||
| 1610 | __call = function(cls, ...) | ||
| 1611 | local _self_0 = setmetatable({ }, _base_0) | ||
| 1612 | cls.__init(_self_0, ...) | ||
| 1613 | return _self_0 | ||
| 1614 | end | ||
| 1615 | }) | ||
| 1616 | _base_0.__class = _class_0 | ||
| 1617 | User = _class_0 | ||
| 1618 | end | ||
| 1619 | print(tostring(User("Yue"))) | ||
| 1562 | local inv = Inventory() | 1620 | local inv = Inventory() |
| 1563 | inv:add_item("t-shirt") | 1621 | inv:add_item("t-shirt") |
| 1564 | inv:add_item("pants") | 1622 | inv:add_item("pants") |
diff --git a/spec/outputs/codes_from_doc_pt-br.lua b/spec/outputs/codes_from_doc_pt-br.lua index 22f9bb9..b3bf0b3 100644 --- a/spec/outputs/codes_from_doc_pt-br.lua +++ b/spec/outputs/codes_from_doc_pt-br.lua | |||
| @@ -939,6 +939,35 @@ _class_0 = setmetatable({ | |||
| 939 | }) | 939 | }) |
| 940 | _base_0.__class = _class_0 | 940 | _base_0.__class = _class_0 |
| 941 | Inventory = _class_0 | 941 | Inventory = _class_0 |
| 942 | local User | ||
| 943 | do | ||
| 944 | local _class_0 | ||
| 945 | local _base_0 = { | ||
| 946 | __tostring = function(self) | ||
| 947 | return "User(" .. tostring(self.name) .. ")" | ||
| 948 | end | ||
| 949 | } | ||
| 950 | if _base_0.__index == nil then | ||
| 951 | _base_0.__index = _base_0 | ||
| 952 | end | ||
| 953 | _class_0 = setmetatable({ | ||
| 954 | __init = function(self, name) | ||
| 955 | self.name = name | ||
| 956 | end, | ||
| 957 | __base = _base_0, | ||
| 958 | __name = "User" | ||
| 959 | }, { | ||
| 960 | __index = _base_0, | ||
| 961 | __call = function(cls, ...) | ||
| 962 | local _self_0 = setmetatable({ }, _base_0) | ||
| 963 | cls.__init(_self_0, ...) | ||
| 964 | return _self_0 | ||
| 965 | end | ||
| 966 | }) | ||
| 967 | _base_0.__class = _class_0 | ||
| 968 | User = _class_0 | ||
| 969 | end | ||
| 970 | print(tostring(User("Yue"))) | ||
| 942 | local inv = Inventory() | 971 | local inv = Inventory() |
| 943 | inv:add_item("t-shirt") | 972 | inv:add_item("t-shirt") |
| 944 | inv:add_item("pants") | 973 | inv:add_item("pants") |
| @@ -1559,6 +1588,35 @@ _class_0 = setmetatable({ | |||
| 1559 | }) | 1588 | }) |
| 1560 | _base_0.__class = _class_0 | 1589 | _base_0.__class = _class_0 |
| 1561 | Inventory = _class_0 | 1590 | Inventory = _class_0 |
| 1591 | local User | ||
| 1592 | do | ||
| 1593 | local _class_0 | ||
| 1594 | local _base_0 = { | ||
| 1595 | __tostring = function(self) | ||
| 1596 | return "User(" .. tostring(self.name) .. ")" | ||
| 1597 | end | ||
| 1598 | } | ||
| 1599 | if _base_0.__index == nil then | ||
| 1600 | _base_0.__index = _base_0 | ||
| 1601 | end | ||
| 1602 | _class_0 = setmetatable({ | ||
| 1603 | __init = function(self, name) | ||
| 1604 | self.name = name | ||
| 1605 | end, | ||
| 1606 | __base = _base_0, | ||
| 1607 | __name = "User" | ||
| 1608 | }, { | ||
| 1609 | __index = _base_0, | ||
| 1610 | __call = function(cls, ...) | ||
| 1611 | local _self_0 = setmetatable({ }, _base_0) | ||
| 1612 | cls.__init(_self_0, ...) | ||
| 1613 | return _self_0 | ||
| 1614 | end | ||
| 1615 | }) | ||
| 1616 | _base_0.__class = _class_0 | ||
| 1617 | User = _class_0 | ||
| 1618 | end | ||
| 1619 | print(tostring(User("Yue"))) | ||
| 1562 | local inv = Inventory() | 1620 | local inv = Inventory() |
| 1563 | inv:add_item("t-shirt") | 1621 | inv:add_item("t-shirt") |
| 1564 | inv:add_item("pants") | 1622 | inv:add_item("pants") |
diff --git a/spec/outputs/codes_from_doc_zh.lua b/spec/outputs/codes_from_doc_zh.lua index cf08375..5756793 100644 --- a/spec/outputs/codes_from_doc_zh.lua +++ b/spec/outputs/codes_from_doc_zh.lua | |||
| @@ -939,6 +939,35 @@ _class_0 = setmetatable({ | |||
| 939 | }) | 939 | }) |
| 940 | _base_0.__class = _class_0 | 940 | _base_0.__class = _class_0 |
| 941 | Inventory = _class_0 | 941 | Inventory = _class_0 |
| 942 | local User | ||
| 943 | do | ||
| 944 | local _class_0 | ||
| 945 | local _base_0 = { | ||
| 946 | __tostring = function(self) | ||
| 947 | return "User(" .. tostring(self.name) .. ")" | ||
| 948 | end | ||
| 949 | } | ||
| 950 | if _base_0.__index == nil then | ||
| 951 | _base_0.__index = _base_0 | ||
| 952 | end | ||
| 953 | _class_0 = setmetatable({ | ||
| 954 | __init = function(self, name) | ||
| 955 | self.name = name | ||
| 956 | end, | ||
| 957 | __base = _base_0, | ||
| 958 | __name = "User" | ||
| 959 | }, { | ||
| 960 | __index = _base_0, | ||
| 961 | __call = function(cls, ...) | ||
| 962 | local _self_0 = setmetatable({ }, _base_0) | ||
| 963 | cls.__init(_self_0, ...) | ||
| 964 | return _self_0 | ||
| 965 | end | ||
| 966 | }) | ||
| 967 | _base_0.__class = _class_0 | ||
| 968 | User = _class_0 | ||
| 969 | end | ||
| 970 | print(tostring(User("Yue"))) | ||
| 942 | local inv = Inventory() | 971 | local inv = Inventory() |
| 943 | inv:add_item("t-shirt") | 972 | inv:add_item("t-shirt") |
| 944 | inv:add_item("pants") | 973 | inv:add_item("pants") |
| @@ -1559,6 +1588,35 @@ _class_0 = setmetatable({ | |||
| 1559 | }) | 1588 | }) |
| 1560 | _base_0.__class = _class_0 | 1589 | _base_0.__class = _class_0 |
| 1561 | Inventory = _class_0 | 1590 | Inventory = _class_0 |
| 1591 | local User | ||
| 1592 | do | ||
| 1593 | local _class_0 | ||
| 1594 | local _base_0 = { | ||
| 1595 | __tostring = function(self) | ||
| 1596 | return "User(" .. tostring(self.name) .. ")" | ||
| 1597 | end | ||
| 1598 | } | ||
| 1599 | if _base_0.__index == nil then | ||
| 1600 | _base_0.__index = _base_0 | ||
| 1601 | end | ||
| 1602 | _class_0 = setmetatable({ | ||
| 1603 | __init = function(self, name) | ||
| 1604 | self.name = name | ||
| 1605 | end, | ||
| 1606 | __base = _base_0, | ||
| 1607 | __name = "User" | ||
| 1608 | }, { | ||
| 1609 | __index = _base_0, | ||
| 1610 | __call = function(cls, ...) | ||
| 1611 | local _self_0 = setmetatable({ }, _base_0) | ||
| 1612 | cls.__init(_self_0, ...) | ||
| 1613 | return _self_0 | ||
| 1614 | end | ||
| 1615 | }) | ||
| 1616 | _base_0.__class = _class_0 | ||
| 1617 | User = _class_0 | ||
| 1618 | end | ||
| 1619 | print(tostring(User("Yue"))) | ||
| 1562 | local inv = Inventory() | 1620 | local inv = Inventory() |
| 1563 | inv:add_item("t-shirt") | 1621 | inv:add_item("t-shirt") |
| 1564 | inv:add_item("pants") | 1622 | inv:add_item("pants") |
diff --git a/spec/outputs/whitespace.lua b/spec/outputs/whitespace.lua index a0d225f..768f2ac 100644 --- a/spec/outputs/whitespace.lua +++ b/spec/outputs/whitespace.lua | |||
| @@ -183,4 +183,9 @@ do | |||
| 183 | local _close_0 <close> = xd | 183 | local _close_0 <close> = xd |
| 184 | CY = _class_0 | 184 | CY = _class_0 |
| 185 | end | 185 | end |
| 186 | do | ||
| 187 | local first, second, color | ||
| 188 | local _obj_0 = obj2 | ||
| 189 | first, second, color = _obj_0.numbers[1], _obj_0.numbers[2], _obj_0.properties.color | ||
| 190 | end | ||
| 186 | return nil | 191 | return nil |
