var parse = require('./grammar/parser').parse,
    ast = require('./ast');

exports.parse = function(sexp) {
    if (!ast.is_list(sexp) || sexp.length === 1) {
        return parse(sexp)[0];
    }

    return parse(sexp);
};

exports.unparse = function(sexp) {
    // Turns AST back into list program
    if (ast.is_boolean(sexp)) {
        return sexp === true ? '#t' : '#f';
    } else if (ast.is_list(sexp)) {
        if (sexp.length > 0 && sexp[0] === 'quote') {
            return "'" + exports.unparse(sexp[1]);
        } else {
            return '(' + sexp.map(exports.unparse).join(' ') + ')';
        }
    } else {
        return sexp.toString();
    }
};

@@ -110,38 +110,73 @@
     
-if (!ast.is_list(sexp) %7C%7C sexp
+var result = parse(sexp);%0A%0A    if (!ast.is_list(result) %7C%7C result
 .len
@@ -203,27 +203,22 @@
  return 
-parse(sexp)
+result
 %5B0%5D;%0A   
@@ -232,27 +232,22 @@
  return 
-parse(sexp)
+result
 ;%0A%7D;%0A%0Aex

Fix parsing of source with several distached statements.