Skip to content

Commit

Permalink
Update error description on sub circumfix:<:{ }>()
Browse files Browse the repository at this point in the history
For some reason it now thinks we're changing the Perl 6 grammar now.
So either we have a problem in the Perl 6 grammar in the handling of :{ }
or we have a false positive on the error message.

Not pursuing this further at this point.
  • Loading branch information
lizmat committed Feb 24, 2018
1 parent bf5e335 commit 26e34cd
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/core/Hash.pm
Expand Up @@ -836,12 +836,13 @@ my class Hash { # declared in BOOTSTRAP
}

sub circumfix:<{ }>(*@elems) { my % = @elems }
# XXX parse dies with 'don't change grammar in the setting, please!'
# with ordinary sub declaration
#sub circumfix:<:{ }>(*@elems) { Hash.^parameterize(Mu,Any).new(@elems) }
BEGIN my &circumfix:<:{ }> = sub (*@e) { Hash.^parameterize(Mu,Any).new(@e) }

proto sub hash(|) {*}
multi sub hash(*%h) { %h }
multi sub hash(*@a, *%h) { my % = flat @a, %h }

# XXX parse hangs with ordinary sub declaration
BEGIN my &circumfix:<:{ }> = sub (*@elems) { Hash.^parameterize(Mu,Any).new(@elems) }

# vim: ft=perl6 expandtab sw=4

0 comments on commit 26e34cd

Please sign in to comment.