zaach/jison — pull request #202 by cjbrowne (2013-12-14 21:03:15+00:00)
Title: AMD module generator should be able to define dependencies

The AMD module generator is great, but at the moment it's hardcoded to produce an empty list of dependencies. This obviously makes it hard to integrate a Jison-generated AMD module into a larger project.

Should only take a small patch of line 954 of jison.js:
var out = '\n\ndefine('+JSON.stringify(opt.deps)+', function('+opt.deps.join(',')+'){'

If I'm correct in my assumptions, that patch would allow you to define dependencies for the generated module using the generator options by providing an array of strings. It's a bit limited since it uses the same array for the names of the modules and their filenames, but it would be enough for most projects.

Pending discussion, I can write this up into a PR for consideration.