Skip to content

Commit

Permalink
Reapply pull request #96 from amsl-project/feature/fix-less-operator
Browse files Browse the repository at this point in the history
This reapplies the pull request #96 from amsl-project/feature/fix-less-
operator consisting of the following commits:
c2764ee
f2dce0b
582d507

and was merged in the mergecommit:
45b69ff
  • Loading branch information
white-gecko committed Jun 27, 2016
1 parent ad848c8 commit 1d37805
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions library/Erfurt/Sparql/Parser.php
Expand Up @@ -224,15 +224,19 @@ public static function tokenize($queryString)
$inUri = false;
continue;
} else if ($queryString[$i] === '<') {
$inUri = true;
if ($tokens[$n] === '') {
$tokens[$n] = '<';
continue;
} else {
$tokens[++$n] = '<';
continue;
}
// this is a less operator, if the next char is a space or =
if (!(isset($queryString[$i+1]) && ($queryString[$i+1] === '=' || $queryString[$i+1] === ' '))) {
// this is an uri
$inUri = true;

if ($tokens[$n] === '') {
$tokens[$n] = '<';
continue;
} else {
$tokens[++$n] = '<';
continue;
}
}
}

$tokens[$n] .= $queryString{$i};
Expand Down

0 comments on commit 1d37805

Please sign in to comment.