Skip to content
Browse files

.

  • Loading branch information...
1 parent f022812 commit 4b3f0614afd6ad38107eb23578baa90a6a4196a5 @richard-lyman committed Dec 28, 2011
Showing with 13 additions and 12 deletions.
  1. +12 −12 src/com/lithinos/amotoen/core.clj
  2. +1 −0 test/com/lithinos/amotoen/test/core.clj
View
24 src/com/lithinos/amotoen/core.clj
@@ -11,14 +11,14 @@
(declare pegasus)
(defprotocol IPosition
- (psdebug [t] "Some form of helpful debug info")
- (clone [t] "")
- (gp [t] "Returns pos") ; E.V.I.L.
- (sp [t j] "Sets pos") ; E.V.I.L.
- (in [t] "Indent")
- (de [t] "Dedent")
- (m [t] "Returns the 'c' then (inc pos)")
- (c [t] "The character at pos"))
+ (psdebug [t] "Some form of helpful debug info")
+ (clone [t] "")
+ (gp [t] "Get pos") ; E.V.I.L. ... maybe
+ (sp [t j] "Set pos") ; E.V.I.L. ... maybe
+ (in [t] "Indent - for debugging")
+ (de [t] "Dedent - for debugging")
+ (m [t] "Returns the 'c' then (inc pos)")
+ (c [t] "The character at pos"))
(defn gen-ps
([s] (gen-ps s 0))
([s j]
@@ -41,8 +41,8 @@
(defn lpegs [t s] (reverse (into '() (cons t (seq s))))) ; This doesn't need to be fast, but shouldn't the following work? (list (cons t (seq s)))
(defn pegs [s] (vec (seq s)))
-
-(defn- debug [w & args] #_(do (print (psdebug w)) (apply println args) (flush)))
+(def *debug* (ref false))
+(defn- debug [w & args] (when @*debug* (print (psdebug w)) (apply println args) (flush)))
(def #^{:private true} grammar-grammar {
:Whitespace '(| \space \newline \tab \,)
@@ -51,7 +51,7 @@
:Grammar [\{ :_* :Rule '(* [:_ :Rule]) :_* \}]
:Rule [:Keyword :_ :Body]
:Keyword [\: :ValidKeywordChar '(* :ValidKeywordChar)]
- :Body '(| :Keyword :Grouping :Char)
+ :Body '(| :Keyword :Char :Grouping)
:Grouping '(| :Sequence :Either :ZeroOrMore :ZeroOrOne :AnyNot)
:Sequence [\[ :_* :Body '(* [:_* :Body]) :_* \]]
:Either [\( \| :_ :Body '(* [:_* :Body]) :_* \)]
@@ -130,7 +130,7 @@
(de w)
result))
-(def grammar-ast (pr-str '{:Grammar [\{ {:_* (())} {:Rule [{:Keyword [\: {:ValidKeywordChar \_} (({:ValidKeywordChar \*}))]} {:_ [{:Whitespace \space} (())]} {:Body {:Grouping {:ZeroOrMore [\( \* {:_ [{:Whitespace \space} (())]} {:Body {:Keyword [\: {:ValidKeywordChar \W} (({:ValidKeywordChar \h} {:ValidKeywordChar \i} {:ValidKeywordChar \t} {:ValidKeywordChar \e} {:ValidKeywordChar \s} {:ValidKeywordChar \p} {:ValidKeywordChar \a} {:ValidKeywordChar \c} {:ValidKeywordChar \e}))]}} {:_* (())} \)]}}}]} (([{:_ [{:Whitespace \,} (({:Whitespace \space}))]} {:Rule [{:Keyword [\: {:ValidKeywordChar \Z} (({:ValidKeywordChar \e} {:ValidKeywordChar \r} {:ValidKeywordChar \o} {:ValidKeywordChar \O} {:ValidKeywordChar \r} {:ValidKeywordChar \M} {:ValidKeywordChar \o} {:ValidKeywordChar \r} {:ValidKeywordChar \e}))]} {:_ [{:Whitespace \space} (())]} {:Body {:Grouping {:Sequence [\[ {:_* (())} {:Body {:Char [\\ \(]}} (([{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \*]}}] [{:_* (({:Whitespace \space}))} {:Body {:Keyword [\: {:ValidKeywordChar \_} (())]}}] [{:_* (({:Whitespace \space}))} {:Body {:Keyword [\: {:ValidKeywordChar \B} (({:ValidKeywordChar \o} {:ValidKeywordChar \d} {:ValidKeywordChar \y}))]}}] [{:_* (({:Whitespace \space}))} {:Body {:Keyword [\: {:ValidKeywordChar \_} (({:ValidKeywordChar \*}))]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \)]}}])) {:_* (())} \]]}}}]}] [{:_ [{:Whitespace \,} (({:Whitespace \space}))]} {:Rule [{:Keyword [\: {:ValidKeywordChar \B} (({:ValidKeywordChar \o} {:ValidKeywordChar \d} {:ValidKeywordChar \y}))]} {:_ [{:Whitespace \space} (())]} {:Body {:Grouping {:Either [\( \| {:_ [{:Whitespace \space} (())]} {:Body {:Keyword [\: {:ValidKeywordChar \K} (({:ValidKeywordChar \e} {:ValidKeywordChar \y} {:ValidKeywordChar \w} {:ValidKeywordChar \o} {:ValidKeywordChar \r} {:ValidKeywordChar \d}))]}} (([{:_* (({:Whitespace \space}))} {:Body {:Keyword [\: {:ValidKeywordChar \G} (({:ValidKeywordChar \r} {:ValidKeywordChar \o} {:ValidKeywordChar \u} {:ValidKeywordChar \p} {:ValidKeywordChar \i} {:ValidKeywordChar \n} {:ValidKeywordChar \g}))]}}] [{:_* (({:Whitespace \space}))} {:Body {:Keyword [\: {:ValidKeywordChar \C} (({:ValidKeywordChar \h} {:ValidKeywordChar \a} {:ValidKeywordChar \r}))]}}])) {:_* (())} \)]}}}]}] [{:_ [{:Whitespace \,} (({:Whitespace \space}))]} {:Rule [{:Keyword [\: {:ValidKeywordChar \S} (({:ValidKeywordChar \p} {:ValidKeywordChar \a} {:ValidKeywordChar \c} {:ValidKeywordChar \e} {:ValidKeywordChar \C} {:ValidKeywordChar \h} {:ValidKeywordChar \a} {:ValidKeywordChar \r}))]} {:_ [{:Whitespace \space} (())]} {:Body {:Grouping {:Sequence [\[ {:_* (())} {:Body {:Char [\\ \s]}} (([{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \p]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \a]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \c]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \e]}}])) {:_* (())} \]]}}}]}] [{:_ [{:Whitespace \,} (({:Whitespace \space}))]} {:Rule [{:Keyword [\: {:ValidKeywordChar \_} (())]} {:_ [{:Whitespace \space} (())]} {:Body {:Grouping {:Sequence [\[ {:_* (())} {:Body {:Keyword [\: {:ValidKeywordChar \W} (({:ValidKeywordChar \h} {:ValidKeywordChar \i} {:ValidKeywordChar \t} {:ValidKeywordChar \e} {:ValidKeywordChar \s} {:ValidKeywordChar \p} {:ValidKeywordChar \a} {:ValidKeywordChar \c} {:ValidKeywordChar \e}))]}} (([{:_* (({:Whitespace \space}))} {:Body {:Grouping {:ZeroOrMore [\( \* {:_ [{:Whitespace \space} (())]} {:Body {:Keyword [\: {:ValidKeywordChar \W} (({:ValidKeywordChar \h} {:ValidKeywordChar \i} {:ValidKeywordChar \t} {:ValidKeywordChar \e} {:ValidKeywordChar \s} {:ValidKeywordChar \p} {:ValidKeywordChar \a} {:ValidKeywordChar \c} {:ValidKeywordChar \e}))]}} {:_* (())} \)]}}}])) {:_* (())} \]]}}}]}] [{:_ [{:Whitespace \,} (({:Whitespace \space}))]} {:Rule [{:Keyword [\: {:ValidKeywordChar \S} (({:ValidKeywordChar \e} {:ValidKeywordChar \q} {:ValidKeywordChar \u} {:ValidKeywordChar \e} {:ValidKeywordChar \n} {:ValidKeywordChar \c} {:ValidKeywordChar \e}))]} {:_ [{:Whitespace \space} (())]} {:Body {:Grouping {:Sequence [\[ {:_* (())} {:Body {:Char [\\ \[]}} (([{:_* (({:Whitespace \space}))} {:Body {:Keyword [\: {:ValidKeywordChar \_} (({:ValidKeywordChar \*}))]}}] [{:_* (({:Whitespace \space}))} {:Body {:Keyword [\: {:ValidKeywordChar \B} (({:ValidKeywordChar \o} {:ValidKeywordChar \d} {:ValidKeywordChar \y}))]}}] [{:_* (({:Whitespace \space}))} {:Body {:Grouping {:ZeroOrMore [\( \* {:_ [{:Whitespace \space} (())]} {:Body {:Grouping {:Sequence [\[ {:_* (())} {:Body {:Keyword [\: {:ValidKeywordChar \_} (({:ValidKeywordChar \*}))]}} (([{:_* (({:Whitespace \space}))} {:Body {:Keyword [\: {:ValidKeywordChar \B} (({:ValidKeywordChar \o} {:ValidKeywordChar \d} {:ValidKeywordChar \y}))]}}])) {:_* (())} \]]}}} {:_* (())} \)]}}}] [{:_* (({:Whitespace \space}))} {:Body {:Keyword [\: {:ValidKeywordChar \_} (({:ValidKeywordChar \*}))]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \]]}}])) {:_* (())} \]]}}}]}] [{:_ [{:Whitespace \,} (({:Whitespace \space}))]} {:Rule [{:Keyword [\: {:ValidKeywordChar \V} (({:ValidKeywordChar \a} {:ValidKeywordChar \l} {:ValidKeywordChar \i} {:ValidKeywordChar \d} {:ValidKeywordChar \K} {:ValidKeywordChar \e} {:ValidKeywordChar \y} {:ValidKeywordChar \w} {:ValidKeywordChar \o} {:ValidKeywordChar \r} {:ValidKeywordChar \d} {:ValidKeywordChar \C} {:ValidKeywordChar \h} {:ValidKeywordChar \a} {:ValidKeywordChar \r}))]} {:_ [{:Whitespace \space} (())]} {:Body {:Grouping {:Either [\( \| {:_ [{:Whitespace \space} (())]} {:Body {:Char [\\ \A]}} (([{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \B]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \C]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \D]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \E]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \F]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \G]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \H]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \I]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \J]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \K]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \L]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \M]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \N]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \O]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \P]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \Q]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \R]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \S]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \T]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \U]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \V]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \W]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \X]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \Y]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \Z]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \a]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \b]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \c]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \d]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \e]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \f]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \g]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \h]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \i]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \j]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \k]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \l]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \m]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \n]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \o]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \p]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \q]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \r]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \s]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \t]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \u]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \v]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \w]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \x]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \y]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \z]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \0]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \1]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \2]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \3]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \4]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \5]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \6]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \7]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \8]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \9]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \:]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \/]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \*]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \+]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \!]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \_]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \?]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \-]}}])) {:_* (())} \)]}}}]}] [{:_ [{:Whitespace \,} (({:Whitespace \space}))]} {:Rule [{:Keyword [\: {:ValidKeywordChar \A} (({:ValidKeywordChar \n} {:ValidKeywordChar \y} {:ValidKeywordChar \N} {:ValidKeywordChar \o} {:ValidKeywordChar \t}))]} {:_ [{:Whitespace \space} (())]} {:Body {:Grouping {:Sequence [\[ {:_* (())} {:Body {:Char [\\ \(]}} (([{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \%]}}] [{:_* (({:Whitespace \space}))} {:Body {:Keyword [\: {:ValidKeywordChar \_} (())]}}] [{:_* (({:Whitespace \space}))} {:Body {:Grouping {:Either [\( \| {:_ [{:Whitespace \space} (())]} {:Body {:Keyword [\: {:ValidKeywordChar \K} (({:ValidKeywordChar \e} {:ValidKeywordChar \y} {:ValidKeywordChar \w} {:ValidKeywordChar \o} {:ValidKeywordChar \r} {:ValidKeywordChar \d}))]}} (([{:_* (({:Whitespace \space}))} {:Body {:Keyword [\: {:ValidKeywordChar \C} (({:ValidKeywordChar \h} {:ValidKeywordChar \a} {:ValidKeywordChar \r}))]}}])) {:_* (())} \)]}}}] [{:_* (({:Whitespace \space}))} {:Body {:Keyword [\: {:ValidKeywordChar \_} (({:ValidKeywordChar \*}))]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \)]}}])) {:_* (())} \]]}}}]}] [{:_ [{:Whitespace \,} (({:Whitespace \space}))]} {:Rule [{:Keyword [\: {:ValidKeywordChar \E} (({:ValidKeywordChar \i} {:ValidKeywordChar \t} {:ValidKeywordChar \h} {:ValidKeywordChar \e} {:ValidKeywordChar \r}))]} {:_ [{:Whitespace \space} (())]} {:Body {:Grouping {:Sequence [\[ {:_* (())} {:Body {:Char [\\ \(]}} (([{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \|]}}] [{:_* (({:Whitespace \space}))} {:Body {:Keyword [\: {:ValidKeywordChar \_} (())]}}] [{:_* (({:Whitespace \space}))} {:Body {:Keyword [\: {:ValidKeywordChar \B} (({:ValidKeywordChar \o} {:ValidKeywordChar \d} {:ValidKeywordChar \y}))]}}] [{:_* (({:Whitespace \space}))} {:Body {:Grouping {:ZeroOrMore [\( \* {:_ [{:Whitespace \space} (())]} {:Body {:Grouping {:Sequence [\[ {:_* (())} {:Body {:Keyword [\: {:ValidKeywordChar \_} (({:ValidKeywordChar \*}))]}} (([{:_* (({:Whitespace \space}))} {:Body {:Keyword [\: {:ValidKeywordChar \B} (({:ValidKeywordChar \o} {:ValidKeywordChar \d} {:ValidKeywordChar \y}))]}}])) {:_* (())} \]]}}} {:_* (())} \)]}}}] [{:_* (({:Whitespace \space}))} {:Body {:Keyword [\: {:ValidKeywordChar \_} (({:ValidKeywordChar \*}))]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \)]}}])) {:_* (())} \]]}}}]}] [{:_ [{:Whitespace \,} (({:Whitespace \space}))]} {:Rule [{:Keyword [\: {:ValidKeywordChar \T} (({:ValidKeywordChar \a} {:ValidKeywordChar \b} {:ValidKeywordChar \C} {:ValidKeywordChar \h} {:ValidKeywordChar \a} {:ValidKeywordChar \r}))]} {:_ [{:Whitespace \space} (())]} {:Body {:Grouping {:Sequence [\[ {:_* (())} {:Body {:Char [\\ \t]}} (([{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \a]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \b]}}])) {:_* (())} \]]}}}]}] [{:_ [{:Whitespace \,} (({:Whitespace \space}))]} {:Rule [{:Keyword [\: {:ValidKeywordChar \N} (({:ValidKeywordChar \e} {:ValidKeywordChar \w} {:ValidKeywordChar \l} {:ValidKeywordChar \i} {:ValidKeywordChar \n} {:ValidKeywordChar \e} {:ValidKeywordChar \C} {:ValidKeywordChar \h} {:ValidKeywordChar \a} {:ValidKeywordChar \r}))]} {:_ [{:Whitespace \space} (())]} {:Body {:Grouping {:Sequence [\[ {:_* (())} {:Body {:Char [\\ \n]}} (([{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \e]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \w]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \l]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \i]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \n]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \e]}}])) {:_* (())} \]]}}}]}] [{:_ [{:Whitespace \,} (({:Whitespace \space}))]} {:Rule [{:Keyword [\: {:ValidKeywordChar \R} (({:ValidKeywordChar \u} {:ValidKeywordChar \l} {:ValidKeywordChar \e}))]} {:_ [{:Whitespace \space} (())]} {:Body {:Grouping {:Sequence [\[ {:_* (())} {:Body {:Keyword [\: {:ValidKeywordChar \K} (({:ValidKeywordChar \e} {:ValidKeywordChar \y} {:ValidKeywordChar \w} {:ValidKeywordChar \o} {:ValidKeywordChar \r} {:ValidKeywordChar \d}))]}} (([{:_* (({:Whitespace \space}))} {:Body {:Keyword [\: {:ValidKeywordChar \_} (())]}}] [{:_* (({:Whitespace \space}))} {:Body {:Keyword [\: {:ValidKeywordChar \B} (({:ValidKeywordChar \o} {:ValidKeywordChar \d} {:ValidKeywordChar \y}))]}}])) {:_* (())} \]]}}}]}] [{:_ [{:Whitespace \,} (({:Whitespace \space}))]} {:Rule [{:Keyword [\: {:ValidKeywordChar \W} (({:ValidKeywordChar \h} {:ValidKeywordChar \i} {:ValidKeywordChar \t} {:ValidKeywordChar \e} {:ValidKeywordChar \s} {:ValidKeywordChar \p} {:ValidKeywordChar \a} {:ValidKeywordChar \c} {:ValidKeywordChar \e}))]} {:_ [{:Whitespace \space} (())]} {:Body {:Grouping {:Either [\( \| {:_ [{:Whitespace \space} (())]} {:Body {:Char [\\ {:SpaceChar [\s \p \a \c \e]}]}} (([{:_* (({:Whitespace \space}))} {:Body {:Char [\\ {:NewlineChar [\n \e \w \l \i \n \e]}]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ {:TabChar [\t \a \b]}]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \,]}}])) {:_* (())} \)]}}}]}] [{:_ [{:Whitespace \,} (({:Whitespace \space}))]} {:Rule [{:Keyword [\: {:ValidKeywordChar \G} (({:ValidKeywordChar \r} {:ValidKeywordChar \a} {:ValidKeywordChar \m} {:ValidKeywordChar \m} {:ValidKeywordChar \a} {:ValidKeywordChar \r}))]} {:_ [{:Whitespace \space} (())]} {:Body {:Grouping {:Sequence [\[ {:_* (())} {:Body {:Char [\\ \{]}} (([{:_* (({:Whitespace \space}))} {:Body {:Keyword [\: {:ValidKeywordChar \_} (({:ValidKeywordChar \*}))]}}] [{:_* (({:Whitespace \space}))} {:Body {:Keyword [\: {:ValidKeywordChar \R} (({:ValidKeywordChar \u} {:ValidKeywordChar \l} {:ValidKeywordChar \e}))]}}] [{:_* (({:Whitespace \space}))} {:Body {:Grouping {:ZeroOrMore [\( \* {:_ [{:Whitespace \space} (())]} {:Body {:Grouping {:Sequence [\[ {:_* (())} {:Body {:Keyword [\: {:ValidKeywordChar \_} (())]}} (([{:_* (({:Whitespace \space}))} {:Body {:Keyword [\: {:ValidKeywordChar \R} (({:ValidKeywordChar \u} {:ValidKeywordChar \l} {:ValidKeywordChar \e}))]}}])) {:_* (())} \]]}}} {:_* (())} \)]}}}] [{:_* (({:Whitespace \space}))} {:Body {:Keyword [\: {:ValidKeywordChar \_} (({:ValidKeywordChar \*}))]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \}]}}])) {:_* (())} \]]}}}]}] [{:_ [{:Whitespace \,} (({:Whitespace \space}))]} {:Rule [{:Keyword [\: {:ValidKeywordChar \C} (({:ValidKeywordChar \h} {:ValidKeywordChar \a} {:ValidKeywordChar \r}))]} {:_ [{:Whitespace \space} (())]} {:Body {:Grouping {:Sequence [\[ {:_* (())} {:Body {:Char [\\ \\]}} (([{:_* (({:Whitespace \space}))} {:Body {:Grouping {:Either [\( \| {:_ [{:Whitespace \space} (())]} {:Body {:Keyword [\: {:ValidKeywordChar \T} (({:ValidKeywordChar \a} {:ValidKeywordChar \b} {:ValidKeywordChar \C} {:ValidKeywordChar \h} {:ValidKeywordChar \a} {:ValidKeywordChar \r}))]}} (([{:_* (({:Whitespace \space}))} {:Body {:Keyword [\: {:ValidKeywordChar \S} (({:ValidKeywordChar \p} {:ValidKeywordChar \a} {:ValidKeywordChar \c} {:ValidKeywordChar \e} {:ValidKeywordChar \C} {:ValidKeywordChar \h} {:ValidKeywordChar \a} {:ValidKeywordChar \r}))]}}] [{:_* (({:Whitespace \space}))} {:Body {:Keyword [\: {:ValidKeywordChar \N} (({:ValidKeywordChar \e} {:ValidKeywordChar \w} {:ValidKeywordChar \l} {:ValidKeywordChar \i} {:ValidKeywordChar \n} {:ValidKeywordChar \e} {:ValidKeywordChar \C} {:ValidKeywordChar \h} {:ValidKeywordChar \a} {:ValidKeywordChar \r}))]}}] [{:_* (({:Whitespace \space}))} {:Body {:Grouping {:AnyNot [\( \% {:_ [{:Whitespace \space} (())]} {:Char [\\ {:SpaceChar [\s \p \a \c \e]}]} {:_* (())} \)]}}}])) {:_* (())} \)]}}}])) {:_* (())} \]]}}}]}] [{:_ [{:Whitespace \,} (({:Whitespace \space}))]} {:Rule [{:Keyword [\: {:ValidKeywordChar \G} (({:ValidKeywordChar \r} {:ValidKeywordChar \o} {:ValidKeywordChar \u} {:ValidKeywordChar \p} {:ValidKeywordChar \i} {:ValidKeywordChar \n} {:ValidKeywordChar \g}))]} {:_ [{:Whitespace \space} (())]} {:Body {:Grouping {:Either [\( \| {:_ [{:Whitespace \space} (())]} {:Body {:Keyword [\: {:ValidKeywordChar \S} (({:ValidKeywordChar \e} {:ValidKeywordChar \q} {:ValidKeywordChar \u} {:ValidKeywordChar \e} {:ValidKeywordChar \n} {:ValidKeywordChar \c} {:ValidKeywordChar \e}))]}} (([{:_* (({:Whitespace \space}))} {:Body {:Keyword [\: {:ValidKeywordChar \E} (({:ValidKeywordChar \i} {:ValidKeywordChar \t} {:ValidKeywordChar \h} {:ValidKeywordChar \e} {:ValidKeywordChar \r}))]}}] [{:_* (({:Whitespace \space}))} {:Body {:Keyword [\: {:ValidKeywordChar \Z} (({:ValidKeywordChar \e} {:ValidKeywordChar \r} {:ValidKeywordChar \o} {:ValidKeywordChar \O} {:ValidKeywordChar \r} {:ValidKeywordChar \M} {:ValidKeywordChar \o} {:ValidKeywordChar \r} {:ValidKeywordChar \e}))]}}] [{:_* (({:Whitespace \space}))} {:Body {:Keyword [\: {:ValidKeywordChar \Z} (({:ValidKeywordChar \e} {:ValidKeywordChar \r} {:ValidKeywordChar \o} {:ValidKeywordChar \O} {:ValidKeywordChar \r} {:ValidKeywordChar \O} {:ValidKeywordChar \n} {:ValidKeywordChar \e}))]}}] [{:_* (({:Whitespace \space}))} {:Body {:Keyword [\: {:ValidKeywordChar \A} (({:ValidKeywordChar \n} {:ValidKeywordChar \y} {:ValidKeywordChar \N} {:ValidKeywordChar \o} {:ValidKeywordChar \t}))]}}])) {:_* (())} \)]}}}]}] [{:_ [{:Whitespace \,} (({:Whitespace \space}))]} {:Rule [{:Keyword [\: {:ValidKeywordChar \K} (({:ValidKeywordChar \e} {:ValidKeywordChar \y} {:ValidKeywordChar \w} {:ValidKeywordChar \o} {:ValidKeywordChar \r} {:ValidKeywordChar \d}))]} {:_ [{:Whitespace \space} (())]} {:Body {:Grouping {:Sequence [\[ {:_* (())} {:Body {:Char [\\ \:]}} (([{:_* (({:Whitespace \space}))} {:Body {:Keyword [\: {:ValidKeywordChar \V} (({:ValidKeywordChar \a} {:ValidKeywordChar \l} {:ValidKeywordChar \i} {:ValidKeywordChar \d} {:ValidKeywordChar \K} {:ValidKeywordChar \e} {:ValidKeywordChar \y} {:ValidKeywordChar \w} {:ValidKeywordChar \o} {:ValidKeywordChar \r} {:ValidKeywordChar \d} {:ValidKeywordChar \C} {:ValidKeywordChar \h} {:ValidKeywordChar \a} {:ValidKeywordChar \r}))]}}] [{:_* (({:Whitespace \space}))} {:Body {:Grouping {:ZeroOrMore [\( \* {:_ [{:Whitespace \space} (())]} {:Body {:Keyword [\: {:ValidKeywordChar \V} (({:ValidKeywordChar \a} {:ValidKeywordChar \l} {:ValidKeywordChar \i} {:ValidKeywordChar \d} {:ValidKeywordChar \K} {:ValidKeywordChar \e} {:ValidKeywordChar \y} {:ValidKeywordChar \w} {:ValidKeywordChar \o} {:ValidKeywordChar \r} {:ValidKeywordChar \d} {:ValidKeywordChar \C} {:ValidKeywordChar \h} {:ValidKeywordChar \a} {:ValidKeywordChar \r}))]}} {:_* (())} \)]}}}])) {:_* (())} \]]}}}]}] [{:_ [{:Whitespace \,} (({:Whitespace \space}))]} {:Rule [{:Keyword [\: {:ValidKeywordChar \Z} (({:ValidKeywordChar \e} {:ValidKeywordChar \r} {:ValidKeywordChar \o} {:ValidKeywordChar \O} {:ValidKeywordChar \r} {:ValidKeywordChar \O} {:ValidKeywordChar \n} {:ValidKeywordChar \e}))]} {:_ [{:Whitespace \space} (())]} {:Body {:Grouping {:Sequence [\[ {:_* (())} {:Body {:Char [\\ \(]}} (([{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \?]}}] [{:_* (({:Whitespace \space}))} {:Body {:Keyword [\: {:ValidKeywordChar \_} (())]}}] [{:_* (({:Whitespace \space}))} {:Body {:Keyword [\: {:ValidKeywordChar \B} (({:ValidKeywordChar \o} {:ValidKeywordChar \d} {:ValidKeywordChar \y}))]}}] [{:_* (({:Whitespace \space}))} {:Body {:Keyword [\: {:ValidKeywordChar \_} (({:ValidKeywordChar \*}))]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \)]}}])) {:_* (())} \]]}}}]}])) {:_* (())} \}]} ))
+(def grammar-ast (pr-str '{:Grammar [\{ {:_* (())} {:Rule [{:Keyword [\: {:ValidKeywordChar \_} (({:ValidKeywordChar \*}))]} {:_ [{:Whitespace \space} (())]} {:Body {:Grouping {:ZeroOrMore [\( \* {:_ [{:Whitespace \space} (())]} {:Body {:Keyword [\: {:ValidKeywordChar \W} (({:ValidKeywordChar \h} {:ValidKeywordChar \i} {:ValidKeywordChar \t} {:ValidKeywordChar \e} {:ValidKeywordChar \s} {:ValidKeywordChar \p} {:ValidKeywordChar \a} {:ValidKeywordChar \c} {:ValidKeywordChar \e}))]}} {:_* (())} \)]}}}]} (([{:_ [{:Whitespace \,} (({:Whitespace \space}))]} {:Rule [{:Keyword [\: {:ValidKeywordChar \Z} (({:ValidKeywordChar \e} {:ValidKeywordChar \r} {:ValidKeywordChar \o} {:ValidKeywordChar \O} {:ValidKeywordChar \r} {:ValidKeywordChar \M} {:ValidKeywordChar \o} {:ValidKeywordChar \r} {:ValidKeywordChar \e}))]} {:_ [{:Whitespace \space} (())]} {:Body {:Grouping {:Sequence [\[ {:_* (())} {:Body {:Char [\\ \(]}} (([{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \*]}}] [{:_* (({:Whitespace \space}))} {:Body {:Keyword [\: {:ValidKeywordChar \_} (())]}}] [{:_* (({:Whitespace \space}))} {:Body {:Keyword [\: {:ValidKeywordChar \B} (({:ValidKeywordChar \o} {:ValidKeywordChar \d} {:ValidKeywordChar \y}))]}}] [{:_* (({:Whitespace \space}))} {:Body {:Keyword [\: {:ValidKeywordChar \_} (({:ValidKeywordChar \*}))]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \)]}}])) {:_* (())} \]]}}}]}] [{:_ [{:Whitespace \,} (({:Whitespace \space}))]} {:Rule [{:Keyword [\: {:ValidKeywordChar \B} (({:ValidKeywordChar \o} {:ValidKeywordChar \d} {:ValidKeywordChar \y}))]} {:_ [{:Whitespace \space} (())]} {:Body {:Grouping {:Either [\( \| {:_ [{:Whitespace \space} (())]} {:Body {:Keyword [\: {:ValidKeywordChar \K} (({:ValidKeywordChar \e} {:ValidKeywordChar \y} {:ValidKeywordChar \w} {:ValidKeywordChar \o} {:ValidKeywordChar \r} {:ValidKeywordChar \d}))]}} (([{:_* (({:Whitespace \space}))} {:Body {:Keyword [\: {:ValidKeywordChar \C} (({:ValidKeywordChar \h} {:ValidKeywordChar \a} {:ValidKeywordChar \r}))]}}] [{:_* (({:Whitespace \space}))} {:Body {:Keyword [\: {:ValidKeywordChar \G} (({:ValidKeywordChar \r} {:ValidKeywordChar \o} {:ValidKeywordChar \u} {:ValidKeywordChar \p} {:ValidKeywordChar \i} {:ValidKeywordChar \n} {:ValidKeywordChar \g}))]}}])) {:_* (())} \)]}}}]}] [{:_ [{:Whitespace \,} (({:Whitespace \space}))]} {:Rule [{:Keyword [\: {:ValidKeywordChar \S} (({:ValidKeywordChar \p} {:ValidKeywordChar \a} {:ValidKeywordChar \c} {:ValidKeywordChar \e} {:ValidKeywordChar \C} {:ValidKeywordChar \h} {:ValidKeywordChar \a} {:ValidKeywordChar \r}))]} {:_ [{:Whitespace \space} (())]} {:Body {:Grouping {:Sequence [\[ {:_* (())} {:Body {:Char [\\ \s]}} (([{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \p]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \a]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \c]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \e]}}])) {:_* (())} \]]}}}]}] [{:_ [{:Whitespace \,} (({:Whitespace \space}))]} {:Rule [{:Keyword [\: {:ValidKeywordChar \_} (())]} {:_ [{:Whitespace \space} (())]} {:Body {:Grouping {:Sequence [\[ {:_* (())} {:Body {:Keyword [\: {:ValidKeywordChar \W} (({:ValidKeywordChar \h} {:ValidKeywordChar \i} {:ValidKeywordChar \t} {:ValidKeywordChar \e} {:ValidKeywordChar \s} {:ValidKeywordChar \p} {:ValidKeywordChar \a} {:ValidKeywordChar \c} {:ValidKeywordChar \e}))]}} (([{:_* (({:Whitespace \space}))} {:Body {:Grouping {:ZeroOrMore [\( \* {:_ [{:Whitespace \space} (())]} {:Body {:Keyword [\: {:ValidKeywordChar \W} (({:ValidKeywordChar \h} {:ValidKeywordChar \i} {:ValidKeywordChar \t} {:ValidKeywordChar \e} {:ValidKeywordChar \s} {:ValidKeywordChar \p} {:ValidKeywordChar \a} {:ValidKeywordChar \c} {:ValidKeywordChar \e}))]}} {:_* (())} \)]}}}])) {:_* (())} \]]}}}]}] [{:_ [{:Whitespace \,} (({:Whitespace \space}))]} {:Rule [{:Keyword [\: {:ValidKeywordChar \S} (({:ValidKeywordChar \e} {:ValidKeywordChar \q} {:ValidKeywordChar \u} {:ValidKeywordChar \e} {:ValidKeywordChar \n} {:ValidKeywordChar \c} {:ValidKeywordChar \e}))]} {:_ [{:Whitespace \space} (())]} {:Body {:Grouping {:Sequence [\[ {:_* (())} {:Body {:Char [\\ \[]}} (([{:_* (({:Whitespace \space}))} {:Body {:Keyword [\: {:ValidKeywordChar \_} (({:ValidKeywordChar \*}))]}}] [{:_* (({:Whitespace \space}))} {:Body {:Keyword [\: {:ValidKeywordChar \B} (({:ValidKeywordChar \o} {:ValidKeywordChar \d} {:ValidKeywordChar \y}))]}}] [{:_* (({:Whitespace \space}))} {:Body {:Grouping {:ZeroOrMore [\( \* {:_ [{:Whitespace \space} (())]} {:Body {:Grouping {:Sequence [\[ {:_* (())} {:Body {:Keyword [\: {:ValidKeywordChar \_} (({:ValidKeywordChar \*}))]}} (([{:_* (({:Whitespace \space}))} {:Body {:Keyword [\: {:ValidKeywordChar \B} (({:ValidKeywordChar \o} {:ValidKeywordChar \d} {:ValidKeywordChar \y}))]}}])) {:_* (())} \]]}}} {:_* (())} \)]}}}] [{:_* (({:Whitespace \space}))} {:Body {:Keyword [\: {:ValidKeywordChar \_} (({:ValidKeywordChar \*}))]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \]]}}])) {:_* (())} \]]}}}]}] [{:_ [{:Whitespace \,} (({:Whitespace \space}))]} {:Rule [{:Keyword [\: {:ValidKeywordChar \V} (({:ValidKeywordChar \a} {:ValidKeywordChar \l} {:ValidKeywordChar \i} {:ValidKeywordChar \d} {:ValidKeywordChar \K} {:ValidKeywordChar \e} {:ValidKeywordChar \y} {:ValidKeywordChar \w} {:ValidKeywordChar \o} {:ValidKeywordChar \r} {:ValidKeywordChar \d} {:ValidKeywordChar \C} {:ValidKeywordChar \h} {:ValidKeywordChar \a} {:ValidKeywordChar \r}))]} {:_ [{:Whitespace \space} (())]} {:Body {:Grouping {:Either [\( \| {:_ [{:Whitespace \space} (())]} {:Body {:Char [\\ \A]}} (([{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \B]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \C]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \D]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \E]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \F]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \G]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \H]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \I]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \J]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \K]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \L]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \M]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \N]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \O]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \P]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \Q]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \R]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \S]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \T]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \U]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \V]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \W]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \X]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \Y]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \Z]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \a]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \b]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \c]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \d]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \e]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \f]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \g]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \h]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \i]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \j]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \k]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \l]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \m]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \n]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \o]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \p]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \q]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \r]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \s]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \t]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \u]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \v]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \w]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \x]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \y]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \z]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \0]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \1]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \2]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \3]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \4]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \5]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \6]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \7]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \8]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \9]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \:]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \/]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \*]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \+]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \!]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \_]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \?]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \-]}}])) {:_* (())} \)]}}}]}] [{:_ [{:Whitespace \,} (({:Whitespace \space}))]} {:Rule [{:Keyword [\: {:ValidKeywordChar \A} (({:ValidKeywordChar \n} {:ValidKeywordChar \y} {:ValidKeywordChar \N} {:ValidKeywordChar \o} {:ValidKeywordChar \t}))]} {:_ [{:Whitespace \space} (())]} {:Body {:Grouping {:Sequence [\[ {:_* (())} {:Body {:Char [\\ \(]}} (([{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \%]}}] [{:_* (({:Whitespace \space}))} {:Body {:Keyword [\: {:ValidKeywordChar \_} (())]}}] [{:_* (({:Whitespace \space}))} {:Body {:Grouping {:Either [\( \| {:_ [{:Whitespace \space} (())]} {:Body {:Keyword [\: {:ValidKeywordChar \K} (({:ValidKeywordChar \e} {:ValidKeywordChar \y} {:ValidKeywordChar \w} {:ValidKeywordChar \o} {:ValidKeywordChar \r} {:ValidKeywordChar \d}))]}} (([{:_* (({:Whitespace \space}))} {:Body {:Keyword [\: {:ValidKeywordChar \C} (({:ValidKeywordChar \h} {:ValidKeywordChar \a} {:ValidKeywordChar \r}))]}}])) {:_* (())} \)]}}}] [{:_* (({:Whitespace \space}))} {:Body {:Keyword [\: {:ValidKeywordChar \_} (({:ValidKeywordChar \*}))]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \)]}}])) {:_* (())} \]]}}}]}] [{:_ [{:Whitespace \,} (({:Whitespace \space}))]} {:Rule [{:Keyword [\: {:ValidKeywordChar \E} (({:ValidKeywordChar \i} {:ValidKeywordChar \t} {:ValidKeywordChar \h} {:ValidKeywordChar \e} {:ValidKeywordChar \r}))]} {:_ [{:Whitespace \space} (())]} {:Body {:Grouping {:Sequence [\[ {:_* (())} {:Body {:Char [\\ \(]}} (([{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \|]}}] [{:_* (({:Whitespace \space}))} {:Body {:Keyword [\: {:ValidKeywordChar \_} (())]}}] [{:_* (({:Whitespace \space}))} {:Body {:Keyword [\: {:ValidKeywordChar \B} (({:ValidKeywordChar \o} {:ValidKeywordChar \d} {:ValidKeywordChar \y}))]}}] [{:_* (({:Whitespace \space}))} {:Body {:Grouping {:ZeroOrMore [\( \* {:_ [{:Whitespace \space} (())]} {:Body {:Grouping {:Sequence [\[ {:_* (())} {:Body {:Keyword [\: {:ValidKeywordChar \_} (({:ValidKeywordChar \*}))]}} (([{:_* (({:Whitespace \space}))} {:Body {:Keyword [\: {:ValidKeywordChar \B} (({:ValidKeywordChar \o} {:ValidKeywordChar \d} {:ValidKeywordChar \y}))]}}])) {:_* (())} \]]}}} {:_* (())} \)]}}}] [{:_* (({:Whitespace \space}))} {:Body {:Keyword [\: {:ValidKeywordChar \_} (({:ValidKeywordChar \*}))]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \)]}}])) {:_* (())} \]]}}}]}] [{:_ [{:Whitespace \,} (({:Whitespace \space}))]} {:Rule [{:Keyword [\: {:ValidKeywordChar \T} (({:ValidKeywordChar \a} {:ValidKeywordChar \b} {:ValidKeywordChar \C} {:ValidKeywordChar \h} {:ValidKeywordChar \a} {:ValidKeywordChar \r}))]} {:_ [{:Whitespace \space} (())]} {:Body {:Grouping {:Sequence [\[ {:_* (())} {:Body {:Char [\\ \t]}} (([{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \a]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \b]}}])) {:_* (())} \]]}}}]}] [{:_ [{:Whitespace \,} (({:Whitespace \space}))]} {:Rule [{:Keyword [\: {:ValidKeywordChar \N} (({:ValidKeywordChar \e} {:ValidKeywordChar \w} {:ValidKeywordChar \l} {:ValidKeywordChar \i} {:ValidKeywordChar \n} {:ValidKeywordChar \e} {:ValidKeywordChar \C} {:ValidKeywordChar \h} {:ValidKeywordChar \a} {:ValidKeywordChar \r}))]} {:_ [{:Whitespace \space} (())]} {:Body {:Grouping {:Sequence [\[ {:_* (())} {:Body {:Char [\\ \n]}} (([{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \e]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \w]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \l]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \i]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \n]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \e]}}])) {:_* (())} \]]}}}]}] [{:_ [{:Whitespace \,} (({:Whitespace \space}))]} {:Rule [{:Keyword [\: {:ValidKeywordChar \R} (({:ValidKeywordChar \u} {:ValidKeywordChar \l} {:ValidKeywordChar \e}))]} {:_ [{:Whitespace \space} (())]} {:Body {:Grouping {:Sequence [\[ {:_* (())} {:Body {:Keyword [\: {:ValidKeywordChar \K} (({:ValidKeywordChar \e} {:ValidKeywordChar \y} {:ValidKeywordChar \w} {:ValidKeywordChar \o} {:ValidKeywordChar \r} {:ValidKeywordChar \d}))]}} (([{:_* (({:Whitespace \space}))} {:Body {:Keyword [\: {:ValidKeywordChar \_} (())]}}] [{:_* (({:Whitespace \space}))} {:Body {:Keyword [\: {:ValidKeywordChar \B} (({:ValidKeywordChar \o} {:ValidKeywordChar \d} {:ValidKeywordChar \y}))]}}])) {:_* (())} \]]}}}]}] [{:_ [{:Whitespace \,} (({:Whitespace \space}))]} {:Rule [{:Keyword [\: {:ValidKeywordChar \W} (({:ValidKeywordChar \h} {:ValidKeywordChar \i} {:ValidKeywordChar \t} {:ValidKeywordChar \e} {:ValidKeywordChar \s} {:ValidKeywordChar \p} {:ValidKeywordChar \a} {:ValidKeywordChar \c} {:ValidKeywordChar \e}))]} {:_ [{:Whitespace \space} (())]} {:Body {:Grouping {:Either [\( \| {:_ [{:Whitespace \space} (())]} {:Body {:Char [\\ {:SpaceChar [\s \p \a \c \e]}]}} (([{:_* (({:Whitespace \space}))} {:Body {:Char [\\ {:NewlineChar [\n \e \w \l \i \n \e]}]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ {:TabChar [\t \a \b]}]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \,]}}])) {:_* (())} \)]}}}]}] [{:_ [{:Whitespace \,} (({:Whitespace \space}))]} {:Rule [{:Keyword [\: {:ValidKeywordChar \G} (({:ValidKeywordChar \r} {:ValidKeywordChar \a} {:ValidKeywordChar \m} {:ValidKeywordChar \m} {:ValidKeywordChar \a} {:ValidKeywordChar \r}))]} {:_ [{:Whitespace \space} (())]} {:Body {:Grouping {:Sequence [\[ {:_* (())} {:Body {:Char [\\ \{]}} (([{:_* (({:Whitespace \space}))} {:Body {:Keyword [\: {:ValidKeywordChar \_} (({:ValidKeywordChar \*}))]}}] [{:_* (({:Whitespace \space}))} {:Body {:Keyword [\: {:ValidKeywordChar \R} (({:ValidKeywordChar \u} {:ValidKeywordChar \l} {:ValidKeywordChar \e}))]}}] [{:_* (({:Whitespace \space}))} {:Body {:Grouping {:ZeroOrMore [\( \* {:_ [{:Whitespace \space} (())]} {:Body {:Grouping {:Sequence [\[ {:_* (())} {:Body {:Keyword [\: {:ValidKeywordChar \_} (())]}} (([{:_* (({:Whitespace \space}))} {:Body {:Keyword [\: {:ValidKeywordChar \R} (({:ValidKeywordChar \u} {:ValidKeywordChar \l} {:ValidKeywordChar \e}))]}}])) {:_* (())} \]]}}} {:_* (())} \)]}}}] [{:_* (({:Whitespace \space}))} {:Body {:Keyword [\: {:ValidKeywordChar \_} (({:ValidKeywordChar \*}))]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \}]}}])) {:_* (())} \]]}}}]}] [{:_ [{:Whitespace \,} (({:Whitespace \space}))]} {:Rule [{:Keyword [\: {:ValidKeywordChar \C} (({:ValidKeywordChar \h} {:ValidKeywordChar \a} {:ValidKeywordChar \r}))]} {:_ [{:Whitespace \space} (())]} {:Body {:Grouping {:Sequence [\[ {:_* (())} {:Body {:Char [\\ \\]}} (([{:_* (({:Whitespace \space}))} {:Body {:Grouping {:Either [\( \| {:_ [{:Whitespace \space} (())]} {:Body {:Keyword [\: {:ValidKeywordChar \T} (({:ValidKeywordChar \a} {:ValidKeywordChar \b} {:ValidKeywordChar \C} {:ValidKeywordChar \h} {:ValidKeywordChar \a} {:ValidKeywordChar \r}))]}} (([{:_* (({:Whitespace \space}))} {:Body {:Keyword [\: {:ValidKeywordChar \S} (({:ValidKeywordChar \p} {:ValidKeywordChar \a} {:ValidKeywordChar \c} {:ValidKeywordChar \e} {:ValidKeywordChar \C} {:ValidKeywordChar \h} {:ValidKeywordChar \a} {:ValidKeywordChar \r}))]}}] [{:_* (({:Whitespace \space}))} {:Body {:Keyword [\: {:ValidKeywordChar \N} (({:ValidKeywordChar \e} {:ValidKeywordChar \w} {:ValidKeywordChar \l} {:ValidKeywordChar \i} {:ValidKeywordChar \n} {:ValidKeywordChar \e} {:ValidKeywordChar \C} {:ValidKeywordChar \h} {:ValidKeywordChar \a} {:ValidKeywordChar \r}))]}}] [{:_* (({:Whitespace \space}))} {:Body {:Grouping {:AnyNot [\( \% {:_ [{:Whitespace \space} (())]} {:Char [\\ {:SpaceChar [\s \p \a \c \e]}]} {:_* (())} \)]}}}])) {:_* (())} \)]}}}])) {:_* (())} \]]}}}]}] [{:_ [{:Whitespace \,} (({:Whitespace \space}))]} {:Rule [{:Keyword [\: {:ValidKeywordChar \G} (({:ValidKeywordChar \r} {:ValidKeywordChar \o} {:ValidKeywordChar \u} {:ValidKeywordChar \p} {:ValidKeywordChar \i} {:ValidKeywordChar \n} {:ValidKeywordChar \g}))]} {:_ [{:Whitespace \space} (())]} {:Body {:Grouping {:Either [\( \| {:_ [{:Whitespace \space} (())]} {:Body {:Keyword [\: {:ValidKeywordChar \S} (({:ValidKeywordChar \e} {:ValidKeywordChar \q} {:ValidKeywordChar \u} {:ValidKeywordChar \e} {:ValidKeywordChar \n} {:ValidKeywordChar \c} {:ValidKeywordChar \e}))]}} (([{:_* (({:Whitespace \space}))} {:Body {:Keyword [\: {:ValidKeywordChar \E} (({:ValidKeywordChar \i} {:ValidKeywordChar \t} {:ValidKeywordChar \h} {:ValidKeywordChar \e} {:ValidKeywordChar \r}))]}}] [{:_* (({:Whitespace \space}))} {:Body {:Keyword [\: {:ValidKeywordChar \Z} (({:ValidKeywordChar \e} {:ValidKeywordChar \r} {:ValidKeywordChar \o} {:ValidKeywordChar \O} {:ValidKeywordChar \r} {:ValidKeywordChar \M} {:ValidKeywordChar \o} {:ValidKeywordChar \r} {:ValidKeywordChar \e}))]}}] [{:_* (({:Whitespace \space}))} {:Body {:Keyword [\: {:ValidKeywordChar \Z} (({:ValidKeywordChar \e} {:ValidKeywordChar \r} {:ValidKeywordChar \o} {:ValidKeywordChar \O} {:ValidKeywordChar \r} {:ValidKeywordChar \O} {:ValidKeywordChar \n} {:ValidKeywordChar \e}))]}}] [{:_* (({:Whitespace \space}))} {:Body {:Keyword [\: {:ValidKeywordChar \A} (({:ValidKeywordChar \n} {:ValidKeywordChar \y} {:ValidKeywordChar \N} {:ValidKeywordChar \o} {:ValidKeywordChar \t}))]}}])) {:_* (())} \)]}}}]}] [{:_ [{:Whitespace \,} (({:Whitespace \space}))]} {:Rule [{:Keyword [\: {:ValidKeywordChar \K} (({:ValidKeywordChar \e} {:ValidKeywordChar \y} {:ValidKeywordChar \w} {:ValidKeywordChar \o} {:ValidKeywordChar \r} {:ValidKeywordChar \d}))]} {:_ [{:Whitespace \space} (())]} {:Body {:Grouping {:Sequence [\[ {:_* (())} {:Body {:Char [\\ \:]}} (([{:_* (({:Whitespace \space}))} {:Body {:Keyword [\: {:ValidKeywordChar \V} (({:ValidKeywordChar \a} {:ValidKeywordChar \l} {:ValidKeywordChar \i} {:ValidKeywordChar \d} {:ValidKeywordChar \K} {:ValidKeywordChar \e} {:ValidKeywordChar \y} {:ValidKeywordChar \w} {:ValidKeywordChar \o} {:ValidKeywordChar \r} {:ValidKeywordChar \d} {:ValidKeywordChar \C} {:ValidKeywordChar \h} {:ValidKeywordChar \a} {:ValidKeywordChar \r}))]}}] [{:_* (({:Whitespace \space}))} {:Body {:Grouping {:ZeroOrMore [\( \* {:_ [{:Whitespace \space} (())]} {:Body {:Keyword [\: {:ValidKeywordChar \V} (({:ValidKeywordChar \a} {:ValidKeywordChar \l} {:ValidKeywordChar \i} {:ValidKeywordChar \d} {:ValidKeywordChar \K} {:ValidKeywordChar \e} {:ValidKeywordChar \y} {:ValidKeywordChar \w} {:ValidKeywordChar \o} {:ValidKeywordChar \r} {:ValidKeywordChar \d} {:ValidKeywordChar \C} {:ValidKeywordChar \h} {:ValidKeywordChar \a} {:ValidKeywordChar \r}))]}} {:_* (())} \)]}}}])) {:_* (())} \]]}}}]}] [{:_ [{:Whitespace \,} (({:Whitespace \space}))]} {:Rule [{:Keyword [\: {:ValidKeywordChar \Z} (({:ValidKeywordChar \e} {:ValidKeywordChar \r} {:ValidKeywordChar \o} {:ValidKeywordChar \O} {:ValidKeywordChar \r} {:ValidKeywordChar \O} {:ValidKeywordChar \n} {:ValidKeywordChar \e}))]} {:_ [{:Whitespace \space} (())]} {:Body {:Grouping {:Sequence [\[ {:_* (())} {:Body {:Char [\\ \(]}} (([{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \?]}}] [{:_* (({:Whitespace \space}))} {:Body {:Keyword [\: {:ValidKeywordChar \_} (())]}}] [{:_* (({:Whitespace \space}))} {:Body {:Keyword [\: {:ValidKeywordChar \B} (({:ValidKeywordChar \o} {:ValidKeywordChar \d} {:ValidKeywordChar \y}))]}}] [{:_* (({:Whitespace \space}))} {:Body {:Keyword [\: {:ValidKeywordChar \_} (({:ValidKeywordChar \*}))]}}] [{:_* (({:Whitespace \space}))} {:Body {:Char [\\ \)]}}])) {:_* (())} \]]}}}]}])) {:_* (())} \}]} ))
(defn self-check []
(let [result (pr-str (pegasus :Grammar grammar-grammar (gen-ps (pr-str grammar-grammar))))]
View
1 test/com/lithinos/amotoen/test/core.clj
@@ -38,5 +38,6 @@ a")))
a")))))
+;(dosync (ref-set *debug* true))
(println "Single run") (time (self-check))
;(println "20 runs") (time (doall (take 20 (repeatedly #(self-check)))))

0 comments on commit 4b3f061

Please sign in to comment.
Something went wrong with that request. Please try again.