Giter Site home page Giter Site logo

Misparse of &&= and ||= about ppi HOT 5 CLOSED

perl-critic avatar perl-critic commented on June 18, 2024
Misparse of &&= and ||=

from ppi.

Comments (5)

moregan avatar moregan commented on June 18, 2024

Would you please double-check that those results are from PPI 1.216_01? The results you report are 1.215 behavior that was fixed in 1.216_01 (see #18). With 1.216_01 I get:

ppidump '$foo ||= 0;'
                    PPI::Document
                      PPI::Statement
[    1,   1,   1 ]     PPI::Token::Symbol       '$foo'
[    1,   6,   6 ]     PPI::Token::Operator     '||='
[    1,  10,  10 ]     PPI::Token::Number       '0'
[    1,  11,  11 ]     PPI::Token::Structure    ';'

Thanks.

from ppi.

moregan avatar moregan commented on June 18, 2024

The change in parsing of ||= et al. is why I believe ValuesAndExpressions::RequireConstantVersion no longer passes its tests.

More notes I've accumulated on the same general topic:

Subroutines::RequireArgUnpacking has started reporting on:

sub BUILD {
    my ($class, $options_ref) = @_;
    $options_ref ||= @_;
}

ErrorHandling::RequireCheckingReturnValueOfEval has started warning on:

return ($has_module_cache{"$mod$version"} ||= eval("require $mod; Exporter::require_version('$mod', $version) if ($version); 1"));

ValuesAndExpressions::ProhibitMixedBooleanOperators has stopped reporting:

$LineEnding ||= guess_endings($File) or
    $this->{_ErrorMsg} = "message $FileName.", goto done;

from ppi.

thaljef avatar thaljef commented on June 18, 2024

Would you please double-check that those results are from PPI 1.216_01?

You were right. I stand corrected.

The change in parsing of ||= et al. is why I believe ValuesAndExpressions::RequireConstantVersion no longer passes its tests.

That's exactly what led me here. Upon further inspection, it appears that we had written a workaround for the problem. And now that the problem is fixed in 1.216_01, I need to remove it.

I will look into those other cases. Thanks for letting me know.

from ppi.

moregan avatar moregan commented on June 18, 2024

There's also a workaround in ProhibitAugmentedAssignmentInDeclaration. I've been waiting for years to get rid of it, but you're welcome to go ahead without me :-)

from ppi.

thaljef avatar thaljef commented on June 18, 2024

I've been waiting for years to get rid of it, but you're welcome to go ahead without me :-)

Done.

from ppi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.