[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:
Ewan Mellor 2018-11-11 00:20:21 -08:00
parent e54607d2ae
commit 4201dd9cf3
No known key found for this signature in database
GPG Key ID: 7CE1C6BC9EC8645D
1 changed files with 2 additions and 14 deletions

View File

@ -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" +