Skip to content

Regression in prerelease 7 with echo #243

@rasmusbe

Description

@rasmusbe

This code

<?php
echo __( 'Echoed translation', 'testdomain' );

handles the function __ as a ClassReference

Full AST
Program {
  kind: 'program',
  loc:
   Location {
     source: null,
     start: Position { line: 1, column: 0, offset: 0 },
     end: Position { line: 3, column: 0, offset: 53 } },
  children:
   [ Echo {
       kind: 'echo',
       loc:
        Location {
          source: null,
          start: Position { line: 2, column: 0, offset: 6 },
          end: Position { line: 2, column: 46, offset: 52 } },
       shortForm: false,
       expressions:
        [ Call {
            kind: 'call',
            loc:
             Location {
               source: null,
               start: Position { line: 2, column: 7, offset: 13 },
               end: Position { line: 2, column: 45, offset: 51 } },
            what:
             ClassReference {
               kind: 'classreference',
               loc:
                Location {
                  source: null,
                  start: Position { line: 2, column: 5, offset: 11 },
                  end: Position { line: 2, column: 7, offset: 13 } },
               resolution: 'uqn',
               name: '__' },
            arguments:
             [ String {
                 kind: 'string',
                 loc:
                  Location {
                    source: null,
                    start: Position { line: 2, column: 9, offset: 15 },
                    end: Position { line: 2, column: 29, offset: 35 } },
                 value: 'Echoed translation',
                 raw: "'Echoed translation'",
                 unicode: false,
                 isDoubleQuote: false },
               String {
                 kind: 'string',
                 loc:
                  Location {
                    source: null,
                    start: Position { line: 2, column: 31, offset: 37 },
                    end: Position { line: 2, column: 43, offset: 49 } },
                 value: 'testdomain',
                 raw: "'testdomain'",
                 unicode: false,
                 isDoubleQuote: false } ] } ] } ],
  errors: [],
  comments: [] }

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