diff --git a/composer.json b/composer.json index d2971d2..746f601 100644 --- a/composer.json +++ b/composer.json @@ -34,7 +34,7 @@ }, "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "3.5-dev" } } } diff --git a/src/Neon/Decoder.php b/src/Neon/Decoder.php index 9576067..bff9aa3 100644 --- a/src/Neon/Decoder.php +++ b/src/Neon/Decoder.php @@ -30,7 +30,7 @@ public function parseToNode(string $input): Node { $lexer = new Lexer; $parser = new Parser; - $tokens = $lexer->tokenize($input); - return $parser->parse($tokens); + $stream = $lexer->tokenize($input); + return $parser->parse($stream); } } diff --git a/src/Neon/Exception.php b/src/Neon/Exception.php index 0a37ad9..09d94e1 100644 --- a/src/Neon/Exception.php +++ b/src/Neon/Exception.php @@ -15,4 +15,13 @@ */ class Exception extends \Exception { + public ?Position /*readonly*/ $position = null; + + + public function __construct(string $message, ?Position $position = null, ?\Throwable $previous = null) + { + $message .= $position ? ' ' . $position : ''; + $this->position = $position; + parent::__construct($message, 0, $previous); + } } diff --git a/src/Neon/Lexer.php b/src/Neon/Lexer.php index 80bf64a..8fa7e17 100644 --- a/src/Neon/Lexer.php +++ b/src/Neon/Lexer.php @@ -56,25 +56,45 @@ public function tokenize(string $input): TokenStream } $types = array_keys(self::Patterns); - $offset = 0; + $position = new Position; $tokens = []; foreach ($matches as $match) { $type = $types[count($match) - 2]; - $tokens[] = new Token($match[0], $type === Token::Char ? $match[0] : $type); - $offset += strlen($match[0]); + $tokens[] = new Token($type === Token::Char ? $match[0] : $type, $match[0], $position); + $position = $this->advance($position, $match[0]); } + $tokens[] = new Token(Token::End, '', $position); + $stream = new TokenStream($tokens); - if ($offset !== strlen($input)) { - $s = str_replace("\n", '\n', substr($input, $offset, 40)); - $stream->error("Unexpected '$s'", count($tokens)); + if ($position->offset !== strlen($input)) { + $s = str_replace("\n", '\n', substr($input, $position->offset, 40)); + throw new Exception("Unexpected '$s'", $position); } return $stream; } + private function advance(Position $position, string $str): Position + { + if ($lines = substr_count($str, "\n")) { + return new Position( + $position->line + $lines, + strlen($str) - strrpos($str, "\n"), + $position->offset + strlen($str), + ); + } else { + return new Position( + $position->line, + $position->column + strlen($str), + $position->offset + strlen($str), + ); + } + } + + public static function requiresDelimiters(string $s): bool { return preg_match('~[\x00-\x1F]|^[+-.]?\d|^(true|false|yes|no|on|off|null)$~Di', $s) diff --git a/src/Neon/Node.php b/src/Neon/Node.php index 4c5c8f8..259963a 100644 --- a/src/Neon/Node.php +++ b/src/Neon/Node.php @@ -17,8 +17,8 @@ abstract class Node implements \IteratorAggregate { public ?int $startTokenPos = null; public ?int $endTokenPos = null; - public ?int $startLine = null; - public ?int $endLine = null; + public ?Position $start = null; + public ?Position $end = null; abstract public function toValue(): mixed; diff --git a/src/Neon/Node/LiteralNode.php b/src/Neon/Node/LiteralNode.php index 23b4b32..275987b 100644 --- a/src/Neon/Node/LiteralNode.php +++ b/src/Neon/Node/LiteralNode.php @@ -113,4 +113,13 @@ public function toString(): string throw new \LogicException; } } + + + public function setMemberFlag(): void + { + if(is_string($this->value) && str_starts_with($this->value, '::')){ + $this->value .= '()'; + } + } + } diff --git a/src/Neon/Node/StringNode.php b/src/Neon/Node/StringNode.php index f921912..63d2781 100644 --- a/src/Neon/Node/StringNode.php +++ b/src/Neon/Node/StringNode.php @@ -33,7 +33,7 @@ public function toValue(): string } - public static function parse(string $s): string + public static function parse(string $s, Nette\Neon\Position $position): string { if (preg_match('#^...\n++([\t ]*+)#', $s, $m)) { // multiline $res = substr($s, 3, -3); @@ -52,14 +52,14 @@ public static function parse(string $s): string return preg_replace_callback( '#\\\\(?:ud[89ab][0-9a-f]{2}\\\\ud[c-f][0-9a-f]{2}|u[0-9a-f]{4}|.)#i', - function (array $m): string { + function (array $m) use ($position): string { $sq = $m[0]; if (isset(self::EscapeSequences[$sq[1]])) { return self::EscapeSequences[$sq[1]]; } elseif ($sq[1] === 'u' && strlen($sq) >= 6) { - return json_decode('"' . $sq . '"') ?? throw new Nette\Neon\Exception("Invalid UTF-8 sequence $sq"); + return json_decode('"' . $sq . '"') ?? throw new Nette\Neon\Exception("Invalid UTF-8 sequence $sq", $position); } else { - throw new Nette\Neon\Exception("Invalid escaping sequence $sq"); + throw new Nette\Neon\Exception("Invalid escaping sequence $sq", $position); } }, $res, diff --git a/src/Neon/Parser.php b/src/Neon/Parser.php index a2a4a1c..2525884 100644 --- a/src/Neon/Parser.php +++ b/src/Neon/Parser.php @@ -13,23 +13,19 @@ /** @internal */ final class Parser { - private TokenStream $tokens; + private TokenStream $stream; - /** @var int[] */ - private $posToLine = []; - - public function parse(TokenStream $tokens): Node + public function parse(TokenStream $stream): Node { - $this->tokens = $tokens; - $this->initLines(); + $this->stream = $stream; - while ($this->tokens->consume(Token::Newline)); - $node = $this->parseBlock($this->tokens->getIndentation()); + while ($this->stream->tryConsume(Token::Newline)); + $node = $this->parseBlock($this->stream->getIndentation()); - while ($this->tokens->consume(Token::Newline)); - if ($this->tokens->isNext()) { - $this->tokens->error(); + while ($this->stream->tryConsume(Token::Newline)); + if (!$this->stream->is(Token::End)) { + $this->stream->error(); } return $node; @@ -45,21 +41,21 @@ private function parseBlock(string $indent, bool $onlyBullets = false): Node loop: $item = new Node\ArrayItemNode; $this->injectPos($item); - if ($this->tokens->consume('-')) { + if ($this->stream->tryConsume('-')) { // continue - } elseif (!$this->tokens->isNext() || $onlyBullets) { + } elseif ($this->stream->is(Token::End) || $onlyBullets) { return $res->items ? $res : $this->injectPos(new Node\LiteralNode(null)); } else { $value = $this->parseValue(); - if ($this->tokens->consume(':', '=')) { + if ($this->stream->tryConsume(':', '=')) { $this->checkArrayKey($value, $keyCheck); $item->key = $value; } else { if ($res->items) { - $this->tokens->error(); + $this->stream->error(); } return $value; @@ -70,12 +66,12 @@ private function parseBlock(string $indent, bool $onlyBullets = false): Node $item->value = new Node\LiteralNode(null); $this->injectPos($item->value); - if ($this->tokens->consume(Token::Newline)) { - while ($this->tokens->consume(Token::Newline)); - $nextIndent = $this->tokens->getIndentation(); + if ($this->stream->tryConsume(Token::Newline)) { + while ($this->stream->tryConsume(Token::Newline)); + $nextIndent = $this->stream->getIndentation(); if (strncmp($nextIndent, $indent, min(strlen($nextIndent), strlen($indent)))) { - $this->tokens->error('Invalid combination of tabs and spaces'); + $this->stream->error('Invalid combination of tabs and spaces'); } elseif (strlen($nextIndent) > strlen($indent)) { // open new block $item->value = $this->parseBlock($nextIndent); @@ -83,21 +79,21 @@ private function parseBlock(string $indent, bool $onlyBullets = false): Node } elseif (strlen($nextIndent) < strlen($indent)) { // close block return $res; - } elseif ($item->key !== null && $this->tokens->isNext('-')) { // special dash subblock + } elseif ($item->key !== null && $this->stream->is('-')) { // special dash subblock $item->value = $this->parseBlock($indent, onlyBullets: true); } } elseif ($item->key === null) { // open new block after dash - $save = $this->tokens->getPos(); + $save = $this->stream->getIndex(); try { $item->value = $this->parseBlock($indent . "\t"); } catch (Exception) { - $this->tokens->seek($save); + $this->stream->seek($save); $item->value = $this->parseBlock($indent . ' '); } - } elseif ($this->tokens->isNext()) { + } elseif (!$this->stream->is(Token::End)) { $item->value = $this->parseValue(); - if ($this->tokens->isNext() && !$this->tokens->isNext(Token::Newline)) { - $this->tokens->error(); + if (!$this->stream->is(Token::End, Token::Newline)) { + $this->stream->error(); } } @@ -108,17 +104,17 @@ private function parseBlock(string $indent, bool $onlyBullets = false): Node $this->injectPos($res, $res->startTokenPos, $item->value->endTokenPos); $this->injectPos($item, $item->startTokenPos, $item->value->endTokenPos); - while ($this->tokens->consume(Token::Newline)); - if (!$this->tokens->isNext()) { + while ($this->stream->tryConsume(Token::Newline)); + if ($this->stream->is(Token::End)) { return $res; } - $nextIndent = $this->tokens->getIndentation(); + $nextIndent = $this->stream->getIndentation(); if (strncmp($nextIndent, $indent, min(strlen($nextIndent), strlen($indent)))) { - $this->tokens->error('Invalid combination of tabs and spaces'); + $this->stream->error('Invalid combination of tabs and spaces'); } elseif (strlen($nextIndent) > strlen($indent)) { - $this->tokens->error('Bad indentation'); + $this->stream->error('Bad indentation'); } elseif (strlen($nextIndent) < strlen($indent)) { // close block return $res; @@ -130,23 +126,20 @@ private function parseBlock(string $indent, bool $onlyBullets = false): Node private function parseValue(): Node { - if ($token = $this->tokens->consume(Token::String)) { - try { - $node = new Node\StringNode(Node\StringNode::parse($token->value)); - $this->injectPos($node, $this->tokens->getPos() - 1); - } catch (Exception $e) { - $this->tokens->error($e->getMessage(), $this->tokens->getPos() - 1); - } - } elseif ($token = $this->tokens->consume(Token::Literal)) { - $pos = $this->tokens->getPos() - 1; - $node = new Node\LiteralNode(Node\LiteralNode::parse($token->value, $this->tokens->isNext(':', '='))); + if ($token = $this->stream->tryConsume(Token::String)) { + $node = new Node\StringNode(Node\StringNode::parse($token->text, $token->position)); + $this->injectPos($node, $this->stream->getIndex() - 1); + + } elseif ($token = $this->stream->tryConsume(Token::Literal)) { + $pos = $this->stream->getIndex() - 1; + $node = new Node\LiteralNode(Node\LiteralNode::parse($token->text, $this->stream->is(':', '='))); $this->injectPos($node, $pos); - } elseif ($this->tokens->isNext('[', '(', '{')) { + } elseif ($this->stream->is('[', '(', '{')) { $node = $this->parseBraces(); } else { - $this->tokens->error(); + $this->stream->error(); } return $this->parseEntity($node); @@ -155,18 +148,19 @@ private function parseValue(): Node private function parseEntity(Node $node): Node { - if (!$this->tokens->isNext('(')) { + if (!$this->stream->is('(')) { return $node; } $attributes = $this->parseBraces(); $entities[] = $this->injectPos(new Node\EntityNode($node, $attributes->items), $node->startTokenPos, $attributes->endTokenPos); - while ($token = $this->tokens->consume(Token::Literal)) { - $valueNode = new Node\LiteralNode(Node\LiteralNode::parse($token->value)); - $this->injectPos($valueNode, $this->tokens->getPos() - 1); - if ($this->tokens->isNext('(')) { + while ($token = $this->stream->tryConsume(Token::Literal)) { + $valueNode = new Node\LiteralNode(Node\LiteralNode::parse($token->text)); + $this->injectPos($valueNode, $this->stream->getIndex() - 1); + if ($this->stream->is('(')) { $attributes = $this->parseBraces(); + $valueNode->setMemberFlag(); $entities[] = $this->injectPos(new Node\EntityNode($valueNode, $attributes->items), $valueNode->startTokenPos, $attributes->endTokenPos); } else { $entities[] = $this->injectPos(new Node\EntityNode($valueNode), $valueNode->startTokenPos); @@ -182,28 +176,28 @@ private function parseEntity(Node $node): Node private function parseBraces(): Node\InlineArrayNode { - $token = $this->tokens->consume(); - $endBrace = ['[' => ']', '{' => '}', '(' => ')'][$token->value]; - $res = new Node\InlineArrayNode($token->value); - $this->injectPos($res, $this->tokens->getPos() - 1); + $token = $this->stream->tryConsume(); + $endBrace = ['[' => ']', '{' => '}', '(' => ')'][$token->text]; + $res = new Node\InlineArrayNode($token->text); + $this->injectPos($res, $this->stream->getIndex() - 1); $keyCheck = []; loop: - while ($this->tokens->consume(Token::Newline)); - if ($this->tokens->consume($endBrace)) { - $this->injectPos($res, $res->startTokenPos, $this->tokens->getPos() - 1); + while ($this->stream->tryConsume(Token::Newline)); + if ($this->stream->tryConsume($endBrace)) { + $this->injectPos($res, $res->startTokenPos, $this->stream->getIndex() - 1); return $res; } $res->items[] = $item = new Node\ArrayItemNode; - $this->injectPos($item, $this->tokens->getPos()); + $this->injectPos($item, $this->stream->getIndex()); $value = $this->parseValue(); - if ($this->tokens->consume(':', '=')) { + if ($this->stream->tryConsume(':', '=')) { $this->checkArrayKey($value, $keyCheck); $item->key = $value; - $item->value = $this->tokens->isNext(Token::Newline, ',', $endBrace) - ? $this->injectPos(new Node\LiteralNode(null), $this->tokens->getPos()) + $item->value = $this->stream->is(Token::Newline, ',', $endBrace) + ? $this->injectPos(new Node\LiteralNode(null), $this->stream->getIndex()) : $this->parseValue(); } else { $item->value = $value; @@ -211,13 +205,13 @@ private function parseBraces(): Node\InlineArrayNode $this->injectPos($item, $item->startTokenPos, $item->value->endTokenPos); - $old = $this->tokens->getPos(); - while ($this->tokens->consume(Token::Newline)); - $this->tokens->consume(','); - if ($old !== $this->tokens->getPos()) { + $old = $this->stream->getIndex(); + while ($this->stream->tryConsume(Token::Newline)); + $this->stream->tryConsume(','); + if ($old !== $this->stream->getIndex()) { goto loop; - } elseif (!$this->tokens->isNext($endBrace)) { - $this->tokens->error(); + } elseif (!$this->stream->is($endBrace)) { + $this->stream->error(); } goto loop; @@ -228,12 +222,12 @@ private function parseBraces(): Node\InlineArrayNode private function checkArrayKey(Node $key, array &$arr): void { if ((!$key instanceof Node\StringNode && !$key instanceof Node\LiteralNode) || !is_scalar($key->value)) { - $this->tokens->error('Unacceptable key', $key->startTokenPos); + $this->stream->error('Unacceptable key', $key->startTokenPos); } $k = (string) $key->value; if (array_key_exists($k, $arr)) { - $this->tokens->error("Duplicated key '$k'", $key->startTokenPos); + $this->stream->error("Duplicated key '$k'", $key->startTokenPos); } $arr[$k] = true; @@ -242,23 +236,11 @@ private function checkArrayKey(Node $key, array &$arr): void private function injectPos(Node $node, ?int $start = null, ?int $end = null): Node { - $node->startTokenPos = $start ?? $this->tokens->getPos(); - $node->startLine = $this->posToLine[$node->startTokenPos]; + $node->startTokenPos = $start ?? $this->stream->getIndex(); + $node->start = $this->stream->tokens[$node->startTokenPos]->position; $node->endTokenPos = $end ?? $node->startTokenPos; - $node->endLine = $this->posToLine[$node->endTokenPos + 1] ?? end($this->posToLine); + $token = $this->stream->tokens[$node->startTokenPos + 1] ?? $this->stream->tokens[$node->startTokenPos]; + $node->end = $token->position; return $node; } - - - private function initLines(): void - { - $this->posToLine = []; - $line = 1; - foreach ($this->tokens->getTokens() as $token) { - $this->posToLine[] = $line; - $line += substr_count($token->value, "\n"); - } - - $this->posToLine[] = $line; - } } diff --git a/src/Neon/Position.php b/src/Neon/Position.php new file mode 100644 index 0000000..a172bd1 --- /dev/null +++ b/src/Neon/Position.php @@ -0,0 +1,27 @@ +line" . ($this->column ? " at column $this->column" : ''); + } +} diff --git a/src/Neon/Token.php b/src/Neon/Token.php index 6a1653c..d92eee4 100644 --- a/src/Neon/Token.php +++ b/src/Neon/Token.php @@ -19,11 +19,19 @@ final class Token public const Comment = 3; public const Newline = 4; public const Whitespace = 5; + public const End = -1; public function __construct( - public string $value, public int|string $type, + public string $text, + public Position $position, ) { } + + + public function is(int|string ...$kind): bool + { + return in_array($this->type, $kind, strict: true); + } } diff --git a/src/Neon/TokenStream.php b/src/Neon/TokenStream.php index 061edd5..56a5bd6 100644 --- a/src/Neon/TokenStream.php +++ b/src/Neon/TokenStream.php @@ -13,60 +13,59 @@ /** @internal */ final class TokenStream { - private int $pos = 0; + private int $index = 0; public function __construct( /** @var Token[] */ - public array $tokens, + public /*readonly*/ array $tokens, ) { } - public function getPos(): int + public function getIndex(): int { - return $this->pos; + return $this->index; } - public function seek(int $position): void + public function seek(int $index): void { - $this->pos = $position; + $this->index = $index; } - /** @return Token[] */ - public function getTokens(): array + /** + * Tells whether the token at current position is of given kind. + */ + public function is(int|string ...$kind): bool { - return $this->tokens; - } - - - public function isNext(int|string ...$types): bool - { - while (in_array($this->tokens[$this->pos]->type ?? null, [Token::Comment, Token::Whitespace], strict: true)) { - $this->pos++; + while ($this->tokens[$this->index]->is(Token::Comment, Token::Whitespace)) { + $this->index++; } - return $types - ? in_array($this->tokens[$this->pos]->type ?? null, $types, strict: true) - : isset($this->tokens[$this->pos]); + return $kind + ? $this->tokens[$this->index]->is(...$kind) + : $this->tokens[$this->index]->type !== Token::End; } - public function consume(int|string ...$types): ?Token + /** + * Consumes the current token of given kind or returns null. + */ + public function tryConsume(int|string ...$kind): ?Token { - return $this->isNext(...$types) - ? $this->tokens[$this->pos++] + return $this->is(...$kind) + ? $this->tokens[$this->index++] : null; } public function getIndentation(): string { - return in_array($this->tokens[$this->pos - 2]->type ?? null, [Token::Newline, null], strict: true) - && ($this->tokens[$this->pos - 1]->type ?? null) === Token::Whitespace - ? $this->tokens[$this->pos - 1]->value + return in_array($this->tokens[$this->index - 2]->type ?? null, [Token::Newline, null], strict: true) + && ($this->tokens[$this->index - 1]->type ?? null) === Token::Whitespace + ? $this->tokens[$this->index - 1]->text : ''; } @@ -74,22 +73,11 @@ public function getIndentation(): string /** @return never */ public function error(?string $message = null, ?int $pos = null): void { - $pos ??= $this->pos; - $input = ''; - foreach ($this->tokens as $i => $token) { - if ($i >= $pos) { - break; - } - - $input .= $token->value; - } - - $line = substr_count($input, "\n") + 1; - $col = strlen($input) - strrpos("\n" . $input, "\n") + 1; - $token = $this->tokens[$pos] ?? null; - $message ??= 'Unexpected ' . ($token === null + $pos ??= $this->index; + $token = $this->tokens[$pos]; + $message ??= 'Unexpected ' . ($token->type === Token::End ? 'end' - : "'" . str_replace("\n", '', substr($this->tokens[$pos]->value, 0, 40)) . "'"); - throw new Exception("$message on line $line, column $col."); + : "'" . str_replace("\n", '', substr($token->text, 0, 40)) . "'"); + throw new Exception($message, $token->position); } } diff --git a/tests/Neon/Decoder.errors.phpt b/tests/Neon/Decoder.errors.phpt index 8b9d5cb..84a7030 100644 --- a/tests/Neon/Decoder.errors.phpt +++ b/tests/Neon/Decoder.errors.phpt @@ -16,63 +16,63 @@ require __DIR__ . '/../bootstrap.php'; Assert::exception( fn() => Neon::decode("Hello\nWorld"), Nette\Neon\Exception::class, - "Unexpected 'World' on line 2, column 1.", + "Unexpected 'World' on line 2 at column 1", ); Assert::exception( fn() => Neon::decode('"\uD801"'), Nette\Neon\Exception::class, - 'Invalid UTF-8 sequence \\uD801 on line 1, column 1.', + 'Invalid UTF-8 sequence \\uD801 on line 1 at column 1', ); Assert::exception( fn() => Neon::decode("- Dave,\n- Rimmer,\n- Kryten,\n"), Nette\Neon\Exception::class, - "Unexpected ',' on line 1, column 7.", + "Unexpected ',' on line 1 at column 7", ); Assert::exception( fn() => Neon::decode('item [a, b]'), Nette\Neon\Exception::class, - "Unexpected ',' on line 1, column 8.", + "Unexpected ',' on line 1 at column 8", ); Assert::exception( fn() => Neon::decode('{,}'), Nette\Neon\Exception::class, - "Unexpected ',' on line 1, column 2.", + "Unexpected ',' on line 1 at column 2", ); Assert::exception( fn() => Neon::decode('{a, ,}'), Nette\Neon\Exception::class, - "Unexpected ',' on line 1, column 5.", + "Unexpected ',' on line 1 at column 5", ); Assert::exception( fn() => Neon::decode('"'), Nette\Neon\Exception::class, - "Unexpected '\"' on line 1, column 1.", + "Unexpected '\"' on line 1 at column 1", ); Assert::exception( fn() => Neon::decode("\ta:\n b:"), Nette\Neon\Exception::class, - 'Invalid combination of tabs and spaces on line 2, column 2.', + 'Invalid combination of tabs and spaces on line 2 at column 2', ); Assert::exception( fn() => Neon::decode("- x: 20\n - a: 10\n\tb: 10"), Nette\Neon\Exception::class, - 'Invalid combination of tabs and spaces on line 3, column 2.', + 'Invalid combination of tabs and spaces on line 3 at column 2', ); @@ -84,7 +84,7 @@ Assert::exception( XX), Nette\Neon\Exception::class, - 'Bad indentation on line 3, column 2.', + 'Bad indentation on line 3 at column 2', ); @@ -94,7 +94,7 @@ Assert::exception( b: XX), Nette\Neon\Exception::class, - 'Bad indentation on line 2, column 3.', + 'Bad indentation on line 2 at column 3', ); @@ -104,7 +104,7 @@ Assert::exception( a: 10 XX), Nette\Neon\Exception::class, - 'Bad indentation on line 2, column 2.', + 'Bad indentation on line 2 at column 2', ); @@ -114,7 +114,7 @@ Assert::exception( a: 10 XX), Nette\Neon\Exception::class, - 'Bad indentation on line 2, column 4.', + 'Bad indentation on line 2 at column 4', ); @@ -124,14 +124,14 @@ Assert::exception( a: 10 XX), Nette\Neon\Exception::class, - 'Bad indentation on line 2, column 2.', + 'Bad indentation on line 2 at column 2', ); Assert::exception( fn() => Neon::decode('- x: y:'), Nette\Neon\Exception::class, - "Unexpected ':' on line 1, column 7.", + "Unexpected ':' on line 1 at column 7", ); @@ -145,7 +145,7 @@ Assert::exception( XX, ), Nette\Neon\Exception::class, - "Unexpected '' on line 3, column 4.", + "Unexpected '' on line 3 at column 4", ); @@ -155,26 +155,26 @@ Assert::exception( a: 2 XX), Nette\Neon\Exception::class, - "Duplicated key 'a' on line 2, column 1.", + "Duplicated key 'a' on line 2 at column 1", ); Assert::exception( fn() => Neon::decode('{ []: foo }'), Nette\Neon\Exception::class, - 'Unacceptable key on line 1, column 3.', + 'Unacceptable key on line 1 at column 3', ); Assert::exception( fn() => Neon::decode('[]: foo'), Nette\Neon\Exception::class, - 'Unacceptable key on line 1, column 1.', + 'Unacceptable key on line 1 at column 1', ); Assert::exception( fn() => Neon::decode('{ - 1}'), Nette\Neon\Exception::class, - "Unexpected '-' on line 1, column 3.", + "Unexpected '-' on line 1 at column 3", ); diff --git a/tests/Neon/Encoder.nodes.phpt b/tests/Neon/Encoder.nodes.phpt index adb1cbc..e2d6d29 100644 --- a/tests/Neon/Encoder.nodes.phpt +++ b/tests/Neon/Encoder.nodes.phpt @@ -28,7 +28,7 @@ $input = [ $encoder = new Neon\Encoder; $node = $encoder->valueToNode($input); -Assert::matchFile( - __DIR__ . '/fixtures/Encoder.nodes.txt', +Assert::same( + strtr(file_get_contents(__DIR__ . '/fixtures/Encoder.nodes.txt'), ["\r\n" => "\n"]), Dumper::toText($node, [Dumper::HASH => false, Dumper::DEPTH => 20]), ); diff --git a/tests/Neon/Parser.nodes.phpt b/tests/Neon/Parser.nodes.phpt index b5a4318..8c1e3ff 100644 --- a/tests/Neon/Parser.nodes.phpt +++ b/tests/Neon/Parser.nodes.phpt @@ -57,14 +57,14 @@ Assert::matchFile( $traverser = new Traverser; $traverser->traverse($node, function (Node $node) use ($stream) { @$node->code = ''; // dynamic property is deprecated - foreach (array_slice($stream->getTokens(), $node->startTokenPos, $node->endTokenPos - $node->startTokenPos + 1) as $token) { - $node->code .= $token->value; + foreach (array_slice($stream->tokens, $node->startTokenPos, $node->endTokenPos - $node->startTokenPos + 1) as $token) { + $node->code .= $token->text; } unset($node->startTokenPos, $node->endTokenPos); }); -Assert::matchFile( - __DIR__ . '/fixtures/Parser.nodes.txt', +Assert::same( + strtr(file_get_contents(__DIR__ . '/fixtures/Parser.nodes.txt'), ["\r\n" => "\n"]), Dumper::toText($node, [Dumper::HASH => false, Dumper::DEPTH => 20]), ); diff --git a/tests/Neon/fixtures/Encoder.nodes.txt b/tests/Neon/fixtures/Encoder.nodes.txt index d505e10..8366dc6 100644 --- a/tests/Neon/fixtures/Encoder.nodes.txt +++ b/tests/Neon/fixtures/Encoder.nodes.txt @@ -6,8 +6,8 @@ Nette\Neon\Node\InlineArrayNode | | | value: 'map' | | | startTokenPos: null | | | endTokenPos: null - | | | startLine: null - | | | endLine: null + | | | start: null + | | | end: null | | value: Nette\Neon\Node\InlineArrayNode | | | bracket: '{' | | | items: array (2) @@ -16,50 +16,50 @@ Nette\Neon\Node\InlineArrayNode | | | | | | value: 'a' | | | | | | startTokenPos: null | | | | | | endTokenPos: null - | | | | | | startLine: null - | | | | | | endLine: null + | | | | | | start: null + | | | | | | end: null | | | | | value: Nette\Neon\Node\LiteralNode | | | | | | value: 'b' | | | | | | startTokenPos: null | | | | | | endTokenPos: null - | | | | | | startLine: null - | | | | | | endLine: null + | | | | | | start: null + | | | | | | end: null | | | | | startTokenPos: null | | | | | endTokenPos: null - | | | | | startLine: null - | | | | | endLine: null + | | | | | start: null + | | | | | end: null | | | | 1 => Nette\Neon\Node\ArrayItemNode | | | | | key: Nette\Neon\Node\LiteralNode | | | | | | value: 'c' | | | | | | startTokenPos: null | | | | | | endTokenPos: null - | | | | | | startLine: null - | | | | | | endLine: null + | | | | | | start: null + | | | | | | end: null | | | | | value: Nette\Neon\Node\LiteralNode | | | | | | value: 'd' | | | | | | startTokenPos: null | | | | | | endTokenPos: null - | | | | | | startLine: null - | | | | | | endLine: null + | | | | | | start: null + | | | | | | end: null | | | | | startTokenPos: null | | | | | endTokenPos: null - | | | | | startLine: null - | | | | | endLine: null + | | | | | start: null + | | | | | end: null | | | startTokenPos: null | | | endTokenPos: null - | | | startLine: null - | | | endLine: null + | | | start: null + | | | end: null | | startTokenPos: null | | endTokenPos: null - | | startLine: null - | | endLine: null + | | start: null + | | end: null | 1 => Nette\Neon\Node\ArrayItemNode | | key: Nette\Neon\Node\LiteralNode | | | value: 'index' | | | startTokenPos: null | | | endTokenPos: null - | | | startLine: null - | | | endLine: null + | | | start: null + | | | end: null | | value: Nette\Neon\Node\InlineArrayNode | | | bracket: '[' | | | items: array (3) @@ -69,51 +69,51 @@ Nette\Neon\Node\InlineArrayNode | | | | | | value: 'a' | | | | | | startTokenPos: null | | | | | | endTokenPos: null - | | | | | | startLine: null - | | | | | | endLine: null + | | | | | | start: null + | | | | | | end: null | | | | | startTokenPos: null | | | | | endTokenPos: null - | | | | | startLine: null - | | | | | endLine: null + | | | | | start: null + | | | | | end: null | | | | 1 => Nette\Neon\Node\ArrayItemNode | | | | | key: null | | | | | value: Nette\Neon\Node\LiteralNode | | | | | | value: 'b' | | | | | | startTokenPos: null | | | | | | endTokenPos: null - | | | | | | startLine: null - | | | | | | endLine: null + | | | | | | start: null + | | | | | | end: null | | | | | startTokenPos: null | | | | | endTokenPos: null - | | | | | startLine: null - | | | | | endLine: null + | | | | | start: null + | | | | | end: null | | | | 2 => Nette\Neon\Node\ArrayItemNode | | | | | key: null | | | | | value: Nette\Neon\Node\LiteralNode | | | | | | value: 'c' | | | | | | startTokenPos: null | | | | | | endTokenPos: null - | | | | | | startLine: null - | | | | | | endLine: null + | | | | | | start: null + | | | | | | end: null | | | | | startTokenPos: null | | | | | endTokenPos: null - | | | | | startLine: null - | | | | | endLine: null + | | | | | start: null + | | | | | end: null | | | startTokenPos: null | | | endTokenPos: null - | | | startLine: null - | | | endLine: null + | | | start: null + | | | end: null | | startTokenPos: null | | endTokenPos: null - | | startLine: null - | | endLine: null + | | start: null + | | end: null | 2 => Nette\Neon\Node\ArrayItemNode | | key: Nette\Neon\Node\LiteralNode | | | value: 'mixed' | | | startTokenPos: null | | | endTokenPos: null - | | | startLine: null - | | | endLine: null + | | | start: null + | | | end: null | | value: Nette\Neon\Node\InlineArrayNode | | | bracket: '{' | | | items: array (4) @@ -123,80 +123,80 @@ Nette\Neon\Node\InlineArrayNode | | | | | | value: 'a' | | | | | | startTokenPos: null | | | | | | endTokenPos: null - | | | | | | startLine: null - | | | | | | endLine: null + | | | | | | start: null + | | | | | | end: null | | | | | startTokenPos: null | | | | | endTokenPos: null - | | | | | startLine: null - | | | | | endLine: null + | | | | | start: null + | | | | | end: null | | | | 1 => Nette\Neon\Node\ArrayItemNode | | | | | key: null | | | | | value: Nette\Neon\Node\LiteralNode | | | | | | value: 'b' | | | | | | startTokenPos: null | | | | | | endTokenPos: null - | | | | | | startLine: null - | | | | | | endLine: null + | | | | | | start: null + | | | | | | end: null | | | | | startTokenPos: null | | | | | endTokenPos: null - | | | | | startLine: null - | | | | | endLine: null + | | | | | start: null + | | | | | end: null | | | | 2 => Nette\Neon\Node\ArrayItemNode | | | | | key: Nette\Neon\Node\LiteralNode | | | | | | value: 4 | | | | | | startTokenPos: null | | | | | | endTokenPos: null - | | | | | | startLine: null - | | | | | | endLine: null + | | | | | | start: null + | | | | | | end: null | | | | | value: Nette\Neon\Node\LiteralNode | | | | | | value: 'c' | | | | | | startTokenPos: null | | | | | | endTokenPos: null - | | | | | | startLine: null - | | | | | | endLine: null + | | | | | | start: null + | | | | | | end: null | | | | | startTokenPos: null | | | | | endTokenPos: null - | | | | | startLine: null - | | | | | endLine: null + | | | | | start: null + | | | | | end: null | | | | 3 => Nette\Neon\Node\ArrayItemNode | | | | | key: Nette\Neon\Node\LiteralNode | | | | | | value: 5 | | | | | | startTokenPos: null | | | | | | endTokenPos: null - | | | | | | startLine: null - | | | | | | endLine: null + | | | | | | start: null + | | | | | | end: null | | | | | value: Nette\Neon\Node\LiteralNode | | | | | | value: 'd' | | | | | | startTokenPos: null | | | | | | endTokenPos: null - | | | | | | startLine: null - | | | | | | endLine: null + | | | | | | start: null + | | | | | | end: null | | | | | startTokenPos: null | | | | | endTokenPos: null - | | | | | startLine: null - | | | | | endLine: null + | | | | | start: null + | | | | | end: null | | | startTokenPos: null | | | endTokenPos: null - | | | startLine: null - | | | endLine: null + | | | start: null + | | | end: null | | startTokenPos: null | | endTokenPos: null - | | startLine: null - | | endLine: null + | | start: null + | | end: null | 3 => Nette\Neon\Node\ArrayItemNode | | key: Nette\Neon\Node\LiteralNode | | | value: 'entity' | | | startTokenPos: null | | | endTokenPos: null - | | | startLine: null - | | | endLine: null + | | | start: null + | | | end: null | | value: Nette\Neon\Node\EntityNode | | | value: Nette\Neon\Node\LiteralNode | | | | value: 'ent' | | | | startTokenPos: null | | | | endTokenPos: null - | | | | startLine: null - | | | | endLine: null + | | | | start: null + | | | | end: null | | | attributes: array (2) | | | | 0 => Nette\Neon\Node\ArrayItemNode | | | | | key: null @@ -204,39 +204,39 @@ Nette\Neon\Node\InlineArrayNode | | | | | | value: 'a' | | | | | | startTokenPos: null | | | | | | endTokenPos: null - | | | | | | startLine: null - | | | | | | endLine: null + | | | | | | start: null + | | | | | | end: null | | | | | startTokenPos: null | | | | | endTokenPos: null - | | | | | startLine: null - | | | | | endLine: null + | | | | | start: null + | | | | | end: null | | | | 1 => Nette\Neon\Node\ArrayItemNode | | | | | key: null | | | | | value: Nette\Neon\Node\LiteralNode | | | | | | value: 'b' | | | | | | startTokenPos: null | | | | | | endTokenPos: null - | | | | | | startLine: null - | | | | | | endLine: null + | | | | | | start: null + | | | | | | end: null | | | | | startTokenPos: null | | | | | endTokenPos: null - | | | | | startLine: null - | | | | | endLine: null + | | | | | start: null + | | | | | end: null | | | startTokenPos: null | | | endTokenPos: null - | | | startLine: null - | | | endLine: null + | | | start: null + | | | end: null | | startTokenPos: null | | endTokenPos: null - | | startLine: null - | | endLine: null + | | start: null + | | end: null | 4 => Nette\Neon\Node\ArrayItemNode | | key: Nette\Neon\Node\LiteralNode | | | value: 'chain' | | | startTokenPos: null | | | endTokenPos: null - | | | startLine: null - | | | endLine: null + | | | start: null + | | | end: null | | value: Nette\Neon\Node\EntityChainNode | | | chain: array (2) | | | | 0 => Nette\Neon\Node\EntityNode @@ -244,8 +244,8 @@ Nette\Neon\Node\InlineArrayNode | | | | | | value: 'first' | | | | | | startTokenPos: null | | | | | | endTokenPos: null - | | | | | | startLine: null - | | | | | | endLine: null + | | | | | | start: null + | | | | | | end: null | | | | | attributes: array (2) | | | | | | 0 => Nette\Neon\Node\ArrayItemNode | | | | | | | key: null @@ -253,74 +253,74 @@ Nette\Neon\Node\InlineArrayNode | | | | | | | | value: 'a' | | | | | | | | startTokenPos: null | | | | | | | | endTokenPos: null - | | | | | | | | startLine: null - | | | | | | | | endLine: null + | | | | | | | | start: null + | | | | | | | | end: null | | | | | | | startTokenPos: null | | | | | | | endTokenPos: null - | | | | | | | startLine: null - | | | | | | | endLine: null + | | | | | | | start: null + | | | | | | | end: null | | | | | | 1 => Nette\Neon\Node\ArrayItemNode | | | | | | | key: null | | | | | | | value: Nette\Neon\Node\LiteralNode | | | | | | | | value: 'b' | | | | | | | | startTokenPos: null | | | | | | | | endTokenPos: null - | | | | | | | | startLine: null - | | | | | | | | endLine: null + | | | | | | | | start: null + | | | | | | | | end: null | | | | | | | startTokenPos: null | | | | | | | endTokenPos: null - | | | | | | | startLine: null - | | | | | | | endLine: null + | | | | | | | start: null + | | | | | | | end: null | | | | | startTokenPos: null | | | | | endTokenPos: null - | | | | | startLine: null - | | | | | endLine: null + | | | | | start: null + | | | | | end: null | | | | 1 => Nette\Neon\Node\EntityNode | | | | | value: Nette\Neon\Node\LiteralNode | | | | | | value: 'second' | | | | | | startTokenPos: null | | | | | | endTokenPos: null - | | | | | | startLine: null - | | | | | | endLine: null + | | | | | | start: null + | | | | | | end: null | | | | | attributes: array (0) | | | | | startTokenPos: null | | | | | endTokenPos: null - | | | | | startLine: null - | | | | | endLine: null + | | | | | start: null + | | | | | end: null | | | startTokenPos: null | | | endTokenPos: null - | | | startLine: null - | | | endLine: null + | | | start: null + | | | end: null | | startTokenPos: null | | endTokenPos: null - | | startLine: null - | | endLine: null + | | start: null + | | end: null | 5 => Nette\Neon\Node\ArrayItemNode | | key: Nette\Neon\Node\LiteralNode | | | value: 'multiline' | | | startTokenPos: null | | | endTokenPos: null - | | | startLine: null - | | | endLine: null + | | | start: null + | | | end: null | | value: Nette\Neon\Node\StringNode | | | value: string | | | | 'hello\n | | | | world' | | | startTokenPos: null | | | endTokenPos: null - | | | startLine: null - | | | endLine: null + | | | start: null + | | | end: null | | startTokenPos: null | | endTokenPos: null - | | startLine: null - | | endLine: null + | | start: null + | | end: null | 6 => Nette\Neon\Node\ArrayItemNode | | key: Nette\Neon\Node\LiteralNode | | | value: 'date' | | | startTokenPos: null | | | endTokenPos: null - | | | startLine: null - | | | endLine: null + | | | start: null + | | | end: null | | value: Nette\Neon\Node\LiteralNode | | | value: DateTime | | | | date: '2016-06-03 19:00:00.000000' @@ -328,13 +328,13 @@ Nette\Neon\Node\InlineArrayNode | | | | timezone: '+02:00' | | | startTokenPos: null | | | endTokenPos: null - | | | startLine: null - | | | endLine: null + | | | start: null + | | | end: null | | startTokenPos: null | | endTokenPos: null - | | startLine: null - | | endLine: null + | | start: null + | | end: null startTokenPos: null endTokenPos: null - startLine: null - endLine: null + start: null + end: null diff --git a/tests/Neon/fixtures/Parser.nodes.txt b/tests/Neon/fixtures/Parser.nodes.txt index 9bafce4..20bf7b5 100644 --- a/tests/Neon/fixtures/Parser.nodes.txt +++ b/tests/Neon/fixtures/Parser.nodes.txt @@ -27,8 +27,14 @@ Nette\Neon\Node\BlockArrayNode | | | value: 'first' | | | startTokenPos: unset | | | endTokenPos: unset - | | | startLine: 3 - | | | endLine: 3 + | | | start: Nette\Neon\Position + | | | | line: 3 + | | | | column: 1 + | | | | offset: 9 + | | | end: Nette\Neon\Position + | | | | line: 3 + | | | | column: 6 + | | | | offset: 14 | | value: Nette\Neon\Node\BlockArrayNode | | | code: '- a' | | | indentation: '\t ' @@ -41,20 +47,44 @@ Nette\Neon\Node\BlockArrayNode | | | | | | value: 'a' | | | | | | startTokenPos: unset | | | | | | endTokenPos: unset - | | | | | | startLine: 5 - | | | | | | endLine: 5 + | | | | | | start: Nette\Neon\Position + | | | | | | | line: 5 + | | | | | | | column: 4 + | | | | | | | offset: 54 + | | | | | | end: Nette\Neon\Position + | | | | | | | line: 5 + | | | | | | | column: 5 + | | | | | | | offset: 55 | | | | | startTokenPos: unset | | | | | endTokenPos: unset - | | | | | startLine: 5 - | | | | | endLine: 5 + | | | | | start: Nette\Neon\Position + | | | | | | line: 5 + | | | | | | column: 2 + | | | | | | offset: 52 + | | | | | end: Nette\Neon\Position + | | | | | | line: 5 + | | | | | | column: 3 + | | | | | | offset: 53 | | | startTokenPos: unset | | | endTokenPos: unset - | | | startLine: 5 - | | | endLine: 5 + | | | start: Nette\Neon\Position + | | | | line: 5 + | | | | column: 2 + | | | | offset: 52 + | | | end: Nette\Neon\Position + | | | | line: 5 + | | | | column: 3 + | | | | offset: 53 | | startTokenPos: unset | | endTokenPos: unset - | | startLine: 3 - | | endLine: 5 + | | start: Nette\Neon\Position + | | | line: 3 + | | | column: 1 + | | | offset: 9 + | | end: Nette\Neon\Position + | | | line: 3 + | | | column: 6 + | | | offset: 14 | 1 => Nette\Neon\Node\ArrayItemNode | | code: string | | | 'next:\n @@ -66,8 +96,14 @@ Nette\Neon\Node\BlockArrayNode | | | value: 'next' | | | startTokenPos: unset | | | endTokenPos: unset - | | | startLine: 6 - | | | endLine: 6 + | | | start: Nette\Neon\Position + | | | | line: 6 + | | | | column: 1 + | | | | offset: 69 + | | | end: Nette\Neon\Position + | | | | line: 6 + | | | | column: 5 + | | | | offset: 73 | | value: Nette\Neon\Node\BlockArrayNode | | | code: string | | | | '- [k,\n @@ -96,12 +132,24 @@ Nette\Neon\Node\BlockArrayNode | | | | | | | | | value: 'k' | | | | | | | | | startTokenPos: unset | | | | | | | | | endTokenPos: unset - | | | | | | | | | startLine: 7 - | | | | | | | | | endLine: 7 + | | | | | | | | | start: Nette\Neon\Position + | | | | | | | | | | line: 7 + | | | | | | | | | | column: 5 + | | | | | | | | | | offset: 79 + | | | | | | | | | end: Nette\Neon\Position + | | | | | | | | | | line: 7 + | | | | | | | | | | column: 6 + | | | | | | | | | | offset: 80 | | | | | | | | startTokenPos: unset | | | | | | | | endTokenPos: unset - | | | | | | | | startLine: 7 - | | | | | | | | endLine: 7 + | | | | | | | | start: Nette\Neon\Position + | | | | | | | | | line: 7 + | | | | | | | | | column: 5 + | | | | | | | | | offset: 79 + | | | | | | | | end: Nette\Neon\Position + | | | | | | | | | line: 7 + | | | | | | | | | column: 6 + | | | | | | | | | offset: 80 | | | | | | | 1 => Nette\Neon\Node\ArrayItemNode | | | | | | | | code: 'l' | | | | | | | | key: null @@ -110,12 +158,24 @@ Nette\Neon\Node\BlockArrayNode | | | | | | | | | value: 'l' | | | | | | | | | startTokenPos: unset | | | | | | | | | endTokenPos: unset - | | | | | | | | | startLine: 8 - | | | | | | | | | endLine: 8 + | | | | | | | | | start: Nette\Neon\Position + | | | | | | | | | | line: 8 + | | | | | | | | | | column: 3 + | | | | | | | | | | offset: 84 + | | | | | | | | | end: Nette\Neon\Position + | | | | | | | | | | line: 8 + | | | | | | | | | | column: 4 + | | | | | | | | | | offset: 85 | | | | | | | | startTokenPos: unset | | | | | | | | endTokenPos: unset - | | | | | | | | startLine: 8 - | | | | | | | | endLine: 8 + | | | | | | | | start: Nette\Neon\Position + | | | | | | | | | line: 8 + | | | | | | | | | column: 3 + | | | | | | | | | offset: 84 + | | | | | | | | end: Nette\Neon\Position + | | | | | | | | | line: 8 + | | | | | | | | | column: 4 + | | | | | | | | | offset: 85 | | | | | | | 2 => Nette\Neon\Node\ArrayItemNode | | | | | | | | code: 'm:\n' | | | | | | | | key: Nette\Neon\Node\LiteralNode @@ -123,19 +183,37 @@ Nette\Neon\Node\BlockArrayNode | | | | | | | | | value: 'm' | | | | | | | | | startTokenPos: unset | | | | | | | | | endTokenPos: unset - | | | | | | | | | startLine: 8 - | | | | | | | | | endLine: 8 + | | | | | | | | | start: Nette\Neon\Position + | | | | | | | | | | line: 8 + | | | | | | | | | | column: 6 + | | | | | | | | | | offset: 87 + | | | | | | | | | end: Nette\Neon\Position + | | | | | | | | | | line: 8 + | | | | | | | | | | column: 7 + | | | | | | | | | | offset: 88 | | | | | | | | value: Nette\Neon\Node\LiteralNode | | | | | | | | | code: '\n' | | | | | | | | | value: null | | | | | | | | | startTokenPos: unset | | | | | | | | | endTokenPos: unset - | | | | | | | | | startLine: 8 - | | | | | | | | | endLine: 9 + | | | | | | | | | start: Nette\Neon\Position + | | | | | | | | | | line: 8 + | | | | | | | | | | column: 8 + | | | | | | | | | | offset: 89 + | | | | | | | | | end: Nette\Neon\Position + | | | | | | | | | | line: 9 + | | | | | | | | | | column: 1 + | | | | | | | | | | offset: 90 | | | | | | | | startTokenPos: unset | | | | | | | | endTokenPos: unset - | | | | | | | | startLine: 8 - | | | | | | | | endLine: 9 + | | | | | | | | start: Nette\Neon\Position + | | | | | | | | | line: 8 + | | | | | | | | | column: 6 + | | | | | | | | | offset: 87 + | | | | | | | | end: Nette\Neon\Position + | | | | | | | | | line: 8 + | | | | | | | | | column: 7 + | | | | | | | | | offset: 88 | | | | | | | 3 => Nette\Neon\Node\ArrayItemNode | | | | | | | | code: 'n' | | | | | | | | key: null @@ -144,28 +222,64 @@ Nette\Neon\Node\BlockArrayNode | | | | | | | | | value: 'n' | | | | | | | | | startTokenPos: unset | | | | | | | | | endTokenPos: unset - | | | | | | | | | startLine: 9 - | | | | | | | | | endLine: 9 + | | | | | | | | | start: Nette\Neon\Position + | | | | | | | | | | line: 9 + | | | | | | | | | | column: 2 + | | | | | | | | | | offset: 91 + | | | | | | | | | end: Nette\Neon\Position + | | | | | | | | | | line: 9 + | | | | | | | | | | column: 3 + | | | | | | | | | | offset: 92 | | | | | | | | startTokenPos: unset | | | | | | | | endTokenPos: unset - | | | | | | | | startLine: 9 - | | | | | | | | endLine: 9 + | | | | | | | | start: Nette\Neon\Position + | | | | | | | | | line: 9 + | | | | | | | | | column: 2 + | | | | | | | | | offset: 91 + | | | | | | | | end: Nette\Neon\Position + | | | | | | | | | line: 9 + | | | | | | | | | column: 3 + | | | | | | | | | offset: 92 | | | | | | startTokenPos: unset | | | | | | endTokenPos: unset - | | | | | | startLine: 7 - | | | | | | endLine: 9 + | | | | | | start: Nette\Neon\Position + | | | | | | | line: 7 + | | | | | | | column: 4 + | | | | | | | offset: 78 + | | | | | | end: Nette\Neon\Position + | | | | | | | line: 7 + | | | | | | | column: 5 + | | | | | | | offset: 79 | | | | | startTokenPos: unset | | | | | endTokenPos: unset - | | | | | startLine: 7 - | | | | | endLine: 9 + | | | | | start: Nette\Neon\Position + | | | | | | line: 7 + | | | | | | column: 2 + | | | | | | offset: 76 + | | | | | end: Nette\Neon\Position + | | | | | | line: 7 + | | | | | | column: 3 + | | | | | | offset: 77 | | | startTokenPos: unset | | | endTokenPos: unset - | | | startLine: 7 - | | | endLine: 9 + | | | start: Nette\Neon\Position + | | | | line: 7 + | | | | column: 2 + | | | | offset: 76 + | | | end: Nette\Neon\Position + | | | | line: 7 + | | | | column: 3 + | | | | offset: 77 | | startTokenPos: unset | | endTokenPos: unset - | | startLine: 6 - | | endLine: 9 + | | start: Nette\Neon\Position + | | | line: 6 + | | | column: 1 + | | | offset: 69 + | | end: Nette\Neon\Position + | | | line: 6 + | | | column: 5 + | | | offset: 73 | 2 => Nette\Neon\Node\ArrayItemNode | | code: string | | | 'second:\n @@ -177,8 +291,14 @@ Nette\Neon\Node\BlockArrayNode | | | value: 'second' | | | startTokenPos: unset | | | endTokenPos: unset - | | | startLine: 10 - | | | endLine: 10 + | | | start: Nette\Neon\Position + | | | | line: 10 + | | | | column: 1 + | | | | offset: 94 + | | | end: Nette\Neon\Position + | | | | line: 10 + | | | | column: 7 + | | | | offset: 100 | | value: Nette\Neon\Node\BlockArrayNode | | | code: string | | | | 'sub:\n @@ -196,8 +316,14 @@ Nette\Neon\Node\BlockArrayNode | | | | | | value: 'sub' | | | | | | startTokenPos: unset | | | | | | endTokenPos: unset - | | | | | | startLine: 11 - | | | | | | endLine: 11 + | | | | | | start: Nette\Neon\Position + | | | | | | | line: 11 + | | | | | | | column: 2 + | | | | | | | offset: 103 + | | | | | | end: Nette\Neon\Position + | | | | | | | line: 11 + | | | | | | | column: 5 + | | | | | | | offset: 106 | | | | | value: Nette\Neon\Node\BlockArrayNode | | | | | | code: string | | | | | | | 'a: 1\n @@ -211,19 +337,37 @@ Nette\Neon\Node\BlockArrayNode | | | | | | | | | value: 'a' | | | | | | | | | startTokenPos: unset | | | | | | | | | endTokenPos: unset - | | | | | | | | | startLine: 12 - | | | | | | | | | endLine: 12 + | | | | | | | | | start: Nette\Neon\Position + | | | | | | | | | | line: 12 + | | | | | | | | | | column: 3 + | | | | | | | | | | offset: 110 + | | | | | | | | | end: Nette\Neon\Position + | | | | | | | | | | line: 12 + | | | | | | | | | | column: 4 + | | | | | | | | | | offset: 111 | | | | | | | | value: Nette\Neon\Node\LiteralNode | | | | | | | | | code: '1' | | | | | | | | | value: 1 | | | | | | | | | startTokenPos: unset | | | | | | | | | endTokenPos: unset - | | | | | | | | | startLine: 12 - | | | | | | | | | endLine: 12 + | | | | | | | | | start: Nette\Neon\Position + | | | | | | | | | | line: 12 + | | | | | | | | | | column: 6 + | | | | | | | | | | offset: 113 + | | | | | | | | | end: Nette\Neon\Position + | | | | | | | | | | line: 12 + | | | | | | | | | | column: 7 + | | | | | | | | | | offset: 114 | | | | | | | | startTokenPos: unset | | | | | | | | endTokenPos: unset - | | | | | | | | startLine: 12 - | | | | | | | | endLine: 12 + | | | | | | | | start: Nette\Neon\Position + | | | | | | | | | line: 12 + | | | | | | | | | column: 3 + | | | | | | | | | offset: 110 + | | | | | | | | end: Nette\Neon\Position + | | | | | | | | | line: 12 + | | | | | | | | | column: 4 + | | | | | | | | | offset: 111 | | | | | | | 1 => Nette\Neon\Node\ArrayItemNode | | | | | | | | code: 'b: 2' | | | | | | | | key: Nette\Neon\Node\LiteralNode @@ -231,35 +375,77 @@ Nette\Neon\Node\BlockArrayNode | | | | | | | | | value: 'b' | | | | | | | | | startTokenPos: unset | | | | | | | | | endTokenPos: unset - | | | | | | | | | startLine: 13 - | | | | | | | | | endLine: 13 + | | | | | | | | | start: Nette\Neon\Position + | | | | | | | | | | line: 13 + | | | | | | | | | | column: 3 + | | | | | | | | | | offset: 117 + | | | | | | | | | end: Nette\Neon\Position + | | | | | | | | | | line: 13 + | | | | | | | | | | column: 4 + | | | | | | | | | | offset: 118 | | | | | | | | value: Nette\Neon\Node\LiteralNode | | | | | | | | | code: '2' | | | | | | | | | value: 2 | | | | | | | | | startTokenPos: unset | | | | | | | | | endTokenPos: unset - | | | | | | | | | startLine: 13 - | | | | | | | | | endLine: 13 + | | | | | | | | | start: Nette\Neon\Position + | | | | | | | | | | line: 13 + | | | | | | | | | | column: 6 + | | | | | | | | | | offset: 120 + | | | | | | | | | end: Nette\Neon\Position + | | | | | | | | | | line: 13 + | | | | | | | | | | column: 7 + | | | | | | | | | | offset: 121 | | | | | | | | startTokenPos: unset | | | | | | | | endTokenPos: unset - | | | | | | | | startLine: 13 - | | | | | | | | endLine: 13 + | | | | | | | | start: Nette\Neon\Position + | | | | | | | | | line: 13 + | | | | | | | | | column: 3 + | | | | | | | | | offset: 117 + | | | | | | | | end: Nette\Neon\Position + | | | | | | | | | line: 13 + | | | | | | | | | column: 4 + | | | | | | | | | offset: 118 | | | | | | startTokenPos: unset | | | | | | endTokenPos: unset - | | | | | | startLine: 12 - | | | | | | endLine: 13 + | | | | | | start: Nette\Neon\Position + | | | | | | | line: 12 + | | | | | | | column: 3 + | | | | | | | offset: 110 + | | | | | | end: Nette\Neon\Position + | | | | | | | line: 12 + | | | | | | | column: 4 + | | | | | | | offset: 111 | | | | | startTokenPos: unset | | | | | endTokenPos: unset - | | | | | startLine: 11 - | | | | | endLine: 13 + | | | | | start: Nette\Neon\Position + | | | | | | line: 11 + | | | | | | column: 2 + | | | | | | offset: 103 + | | | | | end: Nette\Neon\Position + | | | | | | line: 11 + | | | | | | column: 5 + | | | | | | offset: 106 | | | startTokenPos: unset | | | endTokenPos: unset - | | | startLine: 11 - | | | endLine: 13 + | | | start: Nette\Neon\Position + | | | | line: 11 + | | | | column: 2 + | | | | offset: 103 + | | | end: Nette\Neon\Position + | | | | line: 11 + | | | | column: 5 + | | | | offset: 106 | | startTokenPos: unset | | endTokenPos: unset - | | startLine: 10 - | | endLine: 13 + | | start: Nette\Neon\Position + | | | line: 10 + | | | column: 1 + | | | offset: 94 + | | end: Nette\Neon\Position + | | | line: 10 + | | | column: 7 + | | | offset: 100 | 3 => Nette\Neon\Node\ArrayItemNode | | code: string | | | 'third:\n @@ -270,8 +456,14 @@ Nette\Neon\Node\BlockArrayNode | | | value: 'third' | | | startTokenPos: unset | | | endTokenPos: unset - | | | startLine: 14 - | | | endLine: 14 + | | | start: Nette\Neon\Position + | | | | line: 14 + | | | | column: 1 + | | | | offset: 122 + | | | end: Nette\Neon\Position + | | | | line: 14 + | | | | column: 6 + | | | | offset: 127 | | value: Nette\Neon\Node\BlockArrayNode | | | code: string | | | | '- entity(a: 1)\n @@ -288,8 +480,14 @@ Nette\Neon\Node\BlockArrayNode | | | | | | | value: 'entity' | | | | | | | startTokenPos: unset | | | | | | | endTokenPos: unset - | | | | | | | startLine: 15 - | | | | | | | endLine: 15 + | | | | | | | start: Nette\Neon\Position + | | | | | | | | line: 15 + | | | | | | | | column: 4 + | | | | | | | | offset: 132 + | | | | | | | end: Nette\Neon\Position + | | | | | | | | line: 15 + | | | | | | | | column: 10 + | | | | | | | | offset: 138 | | | | | | attributes: array (1) | | | | | | | 0 => Nette\Neon\Node\ArrayItemNode | | | | | | | | code: 'a: 1' @@ -298,27 +496,57 @@ Nette\Neon\Node\BlockArrayNode | | | | | | | | | value: 'a' | | | | | | | | | startTokenPos: unset | | | | | | | | | endTokenPos: unset - | | | | | | | | | startLine: 15 - | | | | | | | | | endLine: 15 + | | | | | | | | | start: Nette\Neon\Position + | | | | | | | | | | line: 15 + | | | | | | | | | | column: 11 + | | | | | | | | | | offset: 139 + | | | | | | | | | end: Nette\Neon\Position + | | | | | | | | | | line: 15 + | | | | | | | | | | column: 12 + | | | | | | | | | | offset: 140 | | | | | | | | value: Nette\Neon\Node\LiteralNode | | | | | | | | | code: '1' | | | | | | | | | value: 1 | | | | | | | | | startTokenPos: unset | | | | | | | | | endTokenPos: unset - | | | | | | | | | startLine: 15 - | | | | | | | | | endLine: 15 + | | | | | | | | | start: Nette\Neon\Position + | | | | | | | | | | line: 15 + | | | | | | | | | | column: 14 + | | | | | | | | | | offset: 142 + | | | | | | | | | end: Nette\Neon\Position + | | | | | | | | | | line: 15 + | | | | | | | | | | column: 15 + | | | | | | | | | | offset: 143 | | | | | | | | startTokenPos: unset | | | | | | | | endTokenPos: unset - | | | | | | | | startLine: 15 - | | | | | | | | endLine: 15 + | | | | | | | | start: Nette\Neon\Position + | | | | | | | | | line: 15 + | | | | | | | | | column: 11 + | | | | | | | | | offset: 139 + | | | | | | | | end: Nette\Neon\Position + | | | | | | | | | line: 15 + | | | | | | | | | column: 12 + | | | | | | | | | offset: 140 | | | | | | startTokenPos: unset | | | | | | endTokenPos: unset - | | | | | | startLine: 15 - | | | | | | endLine: 15 + | | | | | | start: Nette\Neon\Position + | | | | | | | line: 15 + | | | | | | | column: 4 + | | | | | | | offset: 132 + | | | | | | end: Nette\Neon\Position + | | | | | | | line: 15 + | | | | | | | column: 10 + | | | | | | | offset: 138 | | | | | startTokenPos: unset | | | | | endTokenPos: unset - | | | | | startLine: 15 - | | | | | endLine: 15 + | | | | | start: Nette\Neon\Position + | | | | | | line: 15 + | | | | | | column: 2 + | | | | | | offset: 130 + | | | | | end: Nette\Neon\Position + | | | | | | line: 15 + | | | | | | column: 3 + | | | | | | offset: 131 | | | | 1 => Nette\Neon\Node\ArrayItemNode | | | | | code: '- entity(a: 1)foo()bar' | | | | | key: null @@ -332,8 +560,14 @@ Nette\Neon\Node\BlockArrayNode | | | | | | | | | value: 'entity' | | | | | | | | | startTokenPos: unset | | | | | | | | | endTokenPos: unset - | | | | | | | | | startLine: 16 - | | | | | | | | | endLine: 16 + | | | | | | | | | start: Nette\Neon\Position + | | | | | | | | | | line: 16 + | | | | | | | | | | column: 4 + | | | | | | | | | | offset: 148 + | | | | | | | | | end: Nette\Neon\Position + | | | | | | | | | | line: 16 + | | | | | | | | | | column: 10 + | | | | | | | | | | offset: 154 | | | | | | | | attributes: array (1) | | | | | | | | | 0 => Nette\Neon\Node\ArrayItemNode | | | | | | | | | | code: 'a: 1' @@ -342,23 +576,47 @@ Nette\Neon\Node\BlockArrayNode | | | | | | | | | | | value: 'a' | | | | | | | | | | | startTokenPos: unset | | | | | | | | | | | endTokenPos: unset - | | | | | | | | | | | startLine: 16 - | | | | | | | | | | | endLine: 16 + | | | | | | | | | | | start: Nette\Neon\Position + | | | | | | | | | | | | line: 16 + | | | | | | | | | | | | column: 11 + | | | | | | | | | | | | offset: 155 + | | | | | | | | | | | end: Nette\Neon\Position + | | | | | | | | | | | | line: 16 + | | | | | | | | | | | | column: 12 + | | | | | | | | | | | | offset: 156 | | | | | | | | | | value: Nette\Neon\Node\LiteralNode | | | | | | | | | | | code: '1' | | | | | | | | | | | value: 1 | | | | | | | | | | | startTokenPos: unset | | | | | | | | | | | endTokenPos: unset - | | | | | | | | | | | startLine: 16 - | | | | | | | | | | | endLine: 16 + | | | | | | | | | | | start: Nette\Neon\Position + | | | | | | | | | | | | line: 16 + | | | | | | | | | | | | column: 14 + | | | | | | | | | | | | offset: 158 + | | | | | | | | | | | end: Nette\Neon\Position + | | | | | | | | | | | | line: 16 + | | | | | | | | | | | | column: 15 + | | | | | | | | | | | | offset: 159 | | | | | | | | | | startTokenPos: unset | | | | | | | | | | endTokenPos: unset - | | | | | | | | | | startLine: 16 - | | | | | | | | | | endLine: 16 + | | | | | | | | | | start: Nette\Neon\Position + | | | | | | | | | | | line: 16 + | | | | | | | | | | | column: 11 + | | | | | | | | | | | offset: 155 + | | | | | | | | | | end: Nette\Neon\Position + | | | | | | | | | | | line: 16 + | | | | | | | | | | | column: 12 + | | | | | | | | | | | offset: 156 | | | | | | | | startTokenPos: unset | | | | | | | | endTokenPos: unset - | | | | | | | | startLine: 16 - | | | | | | | | endLine: 16 + | | | | | | | | start: Nette\Neon\Position + | | | | | | | | | line: 16 + | | | | | | | | | column: 4 + | | | | | | | | | offset: 148 + | | | | | | | | end: Nette\Neon\Position + | | | | | | | | | line: 16 + | | | | | | | | | column: 10 + | | | | | | | | | offset: 154 | | | | | | | 1 => Nette\Neon\Node\EntityNode | | | | | | | | code: 'foo()' | | | | | | | | value: Nette\Neon\Node\LiteralNode @@ -366,13 +624,25 @@ Nette\Neon\Node\BlockArrayNode | | | | | | | | | value: 'foo' | | | | | | | | | startTokenPos: unset | | | | | | | | | endTokenPos: unset - | | | | | | | | | startLine: 16 - | | | | | | | | | endLine: 16 + | | | | | | | | | start: Nette\Neon\Position + | | | | | | | | | | line: 16 + | | | | | | | | | | column: 16 + | | | | | | | | | | offset: 160 + | | | | | | | | | end: Nette\Neon\Position + | | | | | | | | | | line: 16 + | | | | | | | | | | column: 19 + | | | | | | | | | | offset: 163 | | | | | | | | attributes: array (0) | | | | | | | | startTokenPos: unset | | | | | | | | endTokenPos: unset - | | | | | | | | startLine: 16 - | | | | | | | | endLine: 16 + | | | | | | | | start: Nette\Neon\Position + | | | | | | | | | line: 16 + | | | | | | | | | column: 16 + | | | | | | | | | offset: 160 + | | | | | | | | end: Nette\Neon\Position + | | | | | | | | | line: 16 + | | | | | | | | | column: 19 + | | | | | | | | | offset: 163 | | | | | | | 2 => Nette\Neon\Node\EntityNode | | | | | | | | code: 'bar' | | | | | | | | value: Nette\Neon\Node\LiteralNode @@ -380,29 +650,65 @@ Nette\Neon\Node\BlockArrayNode | | | | | | | | | value: 'bar' | | | | | | | | | startTokenPos: unset | | | | | | | | | endTokenPos: unset - | | | | | | | | | startLine: 16 - | | | | | | | | | endLine: 16 + | | | | | | | | | start: Nette\Neon\Position + | | | | | | | | | | line: 16 + | | | | | | | | | | column: 21 + | | | | | | | | | | offset: 165 + | | | | | | | | | end: Nette\Neon\Position + | | | | | | | | | | line: 16 + | | | | | | | | | | column: 24 + | | | | | | | | | | offset: 168 | | | | | | | | attributes: array (0) | | | | | | | | startTokenPos: unset | | | | | | | | endTokenPos: unset - | | | | | | | | startLine: 16 - | | | | | | | | endLine: 16 + | | | | | | | | start: Nette\Neon\Position + | | | | | | | | | line: 16 + | | | | | | | | | column: 21 + | | | | | | | | | offset: 165 + | | | | | | | | end: Nette\Neon\Position + | | | | | | | | | line: 16 + | | | | | | | | | column: 24 + | | | | | | | | | offset: 168 | | | | | | startTokenPos: unset | | | | | | endTokenPos: unset - | | | | | | startLine: 16 - | | | | | | endLine: 16 + | | | | | | start: Nette\Neon\Position + | | | | | | | line: 16 + | | | | | | | column: 4 + | | | | | | | offset: 148 + | | | | | | end: Nette\Neon\Position + | | | | | | | line: 16 + | | | | | | | column: 10 + | | | | | | | offset: 154 | | | | | startTokenPos: unset | | | | | endTokenPos: unset - | | | | | startLine: 16 - | | | | | endLine: 16 + | | | | | start: Nette\Neon\Position + | | | | | | line: 16 + | | | | | | column: 2 + | | | | | | offset: 146 + | | | | | end: Nette\Neon\Position + | | | | | | line: 16 + | | | | | | column: 3 + | | | | | | offset: 147 | | | startTokenPos: unset | | | endTokenPos: unset - | | | startLine: 15 - | | | endLine: 16 + | | | start: Nette\Neon\Position + | | | | line: 15 + | | | | column: 2 + | | | | offset: 130 + | | | end: Nette\Neon\Position + | | | | line: 15 + | | | | column: 3 + | | | | offset: 131 | | startTokenPos: unset | | endTokenPos: unset - | | startLine: 14 - | | endLine: 16 + | | start: Nette\Neon\Position + | | | line: 14 + | | | column: 1 + | | | offset: 122 + | | end: Nette\Neon\Position + | | | line: 14 + | | | column: 6 + | | | offset: 127 | 4 => Nette\Neon\Node\ArrayItemNode | | code: string | | | '- a: 1\n @@ -421,19 +727,37 @@ Nette\Neon\Node\BlockArrayNode | | | | | | value: 'a' | | | | | | startTokenPos: unset | | | | | | endTokenPos: unset - | | | | | | startLine: 17 - | | | | | | endLine: 17 + | | | | | | start: Nette\Neon\Position + | | | | | | | line: 17 + | | | | | | | column: 3 + | | | | | | | offset: 171 + | | | | | | end: Nette\Neon\Position + | | | | | | | line: 17 + | | | | | | | column: 4 + | | | | | | | offset: 172 | | | | | value: Nette\Neon\Node\LiteralNode | | | | | | code: '1' | | | | | | value: 1 | | | | | | startTokenPos: unset | | | | | | endTokenPos: unset - | | | | | | startLine: 17 - | | | | | | endLine: 17 + | | | | | | start: Nette\Neon\Position + | | | | | | | line: 17 + | | | | | | | column: 6 + | | | | | | | offset: 174 + | | | | | | end: Nette\Neon\Position + | | | | | | | line: 17 + | | | | | | | column: 7 + | | | | | | | offset: 175 | | | | | startTokenPos: unset | | | | | endTokenPos: unset - | | | | | startLine: 17 - | | | | | endLine: 17 + | | | | | start: Nette\Neon\Position + | | | | | | line: 17 + | | | | | | column: 3 + | | | | | | offset: 171 + | | | | | end: Nette\Neon\Position + | | | | | | line: 17 + | | | | | | column: 4 + | | | | | | offset: 172 | | | | 1 => Nette\Neon\Node\ArrayItemNode | | | | | code: 'b: 2' | | | | | key: Nette\Neon\Node\LiteralNode @@ -441,27 +765,57 @@ Nette\Neon\Node\BlockArrayNode | | | | | | value: 'b' | | | | | | startTokenPos: unset | | | | | | endTokenPos: unset - | | | | | | startLine: 18 - | | | | | | endLine: 18 + | | | | | | start: Nette\Neon\Position + | | | | | | | line: 18 + | | | | | | | column: 3 + | | | | | | | offset: 178 + | | | | | | end: Nette\Neon\Position + | | | | | | | line: 18 + | | | | | | | column: 4 + | | | | | | | offset: 179 | | | | | value: Nette\Neon\Node\LiteralNode | | | | | | code: '2' | | | | | | value: 2 | | | | | | startTokenPos: unset | | | | | | endTokenPos: unset - | | | | | | startLine: 18 - | | | | | | endLine: 18 + | | | | | | start: Nette\Neon\Position + | | | | | | | line: 18 + | | | | | | | column: 6 + | | | | | | | offset: 181 + | | | | | | end: Nette\Neon\Position + | | | | | | | line: 18 + | | | | | | | column: 7 + | | | | | | | offset: 182 | | | | | startTokenPos: unset | | | | | endTokenPos: unset - | | | | | startLine: 18 - | | | | | endLine: 18 + | | | | | start: Nette\Neon\Position + | | | | | | line: 18 + | | | | | | column: 3 + | | | | | | offset: 178 + | | | | | end: Nette\Neon\Position + | | | | | | line: 18 + | | | | | | column: 4 + | | | | | | offset: 179 | | | startTokenPos: unset | | | endTokenPos: unset - | | | startLine: 17 - | | | endLine: 18 + | | | start: Nette\Neon\Position + | | | | line: 17 + | | | | column: 3 + | | | | offset: 171 + | | | end: Nette\Neon\Position + | | | | line: 17 + | | | | column: 4 + | | | | offset: 172 | | startTokenPos: unset | | endTokenPos: unset - | | startLine: 17 - | | endLine: 18 + | | start: Nette\Neon\Position + | | | line: 17 + | | | column: 1 + | | | offset: 169 + | | end: Nette\Neon\Position + | | | line: 17 + | | | column: 2 + | | | offset: 170 | 5 => Nette\Neon\Node\ArrayItemNode | | code: '- - c' | | key: null @@ -477,20 +831,44 @@ Nette\Neon\Node\BlockArrayNode | | | | | | value: 'c' | | | | | | startTokenPos: unset | | | | | | endTokenPos: unset - | | | | | | startLine: 19 - | | | | | | endLine: 19 + | | | | | | start: Nette\Neon\Position + | | | | | | | line: 19 + | | | | | | | column: 5 + | | | | | | | offset: 187 + | | | | | | end: Nette\Neon\Position + | | | | | | | line: 19 + | | | | | | | column: 6 + | | | | | | | offset: 188 | | | | | startTokenPos: unset | | | | | endTokenPos: unset - | | | | | startLine: 19 - | | | | | endLine: 19 + | | | | | start: Nette\Neon\Position + | | | | | | line: 19 + | | | | | | column: 3 + | | | | | | offset: 185 + | | | | | end: Nette\Neon\Position + | | | | | | line: 19 + | | | | | | column: 4 + | | | | | | offset: 186 | | | startTokenPos: unset | | | endTokenPos: unset - | | | startLine: 19 - | | | endLine: 19 + | | | start: Nette\Neon\Position + | | | | line: 19 + | | | | column: 3 + | | | | offset: 185 + | | | end: Nette\Neon\Position + | | | | line: 19 + | | | | column: 4 + | | | | offset: 186 | | startTokenPos: unset | | endTokenPos: unset - | | startLine: 19 - | | endLine: 19 + | | start: Nette\Neon\Position + | | | line: 19 + | | | column: 1 + | | | offset: 183 + | | end: Nette\Neon\Position + | | | line: 19 + | | | column: 2 + | | | offset: 184 | 6 => Nette\Neon\Node\ArrayItemNode | | code: string | | | 'dash subblock:\n @@ -501,8 +879,14 @@ Nette\Neon\Node\BlockArrayNode | | | value: 'dash subblock' | | | startTokenPos: unset | | | endTokenPos: unset - | | | startLine: 20 - | | | endLine: 20 + | | | start: Nette\Neon\Position + | | | | line: 20 + | | | | column: 1 + | | | | offset: 189 + | | | end: Nette\Neon\Position + | | | | line: 20 + | | | | column: 14 + | | | | offset: 202 | | value: Nette\Neon\Node\BlockArrayNode | | | code: string | | | | '- a\n @@ -517,12 +901,24 @@ Nette\Neon\Node\BlockArrayNode | | | | | | value: 'a' | | | | | | startTokenPos: unset | | | | | | endTokenPos: unset - | | | | | | startLine: 21 - | | | | | | endLine: 21 + | | | | | | start: Nette\Neon\Position + | | | | | | | line: 21 + | | | | | | | column: 3 + | | | | | | | offset: 206 + | | | | | | end: Nette\Neon\Position + | | | | | | | line: 21 + | | | | | | | column: 4 + | | | | | | | offset: 207 | | | | | startTokenPos: unset | | | | | endTokenPos: unset - | | | | | startLine: 21 - | | | | | endLine: 21 + | | | | | start: Nette\Neon\Position + | | | | | | line: 21 + | | | | | | column: 1 + | | | | | | offset: 204 + | | | | | end: Nette\Neon\Position + | | | | | | line: 21 + | | | | | | column: 2 + | | | | | | offset: 205 | | | | 1 => Nette\Neon\Node\ArrayItemNode | | | | | code: '- b' | | | | | key: null @@ -531,20 +927,44 @@ Nette\Neon\Node\BlockArrayNode | | | | | | value: 'b' | | | | | | startTokenPos: unset | | | | | | endTokenPos: unset - | | | | | | startLine: 22 - | | | | | | endLine: 22 + | | | | | | start: Nette\Neon\Position + | | | | | | | line: 22 + | | | | | | | column: 3 + | | | | | | | offset: 210 + | | | | | | end: Nette\Neon\Position + | | | | | | | line: 22 + | | | | | | | column: 4 + | | | | | | | offset: 211 | | | | | startTokenPos: unset | | | | | endTokenPos: unset - | | | | | startLine: 22 - | | | | | endLine: 22 + | | | | | start: Nette\Neon\Position + | | | | | | line: 22 + | | | | | | column: 1 + | | | | | | offset: 208 + | | | | | end: Nette\Neon\Position + | | | | | | line: 22 + | | | | | | column: 2 + | | | | | | offset: 209 | | | startTokenPos: unset | | | endTokenPos: unset - | | | startLine: 21 - | | | endLine: 22 + | | | start: Nette\Neon\Position + | | | | line: 21 + | | | | column: 1 + | | | | offset: 204 + | | | end: Nette\Neon\Position + | | | | line: 21 + | | | | column: 2 + | | | | offset: 205 | | startTokenPos: unset | | endTokenPos: unset - | | startLine: 20 - | | endLine: 22 + | | start: Nette\Neon\Position + | | | line: 20 + | | | column: 1 + | | | offset: 189 + | | end: Nette\Neon\Position + | | | line: 20 + | | | column: 14 + | | | offset: 202 | 7 => Nette\Neon\Node\ArrayItemNode | | code: string | | | 'text: """\n @@ -556,8 +976,14 @@ Nette\Neon\Node\BlockArrayNode | | | value: 'text' | | | startTokenPos: unset | | | endTokenPos: unset - | | | startLine: 23 - | | | endLine: 23 + | | | start: Nette\Neon\Position + | | | | line: 23 + | | | | column: 1 + | | | | offset: 212 + | | | end: Nette\Neon\Position + | | | | line: 23 + | | | | column: 5 + | | | | offset: 216 | | value: Nette\Neon\Node\StringNode | | | code: string | | | | '"""\n @@ -569,13 +995,31 @@ Nette\Neon\Node\BlockArrayNode | | | | two' | | | startTokenPos: unset | | | endTokenPos: unset - | | | startLine: 23 - | | | endLine: 26 + | | | start: Nette\Neon\Position + | | | | line: 23 + | | | | column: 7 + | | | | offset: 218 + | | | end: Nette\Neon\Position + | | | | line: 26 + | | | | column: 4 + | | | | offset: 243 | | startTokenPos: unset | | endTokenPos: unset - | | startLine: 23 - | | endLine: 26 + | | start: Nette\Neon\Position + | | | line: 23 + | | | column: 1 + | | | offset: 212 + | | end: Nette\Neon\Position + | | | line: 23 + | | | column: 5 + | | | offset: 216 startTokenPos: unset endTokenPos: unset - startLine: 3 - endLine: 26 + start: Nette\Neon\Position + | line: 3 + | column: 1 + | offset: 9 + end: Nette\Neon\Position + | line: 3 + | column: 6 + | offset: 14