mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-01 03:23:09 +03:00
Do fast special cases for +slaw instead of always calling +slay.
+slay is a giant, recursive, slow parser combinator. +slaw is called on every beam handling. In actual usage, we can special case based on the passed in type and use a much smaller parser.
This commit is contained in:
parent
5da58f862c
commit
770025c155
@ -5944,8 +5944,24 @@
|
||||
~/ %slaw
|
||||
|= {mod/@tas txt/@ta}
|
||||
^- (unit @)
|
||||
=+ con=(slay txt)
|
||||
?.(&(?=({~ $$ @ @} con) =(p.p.u.con mod)) ~ [~ q.p.u.con])
|
||||
?+ mod
|
||||
:: slow fallback case to the full slay
|
||||
::
|
||||
=+ con=(slay txt)
|
||||
?.(&(?=({~ $$ @ @} con) =(p.p.u.con mod)) ~ [~ q.p.u.con])
|
||||
::
|
||||
%p
|
||||
(rust (trip txt) ;~(pfix sig fed:ag))
|
||||
::
|
||||
%ud
|
||||
(rust (trip txt) dem:ag)
|
||||
::
|
||||
%ux
|
||||
(rust (trip txt) ;~(pfix (jest '0x') hex:ag))
|
||||
::
|
||||
%tas
|
||||
(rust (trip txt) sym)
|
||||
==
|
||||
::
|
||||
++ slay
|
||||
|= txt/@ta ^- (unit coin)
|
||||
|
Loading…
Reference in New Issue
Block a user