mirror of
https://github.com/ilyakooo0/luau.git
synced 2024-10-03 21:48:26 +03:00
Compare commits
2 Commits
1bea1efb8f
...
9054a6736b
Author | SHA1 | Date | |
---|---|---|---|
9054a6736b | |||
381302386b |
@ -319,7 +319,10 @@
|
||||
;~ pose
|
||||
%+ cook
|
||||
|= x=@rd [%float x]
|
||||
parse-float
|
||||
;~ pose
|
||||
parse-float
|
||||
parse-hex-float
|
||||
==
|
||||
::
|
||||
%+ cook
|
||||
|= x=@u [%int x]
|
||||
@ -461,6 +464,7 @@
|
||||
$%
|
||||
[%blok blok]
|
||||
[%asmnt varlist exprlist]
|
||||
[%label label]
|
||||
[%empty ~]
|
||||
==
|
||||
++ parse-stat
|
||||
@ -469,6 +473,10 @@
|
||||
;~ pose
|
||||
(cold [%empty ~] (just ';'))
|
||||
::
|
||||
%+ cook
|
||||
|= =label [%label label]
|
||||
parse-label
|
||||
::
|
||||
%+ cook
|
||||
|=([* =blok *] [%blok blok])
|
||||
;~ (glue wss)
|
||||
@ -498,6 +506,29 @@
|
||||
"="
|
||||
(commaed (turn +>.stat print-expr))
|
||||
==
|
||||
%label (print-label +.stat)
|
||||
==
|
||||
:: label
|
||||
::
|
||||
+$ label name
|
||||
++ print-label
|
||||
|= =label
|
||||
^- tape
|
||||
%- zing
|
||||
:~
|
||||
"::"
|
||||
(trip label)
|
||||
"::"
|
||||
==
|
||||
++ parse-label
|
||||
%+ knee *label
|
||||
|.
|
||||
%+ cook
|
||||
|= [* =label *] label
|
||||
;~ (glue ws)
|
||||
(jest '::')
|
||||
parse-name
|
||||
(jest '::')
|
||||
==
|
||||
:: Blok
|
||||
::
|
||||
@ -585,6 +616,52 @@
|
||||
==
|
||||
==
|
||||
==
|
||||
++ parse-hex-float
|
||||
%+ knee *@rd
|
||||
|.
|
||||
=<
|
||||
%+ sear
|
||||
|= [* * int=tape frac=(unit tape) exp=(unit [exp-sign=? exp=@])]
|
||||
?: ?=([~ ~] [frac exp]) ~
|
||||
%- some
|
||||
=/ frac (fall frac "")
|
||||
=/ whole=@rd (sun:rd (scan (weld int frac) hex))
|
||||
=/ frac-exp=@rd (sun:rd (pow 16 (lent frac)))
|
||||
=/ without-exp (div:rd whole frac-exp)
|
||||
?~ exp without-exp
|
||||
=/ exp-exp (sun:rd (pow 2 exp.u.exp))
|
||||
?: exp-sign.u.exp
|
||||
(mul:rd without-exp exp-exp)
|
||||
(div:rd without-exp exp-exp)
|
||||
;~ plug
|
||||
(just '0')
|
||||
::
|
||||
(mask "xX")
|
||||
::
|
||||
(plus hex-digit)
|
||||
::
|
||||
%- punt
|
||||
;~ pfix
|
||||
dot
|
||||
(plus hex-digit)
|
||||
==
|
||||
::
|
||||
%- punt
|
||||
;~ pfix
|
||||
(mask "pP")
|
||||
;~(plug ;~(pose (cold | hep) (cold & lus) (easy &)) dim:ag)
|
||||
==
|
||||
==
|
||||
|%
|
||||
++ hex-digit
|
||||
%+ knee *char
|
||||
|.
|
||||
;~ pose
|
||||
(shim '0' '9')
|
||||
(shim 'a' 'f')
|
||||
(shim 'A' 'F')
|
||||
==
|
||||
--
|
||||
++ show-float
|
||||
|= x=@rd
|
||||
^- tape
|
||||
|
@ -37,8 +37,10 @@ test_cases = {
|
||||
{ 0x800000000000, "1.4073748835533e+14" },
|
||||
{ 140737488355328, "1.4073748835533e+14" },
|
||||
}
|
||||
|
||||
::
|
||||
helli
|
||||
::
|
||||
foo = {
|
||||
3.0, 3.1416, 314.16e-2, 0.31416E1, 34e1,
|
||||
0x0.1E, 0xA23p-4, 0X1.921FB54442D18P+1
|
||||
0x0.1E, 0xA23p-4, 0xA23p-4, 0X1.921FB54442D18P+1, 0x1.fp10
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user