 (defn pattern-sequence-selector [tokens pattern-sequences]
   (def alts (alternatives tokens pattern-sequences))
   (if (> (count alts) 0)
-    (let [{expr :expr left-tokens :left-tokens} (first alts)]
-      {:expr (nnode :expression [expr]) :left-tokens left-tokens}) ;; return alternative
+    (let [{node :node left-tokens :left-tokens} (first alts)]
+      {:node (nnode :expression [node]) :left-tokens left-tokens}) ;; return alternative
     nil)) ;; no alternatives match - return
 
 (defn pattern-sequence [tokens patterns collected]

  (nnode :root [(-block tokens [])]))

(defn -block [tokens collected]
  (if-let [{expr :expr left-tokens :left-tokens}
           (-expression tokens [])]
    (-block left-tokens (conj collected expr)) ;; add expr, continue collecting more
    (nnode :block collected))) ;; no more exprs, return block

;; expressions

(defn -assignment [tokens]
  (if-let [{nodes :nodes left-tokens :left-tokens}
           (pattern-sequence tokens [-assignee -is -value -nl] [])]
    {:node (nnode :assignment (take 3 nodes)) :left-tokens left-tokens}
    nil))

(defn -invocation [tokens]
  (if-let [{nodes :nodes left-tokens :left-tokens}
           (pattern-sequence tokens [-identifier -value -nl] [])]
    {:node (nnode :invocation (take 2 nodes)) :left-tokens left-tokens}
    nil))

;; atoms
