 (defn -assignment [tokens]
   (if-let [{nodes :nodes left-tokens :left-tokens}
            (pattern-sequence tokens [-assignee -is -value -nl] [])]
-    {:expr (nnode :assignment (take 3 nodes)) :left-tokens left-tokens}
+    {: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] [])]
-    {:expr (nnode :invocation (take 2 nodes)) :left-tokens left-tokens}
+    {:node (nnode :invocation (take 2 nodes)) :left-tokens left-tokens}
     nil))
 
 ;; atoms

(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
    nil)) ;; no alternatives match - return

(defn pattern-sequence [tokens patterns collected]

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

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

;; expressions
