antlr4-lab icon indicating copy to clipboard operation
antlr4-lab copied to clipboard

Path to examples is hardwired in JS code; code not robust in case of error

Open kaby76 opened this issue 2 years ago • 0 comments

  • 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

kaby76 avatar Mar 01 '23 12:03 kaby76