Skip to content

Commit 8226cdf

Browse files
committed
Use local ast extractor for typechecker
1 parent 14f0388 commit 8226cdf

17 files changed

+16
-21
lines changed

src/types/ast/astExtractor/expression-extractor.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -205,9 +205,6 @@ export class ExpressionExtractor extends BaseJavaCstVisitorWithDefaults {
205205
}
206206

207207
primary(ctx: PrimaryCtx): Primary {
208-
console.log(ctx)
209-
// Primary will always have a prefix.
210-
211208
let primary = this.visit(ctx.primaryPrefix);
212209
if (ctx.primarySuffix) {
213210
const lastSuffix = ctx.primarySuffix[ctx.primarySuffix.length - 1];
@@ -313,10 +310,8 @@ export class ExpressionExtractor extends BaseJavaCstVisitorWithDefaults {
313310
}
314311

315312
fqnOrRefType(ctx: FqnOrRefTypeCtx) {
316-
console.log(ctx);
317313
let fqn = this.visit(ctx.fqnOrRefTypePartFirst);
318314
if (ctx.fqnOrRefTypePartRest) {
319-
console.log("Rest", ctx.fqnOrRefTypePartRest);
320315
for (const r of ctx.fqnOrRefTypePartRest) {
321316
fqn += "." + this.visit(r);
322317
}

src/types/checker/__tests__/arrays.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { check } from "..";
22
import { IncompatibleTypesError } from "../../errors";
3-
import { parse } from "../../../ast/parser";
3+
import { parse } from "../../ast";
44
import { Type } from "../../types/type";
55

66
const createProgram = (statement: string) => `

src/types/checker/__tests__/assignStatements.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { check } from "..";
22
import { IncompatibleTypesError } from "../../errors";
3-
import { parse } from "../../../ast/parser";
3+
import { parse } from "../../ast";
44
import { Type } from "../../types/type";
55

66
const createProgram = (statement: string) => `

src/types/checker/__tests__/binaryExpressions.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { BadOperandTypesError } from "../../errors";
22
import { check } from "..";
3-
import { parse } from "../../../ast/parser";
3+
import { parse } from "../../ast";
44
import { Type } from "../../types/type";
55

66
const createProgram = (statement: string) => `

src/types/checker/__tests__/booleanLiterals.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { check } from "..";
2-
import { parse } from "../../../ast/parser";
2+
import { parse } from "../../ast";
33
import { Type } from "../../types/type";
44

55
const createProgram = (statement: string) => `

src/types/checker/__tests__/characterLiterals.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { check } from "..";
2-
import { parse } from "../../../ast/parser";
2+
import { parse } from "../../ast";
33
import { Type } from "../../types/type";
44

55
const createProgram = (statement: string) => `

src/types/checker/__tests__/floatingPointLiterals.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { check } from "..";
2-
import { parse } from "../../../ast/parser";
2+
import { parse } from "../../ast";
33
import { Type } from "../../types/type";
44

55
const createProgram = (statement: string) => `

src/types/checker/__tests__/forStatements.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { check } from "..";
2-
import { parse } from "../../../ast/parser";
2+
import { parse } from "../../ast";
33
import {
44
CannotFindSymbolError,
55
IncompatibleTypesError,

src/types/checker/__tests__/ifThenElseStatements.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { check } from "..";
22
import { BadOperandTypesError, IncompatibleTypesError } from "../../errors";
3-
import { parse } from "../../../ast/parser";
3+
import { parse } from "../../ast";
44
import { Type } from "../../types/type";
55

66
const createProgram = (statement: string) => `

src/types/checker/__tests__/integerLiterals.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { check } from "..";
2-
import { parse } from "../../../ast/parser";
2+
import { parse } from "../../ast";
33
import { Type } from "../../types/type";
44

55
const createProgram = (statement: string) => `

0 commit comments

Comments
 (0)