@@ -30,7 +30,12 @@
31 %restrict ~[+.flag]
31 %restrict ~[+.flag]
35+ ?: (has-flag %crash-parser)
36+ (some (scan src lua-parser))
37+ (rust src lua-parser)
33−;< bek=beak bind:m get-beak
38+ ;< bek=beak bind:m get-beak
34;< lua-files=(list path) bind:m (list-tree [bek /res/lua])
39;< lua-files=(list path) bind:m (list-tree [bek /res/lua])
35=/ lua-files %+ skim lua-files
40=/ lua-files %+ skim lua-files
@@ -51,10 +56,7 @@
51 ;< =cage bind:m (read-file [bek current-file])
56 ;< =cage bind:m (read-file [bek current-file])
52 =/ lua-code=@t (of-wain:format !<(wain +.cage))
57 =/ lua-code=@t (of-wain:format !<(wain +.cage))
53 ~& %parsing
58 ~& %parsing
54− =/ ast-unit
59+ =/ ast-unit (parse (trip lua-code))
55− ?: (has-flag %crash-parser)
56− (some (rash lua-code lua-parser))
57− (rush lua-code lua-parser)
58 ;< parse-result=test-result bind:m
60 ;< parse-result=test-result bind:m
59 =/ m (strand:spider ,test-result)
61 =/ m (strand:spider ,test-result)
60 ?~ ast-unit (pure:m %err)
62 ?~ ast-unit (pure:m %err)
@@ -68,13 +70,18 @@
68 %& [(into current-file 2 ~.cycled) %ins %lua !>((to-wain:format (crip printed)))]~
70 %& [(into current-file 2 ~.cycled) %ins %lua !>((to-wain:format (crip printed)))]~
70 ~& %parsing-printed
72 ~& %parsing-printed
71− =/ cycled-ast-unit
73+ =/ cycled-ast-unit (parse printed)
72− ?: (has-flag %crash-parser)
73− (some (scan printed lua-parser))
74− (rust printed lua-parser)
75 ?~ cycled-ast-unit (pure:m %err)
74 ?~ cycled-ast-unit (pure:m %err)
76 =/ ast u.cycled-ast-unit
75 =/ ast u.cycled-ast-unit
77 ~? (has-flag %print-asts) ast
76 ~? (has-flag %print-asts) ast
78+ =/ printed (lua-printer ast)
79+ ~& %comparing-printed
80+ ?. =(printed ^printed) (pure:m %err)
81+ ~& %parsing-reprinted
82+ =/ cycled-ast-unit (parse printed)
83+ ?~ cycled-ast-unit (pure:m %err)
84+ =/ ast u.cycled-ast-unit
78 ~& %comparing-asts
85 ~& %comparing-asts
79 ?. =(^ast ast) (pure:m %err)
86 ?. =(^ast ast) (pure:m %err)
80 (pure:m %ok)
87 (pure:m %ok)