Skip to content

Commit

Permalink
ForeachNode, TagParser: added native parser for foreach-variables [Cl…
Browse files Browse the repository at this point in the history
…oses #342]
  • Loading branch information
dg committed Aug 7, 2023
1 parent ad23377 commit d09d8b7
Show file tree
Hide file tree
Showing 5 changed files with 371 additions and 335 deletions.
13 changes: 12 additions & 1 deletion src/Latte/Compiler/TagParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ final class TagParser extends TagParserData
private const
SchemaExpression = 'e',
SchemaArguments = 'a',
SchemaFilters = 'm';
SchemaFilters = 'm',
SchemaForeach = 'f';

private const SymbolNone = -1;

Expand Down Expand Up @@ -119,6 +120,16 @@ public function parseType(): ?Node\SuperiorTypeNode
}


/**
* Parses variables used in foreach.
* @internal
*/
public function parseForeach(): array
{
return $this->parse(self::SchemaForeach);
}


/**
* Consumes optional token followed by whitespace. Suitable before parseUnquotedStringOrExpression().
*/
Expand Down
Loading

0 comments on commit d09d8b7

Please sign in to comment.