wbraswell / rperl

RPerl Compiler
Other
277 stars 34 forks source link

Can't parse helloworld #22

Closed Azq2 closed 9 years ago

Azq2 commented 9 years ago
root@zhumarin /home/azq2/bots/spaces # rperl 1.pl
Can't parse code: Unknown error parsing Perl documentxujroot@zhumarin /home/azq2/bots/spaces # 
root@zhumarin /home/azq2/bots/spaces # cat 1.pl
print "xuj";
wbraswell commented 9 years ago

@Azq2 I'm very confused by the output you have provided here, it appears to show the rperl command producing the output which contains error message "Can't parse code: Unknown error parsing", however there is no such error message ever generated by RPerl! Is this a fake output you have created?

bulk88 commented 9 years ago

Here is the OP's error message, https://metacpan.org/source/MITHALDU/PPI-1.220/lib/PPI/Document.pm#L268

this is what I get on Win32 for that hello world script.

C:\sources>C:\sp3220\perl\site\bin\rperl  t.pl

ERROR ECVPAPC02, RPERL PARSER, PERL CRITIC VIOLATION
Failed Perl::Critic brutal review with the following message:

    Line number:  1
    Policy:       Perl::Critic::Policy::InputOutput::RequireCheckedSyscalls
    Description:  Return value of flagged function ignored - print
    Explanation:  See Perl Best Practices page(s) 208, 278

    Line number:  1
    Policy:       Perl::Critic::Policy::Modules::RequireEndWithOne
    Description:  Module does not end with "1;"
    Explanation:  Must end with a recognizable true value

    Line number:  1
    Policy:       Perl::Critic::Policy::Modules::RequireExplicitPackage
    Description:  Code not contained in explicit package
    Explanation:  Violates encapsulation

    Line number:  1
    Policy:       Perl::Critic::Policy::Modules::RequireVersionVar
    Description:  No package-scoped "$VERSION" variable found
    Explanation:  See Perl Best Practices page(s) 404

    Line number:  1
    Policy:       Perl::Critic::Policy::TestingAndDebugging::RequireUseStrict
    Description:  Code before strictures are enabled
    Explanation:  See Perl Best Practices page(s) 429

    Line number:  1
    Policy:       Perl::Critic::Policy::TestingAndDebugging::RequireUseWarnings
    Description:  Code before warnings are enabled
    Explanation:  See Perl Best Practices page(s) 431

    Line number:  1
    Policy:       Perl::Critic::Policy::ValuesAndExpressions::ProhibitInterpolat
ionOfLiterals
    Description:  Useless interpolation of literal string
    Explanation:  See Perl Best Practices page(s) 51

xuj
wbraswell commented 9 years ago

Oh okay, I see, it was a PPI error message, not an RPerl error message.

The input code is not valid RPerl, please see the following link for a file which is valid RPerl and shows all valid uses of the 'print' operator.

https://github.com/wbraswell/rperl/blob/master/lib/RPerl/Test/OperatorVoid01Print/program_00_good.pl

Also, please note that RPerl currently supports *.pl programs as input files only in test mode perl -t foo.pl, valid RPerl classes only are currently supported in real compiler mode rperl Foo.pm.