Skip to content

Commit

Permalink
#65 properly export assertASTsAreEqual
Browse files Browse the repository at this point in the history
  • Loading branch information
alessiostalla committed May 13, 2024
1 parent db40528 commit 7ddf9ae
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 15 deletions.
16 changes: 11 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,14 @@
"types": "./dist/types/parsing/index.d.ts"
},
"./mapping": {
"import": "./dist/esm/mapping.js",
"require": "./dist/cjs/mapping.js",
"types": "./dist/types/mapping.d.ts"
"import": "./dist/esm/mapping/mapping.js",
"require": "./dist/cjs/mapping/mapping.js",
"types": "./dist/types/mapping/mapping.d.ts"
},
"./testing": {
"import": "./dist/esm/testing/testing.js",
"require": "./dist/cjs/testing/testing.js",
"types": "./dist/types/testing/testing.d.ts"
},
"./interop/ecore": {
"import": "./dist/esm/interop/ecore.js",
Expand All @@ -63,7 +68,8 @@
"typesVersions": {
"*": {
"parsing": ["dist/types/parsing/index.d.ts"],
"mapping": ["dist/types/mapping.d.ts"],
"mapping": ["dist/types/mapping/mapping.d.ts"],
"testing": ["dist/types/testing/testing.d.ts"],
"interop/ecore": ["dist/types/interop/ecore.d.ts"],
"interop/lionweb": ["dist/types/interop/lionweb.d.ts"],
"interop/ecore-enabled-parser": ["dist/types/interop/ecore-enabled-parser.d.ts"],
Expand Down Expand Up @@ -106,7 +112,7 @@
"build": "yarn run build:esm && yarn run build:cjs",
"build:esm": "tsc --module es6 --outDir dist/esm",
"build:cjs": "tsc --module commonjs --outDir dist/cjs",
"extract-docs": "typedoc --out dist/docs src/index.ts src/parsing/index.ts src/mapping.ts src/interop/ecore.ts src/interop/ecore-enabled-parser.ts src/interop/lionweb.ts",
"extract-docs": "typedoc --out dist/docs src/index.ts src/parsing/index.ts src/mapping/mapping.ts src/testing/testing.ts src/interop/ecore.ts src/interop/ecore-enabled-parser.ts src/interop/lionweb.ts",
"lint": "eslint src tests",
"build-test-parser": "antlr4ng -Dlanguage=TypeScript -o tests/parser -Xexact-output-dir -visitor tests/grammar/SimpleLangLexer.g4 tests/grammar/SimpleLangParser.g4",
"test": "yarn run build-test-parser && node --experimental-vm-modules node_modules/jest/bin/jest.js",
Expand Down
6 changes: 2 additions & 4 deletions src/interop/antlr4.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,5 @@
* ANTLR4 interoperability module. Requires the antlr4ng implementation.
* @module interop/antlr4
*/
export * from '../parsing/parse-tree';
export * from '../parsing/parsing';
export * from "../mapping";
export {TylasuParser} from "../parsing";
export * from '../parsing';
export * from "../mapping/mapping";
10 changes: 5 additions & 5 deletions src/mapping.ts → src/mapping/mapping.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import {ParserRuleContext, TerminalNode} from "antlr4ng";
import {Node, Origin} from "./model/model";
import {ASTTransformer} from "./transformation/transformation";
import {ParseTreeOrigin} from "./parsing";
import {Issue} from "./validation";
import {Source} from "./model/position";
import {Node, Origin} from "../model/model";
import {ASTTransformer} from "../transformation/transformation";
import {ParseTreeOrigin} from "../parsing";
import {Issue} from "../validation";
import {Source} from "../model/position";


/**
Expand Down
2 changes: 1 addition & 1 deletion tests/mapping.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {SimpleLangLexer} from "./parser/SimpleLangLexer";
import {CharStream, CommonTokenStream, ParserRuleContext} from "antlr4ng";
import {CompilationUnitContext, DisplayStmtContext, SetStmtContext, SimpleLangParser} from "./parser/SimpleLangParser";
import {ParseTreeOrigin} from "../src/parsing";
import {ParseTreeToASTTransformer} from "../src/mapping";
import {ParseTreeToASTTransformer} from "../src/mapping/mapping";
import {assertASTsAreEqual} from "../src/testing/testing";

class MySetStatement extends Node {
Expand Down

0 comments on commit 7ddf9ae

Please sign in to comment.