NaifyViewExtension\Dialect\Twig\TwigIrBuilder クラス

Twig first-slice source を Core IR へ直接落とす builder。

HTML/text はそのまま text node とし、Twig の制御構文だけを Core IR の if / for_each / set / interpolation へ変換する。未対応構文は null を返し、 既存 converter + NativeIrBridge へ fallback する。

プロパティ

名前型説明
private $localNames array
private $span SourceSpan

メソッド

メソッド説明
public __construct():
public build(string $source, array $additionalLocalNames = '...'): ?IrStructuredNode
private parseSet(string $body): ?array
private parseFor(string $body): ?array
private appendNode(array $stack, IrStructuredNode $node): void
private switchIfBranch(array $stack, string $branchType, ?string $condition): bool
private closeIf(array $stack): bool
private closeFrame(array $stack, string $kind): bool
private convertFilteredExpression(string $expression): string
private convertFilterCall(string $filter): string
private convertExpression(string $expression): string
private convertStringInterpolation(string $expression): string
private extractStringLiterals(string $expr, array $placeholders): string
private convertHelperWrapNamedArguments(string $expr): ?string
private quoteNativeString(string $value): string
private convertTwigLoopIndexExpression(string $expression): string
private splitTopLevel(string $source, string $delimiter): array
private node(string $type, array $payload = '...', array $children = '...'): IrStructuredNode