diff --git a/yaml.lsp b/yaml.0.lsp similarity index 86% rename from yaml.lsp rename to yaml.0.lsp index 9652020..2398538 100644 --- a/yaml.lsp +++ b/yaml.0.lsp @@ -12,9 +12,9 @@ (':seq-exp hd) (':seq-exp tl)) (:macro seq (hd) - (':t (':seq-exp hd))) + (':seq-exp hd)) (:macro seq (hd .. tl) - (':t (':seq-exp hd tl))) + (':seq-exp hd tl)) (:macro c-paren-eval (x) (':c-atm x) @@ -40,7 +40,8 @@ (':t2ot-elt hd) (':t2ot-elt tl))) -(:macro t () (':ot)) +(:macro t () + (':ot)) (:macro t ( .. tl ) (':ot (':t2ot-elt tl))) @@ -48,33 +49,23 @@ (:macro ot ( x ) (':yot (':indent x))) -(:macro indent ( (x(:c-str _)) ) - (':str-cat " " x)) - -(:macro indent ( (hd(:c-atm _)) .. tl ) - (':indent hd) - (':indent tl)) - (:macro indent-each ()) - (:macro indent-each ( hd ) (':indent hd)) - (:macro indent-each ( hd .. tl ) - (':indent hd) + (':indent-each hd) (':indent-each tl)) (:macro rm-first (x .. tl) tl) +;(:macro indent ( (x(:c-str _)) ) +; (':str-cat " " x)) (:macro indent ( (x(:c-li0-eq _ :tree)) ) (':tree (':indent-each (':rm-first (':unpack x))))) - (:macro indent ( (x(:c-li0-eq _ :atm-to-str)) ) (':atm-to-str (':indent-each (':rm-first (':unpack x))))) - (:macro indent ( (x(:c-li0-eq _ :yot)) ) (':yot (':indent-each (':rm-first (':unpack x))))) - (:macro indent ( (x(:c-li0-eq _ :dict-key)) ) (':dict-key (':indent-each (':rm-first (':unpack x))))) diff --git a/yaml.1.lsp b/yaml.1.lsp new file mode 100644 index 0000000..fd155c7 --- /dev/null +++ b/yaml.1.lsp @@ -0,0 +1,43 @@ +(:macro rm-first (x .. tl) + tl) + +(:macro rm-indent ( (x(:c-li0-eq _ :tree)) ) + (':tree + (':rm-indent-each + (':rm-first + (':unpack x))))) +(:macro rm-indent ( (x(:c-li0-eq _ :yot)) ) + (':yot + (':rm-indent + (':rm-first + (':unpack x))))) +(:macro rm-indent ( (x(:c-li0-eq _ :atm-to-str)) ) + (':atm-to-str + (':rm-indent + (':rm-first + (':unpack x))))) +(:macro rm-indent ( (x(:c-li0-eq _ :dict-key)) ) + (':dict-key + (':rm-indent + (':rm-first + (':unpack x))))) + +(:macro rm-indent ( (x(:c-li0-eq _ :indent)) ) + (':rm-first + (':unpack x))) + +(:macro rm-indent-each ( x ) + (':rm-indent x)) +(:macro rm-indent-each ( x .. tl ) + (':rm-indent x) + (':rm-indent-each tl)) + +(:macro cfg () + (':ocfg)) +(:macro cfg ( x ) + (':ocfg + (':rm-indent x))) +(:macro cfg ( hd .. tl ) + (':ocfg + (':rm-indent hd) + (':rm-indent-each tl))) diff --git a/yaml_finish.lsp b/yaml.2.lsp similarity index 74% rename from yaml_finish.lsp rename to yaml.2.lsp index 9ee7212..4ccb595 100644 --- a/yaml_finish.lsp +++ b/yaml.2.lsp @@ -20,9 +20,12 @@ (':str-cat x (':reduce-cat tl))) -(:macro cfg ( ) +(:macro ocfg ( ) "") -(:macro cfg ( x ) +(:macro ocfg ( x ) x) -(:macro cfg ( x .. tl ) - (':tree x (':cfg tl))) +(:macro ocfg ( x .. tl ) + (':tree x (':ocfg tl))) + +(:macro indent ( x ) + (':str-cat " " x))