Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Initial incomplete fake implementation of &fail
  • Loading branch information
tene committed Dec 7, 2009
1 parent 0a236ac commit e71334b
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/builtins/control.pir
Expand Up @@ -36,6 +36,26 @@ src/builtins/control.pir - control flow related functions
.return ()
.end

=item fail

=cut

# XXX Need to throw a Failure, not a Mu
# XXX Need to check for 'use fatal'
.sub '&fail'
.param pmc value :optional
.param int has_value :opt_flag
.local pmc ex, failure

failure = new ['Mu']

ex = root_new ['parrot';'Exception']
ex['payload'] = failure
ex['severity'] = .EXCEPT_ERROR
ex['type'] = .CONTROL_RETURN
throw ex
.end

=item continue

=cut
Expand Down

0 comments on commit e71334b

Please sign in to comment.