tagua-vm / parser

Safe, fast and memory efficient PHP parser (lexical and syntactic analysers, and the Abstract Syntax Tree)
http://tagua.io/
119 stars 15 forks source link

Expression, Intrinsic operators #73

Closed Hywan closed 7 years ago

Hywan commented 7 years ago

Address #72. Address https://github.com/tagua-vm/parser/issues/14.

Specification

https://github.com/php/php-langspec/blob/master/spec/10-expressions.md#intrinsics

Progression

Hywan commented 7 years ago

@nikic exit(2) is valid regarding the spec and Zend Engine implementation. exit 2 is valid regarding the spec but not Zend Engine implementation. Is an issue from the spec?

For the record, the extract from the current spec:

  exit-intrinsic:
    exit  expressionopt
    exit  (  expressionopt  )
    die   expressionopt
    die   (   expressionopt )
nikic commented 7 years ago

@Hywan Yeah, spec bug. Should be

  exit-intrinsic:
    exit
    exit  (  expressionopt  )
    die
    die   (   expressionopt )
Hywan commented 7 years ago

@nikic Would you like me to open a PR?

nikic commented 7 years ago

@Hywan Yeah, would be great!

Hywan commented 7 years ago

@nikic Thank you for following the project and having a close look at what we are doing :-]. Very much appreciated and precious!

Hywan commented 7 years ago

Related PR on the spec: https://github.com/php/php-langspec/pull/176, https://github.com/php/php-langspec/pull/175 and https://github.com/php/php-langspec/pull/174.

Hywan commented 7 years ago

Need to support the long array(…) form, and by reference.