Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/Parsing/ParserState.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,12 @@ public function parseIdentifier($ignoreCase = true)
if ($result === null) {
throw new UnexpectedTokenException('', $this->peek(5), 'identifier', $this->lineNumber);
}
$sCharacter = null;
while (!$this->isEnd() && ($sCharacter = $this->parseCharacter(true)) !== null) {
if (\preg_match('/[a-zA-Z0-9\\x{00A0}-\\x{FFFF}_-]/Sux', $sCharacter)) {
$result .= $sCharacter;
$character = null;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The initialization here appears to be unnecessary. Beyond the scope of this PR.

while (!$this->isEnd() && ($character = $this->parseCharacter(true)) !== null) {
if (\preg_match('/[a-zA-Z0-9\\x{00A0}-\\x{FFFF}_-]/Sux', $character)) {
$result .= $character;
} else {
$result .= '\\' . $sCharacter;
$result .= '\\' . $character;
}
}
if ($ignoreCase) {
Expand Down