Skip to content

Commit

Permalink
Latte: sets Tag::$node
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Nov 12, 2023
1 parent cdc6d79 commit 8eef0b0
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@
"nette/application": "^3.0",
"nette/di": "^3.0",
"nette/tester": "^2.4",
"latte/latte": "^2.10.2 || ^3.0.8",
"latte/latte": "^2.10.2 || ^3.0.11",
"tracy/tracy": "^2.9",
"phpstan/phpstan-nette": "^1"
},
"conflict": {
"latte/latte": ">=3.1"
"latte/latte": ">=3.0.0 <3.0.11 || >=3.1"
},
"suggest": {
"ext-intl": "to use date/time controls"
Expand Down
2 changes: 1 addition & 1 deletion src/Bridges/FormsLatte/Nodes/FieldNNameNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ final class FieldNNameNode extends StatementNode
public static function create(Tag $tag): \Generator
{
$tag->expectArguments();
$node = new static;
$node = $tag->node = new static;
$node->name = $tag->parser->parseUnquotedStringOrExpression(colon: false);
if ($tag->parser->stream->tryConsume(':')) {
$node->part = $tag->parser->isEnd()
Expand Down
2 changes: 1 addition & 1 deletion src/Bridges/FormsLatte/Nodes/FormContainerNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public static function create(Tag $tag): \Generator
$tag->outputMode = $tag::OutputRemoveIndentation;
$tag->expectArguments();

$node = new static;
$node = $tag->node = new static;
$node->name = $tag->parser->parseUnquotedStringOrExpression();
[$node->content] = yield;
return $node;
Expand Down
2 changes: 1 addition & 1 deletion src/Bridges/FormsLatte/Nodes/FormNNameNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ final class FormNNameNode extends StatementNode
public static function create(Tag $tag): \Generator
{
$tag->expectArguments();
$node = new static;
$node = $tag->node = new static;
$node->name = $tag->parser->parseUnquotedStringOrExpression(colon: false);
[$node->content] = yield;
$node->init($tag);
Expand Down
2 changes: 1 addition & 1 deletion src/Bridges/FormsLatte/Nodes/FormNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public static function create(Tag $tag): \Generator

$tag->outputMode = $tag::OutputKeepIndentation;
$tag->expectArguments();
$node = new static;
$node = $tag->node = new static;
$node->name = $tag->parser->parseUnquotedStringOrExpression();
$tag->parser->stream->tryConsume(',');
$node->attributes = $tag->parser->parseArguments();
Expand Down
2 changes: 1 addition & 1 deletion src/Bridges/FormsLatte/Nodes/LabelNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public static function create(Tag $tag): \Generator
$tag->outputMode = $tag::OutputKeepIndentation;
$tag->expectArguments();

$node = new static;
$node = $tag->node = new static;
$node->name = $tag->parser->parseUnquotedStringOrExpression(colon: false);
if ($tag->parser->stream->tryConsume(':')) {
$node->part = $tag->parser->isEnd() || $tag->parser->stream->is(',')
Expand Down

0 comments on commit 8eef0b0

Please sign in to comment.