Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 6e9c452

Browse files
Add fuzzy tests
1 parent 7402e40 commit 6e9c452

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

‎doc/grammars/type.abnf‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
; ---------------------------------------------------------------------------- ;
44

55
Type
6-
= Atomic [Union / Intersection]
6+
= Atomic [Union / Intersection/Conditional]
77
/ Nullable
88

99
Union
@@ -12,6 +12,9 @@ Union
1212
Intersection
1313
= 1*(TokenIntersection Atomic)
1414

15+
Conditional
16+
= 1*ByteHorizontalWs "is" [1*ByteHorizontalWs "not"] 1*ByteHorizontalWs Atomic TokenNullable Atomic TokenColon Atomic
17+
1518
Nullable
1619
= TokenNullable TokenIdentifier [Generic]
1720

‎src/Parser/TokenIterator.php‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use function assert;
88
use function count;
99
use function in_array;
10+
use function strcasecmp;
1011
use function strlen;
1112

1213
class TokenIterator
@@ -59,7 +60,7 @@ public function currentTokenOffset(): int
5960

6061
public function isCurrentTokenValue(string $tokenValue): bool
6162
{
62-
return $this->tokens[$this->index][Lexer::VALUE_OFFSET]=== $tokenValue;
63+
return strcasecmp($this->tokens[$this->index][Lexer::VALUE_OFFSET], $tokenValue) === 0;
6364
}
6465

6566

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /