 ;; expressions
 
 (defn -expression [tokens collected]
-  (def expressions (matched-nodes tokens expression-types)) ;; candidates
+  (def expressions (alternatives tokens [-assignment -invocation]))
   (if (> (count expressions) 0)
     (let [{expr :expr left-tokens :left-tokens} (first expressions)]
       {:expr (nnode :expression [expr]) :left-tokens left-tokens}) ;; return expr

(defn parse [code]
  (-root (lex code)))

(defn matched-nodes [input types] ;; bit round the houses
  (vec (map (fn [t] (t input)) ;; get nodes for each matching type
            (filter (fn [t] (not= nil (t input))) ;; get matching types
                    types))))

;; values

(defn -value [token]
  (def nodes (alternatives token [-string -integer -identifier]))
  (if (> (count nodes) 0)
    (nnode :value [(first nodes)])
    nil))
