on master help sign in
Accept tabs
019aeb2iko
zod/luau/TODO.md+1
@@ -1,3 +1,4 @@
1# Parser
1# Parser
2
2
3- [ ] functioncall
3- [ ] functioncall
4+- [ ] any string apart from the basic string with no escapes
zod/luau/lib/lua.hoon+24−13
@@ -18,7 +18,7 @@
18++ apex
18++ apex
19 %+ knee *ast
19 %+ knee *ast
20 |.
20 |.
21− %+ ifix [gaw gaw]
21+ %+ ifix [ws ws]
22 ;~ pose
22 ;~ pose
23 (cook |=(=blok [%blok blok]) parse-blok)
23 (cook |=(=blok [%blok blok]) parse-blok)
24 ==
24 ==
@@ -151,7 +151,7 @@
151 |.
151 |.
152 %+ cook
152 %+ cook
153 |=([* =table *] table)
153 |=([* =table *] table)
154− ;~ (glue gaw)
154+ ;~ (glue ws)
155 (just '{')
155 (just '{')
156 parse-field-list
156 parse-field-list
157 (just '}')
157 (just '}')
@@ -177,8 +177,8 @@
177 --
177 --
178 %+ cook
178 %+ cook
179 |=([=field-list *] field-list)
179 |=([=field-list *] field-list)
180− ;~ (glue gaw)
180+ ;~ (glue ws)
181− (more (ifix [gaw gaw] field-sep) parse-field)
181+ (more (ifix [ws ws] field-sep) parse-field)
182 (punt field-sep)
182 (punt field-sep)
183 ==
183 ==
184:: field
184:: field
@@ -209,7 +209,7 @@
209 ;~ pose
209 ;~ pose
210 %+ cook
210 %+ cook
211 |=([* key=expr * * val=expr] [%keyed key val])
211 |=([* key=expr * * val=expr] [%keyed key val])
212− ;~ (glue gaw)
212+ ;~ (glue ws)
213 (just '[')
213 (just '[')
214 parse-expr
214 parse-expr
215 (just ']')
215 (just ']')
@@ -219,7 +219,7 @@
219 ::
219 ::
220 %+ cook
220 %+ cook
221 |=([=name * =expr] [%keyed [%string name] expr])
221 |=([=name * =expr] [%keyed [%string name] expr])
222− ;~ (glue gaw)
222+ ;~ (glue ws)
223 parse-name
223 parse-name
224 tis
224 tis
225 parse-expr
225 parse-expr
@@ -341,7 +341,7 @@
341++ parse-exprlist
341++ parse-exprlist
342 %+ knee *exprlist
342 %+ knee *exprlist
343 |.
343 |.
344− %+ most (ifix [gaw gaw] com) parse-expr
344+ %+ most (ifix [ws ws] com) parse-expr
345:: Var
345:: Var
346::
346::
347+$ var
347+$ var
@@ -380,7 +380,7 @@
380 |= =prefix-expr
380 |= =prefix-expr
381 %+ cook
381 %+ cook
382 |=([* =expr *] [%indexed prefix-expr expr])
382 |=([* =expr *] [%indexed prefix-expr expr])
383− ;~ (glue gaw)
383+ ;~ (glue ws)
384 (just '[')
384 (just '[')
385 parse-expr
385 parse-expr
386 (just ']')
386 (just ']')
@@ -418,7 +418,7 @@
418++ parse-varlist
418++ parse-varlist
419 %+ knee *varlist
419 %+ knee *varlist
420 |.
420 |.
421− %+ most (ifix [gaw gaw] com) parse-var
421+ %+ most (ifix [ws ws] com) parse-var
422:: Prefix Expr
422:: Prefix Expr
423::
423::
424+$ prefix-expr
424+$ prefix-expr
@@ -462,7 +462,7 @@
462 ::
462 ::
463 %+ cook
463 %+ cook
464 |=([* =blok *] [%blok blok])
464 |=([* =blok *] [%blok blok])
465− ;~ (glue gawn)
465+ ;~ (glue wss)
466 (jest 'do')
466 (jest 'do')
467 (knee *blok |.(parse-blok))
467 (knee *blok |.(parse-blok))
468 (jest 'end')
468 (jest 'end')
@@ -470,7 +470,7 @@
470 ::
470 ::
471 %+ cook
471 %+ cook
472 |=([=varlist * =exprlist] [%asmnt varlist exprlist])
472 |=([=varlist * =exprlist] [%asmnt varlist exprlist])
473− ;~ (glue gaw)
473+ ;~ (glue ws)
474 parse-varlist
474 parse-varlist
475 (just '=')
475 (just '=')
476 parse-exprlist
476 parse-exprlist
@@ -502,7 +502,7 @@
502++ parse-blok
502++ parse-blok
503 %+ knee *blok
503 %+ knee *blok
504 |.
504 |.
505− (most gawn parse-stat)
505+ (most wss parse-stat)
506:: Helpers
506:: Helpers
507::
507::
508++ commaed
508++ commaed
@@ -510,7 +510,7 @@
510 ^- tape
510 ^- tape
511 %- zing
511 %- zing
512 %+ join "," l
512 %+ join "," l
513−++ gawn (cold ~ (plus ;~(pose vul gah)))
513+:: ++ gawn (cold ~ (plus ;~(pose vul gah)))
514++ parse-name
514++ parse-name
515 %+ knee *name
515 %+ knee *name
516 |.
516 |.
@@ -531,4 +531,15 @@
531 =/ prev-edge (prev nail)
531 =/ prev-edge (prev nail)
532 ?~ q.prev-edge prev-edge
532 ?~ q.prev-edge prev-edge
533 ((cont p.u.q.prev-edge) q.u.q.prev-edge)
533 ((cont p.u.q.prev-edge) q.u.q.prev-edge)
534+++ w
535+ ;~ pose
536+ gah
537+ (just '\09')
538+ ==
539+++ ws
540+ %+ cold ~
541+ %- star w
542+++ wss
543+ %+ cold ~
544+ %- plus w
534--
545--
zod/luau/tests/foo.lua+25
@@ -12,3 +12,28 @@ x = {[hello] = 8, hello = 12}
12
12
13;
13;
14
14
15+test_cases = {
16+ { 0x7fffffff, "2147483647" },
17+ { 2147483647, "2147483647" },
18+
19+ { 0xffffffff, "4294967295" },
20+ { 4294967295, "4294967295" },
21+
22+ { 0x7fffffffffffffff, "9.2233720368548e+18" },
23+ { 9223372036854775807, "9.2233720368548e+18" },
24+
25+ { 0xffffffffffffffff, "1.844674407371e+19" },
26+ { 18446744073709551615, "1.844674407371e+19" },
27+
28+ { 0x100000000, "4294967296" },
29+ { 4294967296, "4294967296" },
30+
31+ { 0x100000000000, "17592186044416" },
32+ { 17592186044416, "17592186044416" },
33+
34+ { 0x80000000, "2147483648" },
35+ { 2147483648, "2147483648" },
36+
37+ { 0x800000000000, "1.4073748835533e+14" },
38+ { 140737488355328, "1.4073748835533e+14" },
39+}