[Swift] Don't catch exceptions inside the test apps.
We get much more info if we let the exception rise to the top level.
This commit is contained in:
parent
e54607d2ae
commit
4201dd9cf3
|
@ -279,7 +279,6 @@ public class BaseSwiftTest implements RuntimeTestSupport {
|
|||
" }\n" +
|
||||
"}\n" +
|
||||
"\n" +
|
||||
"do {\n" +
|
||||
"let args = CommandLine.arguments\n" +
|
||||
"let input = try ANTLRFileStream(args[1])\n" +
|
||||
"let lex = <lexerName>(input)\n" +
|
||||
|
@ -289,12 +288,7 @@ public class BaseSwiftTest implements RuntimeTestSupport {
|
|||
"<profile>\n" +
|
||||
"let tree = try parser.<parserStartRuleName>()\n" +
|
||||
"<if(profile)>print(profiler.getDecisionInfo().description)<endif>\n" +
|
||||
"try ParseTreeWalker.DEFAULT.walk(TreeShapeListener(), tree)\n" +
|
||||
"}catch ANTLRException.recognition(let e ) {\n" +
|
||||
" print(\"error occur\\(e)\")\n" +
|
||||
"}catch {\n" +
|
||||
" print(\"error occur\")\n" +
|
||||
"}\n"
|
||||
"try ParseTreeWalker.DEFAULT.walk(TreeShapeListener(), tree)\n"
|
||||
);
|
||||
ST createParserST = new ST(" let parser = try <parserName>(tokens)\n");
|
||||
if (debug) {
|
||||
|
@ -329,13 +323,7 @@ public class BaseSwiftTest implements RuntimeTestSupport {
|
|||
"let lex = <lexerName>(input)\n" +
|
||||
"let tokens = CommonTokenStream(lex)\n" +
|
||||
|
||||
"do {\n" +
|
||||
" try tokens.fill()\n" +
|
||||
"} catch ANTLRException.recognition(let e ) {\n" +
|
||||
" print(\"error occur\\(e)\")\n" +
|
||||
"} catch {\n" +
|
||||
" print(\"error occur\")\n" +
|
||||
"}\n" +
|
||||
"try tokens.fill()\n" +
|
||||
|
||||
"for t in tokens.getTokens() {\n" +
|
||||
" print(t)\n" +
|
||||
|
|
Loading…
Reference in New Issue