Skip to content

Instantly share code, notes, and snippets.

@perl6
Created November 22, 2009 21:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save perl6/240739 to your computer and use it in GitHub Desktop.
Save perl6/240739 to your computer and use it in GitHub Desktop.
pmichaud@orange:~/ng$ cat x
'abc' ~~ /b/; say $/;
pmichaud@orange:~/ng$ ./perl6 x
Method 'ACCEPTS' not found for invocant of class 'Regex'
current instr.: '&infix:<~~>' pc 155162 (src/gen/perl6-actions.pir:11359)
called from Sub '_block14' pc 29 (EVAL_1:0)
called from Sub '!UNIT_START' pc 1113 (src/glue/run.pir:17)
called from Sub 'perl6;PCT;HLLCompiler;eval' pc -1 ((unknown file):-1)
called from Sub 'perl6;PCT;HLLCompiler;evalfiles' pc 1255 (src/PCT/HLLCompiler.pir:688)
called from Sub 'perl6;PCT;HLLCompiler;command_line' pc 1441 (src/PCT/HLLCompiler.pir:775)
called from Sub 'perl6;Perl6;Compiler;main' pc -1 ((unknown file):-1)
pmichaud@orange:~/ng$ cat src/builtins/Regex.pir
## $Id$
=head1 TITLE
Regex - Perl 6 Regex class
=head1 DESCRIPTION
This file sets up the Perl 6 C<Regex> class, the class for regexes.
=cut
.namespace ['Regex']
.sub 'onload' :anon :load :init
.local pmc p6meta
p6meta = get_hll_global ['Perl6Object'], '$!P6META'
p6meta.'new_class'('Regex', 'parent'=>'Method')
.end
.sub 'ACCEPTS' :method
.param pmc topic
.local pmc match
match = topic.'match'(self)
.return (match)
.end
=over 4
=back
=cut
# Local Variables:
# mode: pir
# fill-column: 100
# End:
# vim: expandtab shiftwidth=4 ft=pir:
pmichaud@orange:~/ng$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment