Skip to content

Incorrect print precedence #208

Closed
Closed

Description

@nikic

print should be between and and yield, currently it's spec'd as taking an arbitrary expression. https://github.com/php/php-langspec/blob/master/spec/10-expressions.md#grammar-print-intrinsic

Activity

  1. nikic commented on Sep 19, 2017

    @nikic
    MemberAuthor

    yield from also has incorrect precedence.

  2. nikic commented on Sep 19, 2017

    @nikic
    MemberAuthor

    Also the yield precedence is not correctly specified, in particular regarding the interaction with arrays, that is [yield "foo" => "bar"], which is [(yield "foo" => "bar")] rather than [(yield "foo") => "bar"].

  3. nikic commented on Mar 15, 2019

    @nikic
    MemberAuthor

    Precedence fixed for by-ref assign (1058a50), yield from (b0dadd5) and print (63d72a6).

    The issue with the yield vs array literal precedence remains, and I'm not sure if there's any reasonable way to specify that in grammar. I didn't manage to get this to work without precedence annotations in the parser.

  4. nikic commented on Mar 15, 2019

    @nikic
    MemberAuthor

    Opened #235 for the yield issue, closing this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions