Skip to content

Commit

Permalink
Add fuzzy tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rvanvelzen committed Mar 25, 2022
1 parent 7402e40 commit 34e7730
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion doc/grammars/type.abnf
Expand Up @@ -3,7 +3,7 @@
; ---------------------------------------------------------------------------- ;

Type
= Atomic [Union / Intersection]
= Atomic [Union / Intersection / Conditional]
/ Nullable

Union
Expand All @@ -12,6 +12,9 @@ Union
Intersection
= 1*(TokenIntersection Atomic)

Conditional
= 1*ByteHorizontalWs "is" [1*ByteHorizontalWs "not"] 1*ByteHorizontalWs Atomic TokenNullable Atomic TokenColon Atomic

Nullable
= TokenNullable TokenIdentifier [Generic]

Expand Down
2 changes: 1 addition & 1 deletion src/Parser/TokenIterator.php
Expand Up @@ -59,7 +59,7 @@ public function currentTokenOffset(): int

public function isCurrentTokenValue(string $tokenValue): bool
{
return $this->tokens[$this->index][Lexer::VALUE_OFFSET] === $tokenValue;
return strcasecmp($this->tokens[$this->index][Lexer::VALUE_OFFSET], $tokenValue) === 0;
}


Expand Down

0 comments on commit 34e7730

Please sign in to comment.