diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Context.php | 2 | ||||
-rw-r--r-- | src/Lexer.php | 2 | ||||
-rw-r--r-- | src/Utils/Formatter.php | 7 |
3 files changed, 9 insertions, 2 deletions
diff --git a/src/Context.php b/src/Context.php index 869a9bb..61fc2b1 100644 --- a/src/Context.php +++ b/src/Context.php @@ -389,7 +389,7 @@ abstract class Context return Token::FLAG_SYMBOL_VARIABLE; } elseif ($str[0] === '`') { return Token::FLAG_SYMBOL_BACKTICK; - } elseif ($str[0] === ':') { + } elseif ($str[0] === ':' || $str[0] === '?') { return Token::FLAG_SYMBOL_PARAMETER; } diff --git a/src/Lexer.php b/src/Lexer.php index ef1ca68..3d33b91 100644 --- a/src/Lexer.php +++ b/src/Lexer.php @@ -872,7 +872,7 @@ class Lexer extends Core $flags |= Token::FLAG_SYMBOL_SYSTEM; } } elseif ($flags & Token::FLAG_SYMBOL_PARAMETER) { - if ($this->last + 1 < $this->len) { + if ('?' !== $token && $this->last + 1 < $this->len) { ++$this->last; } } else { diff --git a/src/Utils/Formatter.php b/src/Utils/Formatter.php index c41c69c..d89a5ce 100644 --- a/src/Utils/Formatter.php +++ b/src/Utils/Formatter.php @@ -227,6 +227,13 @@ class Formatter ), array( 'type' => Token::TYPE_SYMBOL, + 'flags' => Token::FLAG_SYMBOL_PARAMETER, + 'html' => 'class="sql-parameter"', + 'cli' => "\x1b[31m", + 'function' => '', + ), + array( + 'type' => Token::TYPE_SYMBOL, 'flags' => 0, 'html' => 'class="sql-variable"', 'cli' => "\x1b[36m", |