             (filter (fn [t] (not= nil (t input))) ;; get matching types
                     types))))
 
+(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 alternative match - return
+
 (defn pattern-sequence [tokens patterns collected]
   (let [pattern (first patterns)
         token (first tokens)]

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

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

;; expressions

(defn -expression [tokens collected]
  (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
    {:expr nil :left-tokens tokens})) ;; no expr match - return

(defn -assignment [tokens]
  (if-let [{nodes :nodes left-tokens :left-tokens}

        nil ;; pattern match failure - not enough tokens
        (if-let [node (pattern token)] ;; matched token
          (pattern-sequence (rest tokens) (rest patterns) (conj collected node)) ;; round again
          nil))))) ;; pattern match failure token match failure - return

;; only one token, for now
(defn pattern [input matcher tag & args]
