WIP PPI version causes Marpa to fail its tests (this blocks PPI)
wchristian opened this issue · 6 comments
Specifically this one:
D:\cpan\Marpa-R2-4.000000>prove -bv t\use.t
t\use.t ..
1..1
Perl token "THING" was not accepted: '5'
PPI token is PPI::Token::Number: [no file]:11:12, content="5" at t\use.t line 164.
# Looks like your test exited with 255 before it could output anything.
Dubious, test returned 255 (wstat 65280, 0xff00)
The branch with the PPI work is here: https://github.com/adamkennedy/PPI/tree/mmore
The line of Perl code that Marpa seems to disagree with PPI over is:
use v5 xyz 5;
Which i'm not even sure what the expected parse should be, given it's invalid syntax even without strict.
This is currently blocking PPI, so can you please either adapt your tests, or let me know how PPI should be parsing this?
1..1
PPI::Token::Word; use
PPI::Token::Whitespace;
PPI::Token::Number::Version; v5
PPI::Token::Structure; ;
PPI::Token::Whitespace;
PPI::Token::Word; use
PPI::Token::Whitespace;
PPI::Token::Number; 5
PPI::Token::Structure; ;
PPI::Token::Whitespace;
PPI::Token::Word; use
PPI::Token::Whitespace;
PPI::Token::Number::Float; 5.1
PPI::Token::Structure; ;
PPI::Token::Whitespace;
PPI::Token::Word; use
PPI::Token::Whitespace;
PPI::Token::Word; xyz
PPI::Token::Structure; ;
PPI::Token::Whitespace;
PPI::Token::Word; use
PPI::Token::Whitespace;
PPI::Token::Number::Version; v5
PPI::Token::Whitespace;
PPI::Token::Word; xyz
PPI::Token::Structure; ;
PPI::Token::Whitespace;
PPI::Token::Word; use
PPI::Token::Whitespace;
PPI::Token::Number; 5
PPI::Token::Whitespace;
PPI::Token::Word; xyz
PPI::Token::Structure; ;
PPI::Token::Whitespace;
PPI::Token::Word; use
PPI::Token::Whitespace;
PPI::Token::Number::Float; 5.1
PPI::Token::Whitespace;
PPI::Token::Word; xyz
PPI::Token::Structure; ;
PPI::Token::Whitespace;
PPI::Token::Word; use
PPI::Token::Whitespace;
PPI::Token::Word; xyz
PPI::Token::Whitespace;
PPI::Token::Number::Version; v5
PPI::Token::Structure; ;
PPI::Token::Whitespace;
PPI::Token::Word; use
PPI::Token::Whitespace;
PPI::Token::Word; xyz
PPI::Token::Whitespace;
PPI::Token::Number; 5
PPI::Token::Structure; ;
PPI::Token::Whitespace;
PPI::Token::Word; use
PPI::Token::Whitespace;
PPI::Token::Word; xyz
PPI::Token::Whitespace;
PPI::Token::Number::Float; 5.1
PPI::Token::Structure; ;
PPI::Token::Whitespace;
PPI::Token::Word; use
PPI::Token::Whitespace;
PPI::Token::Number::Version; v5
PPI::Token::Whitespace;
PPI::Token::Word; xyz
PPI::Token::Whitespace;
PPI::Token::Number; 5
PPI::Token::Structure; ;
PPI::Token::Whitespace;
PPI::Token::Word; use
PPI::Token::Whitespace;
PPI::Token::Number; 5
PPI::Token::Whitespace;
PPI::Token::Word; xyz
PPI::Token::Whitespace;
PPI::Token::Number; 5
PPI::Token::Structure; ;
PPI::Token::Whitespace;
PPI::Token::Word; use
PPI::Token::Whitespace;
PPI::Token::Number::Float; 5.1
PPI::Token::Whitespace;
PPI::Token::Word; xyz
PPI::Token::Whitespace;
PPI::Token::Number; 5
PPI::Token::Structure; ;
PPI::Token::Whitespace;
PPI::Token::Word; use
PPI::Token::Whitespace;
PPI::Token::Word; xyz
PPI::Token::Whitespace;
PPI::Token::Number::Version; v5
PPI::Token::Whitespace;
PPI::Token::Number; 5
PPI::Token::Structure; ;
PPI::Token::Whitespace;
PPI::Token::Word; use
PPI::Token::Whitespace;
PPI::Token::Word; xyz
PPI::Token::Whitespace;
PPI::Token::Number; 5
PPI::Token::Whitespace;
PPI::Token::Number; 5
PPI::Token::Structure; ;
PPI::Token::Whitespace;
PPI::Token::Word; use
PPI::Token::Whitespace;
PPI::Token::Word; xyz
PPI::Token::Whitespace;
PPI::Token::Number::Float; 5.1
PPI::Token::Whitespace;
PPI::Token::Number; 5
PPI::Token::Structure; ;
PPI::Token::Whitespace;
PPI::Token::Word; use
PPI::Token::Whitespace;
PPI::Token::Number::Version; v5
PPI::Token::Whitespace;
PPI::Token::Word; xyz
PPI::Token::Whitespace;
PPI::Token::Number; 5
PPI::Token::Operator; ,
PPI::Token::Whitespace;
PPI::Token::Number; 5
PPI::Token::Structure; ;
PPI::Token::Whitespace;
PPI::Token::Word; use
PPI::Token::Whitespace;
PPI::Token::Number; 5
PPI::Token::Whitespace;
PPI::Token::Word; xyz
PPI::Token::Whitespace;
PPI::Token::Number; 5
PPI::Token::Operator; ,
PPI::Token::Whitespace;
PPI::Token::Number; 5
PPI::Token::Structure; ;
PPI::Token::Whitespace;
PPI::Token::Word; use
PPI::Token::Whitespace;
PPI::Token::Number::Float; 5.1
PPI::Token::Whitespace;
PPI::Token::Word; xyz
PPI::Token::Whitespace;
PPI::Token::Number; 5
PPI::Token::Operator; ,
PPI::Token::Whitespace;
PPI::Token::Number; 5
PPI::Token::Structure; ;
PPI::Token::Whitespace;
PPI::Token::Word; use
PPI::Token::Whitespace;
PPI::Token::Word; xyz
PPI::Token::Whitespace;
PPI::Token::Number::Version; v5
PPI::Token::Whitespace;
PPI::Token::Number; 5
PPI::Token::Operator; ,
PPI::Token::Whitespace;
PPI::Token::Number; 5
PPI::Token::Structure; ;
PPI::Token::Whitespace;
PPI::Token::Word; use
PPI::Token::Whitespace;
PPI::Token::Word; xyz
PPI::Token::Whitespace;
PPI::Token::Number; 5
PPI::Token::Whitespace;
PPI::Token::Number; 5
PPI::Token::Operator; ,
PPI::Token::Whitespace;
PPI::Token::Number; 5
PPI::Token::Structure; ;
PPI::Token::Whitespace;
PPI::Token::Word; use
PPI::Token::Whitespace;
PPI::Token::Word; xyz
PPI::Token::Whitespace;
PPI::Token::Number::Float; 5.1
PPI::Token::Whitespace;
PPI::Token::Number; 5
PPI::Token::Operator; ,
PPI::Token::Whitespace;
PPI::Token::Number; 5
PPI::Token::Structure; ;
PPI::Token::Whitespace;
PPI::Token::Word; use
PPI::Token::Whitespace;
PPI::Token::Word; xyz
PPI::Token::Whitespace;
PPI::Token::Number::Float; 5.1
PPI::Token::Whitespace;
PPI::Token::Symbol; @a
PPI::Token::Structure; ;
PPI::Token::Whitespace;
Here's the portion of the above that I think is relevant to the issue, if you were correct in singling out the use v5 xyz 5;
statement as the point of failure:
PPI::Token::Word; use
PPI::Token::Whitespace;
PPI::Token::Number::Version; v5
PPI::Token::Whitespace;
PPI::Token::Word; xyz
PPI::Token::Whitespace;
PPI::Token::Number; 5
PPI::Token::Structure; ;
PPI::Token::Whitespace;
The error message indicates that the PPI::Token::Number
token for the string 5
is not expected at the point where it occurs. This probably means that a false expectation was set up by a change in the token stream earlier. Because of the structure of the grammar, this false expectation is likelier to occur in the portion of the tokenization that I have quoted in this message. In particular, what are the tokens in the bleeding-edge PPI for v5
and xyz
?
If they're OK, you might look at the tokenization in prior statements. Bleeding-edge and stable PPI tokenization should match, or else Marpa::R2's t/use.t
is going to get out-of-sync.
I hope this is helpful, jeffrey
Thanks a lot for the information, i've written a test and it's highlighting that changes did indeed break some things. I'll be fixing that on my end to conform to the correct expectations. :)
D:\cpan\PPI>prove -l t\marpa.t
t\marpa.t ..
# Failed test '"use v5 ;"'
t\marpa.t .. 1/23 # at t\marpa.t line 11.
# Structures begin differing at:
# $got->[4] = 'PPI::Token::Word'
# $expected->[4] = 'PPI::Token::Number::Version'
# >>> use v5 ; -- "use v5 ;"
# GOT: [ 'PPI::Statement::Include', 'use v5 ;', 'PPI::Token::Word', 'use', 'PPI::Token::Word', 'v5', 'PPI::Token::Structure', ';']
# EXP: [ 'PPI::Statement::Include', 'use v5 ;', 'PPI::Token::Word', 'use', 'PPI::Token::Number::Version', 'v5', 'PPI::Token::Structure', ';']
# Failed test '"use v5 xyz () ;"'
# at t\marpa.t line 54.
# Structures begin differing at:
# $got->[4] = 'PPI::Token::Word'
# $expected->[4] = 'PPI::Token::Number::Version'
# >>> use v5 xyz () ; -- "use v5 xyz () ;"
# GOT: [ 'PPI::Statement::Include', 'use v5 xyz () ;', 'PPI::Token::Word', 'use', 'PPI::Token::Word', 'v5', 'PPI::Token::Word', 'xyz', 'PPI::Structure::List', '()', 'PPI::Token::Structure', '(', 'PPI::Token::Structure', ')', 'PPI::Token::Structure', ';']
# EXP: [ 'PPI::Statement::Include', 'use v5 xyz () ;', 'PPI::Token::Word', 'use', 'PPI::Token::Number::Version', 'v5', 'PPI::Token::Word', 'xyz', 'PPI::Structure::List', '()', 'PPI::Token::Structure', '(', 'PPI::Token::Structure', ')', 'PPI::Token::Structure', ';']
# Failed test '"use v5 xyz 5 ;"'
# at t\marpa.t line 138.
# Structures begin differing at:
# $got->[4] = 'PPI::Token::Word'
# $expected->[4] = 'PPI::Token::Number::Version'
# >>> use v5 xyz 5 ; -- "use v5 xyz 5 ;"
# GOT: [ 'PPI::Statement::Include', 'use v5 xyz 5 ;', 'PPI::Token::Word', 'use', 'PPI::Token::Word', 'v5', 'PPI::Token::Word', 'xyz', 'PPI::Token::Number', '5', 'PPI::Token::Structure', ';']
# EXP: [ 'PPI::Statement::Include', 'use v5 xyz 5 ;', 'PPI::Token::Word', 'use', 'PPI::Token::Number::Version', 'v5', 'PPI::Token::Word', 'xyz', 'PPI::Token::Number', '5', 'PPI::Token::Structure', ';']
# Failed test '"use v5 xyz 5,5 ;"'
# at t\marpa.t line 210.
# Structures begin differing at:
# $got->[4] = 'PPI::Token::Word'
# $expected->[4] = 'PPI::Token::Number::Version'
# >>> use v5 xyz 5,5 ; -- "use v5 xyz 5,5 ;"
# GOT: [ 'PPI::Statement::Include', 'use v5 xyz 5,5 ;', 'PPI::Token::Word', 'use', 'PPI::Token::Word', 'v5', 'PPI::Token::Word', 'xyz', 'PPI::Token::Number', '5', 'PPI::Token::Operator', ',', 'PPI::Token::Number', '5', 'PPI::Token::Structure', ';']
# EXP: [ 'PPI::Statement::Include', 'use v5 xyz 5,5 ;', 'PPI::Token::Word', 'use', 'PPI::Token::Number::Version', 'v5', 'PPI::Token::Word', 'xyz', 'PPI::Token::Number', '5', 'PPI::Token::Operator', ',', 'PPI::Token::Number', '5', 'PPI::Token::Structure', ';']
# Looks like you failed 4 tests of 23.
t\marpa.t .. Dubious, test returned 4 (wstat 1024, 0x400)
Failed 4/23 subtests
Test Summary Report
-------------------
t\marpa.t (Wstat: 1024 Tests: 23 Failed: 4)
Failed tests: 1, 5, 11, 17
Non-zero exit status: 4
Files=1, Tests=23, 1 wallclock secs ( 0.06 usr + 0.03 sys = 0.09 CPU)
Result: FAIL
D:\cpan\PPI>