New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handles parrot's exceptions in Str.substr. #142
Comments
From @bacekHello. Attached patch handles parrot's exception on substr invocations and -- |
From @baceksubstr.diffdiff --git a/languages/perl6/src/classes/Str.pir b/languages/perl6/src/classes/Str.pir
index 6195989..eb454cb 100644
--- a/languages/perl6/src/classes/Str.pir
+++ b/languages/perl6/src/classes/Str.pir
@@ -258,10 +284,17 @@ Returns a Perl representation of the Str.
len = len - start
end:
+ push_eh cant_substr
$S0 = substr self, start, len
+ pop_eh
s = new 'Str'
s = $S0
.return (s)
+ cant_substr:
+ .get_results ($P0, $S0)
+ s = new 'Failure'
+ .return (s)
+
.end
=back
|
From @pmichaudPatch postponed for now -- instead of creating Failure objects directly Pm |
The RT System itself - Status changed from 'new' to 'open' |
From @bacekOn Sat Jun 21 21:46:33 2008, pmichaud wrote:
Here it is. -- |
From @baceksubstr2.patchdiff --git a/languages/perl6/src/builtins/any-str.pir b/languages/perl6/src/builtins/any-str.pir
index 791ff45..16980d9 100644
--- a/languages/perl6/src/builtins/any-str.pir
+++ b/languages/perl6/src/builtins/any-str.pir
@@ -519,8 +519,14 @@ B<Note:> partial implementation only
len -= start
len_done:
$S0 = self
+ push_eh fail
$S1 = substr $S0, start, len
+ pop_eh
.return ($S1)
+ fail:
+ .get_results($P0)
+ pop_eh
+ .tailcall '!FAIL'($P0)
.end
=item trans()
|
From @moritzOn Thu Nov 13 16:59:19 2008, bacek wrote:
Applied as r32781, thanks |
@moritz - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#56216 (status was 'resolved')
Searchable as RT56216$
The text was updated successfully, but these errors were encountered: