Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
happytomatoe committed Oct 11, 2024
1 parent 1dfc0ce commit 70cbcec
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion components/src/stores/compiler.store.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { FileSystem } from "@davidsouther/jiffies/lib/esm/fs.js";
import { compile, validate } from "@nand2tetris/simulator/jack/compiler.js";
import { compile, validate } from "@nand2tetris/simulator/jack/anltr.compiler.js";
import { CompilationError } from "@nand2tetris/simulator/languages/base.js";
import { Dispatch, MutableRefObject, useContext, useMemo, useRef } from "react";
import { useImmerReducer } from "../react.js";
Expand Down
6 changes: 3 additions & 3 deletions simulator/src/jack/listener/error.listener.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ import { assertExists } from "@davidsouther/jiffies/lib/esm/assert.js";
interface LexerNoViableAltException {
startIndex: number;
}
export class JackCustomErrorListener extends ErrorListener<any> {
export class JackCustomErrorListener extends ErrorListener<unknown> {
public errors: JackCompilerError[] = [];

override syntaxError = (
recognizer: Recognizer<any>,
offendingSymbol: any,
recognizer: Recognizer<unknown>,
offendingSymbol: unknown,
line: number,
column: number,
msg: string,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import { assertExists } from "@davidsouther/jiffies/lib/esm/assert.js";

const primitives = new Set(builtInTypes);
export type Primitive = typeof primitives extends Set<infer S> ? S : never;
/* eslint-disable @typescript-eslint/no-non-null-assertion */
/**
* Creates global symbol table that contains built-in functions and found classes and subroutines
*/
Expand Down
1 change: 0 additions & 1 deletion simulator/src/jack/listener/validator.listener.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ import {
} from "../symbol.js";
import { CallType, getCallType } from "./common.js";
import { assertExists } from "@davidsouther/jiffies/lib/esm/assert.js";
/* eslint-disable @typescript-eslint/no-non-null-assertion */
/**
* Validates Jack file
*/
Expand Down
2 changes: 1 addition & 1 deletion simulator/src/jack/listener/vm.writer.listener.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const unaryOperationToVmCmd: Record<string, string> = {
"-": "neg",
"~": "not",
};
/* eslint-disable @typescript-eslint/no-non-null-assertion */

/**
* Transforms parse tree into VM code
*/
Expand Down

0 comments on commit 70cbcec

Please sign in to comment.