instow

:)
git clone https://git.sr.ht/~ashymad/instow
Log | Files | Refs | LICENSE

commit d3ba5b139947d505ddeb7aa39a6dcd022d622ea1
parent 18606d53fc17e03de9f2e85c8ce29b8f8bbfadde
Author: Szymon Mikulicz <szymon.mikulicz@posteo.net>
Date:   Thu, 28 May 2026 22:53:52 +0200

Parsing quite well

Diffstat:
Msrc/mnt.janet | 16++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/src/mnt.janet b/src/mnt.janet @@ -12,11 +12,15 @@ :indent (lenprefix (backref :col) " ") :list (some (* :indent "-" :val (+ -1 (some "\n")))) :comment (some (* "#" (to (+ "\n" -1)) (? "\n"))) - :all (any (+ :comment :list :map)) - :map (some (unref (group (* :indent :key ":" (group (+ -1 (* :val (+ (some "\n") -1)) (* (some "\n") :increase :all))))) :col)) - :check_indent (+ (error (* " " (constant "Invalid indent"))) true) - :check_start (+ (error (* (+ " " "\n" -1) (constant "Stray space at start"))) true) - :check_end (+ (error (* " " (constant "Stray space at end"))) true) - :check_empty (+ (error (* 1 (constant "Stray characters at the end"))) true) + :all (* (any :comment) (+ :lists :maps :nil)) + :map (some (unref (group (* :indent :key ":" (+ (* -1 :nil) (* :val (+ (some "\n") -1)) (* (some "\n") :increase :all)))) :col)) + :maps (/ (group (* :map (any (+ :comment :map)))) ,from-pairs) + :lists (group (* :list (any (+ :comment :list)))) + :check_indent (+ (error (* " " (% (* :location (constant "Invalid indent"))))) true) + :check_start (+ (error (* (+ " " "\n" -1) (% (* :location (constant "Stray space at start"))))) true) + :check_end (+ (error (* " " (% (* :location (constant "Stray space at end"))))) true) + :check_empty (+ (error (* 1 (% (* :location (constant "Stray characters at the end"))))) true) + :location (% (* (constant "at [") (line) (constant ":") (column) (constant "]: "))) + :nil (constant :nil) }))