Chevrotain / chevrotain

Parser Building Toolkit for JavaScript
https://chevrotain.io
Apache License 2.0
2.48k stars 204 forks source link

Running The Playground #1840

Closed esatterwhite closed 2 years ago

esatterwhite commented 2 years ago

I have a project that uses chevrotain, and the playground is great for debugging, but its hard to copy all of my code into it and get it working.

Is it possible to run my own instance of the playground so I can bake my code into the set up of it? I'm not seeing where the code for the playground application lives

It would be really nice to be able to do something like

const {Playground} = require('chevrotain')
const app = new Playground({
  parser: require('./lib/parser')
, tokens: require('./lib/tokens')
, lexer: require('./lib/lexer')
, defaultRule: 'my-rule'
})

app.listen(3000)
bd82 commented 2 years ago

Hello @esatterwhite

The playground is very old (and hacky) code for a static webpage coupled with DOM logic. The code can be found here: https://github.com/Chevrotain/chevrotain/tree/gh-pages/playground

I personally never treated it as a full development tool, but more like a demo tool and prefer developing and debugging in my regular IDE.

Perhaps you could modify it enough for your use-case...