Skip to content
Permalink
Browse files

Actually support "use isms <C++>

Allows this to work:

    use isms <C++>;
    sub new(\a,|c) { a.new(|c) }
    dd new Str, :value<foo>'   # "foo"
  • Loading branch information...
lizmat committed Sep 12, 2018
1 parent 57f8927 commit c6c2b6c4dff593d38dc68a29a41d9b80f50442dd
Showing with 4 additions and 3 deletions.
  1. +4 −3 src/Perl6/Grammar.nqp
@@ -360,8 +360,8 @@ role STD {
}
# "when" arg assumes more things will become obsolete after Perl 6 comes out...
method obs($old, $new, $when = 'in Perl 6', :$always) {
unless $*LANG.pragma('p5isms') && !$always {
method obs($old, $new, $when = 'in Perl 6', :$ism = 'p5isms') {
unless $*LANG.pragma($ism) {
$*W.throw(self.MATCH(), ['X', 'Obsolete'],
old => $old,
replacement => $new,
@@ -2014,7 +2014,8 @@ grammar Perl6::Grammar is HLL::Grammar does STD {
}
token term:sym<new> {
'new' \h+ <longname> \h* <![:]> <.obs("C++ constructor syntax", "method call syntax", :always)>
<!{ $*LANG.pragma('c++isms') }>
'new' \h+ <longname> \h* <![:]> <.obs("C++ constructor syntax", "method call syntax", :ism<c++isms>)>
}
token fatarrow {

0 comments on commit c6c2b6c

Please sign in to comment.
You can’t perform that action at this time.