Skip to content

Commit

Permalink
cli
Browse files Browse the repository at this point in the history
  • Loading branch information
maestrow committed May 17, 2021
1 parent 53ab48f commit b9d99e8
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@ import { math1 } from './grammars/math1'
import { ometa1, proj } from './grammars/ometa1'
import { TraceDiscovery } from "./utils/trace-discover";

const saveTrace = (p: Parser) => {
const disco = new TraceDiscovery(ometa1, input, p.trace.data)
const trace = disco.convert()
fs.writeFileSync("./dist/trace.json", JSON.stringify(trace, null, 2))
}

const input = fs.readFileSync('src/grammars/ometa1.ometa', 'utf-8')

//const p = new Parser(math1, [...'((1+2)-3*3)/4'])
//const r = p.match('expr')

const p = new Parser(ometa1, input as unknown as any[], proj)

const r = p.match('ometa')


console.dir(r, {depth: null})
const disco = new TraceDiscovery(ometa1, input, p.trace.data)
const trace = disco.convert()

//console.dir(trace, {depth: null})
fs.writeFileSync("./dist/trace.json", JSON.stringify(trace, null, 2))

0 comments on commit b9d99e8

Please sign in to comment.