Skip to content

Commit a50b3ab

Browse files
committed
UniLex upgraded to 0.3.0
1 parent 94d7cd9 commit a50b3ab

File tree

3 files changed

+17
-16
lines changed

3 files changed

+17
-16
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [Unreleased]
8+
### Added
9+
- UniLex version updated to 0.3.0.
10+
711
## [0.6.8] - 2020-04-03
812
### Added
913
- UniLex version updated to 0.2.0.

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"require": {
2020
"php": "^7.3",
2121
"remorhaz/php-json-data": "^0.5.2",
22-
"remorhaz/php-unilex": "^0.2"
22+
"remorhaz/php-unilex": "^0.3"
2323
},
2424
"require-dev": {
2525
"phpunit/phpunit": "^9.1",

generated/TokenMatcher.php

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
* Generated by UniLex.
88
*/
99

10+
declare(strict_types=1);
11+
1012
namespace Remorhaz\JSON\Pointer;
1113

1214
use Remorhaz\JSON\Pointer\Parser\TokenType;
@@ -29,30 +31,38 @@ public function match(CharBufferInterface $buffer, TokenFactoryInterface $tokenF
2931
$char = $context->getBuffer()->getSymbol();
3032
if (0x2F == $char) {
3133
$context->getBuffer()->nextSymbol();
34+
// /
3235
$context
3336
->setNewToken(TokenType::SLASH)
3437
->setTokenAttribute('text', '/');
38+
3539
return true;
3640
}
3741
if (0x7E == $char) {
3842
$context->getBuffer()->nextSymbol();
43+
// ~
3944
$context
4045
->setNewToken(TokenType::TILDE)
4146
->setTokenAttribute('text', '~');
47+
4248
return true;
4349
}
4450
if (0x30 == $char) {
4551
$context->getBuffer()->nextSymbol();
52+
// 0
4653
$context
4754
->setNewToken(TokenType::ZERO)
4855
->setTokenAttribute('text', '0');
56+
4957
return true;
5058
}
5159
if (0x31 == $char) {
5260
$context->getBuffer()->nextSymbol();
61+
// 1
5362
$context
5463
->setNewToken(TokenType::ONE)
5564
->setTokenAttribute('text', '1');
65+
5666
return true;
5767
}
5868
if (0x00 <= $char && $char <= 0x2E || 0x32 <= $char && $char <= 0x7D || 0x7F <= $char && $char <= 0x10FFFF) {
@@ -68,27 +78,14 @@ public function match(CharBufferInterface $buffer, TokenFactoryInterface $tokenF
6878
$char = $context->getBuffer()->getSymbol();
6979
if (0x00 <= $char && $char <= 0x2E || 0x32 <= $char && $char <= 0x7D || 0x7F <= $char && $char <= 0x10FFFF) {
7080
$context->getBuffer()->nextSymbol();
71-
goto state7;
81+
goto state6;
7282
}
7383
finish6:
84+
// [^/~01]+
7485
$context
7586
->setNewToken(TokenType::UNESCAPED)
7687
->setTokenAttribute('text', $context->getSymbolString());
77-
return true;
7888

79-
state7:
80-
if ($context->getBuffer()->isEnd()) {
81-
goto finish7;
82-
}
83-
$char = $context->getBuffer()->getSymbol();
84-
if (0x00 <= $char && $char <= 0x2E || 0x32 <= $char && $char <= 0x7D || 0x7F <= $char && $char <= 0x10FFFF) {
85-
$context->getBuffer()->nextSymbol();
86-
goto state7;
87-
}
88-
finish7:
89-
$context
90-
->setNewToken(TokenType::UNESCAPED)
91-
->setTokenAttribute('text', $context->getSymbolString());
9289
return true;
9390

9491
error:

0 commit comments

Comments
 (0)