From 8170000998965350345862f0cc22771e5f798ffa Mon Sep 17 00:00:00 2001 From: Arnaud Spiwack Date: Fri, 31 Oct 2025 15:12:59 +0900 Subject: [PATCH] An additional S-expr example I wrote it for the blog post, it visualises a little more. --- test/Test.hs | 1 + test/Test/Best.hs | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/test/Test.hs b/test/Test.hs index 43d04d8..1935717 100644 --- a/test/Test.hs +++ b/test/Test.hs @@ -21,5 +21,6 @@ main = do Simple.reprintSexpr Simple.a_sexpr putStrLn "== Visualise megaparsec/prettyprinter PUP ==" Best.reprintSexpr Best.a_small_sexpr + Best.reprintSexpr Best.a_medium_sexpr Best.reprintSexpr Best.a_sexpr Hedgehog.defaultMain [Simple.tests, Best.tests] diff --git a/test/Test/Best.hs b/test/Test/Best.hs index 467a3c5..31cd763 100644 --- a/test/Test/Best.hs +++ b/test/Test/Best.hs @@ -10,6 +10,7 @@ module Test.Best reprintSexpr, a_small_sexpr, a_sexpr, + a_medium_sexpr, ) where @@ -167,6 +168,11 @@ reprintSexpr str = do a_small_sexpr :: Text a_small_sexpr = "((abstr 57 :tag) \"this is nested\")" +a_medium_sexpr :: Text +a_medium_sexpr = + "((a-fun 57 :tag) \"a string\" (list 1 \"somewhat\" :long \"list of mixed types\"\ + \ (list \"at least\" 3) (list \"but maybe\" :more)))" + -- Modified Emacs Lisp a_sexpr :: Text a_sexpr =