@@ -5,8 +5,15 @@ apex
55|%
66++ apex
77 %^ tnee %apex ast
8− %+ ifix [ws ws]
9− ;~ pose
8+ ;~ pfix
9+ %- punt
10+ ;~ plug
11+ hax
12+ zap
13+ (star ;~(less (just '\0a') next))
14+ ==
15+ ::
16+ %+ ifix [ws ws]
1017 (cook |=(=blok [%blok blok]) parse-blok)
1118 ==
1219:: The expressions that are separated by binary operators
@@ -169,17 +176,17 @@ apex
169176 (cold %mod (jest '%'))
170177 (cold %band (jest '&'))
171178 (cold %bor (jest '|'))
172− (cold %bxor (jest '~'))
179+ (cold %eq (jest '=='))
173180 (cold %rshft (jest '>>'))
174181 (cold %lshft (jest '<<'))
182+ (cold %lteq (jest '<='))
183+ (cold %gteq (jest '>='))
184+ (cold %neq (jest '~='))
185+ (cold %bxor (jest '~'))
175186 (cold %and (jest 'and'))
176187 (cold %or (jest 'or'))
177188 (cold %lt (jest '<'))
178− (cold %lteq (jest '<='))
179− (cold %eq (jest '=='))
180189 (cold %gt (jest '>'))
181− (cold %gteq (jest '>='))
182− (cold %neq (jest '~='))
183190 (cold %concat (jest '..'))
184191 ==
185192++ parse-numeral
@@ -511,31 +518,41 @@ apex
511518++ parse-if
512519 %^ tnee %parse-if if
513520 %+ cook
514− |= [* cond=expr * body=blok elsa=(list [cond=expr body=blok]) else=(unit blok) *]
521+ |= [[* cond=expr * body=blok] elsa=(list [cond=expr body=blok]) else=(unit blok) *]
515522 [cond body elsa else]
516− ;~ (glue wss)
517− (jest 'if')
518− parse-expr
519− (jest 'then')
520− parse-blok
521− ::
522− %- star
523− %+ cook
524− |= [* cond=expr * body=blok] [cond body]
523+ ;~ plug
525524 ;~ (glue wss)
526− (jest 'elseif')
525+ (jest 'if')
527526 parse-expr
528527 (jest 'then')
529528 parse-blok
530529 ==
531530 ::
531+ %- star
532+ %+ cook
533+ |= [* cond=expr * body=blok] [cond body]
534+ ;~ pfix
535+ wss
536+ ;~ (glue wss)
537+ (jest 'elseif')
538+ parse-expr
539+ (jest 'then')
540+ parse-blok
541+ ==
542+ ==
543+ ::
532544 %- punt
533545 %+ cook
534546 |= [* =blok] blok
535− ;~ (glue wss)
536− (jest 'else')
537− parse-blok
547+ ;~ pfix
548+ wss
549+ ;~ (glue wss)
550+ (jest 'else')
551+ parse-blok
552+ ==
538553 ==
554+ ::
555+ wss
539556 (jest 'end')
540557 ==
541558++ parse-functioncall
@@ -601,19 +618,17 @@ apex
601618 |= ret=(unit ret) [stats ret]
602619 %- punt
603620 ;~ pfix
604− ?~ stats (easy ~) wss
621+ ?~ stats ws wss
605622 parse-ret
606623 ==
607624++ parse-ret
608625 %^ tnee %parse-ret ret
609626 %+ cook
610− |= [[* =exprlist] *] exprlist
627+ |= [* ret=(unit exprlist) *] ret
611628 ;~ plug
612− ;~ (glue wss)
613− (jest 'return')
614− parse-exprlist
615− ==
616− (punt (just ';'))
629+ (jest 'return')
630+ (punt ;~(pfix wss parse-exprlist))
631+ (punt ;~(plug ws (just ';')))
617632 ==
618633++ parse-name
619634 =>
@@ -630,8 +645,15 @@ apex
630645 =/ prev-edge (prev nail)
631646 ?~ q.prev-edge prev-edge
632647 ((cont p.u.q.prev-edge) q.u.q.prev-edge)
648+++ comment
649+ ;~ pfix
650+ (jest '--')
651+ (star ;~(less nl next))
652+ ==
653+++ nl (just '\0a')
633654++ w
634655 ;~ pose
656+ comment
635657 gah
636658 (just '\09')
637659 ==