-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #32 from xp-framework/feature/new-callable
Support `new T(...)` callable syntax
- Loading branch information
Showing
3 changed files
with
60 additions
and
1 deletion.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
src/main/php/lang/ast/nodes/CallableNewExpression.class.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php namespace lang\ast\nodes; | ||
|
||
use lang\ast\Node; | ||
|
||
class CallableNewExpression extends Node { | ||
public $kind= 'callablenew'; | ||
public $type; | ||
|
||
public function __construct($type, $line= -1) { | ||
$this->type= $type; | ||
$this->line= $line; | ||
} | ||
|
||
/** @return iterable */ | ||
public function children() { return [$this->type]; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters