Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
happytomatoe committed Oct 3, 2024
1 parent 694dbcd commit 6bd99b8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions simulator/src/jack/compiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,12 @@ function _doWithTryCatch(files: Record<string, string>, cmd: Command) {
}
enum Command {
Compile,
Validate
Validate,
}

function _do(
files: Record<string, string>, cmd: Command
files: Record<string, string>,
cmd: Command,
): Record<string, string | CompilationError> {
if (files instanceof LexerOrParserError) {
throw new Error("Expected tree but got a lexer or parser error");
Expand Down Expand Up @@ -113,7 +114,7 @@ export class Compiler {
const validator = new ValidatorListener(this.binder.globalSymbolTable);
ParseTreeWalker.DEFAULT.walk(validator, tree);

return tree
return tree;
}
compile(tree: ProgramContext): string | JackCompilerError[] {
const treeOrErrors = this.validate(tree);
Expand Down

0 comments on commit 6bd99b8

Please sign in to comment.