summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/Core/Filter/Lexer.php11
1 files changed, 6 insertions, 5 deletions
diff --git a/app/Core/Filter/Lexer.php b/app/Core/Filter/Lexer.php
index 041b58d3..8a7a68b1 100644
--- a/app/Core/Filter/Lexer.php
+++ b/app/Core/Filter/Lexer.php
@@ -26,9 +26,10 @@ class Lexer
*/
private $tokenMap = array(
"/^(\s+)/" => 'T_WHITESPACE',
- '/^([<=>]{0,2}[0-9]{4}-[0-9]{2}-[0-9]{2})/' => 'T_DATE',
- '/^(yesterday|tomorrow|today)/' => 'T_DATE',
- '/^("(.*?)")/' => 'T_STRING',
+ '/^([<=>]{0,2}[0-9]{4}-[0-9]{2}-[0-9]{2})/' => 'T_STRING',
+ '/^([<=>]{1,2}\w+)/' => 'T_STRING',
+ '/^([<=>]{1,2}".+")/' => 'T_STRING',
+ '/^("(.+)")/' => 'T_STRING',
"/^(\w+)/" => 'T_STRING',
"/^(#\d+)/" => 'T_STRING',
);
@@ -107,7 +108,7 @@ class Lexer
$this->offset += strlen($matches[1]);
return array(
- 'match' => trim($matches[1], '"'),
+ 'match' => str_replace('"', '', $matches[1]),
'token' => $name,
);
}
@@ -134,7 +135,7 @@ class Lexer
} else {
$next = next($tokens);
- if ($next !== false && in_array($next['token'], array('T_STRING', 'T_DATE'))) {
+ if ($next !== false && $next['token'] === 'T_STRING') {
$map[$token['token']][] = $next['match'];
}
}