                     (= \; c)
                     (= \\ c)
                     :else
-                      (recur (inc offset) line (inc col) parents hook-state)))))))))
+                      (recur (inc offset) line (inc col) parents accumulated-state)))))))))
 	          
 (comment
 (defn parse-lib 

                    ; TODO refactor the following stuff. or keep for performance ? (bleh)
                    (start-like (.substring text (-> parents peek :offset)) "\\newline")
                      (if (< (inc (- offset (-> parents peek :offset))) (.length "\\newline"))
                        (recur (inc offset) line (inc col) parents hook-state)
                        (recur (inc offset) line (inc col) (pop parents) hook-state))
                    (start-like (.substring text (-> parents peek :offset)) "\\tab")
                      (if (< (inc (- offset (-> parents peek :offset))) (.length "\\tab"))
                        (recur (inc offset) line (inc col) parents hook-state)
                        (recur (inc offset) line (inc col) (pop parents) hook-state))
                    (start-like (.substring text (-> parents peek :offset)) "\\space")
                      (if (< (inc (- offset (-> parents peek :offset))) (.length "\\space"))
                        (recur (inc offset) line (inc col) parents hook-state)
                        (recur (inc offset) line (inc col) (pop parents) hook-state))
                    (start-like (.substring text (-> parents peek :offset)) "\\backspace")
                      (if (< (inc (- offset (-> parents peek :offset))) (.length "\\backspace"))
                        (recur (inc offset) line (inc col) parents hook-state)
                        (recur (inc offset) line (inc col) (pop parents) hook-state))
                    (start-like (.substring text (-> parents peek :offset)) "\\formfeed")
                      (if (< (inc (- offset (-> parents peek :offset))) (.length "\\formfeed"))
                        (recur (inc offset) line (inc col) parents hook-state)
                        (recur (inc offset) line (inc col) (pop parents) hook-state))
                    (start-like (.substring text (-> parents peek :offset)) "\\return")
                      (if (< (inc (- offset (-> parents peek :offset))) (.length "\\return"))
                        (recur (inc offset) line (inc col) parents hook-state)
                        (recur (inc offset) line (inc col) (pop parents) hook-state))
                    ; TODO I don't like the fact the next two conditions on \r and \newline are repeated from the default case
                    ;      clearly a level of indirection is missing regarding the update of line, offset and col
                    (= (first "\r") c)
                      (recur (inc offset) line col parents hook-state) ; we do not increment the column    
                    (= \newline c)
                      (recur (inc offset) (inc line) (int 0) parents hook-state)
                    :else
                      (recur (inc offset) line (inc col) (pop parents) hook-state))
                ; last falling case: we are in plain code, neither in a string, regexp or a comment
                (cond
                  (*opening-brackets* c)
                    (recur 
                      (inc offset) line (inc col)
                      (conj parents {:type c :offset offset :line line :col col})
                       hook-state)
                  (*closing-brackets* c)
                    (recur 
                      (inc offset) line (inc col)
                      (pop parents)
                       hook-state)
                  (= (first "\r") c)
                    (recur (inc offset) line col parents hook-state) ; we do not increment the column    
                  (= \newline c)
                    (recur (inc offset) (inc line) (int 0) parents hook-state)
                  (= \" c)
                    (recur (inc offset) line (inc col) (conj parents {:type c :offset offset :line line :col col }) hook-state)
                  (= \; c)
                    (recur (inc offset) line (inc col) (conj parents {:type c :offset offset :line line :col col}) hook-state)
                  (= \\ c)
                    (recur (inc offset) line (inc col) (conj parents {:type c :offset offset :line line :col col}) hook-state)
                  :else
                    (recur (inc offset) line (inc col) parents hook-state))
                  
                  #_(cond   ; leaved as a template if new cases have to be handled
                    (*opening-brackets* c)

 { :parents [ {:type <[ or ( or { or \" or \\> :line :offset :col} ... ]
   :offset current-offset :line current-line :col current-col}"

; todo : later on, move offset+line+col+parents inside a proper deftyped type
(defn default-accumulator
  [#^String text offset line col parents parser-state accumulated-state]
    [#^String text offset line col parents parser-state accumulated-state]
    nil)

(defn make-default-continue?-fn
  [stop-offset]
  (fn default-continue?-fn
    [#^String text offset line col parents parser-state accumulated-state]
    (< offset stop-offset)))

(defn default-make-result
  [#^String text offset line col parents parser-state accumulated-state]
  { :parents parents :offset offset :line line :col col })
   
(defn parse 
