NaifyView\Dialect\Naify\NaifyTokenizer クラス
NaifyTokenizer — Naify dialect の Naify Tokenizer
Native template 構文の parser / evaluator / runtime contract を担当する。 Twig / Smarty 互換文化を混ぜず、Naify として持つ構文 surface をここで固定する。
使用例
// Naify dialect の parser / expression / runtime helper として使う。
// 通常は NaifyParser や compiler/executor から間接的に呼ばれる。
プロパティ
| 名前 | 型 | 説明 |
|---|---|---|
private
$tagSurfaceReader
|
NaifyTagSurfaceReader |
tag close / attribute parse owner |
private
$interpolationOpen
|
string |
|
private
$interpolationClose
|
string |
メソッド
| メソッド | 説明 |
|---|---|
public
__construct(?NaifyTagSurfaceReader $tagSurfaceReader, string $interpolationOpen = {{, string $interpolationClose = }}): void
|
インスタンスを初期化する |
public
tokenize(string $source): array
|
source を token 列へ分解する |
private
readInterpolation(string $source, int $offset, int $line, int $column): Token
|
`readInterpolation()` を実行する |
private
readRawBody(string $source, string $name, int $offset, int $line, int $column): ?Token
|
Preserve raw/comment content without interpreting nested interpolation or directive syntax. |
private
readTag(string $source, int $offset, int $line, int $column): ?Token
|
|
private
readText(string $source, int $offset, int $line, int $column): Token
|
`readText()` を実行する |
private
readLiteralCharacter(string $source, int $offset, int $line, int $column): Token
|
`readLiteralCharacter()` を実行する |
private
isNativeDirectiveTagStart(string $source, int $offset): bool
|
`isNativeDirectiveTagStart()` かを返す |
private
buildTagToken(string $lexeme, SourceSpan $span): Token
|
`buildTagToken()` を実行する |
private
advanceCursor(string $fragment, int $offset, int $line, int $column): void
|
`advanceCursor()` を実行する |