int mode) throws Exception {
Parser parser = new Parser(new CompilerEnvirons(), reporter);
ScriptOrFnNode root = parser.parse(reader, null, 1);
Environment env = new Environment(keepLineno, mode);
GlobalScope globalScope = new GlobalScope();
StatementList statements = new StatementList();
Node node = root.getFirstChild();
while (node != null) {
IStatement statement = Utils.createStatement(node, root, globalScope);
statements.add(statement);
node = statement.getNext();
}
if (statements.size() > 0) {
globalScope.compress(statements.get(0) instanceof VariableStatement, env);
}
if (env.isKeepLineno()) {
env.setLineno(1);
}