From 4fc472c43797c0c8ccb30425e43b942214823a2c Mon Sep 17 00:00:00 2001 From: maestrow Date: Mon, 17 May 2021 10:56:38 +0300 Subject: [PATCH] Made all paths in imports relative. Thus steps shouldn't use modules from other steps. --- src/step2/grammars/ometa1.ts | 2 +- src/step2/utils/trace-discover.ts | 6 +++--- src/step3/cli.ts | 2 +- src/step3/grammars/ometa1.ts | 2 +- src/step3/test.ts | 2 +- src/step3/utils/trace-discover.ts | 6 +++--- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/step2/grammars/ometa1.ts b/src/step2/grammars/ometa1.ts index d30202b..b4db5d0 100644 --- a/src/step2/grammars/ometa1.ts +++ b/src/step2/grammars/ometa1.ts @@ -1,4 +1,4 @@ -import { IProjectors } from 'step2/types' +import { IProjectors } from '../types' import { Ast as AST } from '../grammar-ast' export const ometa1: AST.Grammar = [ diff --git a/src/step2/utils/trace-discover.ts b/src/step2/utils/trace-discover.ts index 0ab83e6..14aca19 100644 --- a/src/step2/utils/trace-discover.ts +++ b/src/step2/utils/trace-discover.ts @@ -1,6 +1,6 @@ -import { Ast } from "step2/grammar-ast"; -import { TraceItem } from "step2/tracer"; -import { Compiler, Templates, TemplatesTrace } from "step2/ast2ometa"; +import { Ast } from "../grammar-ast"; +import { TraceItem } from "../tracer"; +import { Compiler, Templates, TemplatesTrace } from "../ast2ometa"; export class TraceDiscovery { diff --git a/src/step3/cli.ts b/src/step3/cli.ts index 4857023..5fbb879 100644 --- a/src/step3/cli.ts +++ b/src/step3/cli.ts @@ -6,7 +6,7 @@ import { ometa1, proj } from './grammars/ometa1' import { TraceDiscovery } from "./utils/trace-discover"; -const input = fs.readFileSync('src/step2/grammars/ometa1.ometa', 'utf-8') +const input = fs.readFileSync('src/step3/grammars/ometa1.ometa', 'utf-8') //const p = new Parser(math1, [...'((1+2)-3*3)/4']) //const r = p.match('expr') diff --git a/src/step3/grammars/ometa1.ts b/src/step3/grammars/ometa1.ts index d30202b..b4db5d0 100644 --- a/src/step3/grammars/ometa1.ts +++ b/src/step3/grammars/ometa1.ts @@ -1,4 +1,4 @@ -import { IProjectors } from 'step2/types' +import { IProjectors } from '../types' import { Ast as AST } from '../grammar-ast' export const ometa1: AST.Grammar = [ diff --git a/src/step3/test.ts b/src/step3/test.ts index b821627..019e452 100644 --- a/src/step3/test.ts +++ b/src/step3/test.ts @@ -3,7 +3,7 @@ import { ometa1, proj } from './grammars/ometa1' import * as fs from "fs"; test('the data is peanut butter', () => { - const input = fs.readFileSync('src/step2/grammars/ometa1.ometa', 'utf-8') + const input = fs.readFileSync('src/step3/grammars/ometa1.ometa', 'utf-8') const p = new Parser(ometa1, input as unknown as any[], proj) const r = p.match('ometa') //const p = new Parser() diff --git a/src/step3/utils/trace-discover.ts b/src/step3/utils/trace-discover.ts index 0ab83e6..14aca19 100644 --- a/src/step3/utils/trace-discover.ts +++ b/src/step3/utils/trace-discover.ts @@ -1,6 +1,6 @@ -import { Ast } from "step2/grammar-ast"; -import { TraceItem } from "step2/tracer"; -import { Compiler, Templates, TemplatesTrace } from "step2/ast2ometa"; +import { Ast } from "../grammar-ast"; +import { TraceItem } from "../tracer"; +import { Compiler, Templates, TemplatesTrace } from "../ast2ometa"; export class TraceDiscovery {