         ;; FIXME: proper ns-info for cljs.user, can use analyzer data because nothing was compiled yet
 
         repl-state
-        {:current {:ns 'cljs.user
+        {::repl-state true
+         :current {:ns 'cljs.user
                    :name "cljs/user.cljs"
                    :ns-info ns-info}
          ;; the sources required to get the repl started

            )))))

(defn read-one
  ([repl-state reader]
   (read-one repl-state reader {}))
  ([repl-state
    reader
    {:keys [filename] :or {filename "repl-input.cljs"}}]
   (let [eof-sentinel
         (Object.)

         opts
         {:eof eof-sentinel
          :read-cond :allow
          :features #{:cljs}}

         in
         (readers/source-logging-push-back-reader
           reader ;; (PushbackReader. reader (object-array buf-len) buf-len buf-len)
           1
           filename)

         {:keys [ns ns-info] :as repl-rc}
         (:current repl-state)

         form
         (binding [*ns*
                   (create-ns ns)

                   ana/*cljs-ns*
                   ns

                   ana/*cljs-file*
                   name

                   reader/*data-readers*
                   tags/*cljs-data-readers*

                   reader/*alias-map*
                   (merge reader/*alias-map*
                     (:requires ns-info)
                     (:require-macros ns-info))]

           (reader/read opts in))

         eof?
         (identical? form eof-sentinel)]

     (-> {:eof? eof?}
         (cond->
           (not eof?)
           (assoc :form form
                  :source
                  ;; FIXME: poking at the internals of SourceLoggingPushbackReader
                  ;; not using (-> form meta :source) which log-source provides
                  ;; since there are things that do not support IMeta, still want the source though
                  (-> @(.-source-log-frames in)
                      (:buffer)
                      (str)))))
     )))

(defn process-input
  "processes a string of forms, may read multiple forms"

        (readers/input-stream-reader input-stream)

        {:keys [eof?] :as read-result}
        (read-one repl-state reader {})]
    (if eof?
      state
      (process-read-result state read-result))))
