antlr4-lab
antlr4-lab copied to clipboard
Path to examples is hardwired in JS code; code not robust in case of error
- The JS browser code hardwires the path to the examples directory:
- https://github.com/antlr/antlr4-lab/blob/711ef7d86fd5484d37eeceaf6328dfc936ab3b49/static/js/grammars-v4.js#L38
- https://github.com/antlr/antlr4-lab/blob/711ef7d86fd5484d37eeceaf6328dfc936ab3b49/static/js/grammars-v4.js#L88
- The client code tries to download the example input file. If there is a problem retrieving the example, the rest of the UI set-up fails, including setting up the start symbol, which occurs just after doing the download. https://github.com/antlr/antlr4-lab/blob/711ef7d86fd5484d37eeceaf6328dfc936ab3b49/static/js/grammars-v4.js#L42