Skip to content

Commit 0cece2c

Browse files
committed
Added more format function specs.
1 parent ec20937 commit 0cece2c

4 files changed

Lines changed: 119 additions & 33 deletions

File tree

spec/inputs/test/format_spec.yue

Lines changed: 58 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
files = [
2+
"spec/inputs/import_global.yue"
3+
"spec/inputs/nil_coalesce_precedence.yue"
24
"spec/inputs/macro_export.yue"
5+
"spec/inputs/props.yue"
36
"spec/inputs/attrib.yue"
7+
"spec/inputs/upvalue_func.yue"
48
"spec/inputs/macro.yue"
9+
"spec/inputs/export_mixed.yue"
510
"spec/inputs/using.yue"
611
"spec/inputs/whitespace.yue"
712
"spec/inputs/nil_coalescing.yue"
@@ -11,16 +16,19 @@ files = [
1116
"spec/inputs/string.yue"
1217
"spec/inputs/local.yue"
1318
"spec/inputs/tables.yue"
19+
"spec/inputs/pipe_chain_combo.yue"
1420
"spec/inputs/operators.yue"
1521
"spec/inputs/lists.yue"
1622
"spec/inputs/compile_doc.yue"
1723
"spec/inputs/switch.yue"
1824
"spec/inputs/multiline_chain.yue"
1925
"spec/inputs/existential.yue"
2026
"spec/inputs/export_default.yue"
27+
"spec/inputs/with_scope_shadow.yue"
2128
"spec/inputs/assign.yue"
2229
"spec/inputs/literals.yue"
2330
"spec/inputs/luarocks_upload.yue"
31+
"spec/inputs/comprehension_nested.yue"
2432
"spec/inputs/ambiguous.yue"
2533
"spec/inputs/bubbling.yue"
2634
"spec/inputs/try_catch.yue"
@@ -41,17 +49,63 @@ files = [
4149
"spec/inputs/loops.yue"
4250
"spec/inputs/class.yue"
4351
"spec/inputs/vararg.yue"
52+
"spec/inputs/destructure_defaults.yue"
4453
"spec/inputs/goto.yue"
4554
"spec/inputs/metatable.yue"
4655
"spec/inputs/syntax.yue"
4756
"spec/inputs/global.yue"
4857
"spec/inputs/plus.yue"
58+
"spec/inputs/test/with_spec.yue"
59+
"spec/inputs/test/try_catch_spec.yue"
60+
"spec/inputs/test/operator_advanced_spec.yue"
61+
"spec/inputs/test/with_statement_spec.yue"
62+
"spec/inputs/test/literals_spec.yue"
63+
"spec/inputs/test/varargs_assignment_spec.yue"
64+
"spec/inputs/test/advanced_macro_spec.yue"
65+
"spec/inputs/test/pipe_spec.yue"
66+
"spec/inputs/test/export_spec.yue"
67+
"spec/inputs/test/existential_spec.yue"
68+
"spec/inputs/test/metatable_spec.yue"
69+
"spec/inputs/test/multiline_args_spec.yue"
70+
"spec/inputs/test/format_spec.yue"
71+
"spec/inputs/test/do_statement_spec.yue"
4972
"spec/inputs/test/class_spec.yue"
73+
"spec/inputs/test/stub_spec.yue"
74+
"spec/inputs/test/whitespace_spec.yue"
75+
"spec/inputs/test/in_expression_spec.yue"
76+
"spec/inputs/test/param_destructure_spec.yue"
77+
"spec/inputs/test/operators_spec.yue"
78+
"spec/inputs/test/comprehension_spec.yue"
79+
"spec/inputs/test/attrib_spec.yue"
80+
"spec/inputs/test/nil_coalescing_spec.yue"
81+
"spec/inputs/test/table_comprehension_spec.yue"
82+
"spec/inputs/test/slicing_spec.yue"
83+
"spec/inputs/test/close_attribute_spec.yue"
84+
"spec/inputs/test/named_varargs_spec.yue"
5085
"spec/inputs/test/table_spreading_spec.yue"
86+
"spec/inputs/test/macro_spec.yue"
87+
"spec/inputs/test/chaining_comparison_spec.yue"
88+
"spec/inputs/test/table_append_spec.yue"
89+
"spec/inputs/test/destructure_spec.yue"
90+
"spec/inputs/test/vararg_spec.yue"
91+
"spec/inputs/test/string_spec.yue"
92+
"spec/inputs/test/implicit_object_spec.yue"
93+
"spec/inputs/test/backcall_spec.yue"
94+
"spec/inputs/test/while_assignment_spec.yue"
95+
"spec/inputs/test/switch_spec.yue"
96+
"spec/inputs/test/functions_advanced_spec.yue"
97+
"spec/inputs/test/config_spec.yue"
98+
"spec/inputs/test/yaml_string_spec.yue"
99+
"spec/inputs/test/const_attribute_spec.yue"
100+
"spec/inputs/test/cond_spec.yue"
101+
"spec/inputs/test/import_spec.yue"
102+
"spec/inputs/test/reverse_index_spec.yue"
103+
"spec/inputs/test/prefixed_return_spec.yue"
104+
"spec/inputs/test/goto_spec.yue"
105+
"spec/inputs/test/return_spec.yue"
51106
"spec/inputs/test/loops_spec.yue"
52-
"spec/inputs/test/format_spec.yue"
53-
"spec/inputs/upvalue_func.yue"
54-
"spec/inputs/import_global.yue"
107+
"spec/inputs/test/if_assignment_spec.yue"
108+
"spec/inputs/test/tables_advanced_spec.yue"
55109
"spec/inputs/unicode/macro_export.yue"
56110
"spec/inputs/unicode/attrib.yue"
57111
"spec/inputs/unicode/macro.yue"
@@ -63,6 +117,7 @@ files = [
63117
"spec/inputs/unicode/string.yue"
64118
"spec/inputs/unicode/local.yue"
65119
"spec/inputs/unicode/tables.yue"
120+
"spec/inputs/unicode/pipe_chain_combo.yue"
66121
"spec/inputs/unicode/operators.yue"
67122
"spec/inputs/unicode/lists.yue"
68123
"spec/inputs/unicode/switch.yue"
@@ -95,18 +150,6 @@ files = [
95150
"spec/inputs/unicode/syntax.yue"
96151
"spec/inputs/unicode/global.yue"
97152
"spec/inputs/unicode/plus.yue"
98-
"spec/inputs/pipe_chain_combo.yue"
99-
"spec/inputs/destructure_defaults.yue"
100-
"spec/inputs/nil_coalesce_precedence.yue"
101-
"spec/inputs/comprehension_nested.yue"
102-
"spec/inputs/with_scope_shadow.yue"
103-
"spec/inputs/export_mixed.yue"
104-
"spec/inputs/unicode/pipe_chain_combo.yue"
105-
"spec/inputs/test/destructure_spec.yue"
106-
"spec/inputs/test/nil_coalescing_spec.yue"
107-
"spec/inputs/test/pipe_spec.yue"
108-
"spec/inputs/test/try_catch_spec.yue"
109-
"spec/inputs/test/comprehension_spec.yue"
110153
]
111154

112155
import "yue"

spec/outputs/test/format_spec.lua

Lines changed: 59 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
local files = {
2+
"spec/inputs/import_global.yue",
3+
"spec/inputs/nil_coalesce_precedence.yue",
24
"spec/inputs/macro_export.yue",
5+
"spec/inputs/props.yue",
36
"spec/inputs/attrib.yue",
7+
"spec/inputs/upvalue_func.yue",
48
"spec/inputs/macro.yue",
9+
"spec/inputs/export_mixed.yue",
510
"spec/inputs/using.yue",
611
"spec/inputs/whitespace.yue",
712
"spec/inputs/nil_coalescing.yue",
@@ -11,16 +16,19 @@ local files = {
1116
"spec/inputs/string.yue",
1217
"spec/inputs/local.yue",
1318
"spec/inputs/tables.yue",
19+
"spec/inputs/pipe_chain_combo.yue",
1420
"spec/inputs/operators.yue",
1521
"spec/inputs/lists.yue",
1622
"spec/inputs/compile_doc.yue",
1723
"spec/inputs/switch.yue",
1824
"spec/inputs/multiline_chain.yue",
1925
"spec/inputs/existential.yue",
2026
"spec/inputs/export_default.yue",
27+
"spec/inputs/with_scope_shadow.yue",
2128
"spec/inputs/assign.yue",
2229
"spec/inputs/literals.yue",
2330
"spec/inputs/luarocks_upload.yue",
31+
"spec/inputs/comprehension_nested.yue",
2432
"spec/inputs/ambiguous.yue",
2533
"spec/inputs/bubbling.yue",
2634
"spec/inputs/try_catch.yue",
@@ -41,17 +49,63 @@ local files = {
4149
"spec/inputs/loops.yue",
4250
"spec/inputs/class.yue",
4351
"spec/inputs/vararg.yue",
52+
"spec/inputs/destructure_defaults.yue",
4453
"spec/inputs/goto.yue",
4554
"spec/inputs/metatable.yue",
4655
"spec/inputs/syntax.yue",
4756
"spec/inputs/global.yue",
4857
"spec/inputs/plus.yue",
58+
"spec/inputs/test/with_spec.yue",
59+
"spec/inputs/test/try_catch_spec.yue",
60+
"spec/inputs/test/operator_advanced_spec.yue",
61+
"spec/inputs/test/with_statement_spec.yue",
62+
"spec/inputs/test/literals_spec.yue",
63+
"spec/inputs/test/varargs_assignment_spec.yue",
64+
"spec/inputs/test/advanced_macro_spec.yue",
65+
"spec/inputs/test/pipe_spec.yue",
66+
"spec/inputs/test/export_spec.yue",
67+
"spec/inputs/test/existential_spec.yue",
68+
"spec/inputs/test/metatable_spec.yue",
69+
"spec/inputs/test/multiline_args_spec.yue",
70+
"spec/inputs/test/format_spec.yue",
71+
"spec/inputs/test/do_statement_spec.yue",
4972
"spec/inputs/test/class_spec.yue",
73+
"spec/inputs/test/stub_spec.yue",
74+
"spec/inputs/test/whitespace_spec.yue",
75+
"spec/inputs/test/in_expression_spec.yue",
76+
"spec/inputs/test/param_destructure_spec.yue",
77+
"spec/inputs/test/operators_spec.yue",
78+
"spec/inputs/test/comprehension_spec.yue",
79+
"spec/inputs/test/attrib_spec.yue",
80+
"spec/inputs/test/nil_coalescing_spec.yue",
81+
"spec/inputs/test/table_comprehension_spec.yue",
82+
"spec/inputs/test/slicing_spec.yue",
83+
"spec/inputs/test/close_attribute_spec.yue",
84+
"spec/inputs/test/named_varargs_spec.yue",
5085
"spec/inputs/test/table_spreading_spec.yue",
86+
"spec/inputs/test/macro_spec.yue",
87+
"spec/inputs/test/chaining_comparison_spec.yue",
88+
"spec/inputs/test/table_append_spec.yue",
89+
"spec/inputs/test/destructure_spec.yue",
90+
"spec/inputs/test/vararg_spec.yue",
91+
"spec/inputs/test/string_spec.yue",
92+
"spec/inputs/test/implicit_object_spec.yue",
93+
"spec/inputs/test/backcall_spec.yue",
94+
"spec/inputs/test/while_assignment_spec.yue",
95+
"spec/inputs/test/switch_spec.yue",
96+
"spec/inputs/test/functions_advanced_spec.yue",
97+
"spec/inputs/test/config_spec.yue",
98+
"spec/inputs/test/yaml_string_spec.yue",
99+
"spec/inputs/test/const_attribute_spec.yue",
100+
"spec/inputs/test/cond_spec.yue",
101+
"spec/inputs/test/import_spec.yue",
102+
"spec/inputs/test/reverse_index_spec.yue",
103+
"spec/inputs/test/prefixed_return_spec.yue",
104+
"spec/inputs/test/goto_spec.yue",
105+
"spec/inputs/test/return_spec.yue",
51106
"spec/inputs/test/loops_spec.yue",
52-
"spec/inputs/test/format_spec.yue",
53-
"spec/inputs/upvalue_func.yue",
54-
"spec/inputs/import_global.yue",
107+
"spec/inputs/test/if_assignment_spec.yue",
108+
"spec/inputs/test/tables_advanced_spec.yue",
55109
"spec/inputs/unicode/macro_export.yue",
56110
"spec/inputs/unicode/attrib.yue",
57111
"spec/inputs/unicode/macro.yue",
@@ -63,6 +117,7 @@ local files = {
63117
"spec/inputs/unicode/string.yue",
64118
"spec/inputs/unicode/local.yue",
65119
"spec/inputs/unicode/tables.yue",
120+
"spec/inputs/unicode/pipe_chain_combo.yue",
66121
"spec/inputs/unicode/operators.yue",
67122
"spec/inputs/unicode/lists.yue",
68123
"spec/inputs/unicode/switch.yue",
@@ -94,19 +149,7 @@ local files = {
94149
"spec/inputs/unicode/metatable.yue",
95150
"spec/inputs/unicode/syntax.yue",
96151
"spec/inputs/unicode/global.yue",
97-
"spec/inputs/unicode/plus.yue",
98-
"spec/inputs/pipe_chain_combo.yue",
99-
"spec/inputs/destructure_defaults.yue",
100-
"spec/inputs/nil_coalesce_precedence.yue",
101-
"spec/inputs/comprehension_nested.yue",
102-
"spec/inputs/with_scope_shadow.yue",
103-
"spec/inputs/export_mixed.yue",
104-
"spec/inputs/unicode/pipe_chain_combo.yue",
105-
"spec/inputs/test/destructure_spec.yue",
106-
"spec/inputs/test/nil_coalescing_spec.yue",
107-
"spec/inputs/test/pipe_spec.yue",
108-
"spec/inputs/test/try_catch_spec.yue",
109-
"spec/inputs/test/comprehension_spec.yue"
152+
"spec/inputs/unicode/plus.yue"
110153
}
111154
local yue = require("yue")
112155
local rewriteLineCol

src/yuescript/yue_ast.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -860,7 +860,7 @@ std::string CompForEach_t::to_string(void* ud) const {
860860
std::string CompForNum_t::to_string(void* ud) const {
861861
auto line = "for "s + varName->to_string(ud) + " = "s + startValue->to_string(ud) + ", "s + stopValue->to_string(ud);
862862
if (stepValue) {
863-
line += stepValue->to_string(ud);
863+
line += ", "s + stepValue->to_string(ud);
864864
}
865865
return line;
866866
}

src/yuescript/yue_compiler.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ static std::unordered_set<std::string> Metamethods = {
7878
"close"s // Lua 5.4
7979
};
8080

81-
const std::string_view version = "0.32.6"sv;
81+
const std::string_view version = "0.32.7"sv;
8282
const std::string_view extension = "yue"sv;
8383

8484
class CompileError : public std::logic_error {

0 commit comments

Comments
 (0)