Ticket #35: throwStop.patch
File throwStop.patch, 1.2 KB (added by hopscc, 16 years ago) |
---|
-
Source/CobraParser.cobra
539 539 token = .grab 540 540 branch token.text 541 541 on 'throw' 542 msg = .optional('STRING_SINGLE','STRING_DOUBLE') 543 if msg 544 print '%%> [msg.text[1:-1]]' 545 .throwError('Compilation Stopped due CompilerDirective "throw"') 542 546 # throw an internal error. used for testing that the compiler will catch and report these as internal errors 543 547 .expect('EOL') 544 548 # TODO: throw AssertException(SourceSite sourceSite, object[] expressions, object thiss, object info) -
Tests/820-errors/600-other/120-throw-stop.cobra
1 # This tests %% throw with message ends with Compilation Stopped 2 # Need also test that thrown msg emitted but need TestifyRunner i/f for that 3 4 5 #below emits %%> internal error 6 %% throw 'internal error' # .error. Compilation Stopped 7 8 class Program 9 10 def main is shared 11 pass