summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Context.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/Context.php b/src/Context.php
index 545bf08..fd8d96a 100644
--- a/src/Context.php
+++ b/src/Context.php
@@ -310,6 +310,9 @@ abstract class Context
public static function isComment($str, $end=false)
{
$len = strlen($str);
+ if ($len == 0) {
+ return null;
+ }
if ($str[0] === '#') {
return Token::FLAG_COMMENT_BASH;
} elseif (($len > 1) && ($str[0] === '/') && ($str[1] === '*')) {
@@ -376,6 +379,9 @@ abstract class Context
*/
public static function isSymbol($str)
{
+ if (strlen($str) == 0) {
+ return null;
+ }
if ($str[0] === '@') {
return Token::FLAG_SYMBOL_VARIABLE;
} elseif ($str[0] === '`') {
@@ -397,6 +403,9 @@ abstract class Context
*/
public static function isString($str)
{
+ if (strlen($str) == 0) {
+ return null;
+ }
if ($str[0] === '\'') {
return Token::FLAG_STRING_SINGLE_QUOTES;
} elseif ($str[0] === '"') {