Skip to content

Commit

Permalink
Actually support "use isms <C++>
Browse files Browse the repository at this point in the history
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 c6c2b6c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Perl6/Grammar.nqp
Expand Up @@ -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,
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit c6c2b6c

Please sign in to comment.