 {Transform} = require 'stream'
 lispToArray = require 'lisp-to-array'
+{log, warn, error} = require '../../logger'
 _ = require 'lodash'
 
 class ParseSExpr extends Transform

            objectMode: true

    _transform: (chunk, encoding, next) ->
        @push postprocess(lispToArray(preprocess(chunk)))
        next()

preprocess = (chunk) ->

                # keep traversing
                return node.map (x) -> postprocess x
    else
        if typeof node is 'string'
            # some ()s in strings were replaced with (__nil__) when preprocessing
            node.replace('(__nil__)', '()')
        else
            node

module.exports = ParseSExpr
