develooper Front page | perl.perl5.porters | Postings from August 2016

[perl #129073] Perl_yyparse: Assertion `( (((PL_curcop ==&PL_compiling ? PL_compiling.cop_hints : PL_curcop->cop_hints) & 0x1c000000)>> 26) == (0x1c000000 >> 26) && (((PL_curcop == &PL_compiling ?PL_compiling.cop

From:
Father Chrysostomos via RT
Date:
August 25, 2016 00:54
Subject:
[perl #129073] Perl_yyparse: Assertion `( (((PL_curcop ==&PL_compiling ? PL_compiling.cop_hints : PL_curcop->cop_hints) & 0x1c000000)>> 26) == (0x1c000000 >> 26) && (((PL_curcop == &PL_compiling ?PL_compiling.cop
Message ID:
rt-4.0.24-1916-1472086437-1360.129073-15-0@perl.org
On Wed Aug 24 16:27:33 2016, brian.carpenter@gmail.com wrote:
> Perl v5.25.4-10-g8d168aa
> 
> ./perl -e '%{p{};sub p}()'

With a simple ‘{sub f}’, the lexer emits a semicolon before the closing brace.  Excerpt from -DpT output:

Reading a token:
### 1:LEX_NORMAL/XBLOCK "}\n"
### forced token:
### <== '}'

### <== ';'

(A ‘forced token’ is a pending token that will be emitted the next time yylex is called.)

With %{p{}; before it, it behaves differently:

Reading a token:
### 1:LEX_NORMAL/XBLOCK "}()\n"
### 1:LEX_NORMAL/XOPERATOR "()\n"
### <== '('

I have not looked into why.

BTW, perl interprets %{p{foo}} as %p{foo}, and the parser starts to read the %{p{... as a key/value slice.

-- 

Father Chrysostomos


---
via perlbug:  queue: perl5 status: new
https://rt.perl.org/Ticket/Display.html?id=129073



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About