fix parser binding order

This commit is contained in:
2026-05-16 20:16:10 -06:00
parent c58077e65a
commit 11bfd20e5d
2 changed files with 3 additions and 3 deletions

View File

@@ -52,8 +52,8 @@ parseSexps f = marshal . SexpLoc.parseSexps f . view lazy . encodeUtf8
nonEmptyGrammar :: Grammar p (NonEmpty x :- t) (List x :- x :- t) nonEmptyGrammar :: Grammar p (NonEmpty x :- t) (List x :- x :- t)
nonEmptyGrammar = IGB.Iso nonEmptyGrammar = IGB.Iso
(\((x:|xs) :- t) -> xs :- x :- t) (\((x:|xs) :- t) -> reverse xs :- x :- t)
(\(xs :- x :- t) -> (x:|xs) :- t) (\(xs :- x :- t) -> (x :| reverse xs) :- t)
nonempty :: SexpGrammar a -> SexpGrammar (NonEmpty a) nonempty :: SexpGrammar a -> SexpGrammar (NonEmpty a)
nonempty a = nonempty a =

View File

@@ -1,4 +1,4 @@
;;; -*- mode:scheme -*- ;;; -*- mode:scheme -*-
(let ((x0 (prim:cons 4 2)) (x3 (prim:write x2)) (x2 (prim:* 3 x1)) (x1 (prim:cdr x0))) x3) (let ((x0 (prim:cons 4 2)) (x1 (prim:cdr x0)) (x2 (prim:* 3 x1)) (x3 (prim:write x2))) x3)