zaach / jison

Bison in JavaScript.
http://jison.org
4.34k stars 448 forks source link

Always remove the token stack label #352

Open download13 opened 7 years ago

download13 commented 7 years ago

_token_stack label was only removed when token-stack option was present.

winrid commented 6 years ago

Ran into this recently, can this fix be merged?

MoOx commented 6 years ago

Would really like to see this merged as it's preventing me from bundling a project with webpack :(

ftes commented 5 years ago

Anything missing here? Any way to help out?

omervk commented 4 months ago

For those who are still seeing this issue, seven years in, I worked around this by creating a script to replace the CLI:

const cli = require('jison/lib/cli')

// This is a workaround for https://github.com/zaach/jison/pull/352 having never been merged
const oldProcessGrammars = cli.processGrammars

cli.processGrammars = function () {
    const grammar = oldProcessGrammars.apply(this, arguments)
    grammar.options = grammar.options ?? {}
    grammar.options['token-stack'] = true
    return grammar
}

cli.main({
    file: '', // TODO: Add your file path here
    outfile: '', // TODO: Add your output path here
    // TODO: Add any other options you want here
    'token-stack': true,
})