NaifyView\Dialect\Naify\NaifyParserExceptionFactory クラス

NaifyParserExceptionFactory — Naify dialect の Naify Parser Exception Factory

Native template 構文の parser / evaluator / runtime contract を担当する。 Twig / Smarty 互換文化を混ぜず、Naify として持つ構文 surface をここで固定する。

使用例

// Naify dialect の parser / expression / runtime helper として使う。
// 通常は NaifyParser や compiler/executor から間接的に呼ばれる。

メソッド

メソッド説明
public buildTokenException(string $message, string $errorCode, string $messageKey, ?Token $token, array $payload, ?string $templatePath, string $source): NaifyViewException `buildTokenException()` を実行する
public buildSpanException(string $message, string $errorCode, string $messageKey, SourceSpan $span, array $payload, ?string $templatePath, string $source): NaifyViewException `buildSpanException()` を実行する
private buildPayload(?SourceSpan $span, ?string $lexeme, mixed $tokenKind, string $messageKey, array $payload, ?string $templatePath, string $source): array `buildPayload()` を実行する
private buildSourceExcerpt(string $source, ?int $lineNumber, int $contextLines = 2): string `buildSourceExcerpt()` を実行する
private buildHint(string $messageKey, array $payload): ?string `buildHint()` を実行する