Closed mrigger closed 2 years ago
Our internal version has better error message, shown as below
Exception in thread "main" java.lang.IllegalStateException: Failed to detect the language kind for file /tmp/tmp.fCqtnqktZv/a.non_existent_language
The available languages are listed below:
go: exts=[go]
rust: exts=[rs]
scala: exts=[scala, sc]
java: exts=[java]
c: exts=[c]
system_verilog: exts=[v, sv]
solidity: exts=[sol]
cpp: exts=[cc, cpp, cxx]
javascript: exts=[javascript, js]
php: exts=[php]
smtlibv2: exts=[smt2]
python3: exts=[py, py3]
ruby: exts=[rb]
at org.perses.grammar.AbstractParserFacadeFactory.reportError$src_org_perses_grammar_facade_factory(AbstractParserFacadeFactory.kt:63)
at org.perses.grammar.AbstractParserFacadeFactory.computeLanguageKindOrThrow(AbstractParserFacadeFactory.kt:50)
at org.perses.reduction.RegularProgramReductionDriver$Companion.createReductionInputs(RegularProgramReductionDriver.kt:57)
at org.perses.reduction.RegularProgramReductionDriver$Companion.create(RegularProgramReductionDriver.kt:101)
at org.perses.Main.createReductionDriver(Main.java:85)
at org.perses.AbstractMain.internalRun(AbstractMain.kt:33)
at org.perses.util.cmd.AbstractMain.run(AbstractMain.kt:53)
at org.perses.Main.main(Main.java:89)
Next week, we will push a release to the public repo. Thanks for reporting. I also added a regression test to make sure in the future we still report such an error message when a language is not supported.
Awesome, thanks!
I just tried executing Perses on a file with a SQL extension using the command line below:
This resulted in the following
Exception
:While this might be expected, I think it would be useful to explicitly check for supported extensions and throw a more informative
Exception
, or print an error message, when the extension is not supported.