Support compiling multiple entry files

This commit is contained in:
dcodeIO
2017-12-09 02:52:20 +01:00
parent 732068e981
commit 5ff88e126e
3 changed files with 47 additions and 48 deletions

View File

@ -26,8 +26,7 @@ import { Parser } from "./parser";
import { Program } from "./program";
/** Parses a single source file. If `parser` has been omitted a new one is created. */
export function parseFile(text: string, path: string, parser: Parser | null = null): Parser {
let isEntry: bool = false;
export function parseFile(text: string, path: string, parser: Parser | null = null, isEntry: bool = false): Parser {
if (!parser) {
parser = new Parser();
isEntry = true;