8000 Add syntactical support for pipelines with `|>` and `?|>` by thekid · Pull Request #52 · xp-framework/ast · GitHub
[go: up one dir, main page]

Skip to content

Add syntactical support for pipelines with |> and ?|> #52

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
May 28, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
  • Loading branch information
thekid committed Feb 8, 2025
commit 7368aa7697ff59d8623764d9593a1a3321c8032c
8 changes: 4 additions & 4 deletions src/main/php/lang/ast/syntax/PHP.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,12 +175,12 @@ public function __construct() {
return new ScopeExpression($scope, $expr, $token->line);
});

$this->infix('|>', 90, function($parse, $token, $left) {
return new PipeExpression($left, $this->expression($parse, 90), $left->line);
$this->infix('|>', 20, function($parse, $token, $left) {
return new PipeExpression($left, $this->expression($parse, 20), $left->line);
});

$this->infix('?|>', 90, function($parse, $node, $left) {
$value= new PipeExpression($left, $this->expression($parse, 90), $left->line);
$this->infix('?|>', 20, function($parse, $node, $left) {
$value= new PipeExpression($left, $this->expression($parse, 20), $left->line);
$value->kind= 'nullsafepipe';
return $value;
});
Expand Down
Loading
0