mirror of
https://github.com/ilyakooo0/luau.git
synced 2024-10-03 21:48:26 +03:00
Added hex ints
This commit is contained in:
parent
019aeb2d86
commit
c0191b63dd
@ -2,3 +2,4 @@
|
||||
|
||||
- [ ] functioncall
|
||||
- [ ] any string apart from the basic string with no escapes
|
||||
- [ ] check if int fits in int or make it a float
|
||||
|
@ -310,7 +310,7 @@
|
||||
::
|
||||
+$ numeral
|
||||
$%
|
||||
[%int @s]
|
||||
[%int @u]
|
||||
:: [%float @rd]
|
||||
==
|
||||
++ parse-numeral
|
||||
@ -318,10 +318,14 @@
|
||||
|.
|
||||
;~ pose
|
||||
%+ cook
|
||||
|= [is-neg=(unit *) x=@]
|
||||
[%int (new:si ?=(~ is-neg) x)]
|
||||
;~ plug
|
||||
(punt (just '-'))
|
||||
|= x=@u [%int x]
|
||||
;~ pose
|
||||
;~ pfix
|
||||
(just '0')
|
||||
(mask "xX")
|
||||
hex
|
||||
==
|
||||
::
|
||||
(bass 10 (plus dit))
|
||||
==
|
||||
==
|
||||
@ -329,7 +333,7 @@
|
||||
|= [num=numeral]
|
||||
^- tape
|
||||
?- -.num
|
||||
%int (show-s +.num)
|
||||
%int (show-u +.num)
|
||||
==
|
||||
:: exprlist
|
||||
::
|
||||
@ -524,6 +528,8 @@
|
||||
;~(plug name-fst-char (star name-char))
|
||||
++ show-s
|
||||
|=(s=@s `tape`[?:((syn:si s) %$ '-') (slag 2 (scow %ui (abs:si s)))])
|
||||
++ show-u
|
||||
|=(u=@u `tape`(slag 2 (scow %ui u)))
|
||||
++ bind
|
||||
|* =mold
|
||||
|* [prev=rule cont=$-(mold rule)]
|
||||
|
Loading…
Reference in New Issue
Block a user