Accept tabs

This commit is contained in:
iko 2024-05-15 19:02:45 +03:00
parent 8516d6ad50
commit 019aeb2d86
Signed by untrusted user: iko
GPG Key ID: 82C257048D1026F2
3 changed files with 50 additions and 13 deletions

View File

@ -1,3 +1,4 @@
# Parser # Parser
- [ ] functioncall - [ ] functioncall
- [ ] any string apart from the basic string with no escapes

View File

@ -18,7 +18,7 @@
++ apex ++ apex
%+ knee *ast %+ knee *ast
|. |.
%+ ifix [gaw gaw] %+ ifix [ws ws]
;~ pose ;~ pose
(cook |=(=blok [%blok blok]) parse-blok) (cook |=(=blok [%blok blok]) parse-blok)
== ==
@ -151,7 +151,7 @@
|. |.
%+ cook %+ cook
|=([* =table *] table) |=([* =table *] table)
;~ (glue gaw) ;~ (glue ws)
(just '{') (just '{')
parse-field-list parse-field-list
(just '}') (just '}')
@ -177,8 +177,8 @@
-- --
%+ cook %+ cook
|=([=field-list *] field-list) |=([=field-list *] field-list)
;~ (glue gaw) ;~ (glue ws)
(more (ifix [gaw gaw] field-sep) parse-field) (more (ifix [ws ws] field-sep) parse-field)
(punt field-sep) (punt field-sep)
== ==
:: field :: field
@ -209,7 +209,7 @@
;~ pose ;~ pose
%+ cook %+ cook
|=([* key=expr * * val=expr] [%keyed key val]) |=([* key=expr * * val=expr] [%keyed key val])
;~ (glue gaw) ;~ (glue ws)
(just '[') (just '[')
parse-expr parse-expr
(just ']') (just ']')
@ -219,7 +219,7 @@
:: ::
%+ cook %+ cook
|=([=name * =expr] [%keyed [%string name] expr]) |=([=name * =expr] [%keyed [%string name] expr])
;~ (glue gaw) ;~ (glue ws)
parse-name parse-name
tis tis
parse-expr parse-expr
@ -341,7 +341,7 @@
++ parse-exprlist ++ parse-exprlist
%+ knee *exprlist %+ knee *exprlist
|. |.
%+ most (ifix [gaw gaw] com) parse-expr %+ most (ifix [ws ws] com) parse-expr
:: Var :: Var
:: ::
+$ var +$ var
@ -380,7 +380,7 @@
|= =prefix-expr |= =prefix-expr
%+ cook %+ cook
|=([* =expr *] [%indexed prefix-expr expr]) |=([* =expr *] [%indexed prefix-expr expr])
;~ (glue gaw) ;~ (glue ws)
(just '[') (just '[')
parse-expr parse-expr
(just ']') (just ']')
@ -418,7 +418,7 @@
++ parse-varlist ++ parse-varlist
%+ knee *varlist %+ knee *varlist
|. |.
%+ most (ifix [gaw gaw] com) parse-var %+ most (ifix [ws ws] com) parse-var
:: Prefix Expr :: Prefix Expr
:: ::
+$ prefix-expr +$ prefix-expr
@ -462,7 +462,7 @@
:: ::
%+ cook %+ cook
|=([* =blok *] [%blok blok]) |=([* =blok *] [%blok blok])
;~ (glue gawn) ;~ (glue wss)
(jest 'do') (jest 'do')
(knee *blok |.(parse-blok)) (knee *blok |.(parse-blok))
(jest 'end') (jest 'end')
@ -470,7 +470,7 @@
:: ::
%+ cook %+ cook
|=([=varlist * =exprlist] [%asmnt varlist exprlist]) |=([=varlist * =exprlist] [%asmnt varlist exprlist])
;~ (glue gaw) ;~ (glue ws)
parse-varlist parse-varlist
(just '=') (just '=')
parse-exprlist parse-exprlist
@ -502,7 +502,7 @@
++ parse-blok ++ parse-blok
%+ knee *blok %+ knee *blok
|. |.
(most gawn parse-stat) (most wss parse-stat)
:: Helpers :: Helpers
:: ::
++ commaed ++ commaed
@ -510,7 +510,7 @@
^- tape ^- tape
%- zing %- zing
%+ join "," l %+ join "," l
++ gawn (cold ~ (plus ;~(pose vul gah))) :: ++ gawn (cold ~ (plus ;~(pose vul gah)))
++ parse-name ++ parse-name
%+ knee *name %+ knee *name
|. |.
@ -531,4 +531,15 @@
=/ prev-edge (prev nail) =/ prev-edge (prev nail)
?~ q.prev-edge prev-edge ?~ q.prev-edge prev-edge
((cont p.u.q.prev-edge) q.u.q.prev-edge) ((cont p.u.q.prev-edge) q.u.q.prev-edge)
++ w
;~ pose
gah
(just '\09')
==
++ ws
%+ cold ~
%- star w
++ wss
%+ cold ~
%- plus w
-- --

View File

@ -12,3 +12,28 @@ x = {[hello] = 8, hello = 12}
; ;
test_cases = {
{ 0x7fffffff, "2147483647" },
{ 2147483647, "2147483647" },
{ 0xffffffff, "4294967295" },
{ 4294967295, "4294967295" },
{ 0x7fffffffffffffff, "9.2233720368548e+18" },
{ 9223372036854775807, "9.2233720368548e+18" },
{ 0xffffffffffffffff, "1.844674407371e+19" },
{ 18446744073709551615, "1.844674407371e+19" },
{ 0x100000000, "4294967296" },
{ 4294967296, "4294967296" },
{ 0x100000000000, "17592186044416" },
{ 17592186044416, "17592186044416" },
{ 0x80000000, "2147483648" },
{ 2147483648, "2147483648" },
{ 0x800000000000, "1.4073748835533e+14" },
{ 140737488355328, "1.4073748835533e+14" },
}