blob: 80d4aaab2e4395d50d8ee251e37d425520dd7aa4 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
import * as parser from "../src/parser.js"
import * as fs from "fs"
// try piping "Hello, World" into stdin!
const input = fs.readFileSync(0, "utf-8");
const parse = parser.DO(function* () {
const p = yield parser.string("Hello")
yield parser.char(',')
yield parser.char(' ')
return p
})
console.log(parser.show(parse(input)))
|