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 13, 2023
1 parent 2a019f1 commit e0d71b2
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions composer.json
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.12",
"tracy/tracy": "^2.9",
"phpstan/phpstan-nette": "^1"
},
"conflict": {
"latte/latte": ">=3.1"
"latte/latte": ">=3.0.0 <3.0.12 || >=3.1"
},
"suggest": {
"ext-intl": "to use date/time controls"
Expand Down
2 changes: 1 addition & 1 deletion src/Bridges/FormsLatte/Nodes/FieldNNameNode.php
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
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
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
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
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 e0d71b2

Please sign in to comment.