Skip to content

Commit

Permalink
refactor: remove extraneous globals from semantics and AST (#1196)
Browse files Browse the repository at this point in the history
* refactor: move SrcInfo to a separate file
  • Loading branch information
verytactical authored Dec 17, 2024
1 parent a29bbde commit add1456
Show file tree
Hide file tree
Showing 54 changed files with 1,111 additions and 966 deletions.
4 changes: 2 additions & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ coverage/
**/output/
src/test/**/output/
src/func/funcfiftlib.js
src/grammar/grammar.ohm*.ts
src/grammar/grammar.ohm*.js
**/grammar.ohm*.ts
**/grammar.ohm*.js
jest.setup.js
jest.teardown.js
/docs
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ node_modules
coverage
dist
output/
src/grammar/grammar.ohm-bundle.js
src/grammar/grammar.ohm-bundle.d.ts
**/grammar.ohm-bundle.js
**/grammar.ohm-bundle.d.ts
src/func/funcfiftlib.wasm.js
src/test/contracts/pretty-printer-output
3 changes: 2 additions & 1 deletion src/abi/AbiFunction.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { AstExpression, SrcInfo } from "../grammar/ast";
import { AstExpression } from "../grammar/ast";
import { CompilerContext } from "../context";
import { WriterContext } from "../generator/Writer";
import { TypeRef } from "../types/types";
import { SrcInfo } from "../grammar";

export type AbiFunction = {
name: string;
Expand Down
2 changes: 1 addition & 1 deletion src/abi/map.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { CompilerContext } from "../context";
import { SrcInfo } from "../grammar/grammar";
import { SrcInfo } from "../grammar";
import { TypeRef } from "../types/types";
import { WriterContext } from "../generator/Writer";
import { ops } from "../generator/writers/ops";
Expand Down
7 changes: 6 additions & 1 deletion src/check.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { featureEnable } from "./config/features";
import { CompilerContext } from "./context";
import { getAstFactory } from "./grammar/ast";
import { getParser } from "./grammar";
import files from "./imports/stdlib";
import { createVirtualFileSystem, TactError, VirtualFileSystem } from "./main";
import { precompile } from "./pipeline/precompile";
Expand Down Expand Up @@ -35,10 +37,13 @@ export function check(args: {
ctx = featureEnable(ctx, "masterchain"); // Enable masterchain flag to avoid masterchain-specific errors
ctx = featureEnable(ctx, "external"); // Enable external messages flag to avoid external-specific errors

const ast = getAstFactory();
const parser = getParser(ast);

// Execute check
const items: CheckResultItem[] = [];
try {
precompile(ctx, args.project, stdlib, args.entrypoint);
precompile(ctx, args.project, stdlib, args.entrypoint, parser, ast);
} catch (e) {
if (e instanceof TactError) {
items.push({
Expand Down
Loading

0 comments on commit add1456

Please sign in to comment.