Skip to content

Commit 44ab055

Browse files
rvanvelzenondrejmirtes
authored andcommitted
Add fuzzy tests
1 parent db2e1c2 commit 44ab055

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)