https://github.com/pdubroy/pegboard
Two little interpreters
https://github.com/pdubroy/pegboard
interpreter parsing peg
Last synced: 16 days ago
JSON representation
Two little interpreters
- Host: GitHub
- URL: https://github.com/pdubroy/pegboard
- Owner: pdubroy
- License: mit
- Created: 2023-08-26T08:54:03.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-03-26T10:38:56.000Z (almost 2 years ago)
- Last Synced: 2024-04-14T11:03:54.493Z (over 1 year ago)
- Topics: interpreter, parsing, peg
- Language: JavaScript
- Homepage: https://dubroy.com/blog/two-little-interpreters
- Size: 365 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Pegboard
PEG parsing in TypeScript, two ways:
- an AST interpreter (src/tree-walk.ts)
- a switch-based bytecode interpreter (src/switch-interp.ts)
## Tests
`npm test`
## Benchmarks
`npm run bench:bun` (for JSC) or `npm run bench:node` (V8)
## Debugging and profiling
Deopts:
1. Ensure [Deopt Explorer](https://github.com/microsoft/deoptexplorer-vscode) is
is installed in VSCode.
2. `npx tsc && npx dexnode build/scripts/parse.js test/data/jquery-3.2.1.js`
3. Open the log file (named something like `isolate-0x140078000-55537-v8.log`)
in Deopt Explorer.