      TITLE = (<'=='> SPACE SYMBOL SPACE <'=='>)
      FUNCTION = SYMBOL | (SYMBOL SPACE ARGS)
      ARGS = ((ARG SPACE)* ARG) | Epsilon
-     <ARG> = MAP-ARG | LIST-ARG | STRING-SYMBOL | SYMBOL  | OPTIONAL-ARG
+     <ARG> = MAP-ARG | LIST-ARG | STRING-SYMBOL | SYMBOL  | OPTIONAL-ARG | ENUM
+     ENUM = ((SYMBOL <'|'>)* SYMBOL) | Epsilon
      OPTIONAL-ARG = (<'('> OPTIONAL-SPACE (ARG | ARGS) OPTIONAL-SPACE <')'>)
      LIST-ARG = <'['> ARG <',...'> <']'> 
      MAP-ARG = (<'{'>) ((KEY-VALUE <','>)* KEY-VALUE) (<'}'>)
      KEY-VALUE = ARG <':'> ARG
      OPEN-KEY-VALUE = (KEY-VALUE <',...'>)
-     STRING-SYMBOL = ('\"' SYMBOL '\"')
+     STRING-SYMBOL = ('\"' ARG '\"')
      
      NEW-LINE = '\n' | Epsilon
      SYMBOL = #'[a-zA-Z_]'  #'\\w'*

                :no-lock (s/cat :input ::txid-opts, :output ::address-amount)
                :lock (s/cat :input ::txid-opts, :output ::address-amount, :locktime integer?))
        :ret ::hex-string) 
(def-rpc-opt createrawtransaction 2 txids addresses locktime)

(def-rpc decoderawtransaction hexstring)
(def-rpc decodescript hexstring)

    ast->clj-map 
    ast))

(def not-working #{"prioritisetransaction" "createrawtransaction" "listunspent" "sendmany"})

(defn valid-fn [l] 
  (let [n (first (.split l " "))]
    (not (contains? not-working n))))

(defn parse [l]
  (let [r (help-parser l)]
    (if (insta/failure? r) 
      (throw (IllegalStateException. (pr-str (insta/get-failure r)))) 
      (ast->clj r))))

(defn def-rpcs [] 
  (let [e (conj 
            (map parse (filter valid-fn (split-help)))
            'do)]
    e))

;;--------------------------------------------------------

