-
Notifications
You must be signed in to change notification settings - Fork 8
/
main.lua
930 lines (830 loc) · 62 KB
/
main.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
DEBUG = not fengari
package.path = "scripts/?.lua"
js = nil
if fengari then
js = require "js"
end
local line_number
local compile_file
local _cache = {}
-- Defined here to pick up compile_file and line_number
function error_lexer(msg, _)
error(string.format("%s:%s: %s", compile_file, line_number, msg), 0)
end
for _, lib in ipairs {"base64", "lexer-functions", "lexer-operators", "lexer-tokens", "lexer-debug", "lexer", "stdlib"} do
if DEBUG then
dofile(package.path:gsub("?", lib))
else
require(lib)
end
end
do
local assert_old = assert
local function assert_lexer(test, msg)
if not test then
error_lexer(msg)
end
return test
end
function lua_main(func, arg1, arg2, arg3)
local status, ret
if func == "compile" then
assert = assert_lexer
local exported = {}
for i = 1, #arg1 do
local pair = arg1[i]
status, ret = pcall(compile, pair.name, pair.text, arg2, arg3)
if not status then
assert = assert_old
if js then
-- Fengari has bugs where it can return a native JS exception object
ret = js.tostring(ret)
end
return false, pair.name .. "\n" .. ret
end
exported[i] = ret
end
assert = assert_old
return true, exported
elseif func == "import" then
status, ret = pcall(import, arg1)
if status then
return true, ret[1], ret[2]
end
elseif func == "unittest" then
status, ret = pcall(unittest)
else
assert(false, "BUG REPORT: unknown lua_main function: " .. func)
end
return status, ret
end
end
local function cache(line, variables)
local key = {}
for _, v in pairs (variables) do
table.insert(key, string.format("%s.%s.%s.%s", v.scope, v.type, v.name, v.value))
end
table.sort(key)
table.insert(key, line)
key = table.concat(key, "¤")
if not _cache[key] then
_cache[key] = lexer(line, variables)
end
return _cache[key]
end
local function parseMacro(text, macros, depth, env)
assert(depth < 100, "macro expansion depth reached " .. depth .. ", probable infinite loop in: " .. text)
return text:gsub("%b{}", function(macro)
if #macro == 2 then
return
end
macro = parseMacro(macro:sub(2,-2), macros, depth + 1, env)
local arg_body = ""
local name = macro:match("^([^%(]+)$")
if not name then
name, arg_body = macro:match("^([^%(]+)(%b())")
end
assert(name, "invalid macro call: " .. macro)
assert(#name + #arg_body == #macro, "trailing junk after macro call: " .. macro)
if name == "len" then
assert(arg_body ~= "", "len is a macro function")
return tostring(#arg_body - 2)
elseif name == "lua" then
assert(arg_body ~= "", "lua is a macro function")
local lua_text = arg_body:sub(2,-2)
local chunk, err = load(lua_text, lua_text, "t", env)
assert(chunk, err)
local status, result = pcall(chunk)
if status then
return tostring(result or "")
end
error_lexer(result)
end
local args = {}
local arg_count = 0
local arg_begin = 2
local nesting = 0
for i = 2, #arg_body do
local char = arg_body:sub(i, i)
if nesting == 0 and (char == "," or i == #arg_body) then
args["{#"..arg_count.."#}"] = arg_body:sub(arg_begin, i-1)
arg_count = arg_count + 1
arg_begin = i + 1
elseif char == "(" then
nesting = nesting + 1
elseif char == ")" and i ~= #arg_body then
nesting = nesting - 1
assert(nesting >= 0, "unbalanced parenthesis inside macro call: " .. macro)
end
end
assert(nesting == 0, "unclosed parenthesis inside macro call: " .. macro)
local macro_obj = macros[name]
assert(macro_obj, "macro does not exist: " .. name)
local unexpanded, arg_len = macro_obj.text, macro_obj.arg_len
assert(arg_len == arg_count,
"macro call has wrong number of args, expected " .. arg_len ..
" but got " .. arg_count .. ": " .. macro)
return parseMacro(unexpanded:gsub("{#[0-9]+#}", args), macros, depth + 1, env)
end)
end
-- Whitelist of functions and tables that are allowed in the lua() macro. We
-- store this as a string, so that we can bind the names properly.
local globals_whitelist = {}
for k in string.gmatch([[assert
error
getmetatable
ipairs
load
next
pairs
pcall
print
rawequal
rawget
rawlen
rawset
select
setmetatable
tonumber
tostring
type
_VERSION
xpcall
coroutine
string
utf8
table
math]], "%g+") do globals_whitelist[#globals_whitelist+1] = k end
local os_whitelist = {'clock', 'date', 'difftime', 'time'}
local function filter_table(table_in, whitelist)
res = {}
for i = 1, #whitelist do
local k = whitelist[i]
local v = table_in[k]
if type(v) == 'table' then
local new_tab = {}
for k2, v2 in pairs(v) do
new_tab[k2] = v2
end
v = new_tab
end
res[k] = v
end
return res
end
local function clone_global()
local new_g = filter_table(_G, globals_whitelist)
new_g.os = filter_table(_G.os, os_whitelist)
new_g._G = new_g
return new_g
end
local function is_empty(line)
return line:find("^%s*$") or line:find("^%s*;.*$")
end
local json_escape_table = {["\\"]=[[\\]], ['"']=[[\"]]}
for i = 0, 31 do
json_escape_table[string.char(i)] = string.format([[\u%04x]], i)
end
json_escape_table["\b"] = [[\b]]
json_escape_table["\f"] = [[\f]]
json_escape_table["\n"] = [[\n]]
json_escape_table["\r"] = [[\r]]
json_escape_table["\t"] = [[\t]]
local line_encode_table = {}
local utf_decode_table = {}
for k, v in pairs(json_escape_table) do
line_encode_table[k] = v
end
for i = 0x80, 0xff do
line_encode_table[string.char(i)] = utf8.char(i)
utf_decode_table[utf8.char(i)] = string.char(i)
end
-- importFunc takes a string (filename) and returns a pair of (status, string)
-- (the content of the imported file on success, an error message on failure).
function compile(name, input, options, importFunc)
local variables, impulses, conditions, actions = {}, {}, {}, {}
local budget, use_budget
local env = clone_global()
local macros, imported = {len = '__builtin__', lua = '__builtin__'}, {}
local ret = {}
local function import(filename, input, isImport)
if imported[filename] then
return {}
end
imported[filename] = true
line_number = 0
compile_file = filename
local lines = {}
local labelCache = {}
local lineCache = {}
for real_line in input:gmatch"[^\n]*" do
line_number = line_number + 1
if real_line:sub(-1) == "\\" then
lineCache[#lineCache+1] = real_line:sub(1, -2)
goto continue
end
lineCache[#lineCache+1] = real_line
line = table.concat(lineCache):gsub("^%s+", ""):gsub("%s+$", "")
if line:sub(1, 1) ~= "#" then
line = parseMacro(line, macros, 1, env)
end
lineCache = {}
if line:match"^#" then
local macro_args = ""
local name, macro = line:sub(2):match(TOKEN.identifier.pattern .. " (.+)$")
if not name then
name, macro_args, macro = line:sub(2):match(TOKEN.identifier.pattern .. "(%([%w%._ ,]+%)) (.+)$")
end
assert(name, "macro definition: #name <text> or #name(args...) <text>")
local args = {}
local arg_len = 0
local arg_begin = 2
while arg_begin <= #macro_args do
local pos = macro_args:find(",", arg_begin, true)
if not pos then
pos = #macro_args
end
local arg_string = macro_args:sub(arg_begin, pos - 1)
local arg = arg_string:match("^ *" .. TOKEN.identifier.patternAnywhere .. " *$")
assert(arg, "bad macro function argument name: " .. arg_string)
args["{" .. arg .. "}"] = "{#" .. arg_len .. "#}"
arg_len = arg_len + 1
arg_begin = pos + 1
end
assert(not macros[name], "macro already exists: " .. name)
macros[name] = {text = macro:gsub("{[^{}]+}", args), arg_len = arg_len}
elseif line:match"^:" then
local token = line:match("^:" .. TOKEN.identifier.patternAnywhere)
if token == "const" then
local _, type, name, value = line:sub(2):match("^(%a+) (%a+) " .. TOKEN.identifier.patternAnywhere .. " (.+)$")
assert(type, "constant definition: const [int/double/string/bool] name value")
assert(type == "int" or type == "double" or type == "string" or type == "bool", "constant types are 'int', 'double', 'string' and 'bool'")
if (type == "int" or type == "double") then
assert((value:match"^%d+$" and type == "int") or (value:match"^%d+%.%d*$" and type == "double"), "bad argument, " .. type .. " expected, got " .. value)
value = tonumber(value)
elseif (type == "bool") then
assert(value:match"^true$" or value:match"^false$", "bool values are 'true' or 'false'")
if value:match"^true$" then
value = true
else
value = false
end
elseif (type == "string") then
value = value:match"^%b''$" or value:match'^%b""$'
assert(value, "strings must be enclosed in either single quotes or double quotes")
value = value:sub(2,-2)
end
assert(not variables[name], "variable/label/constant already exists: " .. name)
variables[name] = {name = name, scope = "constant", type = type, value = value}
elseif token == "import" then
local import_name = line:match("^:%a+ +(.+)")
assert(import_name, "import directive: :import file")
local status, import_result = importFunc(import_name)
assert(status, "Import failed: " .. import_result)
local saved_lineno, saved_compile_file = line_number, compile_file
import(import_name, import_result, true)
-- These got stomped by the import, re-set them
compile_file = saved_compile_file
line_number = saved_lineno
elseif token == "global" or token == "local" then
local scope, type, name = line:sub(2):gsub(" *;.*", ""):match("^(%a+) +(%a+) +" .. TOKEN.identifier.patternAnywhere .."$")
assert(scope, "variable definition: [global/local/const] [bool/int/double/string/vector] name")
assert(({bool=true, int=true, double=true, string=true, vector=true})[type], "variable types are 'bool', 'int', 'double', 'string', and 'vector'")
assert(not variables[name], "variable/label already exists: " .. name)
variables[name] = {name = name, scope = scope, type = type}
elseif token == "name" then
local name = line:match("^:%a+ +(.+)")
assert(name, "name directive: :name script_name")
compile_file = name
elseif token == "budget_cap" then
local cost = line:match("^:budget_cap +(.+)")
if cost and cost ~= "max" then
cost = tonumber(cost)
if cost then
assert(-2147483648 <= cost and cost < 2147483648,
"budget_cap must fit in an integer (-2^31 <= cost < 2^31), got " .. cost)
end
end
assert(cost, "budget_cap directive: :budget_cap [max/<integer>]")
budget = cost
elseif token == "use_budget" then
use_budget = line:match("^:use_budget +(.+)")
assert(use_budget == "true" or use_budget == "false" or use_budget == "default",
"use_budget directive: :use_budget [true/false/default]")
else
assert(false, "Unrecognized directive :" .. token)
end
else
line = line
:gsub(TOKEN.identifier.pattern .. ":", function(name)
assert(not variables[name] or labelCache[name], "variable/label already exists: " .. name)
variables[name] = {name = name, scope = "local", type = "int", label = 0}
table.insert(labelCache, name)
return ""
end)
:gsub("^%s+", ""):gsub("%s+$", "")
if not is_empty(line) then
assert(not isImport,
"Imported files can't produce output, they must only contain variable and macro declarations")
table.insert(lines, {text = line, num = line_number, label = labelCache})
labelCache = {}
end
end
::continue::
end
-- anything left in the label cache points to the end of the script
for _, label in ipairs (labelCache) do
variables[label].label = 99
end
return lines
end
import("__stdlib__", STDLIB, true)
local lines = import(name, input, false)
for _, line in ipairs (lines) do
line_number = line.num
local node = cache(line.text, variables)
if node and node.func then
if node.func.ret == "void" then
table.insert(actions, node)
if #(line.label) > 0 then
for _, label in ipairs (line.label) do
variables[label].label = #actions
end
end
else
assert(#(line.label) == 0, "labels cannot be placed before impulses/conditions")
if node.func.ret == "impulse" then
table.insert(impulses, node)
else
table.insert(conditions, node)
end
end
end
end
local function ins(frmt, val)
ret[#ret+1] = string.pack(frmt, val)
end
local function prefix_code(size)
while size >= 0x80 do
ret[#ret+1] = string.pack("B", 0x80 + (size & 0x7F))
size = size >> 7
end
ret[#ret+1] = string.pack("B", size)
end
local function encode(node)
if node.func then
if node.func.name == "label" then
local var = node.args[1].value
assert(variables[var], "why are you calling the label function manually?")
encode{type = "number", value = variables[var].label}
return
end
prefix_code(#node.func.name)
ret[#ret+1] = node.func.name;
for _, arg in ipairs (node.args) do
encode(arg)
end
else
ins("s1", "constant")
if node.type == "bool" then
ins("b", 1)
ins("b", node.value and 1 or 0)
elseif node.type == "number" then
if math.type(node.value) == "integer" then
ins("b", 2)
ins("i4", node.value)
else
ins("b", 3)
ins("d", node.value)
end
elseif node.type == "string" then
ins("b", 4)
prefix_code(#node.value);
ret[#ret+1] = node.value
elseif node.type == "vector" then
ins("b", 5)
ins("f", node.x)
ins("f", node.y)
elseif node.type == "operator" then
ins("b", 4)
if node.value == "%" then
node.value = "mod"
elseif node.value == "^" then
node.value = "pow"
elseif node.value == "//" then
node.value = "log"
end
ins("s1", node.value)
else
assert(false, "BUG REPORT: unknown compile type: " .. node.type)
end
end
end
local gsub = string.gsub
local function json_encode(node)
local current_pos = #ret
encode(node)
for i = current_pos+1, #ret do
-- Need to JSON-escape control characters, backslash and double-quote,
-- and also UTF-8 encode high-byte chars
ret[i] = gsub(ret[i], '[\0-\x1f\\"\x80-\xff]', line_encode_table)
end
end
local function json_escape(str)
ret[#ret+1] = gsub(str, '[\0-\x1f\\"]', json_escape_table)
end
local package_name, script_name = compile_file:match("([^:]*):(.*)")
if not script_name then
script_name = compile_file
end
if options.format ~= "v2" then
prefix_code(#compile_file)
ret[#ret+1] = compile_file
for _, tbl in ipairs {impulses, conditions, actions} do
ins("i4", #tbl)
for _, line in ipairs (tbl) do
encode(line)
end
end
ret = base64.encode(table.concat(ret))
else
for num, pair in ipairs({
{name="actions", tbl=actions},
{name="conditions", tbl=conditions},
{name="impulses", tbl=impulses}
}) do
ret[#ret+1] = num == 1 and [[{"]] or [[],"]]
ret[#ret+1] = pair.name
ret[#ret+1] = [[":[]]
for num, line in ipairs(pair.tbl) do
if num ~= 1 then
ret[#ret+1] = [[,]]
end
ret[#ret+1] = [["]]
if pair.name == "impulses" then
ret[#ret+1] = line.func.name -- Impulses are no-arg functions with straight ASCII names
else
json_encode(line)
end
ret[#ret+1] = [["]]
end
end
ret[#ret+1] = [[],"name":"]]
json_escape(script_name)
ret[#ret+1] = [[","package":"]]
json_escape(package_name or "")
ret[#ret+1] = [["]]
if budget then
ret[#ret+1] = [[,"budget":]]
-- No quotes because budget is a number in the JSON
ret[#ret+1] = budget == "max" and "-1" or string.format("%d", budget)
end
if use_budget ~= "default" and (use_budget or budget) then
ret[#ret+1] = [[,"useBudget":]]
-- No quotes because useBudget is a boolean in the JSON
ret[#ret+1] = use_budget or "true"
end
ret[#ret+1] = [[}]]
ret = table.concat(ret)
end
package_name = package_name and package_name:sub(1, 24) .. ":" or ""
script_name = script_name:sub(1, 24)
return {
name = package_name .. script_name,
type = "script",
impulses = #impulses,
conditions = #conditions,
actions = #actions,
code = ret,
}
end
function import(input)
local data
local pos = 1
local variables = {}
local num_vars = 0
local ret = {}
local function read(frmt)
local ret, new = string.unpack(frmt, data, pos)
pos = new
return ret
end
local function stripParens(text)
text = tostring(text)
if text:byte() == 40 and text:byte(-1) == 41 then -- "(" + ")"
text = text:sub(2, -2)
end
return text
end
local function parse()
local func = read"s1"
if func == "constant" then
local type = read"b"
if type == 1 then
return read"b" == 1 and "true" or "false"
elseif type == 2 then
return tostring(read"i4")
elseif type == 3 then
local val = read"d"
if val == 1/0 then return "(1./0.)" end
if val == -1/0 then return "(-1./0.)" end
if val ~= val then return "(0./0.)" end
return tostring(val)
elseif type == 4 then
local pos, len = 0, 0
repeat
local byte = read"B"
len = len + ((byte & 0x7F) << 7*pos)
pos = pos + 1
until byte & 0x80 == 0
local str = read("c" .. len)
local sq, dq = str:match"'", str:match'"'
if not dq then
return '"' .. str .. '"'
elseif dq and not sq then
return "'" .. str .. "'"
end
str = string.format('"%s"', str:gsub('"', [[" . '"' . "]])):gsub('"" %.', ""):gsub('%. ""', "")
return str
elseif type == 5 then
return string.format("vec(%s, %s)", read"f", read"f")
else
assert(false, "BUG REPORT: unknown constant type: " .. type)
end
else
local func = assert(FUNCTION[func], "BUG REPORT: unknown function: " .. func)
local args = {}
local dynamicOperator = false
for i, arg in ipairs (func.args) do
args[#args+1] = parse()
if arg.type:match"^op_" then
dynamicOperator = true
if args[i]:byte() == 34 then -- '"'
local transformed = args[i]:sub(2, -2)
:gsub("^=$", "==")
:gsub("mod", "%%")
:gsub("pow", "^")
:gsub("log", "//")
if OPERATOR[transformed] then
args[i] = transformed
dynamicOperator = false
end
end
end
end
local scope, type, func_name = func.name:match"(%a+)%.(%w+)%.(%a+)"
if (scope == "global" or scope == "local") and args[1]:byte() == 34 then
local var = args[1]:sub(2,-2)
if var == var:match(TOKEN.identifier.pattern) then
if type == "vec2" then
type = "vector"
end
if not variables[var] then
local key = string.format(":%s %s %s", scope, type, var)
variables[var] = key
num_vars = num_vars + 1
end
return func_name == "set" and string.format("%s = %s", var, stripParens(args[2])) or var
end
elseif not dynamicOperator and (func.name:sub(1,10) == "arithmetic" or func.name:sub(1,10) == "comparison") then
return string.format("(%s)", table.concat(args, " "))
elseif func.name == "concat" then
return string.format("(%s . %s)", table.unpack(args))
end
local type, func_name = func.name:match"(%a+)%.(%a+)"; -- rnd, min, max
local func_short = func.short;
if func.name:match"^ternary" then
func_short = "if"
elseif (type == "int" or type == "double") and (func_name == "rnd" or func_name == "min" or func_name == "max") then
func_short = func_name
end
for k, v in ipairs (args) do
args[k] = stripParens(v)
end
return string.format("%s(%s)", func_short, table.concat(args, ", "))
end
end
local function ins(val)
local text = stripParens(val)
ret[#ret+1] = text
end
local function oldFormat()
data = base64.decode(input)
local name = read"s1"
for i = 1, 3 do
local sz = read"I4"
assert(sz >= 0, string.format("Bad import: Section %d had negative count %d", i, sz))
for j = 1, sz do
ins(parse())
end
ins""
end
assert(pos - 1 == #data, string.format("Bad import: Extra characters after parsing from %d-%d (%s)", pos - 1, #data, string.sub(data, pos)))
table.insert(ret, 1, "")
for _, var in pairs (variables) do
table.insert(ret, 1, var)
end
return name
end
local function modernFormat()
local script_name = input.name
local package_name = input.package
-- Split packages make our life harder. We need to prefix the script with ":" if it contains a
-- ":" but otherwise has no package. Note that if the *package* contains a ":", this will be
-- lost in translation.
local name = (package_name and package_name ~= "") and
(package_name .. ":" .. script_name) or
(script_name:find(":", 1, true) and ":" or "") .. script_name
ret[1] = ":name " .. name
-- This complicated set of conditions supports the following goals:
-- If useBudget is false or missing *and* budget is 0 or missing, don't include any directives.
-- (This is the default/compatibility case for old scripts.)
-- The export will only match the import if both directives were missing, but this is deemed
-- acceptable, since we don't want to clutter scripts up with irrelevant junk for this common case.
-- The default values are false/0, so functionally it comes out the same.
-- If useBudget is true, we must include something. Generally it is the budget cap, but in the special case
-- of a missing budget, we set :use_budget instead so the export matches the import.
-- If budget is positive, we set the directives so the export will match the import.
if input.budget and (input.budget ~= 0 or input.useBudget) then
ret[#ret+1] = ":budget_cap " .. (input.budget == -1 and "max" or string.format("%d", input.budget))
end
if not input.useBudget and input.budget and input.budget ~= 0 then
ret[#ret+1] = ":use_budget " .. (input.useBudget == nil and "default" or "false")
end
if input.useBudget and input.budget == nil then
ret[#ret+1] = ":use_budget true"
end
ins""
local variable_slot = #ret
for i, tbl in ipairs({input.impulses, input.conditions, input.actions}) do
for _, line in ipairs(tbl) do
if i == 1 then
ins(line .. "()") -- Impulses are straight ASCII
else
-- High-bit chars are UTF8-encoded, have to undo that
data = line:gsub("[\xC2\xC3].", utf_decode_table)
pos = 1
ins(parse())
if pos - 1 ~= #data then
error(string.format("Bad import: Extra characters after parsing from %d-%d (%s)", pos - 1, #data, string.sub(data, pos)))
end
end
end
ins""
end
local shift_amount = num_vars + 1
for i = #ret, variable_slot, -1 do
ret[i + shift_amount] = ret[i]
end
ret[variable_slot] = ""
for _, var in pairs (variables) do
variable_slot = variable_slot + 1
ret[variable_slot] = var
end
return name
end
local name = type(input) == "string" and oldFormat() or modernFormat()
ret = table.concat(ret, "\n"):gsub("\n\n+", "\n\n"):gsub("^\n+", ""):gsub("\n+$", "")
return {name, ret}
end
function unittest()
local import_tests = {
"C2dsb2JhbF90aWVyAQAAAAVrZXkuMQAAAAABAAAADmdsb2JhbC5pbnQuc2V0CGNvbnN0YW50BAR0aWVyDmFyaXRobWV0aWMuaW50DmFyaXRobWV0aWMuaW50Dmdsb2JhbC5pbnQuZ2V0CGNvbnN0YW50BAR0aWVyCGNvbnN0Y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whjb25zdGFudAQGYXJjYWRlCGNvbnN0YW50AQEQdG93bi53aW5kb3cuc2hvdwhjb25zdGFudAQGbXVzZXVtCGNvbnN0YW50AQEQdG93bi53aW5kb3cuc2hvdwhjb25zdGFudAQMaGVhZHF1YXJ0ZXJzCGNvbnN0YW50AQEQdG93bi53aW5kb3cuc2hvdwhjb25zdGFudAQQY29uc3RydWN0aW9uZmlybQhjb25zdGFudAEBEHRvd24ud2luZG93LnNob3cIY29uc3RhbnQEDXN0YXR1ZW9mY3Vib3MIY29uc3RhbnQBARB0b3duLndpbmRvdy5zaG93CGNvbnN0YW50BARtaW5lCGNvbnN0YW50AQE=",
"BFRlc3QAAAAAAAAAAAEAAAAQbG9jYWwuZG91YmxlLnNldAhjb25zdGFudAQBaQhjb25zdGFudAMzp6jVI/ZJOQ==",
"BHRlc3QAAAAAAAAAAAEAAAAMZ2VuZXJpYy53YWl0CGNvbnN0YW50AwAAAAAAAPB/",
"BHRlc3QAAAAAAAAAAAEAAAAMZ2VuZXJpYy53YWl0CGNvbnN0YW50AwAAAAAAAPD/",
"BHRlc3QAAAAAAAAAAAEAAAAMZ2VuZXJpYy53YWl0CGNvbnN0YW50AwAAAAAAAPj/",
"BHRlc3QAAAAAAAAAAAEAAAAMZ2VuZXJpYy53YWl0EWFyaXRobWV0aWMuZG91YmxlCGNvbnN0YW50AwAAAAAAAAAACGNvbnN0YW50BAR0ZXN0CGNvbnN0YW50AwAAAAAAAAAA",
}
local compile_tests = {macro_test = {[[
; Basic test of macros and macro functions
#concat(a, b) {a}{b}
#concat2(a, b) {lua(return [=[{a}]=] .. [=[{b}]=])}
:global string res
res = "{concat(1,2)}{co{concat2(ncat,)}(3,4")}
]], "Cm1hY3JvX3Rlc3QAAAAAAAAAAAEAAAARZ2xvYmFsLnN0cmluZy5zZXQIY29uc3RhbnQEA3Jlcwhjb25zdGFudAQEMTIzNA=="},
imported = {[[
; This should compile to (almost) no code
:local int acc
:global string status
#output status = "Number is: " . acc
]], "CGltcG9ydGVkAAAAAAAAAAAAAAAA"},
import_test = {[[
:import imported
:import imported
{output}
]], "C2ltcG9ydF90ZXN0AAAAAAAAAAABAAAAEWdsb2JhbC5zdHJpbmcuc2V0CGNvbnN0YW50BAZzdGF0dXMGY29uY2F0CGNvbnN0YW50BAtOdW1iZXIgaXM6IANpMnMNbG9jYWwuaW50LmdldAhjb25zdGFudAQDYWNj"},
folding_test = {[[
:global string test
test = 1.."a"
test = 1 ."a"
test = 1 .""
test = "a".1.
test = "a".1
test = "".1
]], "DGZvbGRpbmdfdGVzdAAAAAAAAAAABgAAABFnbG9iYWwuc3RyaW5nLnNldAhjb25zdGFudAQEdGVzdAhjb25zdGFudAQEMS4wYRFnbG9iYWwuc3RyaW5nLnNldAhjb25zdGFudAQEdGVzdAhjb25zdGFudAQCMWERZ2xvYmFsLnN0cmluZy5zZXQIY29uc3RhbnQEBHRlc3QIY29uc3RhbnQEATERZ2xvYmFsLnN0cmluZy5zZXQIY29uc3RhbnQEBHRlc3QIY29uc3RhbnQEBGExLjARZ2xvYmFsLnN0cmluZy5zZXQIY29uc3RhbnQEBHRlc3QIY29uc3RhbnQEAmExEWdsb2JhbC5zdHJpbmcuc2V0CGNvbnN0YW50BAR0ZXN0CGNvbnN0YW50BAEx"},
lowercase_test = {[[
software.toggle("software.criticalWavejump", true)
craft("producer.constructionFirm", 1, 1.)
]], "Dmxvd2VyY2FzZV90ZXN0AAAAAAAAAAACAAAAD3NvZnR3YXJlLnRvZ2dsZQhjb25zdGFudAQZc29mdHdhcmUuY3JpdGljYWxXYXZlanVtcAhjb25zdGFudAEBDWZhY3RvcnkuY3JhZnQIY29uc3RhbnQEGXByb2R1Y2VyLmNvbnN0cnVjdGlvbkZpcm0IY29uc3RhbnQCAQAAAAhjb25zdGFudAMAAAAAAADwPw=="},
}
local new_import_tests = {
default_default = {{actions={}, conditions={}, impulses={}, name="test", package=""}, [[
:name test]], [[
{"actions":[],"conditions":[],"impulses":[],"name":"test","package":""}]]},
default_0 = {{budget=0, actions={}, conditions={}, impulses={}, name="test", package=""}, [[
:name test]], [[
{"actions":[],"conditions":[],"impulses":[],"name":"test","package":""}]]},
default_1 = {{budget=1, actions={}, conditions={}, impulses={}, name="test", package=""}, [[
:name test
:budget_cap 1
:use_budget default]], [[
{"actions":[],"conditions":[],"impulses":[],"name":"test","package":"","budget":1}]]},
false_default = {{useBudget=false, actions={}, conditions={}, impulses={}, name="test", package=""}, [[
:name test]], [[
{"actions":[],"conditions":[],"impulses":[],"name":"test","package":""}]]},
false_0 = {{useBudget=false, budget=0, actions={}, conditions={}, impulses={}, name="test", package=""}, [[
:name test]], [[
{"actions":[],"conditions":[],"impulses":[],"name":"test","package":""}]]},
false_1 = {{useBudget=false, budget=1, actions={}, conditions={}, impulses={}, name="test", package=""}, [[
:name test
:budget_cap 1
:use_budget false]], [[
{"actions":[],"conditions":[],"impulses":[],"name":"test","package":"","budget":1,"useBudget":false}]]},
true_default = {{useBudget=true, actions={}, conditions={}, impulses={}, name="test", package=""}, [[
:name test
:use_budget true]], [[
{"actions":[],"conditions":[],"impulses":[],"name":"test","package":"","useBudget":true}]]},
true_0 = {{useBudget=true, budget=0, actions={}, conditions={}, impulses={}, name="test", package=""}, [[
:name test
:budget_cap 0]], [[
{"actions":[],"conditions":[],"impulses":[],"name":"test","package":"","budget":0,"useBudget":true}]]},
true_1 = {{useBudget=true, budget=1, actions={}, conditions={}, impulses={}, name="test", package=""}, [[
:name test
:budget_cap 1]], [[
{"actions":[],"conditions":[],"impulses":[],"name":"test","package":"","budget":1,"useBudget":true}]]},
high_bytes = {{actions={"\x11global.double.set\bconstant\x04\x03foo\bconstant\x03ÍÌÌÌÌÌô?"}, conditions={}, impulses={}, name="test", package=""}, [[
:name test
:global double foo
foo = 1.3]], [[
{"actions":["\u0011global.double.set\bconstant\u0004\u0003foo\bconstant\u0003ÍÌÌÌÌÌô?"],"conditions":[],"impulses":[],"name":"test","package":""}]]},
}
local status, ret
local function importFunc(name)
local v = compile_tests[name]
if v then
return true, v[1]
end
return false, (name .. " not found")
end
for k, v in pairs(compile_tests) do
status, ret = pcall(compile, k, v[1], {format="v0"}, importFunc)
assert(status, string.format("Failed to compile unit test %s at line %d\n\n%s", k, line_number, ret))
assert(ret.code == v[2], string.format("Unit test %s failure! Expected:\n%s\nActual:\n%s", k, v[2], ret.code))
end
for k, v in pairs(new_import_tests) do
status, ret = pcall(import, v[1])
assert(status, string.format("Failed to import unit test %s\n\n%s", k, ret))
assert(ret[2] == v[2], string.format("Unit test %s import failure! Expected:\n%s\nActual:\n%s", k, v[2], ret[2]))
status, ret = pcall(compile, ret[1], ret[2], {format="v2"}, importFunc)
assert(status, string.format("Failed to compile unit test %s\n\n%s", k, ret))
assert(ret.code == v[3], string.format("Unit test %s compile failure! Expected:\n%s\nActual:\n%s", k, v[3], ret.code))
end
for k, v in ipairs (import_tests) do
status, ret = pcall(import, v)
assert(status, string.format("Failed to import unit test #%s\n\n%s", k, ret))
status, ret = pcall(compile, ret[1], ret[2], {format="v0"}, importFunc)
assert(status, string.format("Failed to compile unit test #%s\n\n%s", k, ret))
v = ret.code
status, ret = pcall(import, v)
assert(status, string.format("Failed to re-import unit test #%s\n\n%s", k, ret))
status, ret = pcall(compile, ret[1], ret[2], {format="v0"}, nil)
assert(status, string.format("Failed to re-compile unit test #%s\n\n%s", k, ret))
assert(ret.code == v, string.format("Failed to match unit test #%s\n\n%s\n\n%s\n\n%s\n\n%s", k, v, ret.code, base64.decode(v), base64.decode(ret.code)))
end
return true
end