1
0
mirror of synced 2025-02-03 05:49:25 +03:00

Check for custom functions first.

This commit is contained in:
Mathew Davies 2017-06-08 17:22:07 +01:00 committed by Luís Cobucci
parent e80cd74c3e
commit 914c400a7d
No known key found for this signature in database
GPG Key ID: EC61C5F01750ED3C

View File

@ -3376,8 +3376,13 @@ class Parser
$token = $this->lexer->lookahead; $token = $this->lexer->lookahead;
$funcName = strtolower($token['value']); $funcName = strtolower($token['value']);
// Check for built-in functions first! $customFunctionDeclaration = $this->CustomFunctionDeclaration();
// Check for custom functions functions first!
switch (true) { switch (true) {
case $customFunctionDeclaration !== null:
return $customFunctionDeclaration;
case (isset(self::$_STRING_FUNCTIONS[$funcName])): case (isset(self::$_STRING_FUNCTIONS[$funcName])):
return $this->FunctionsReturningStrings(); return $this->FunctionsReturningStrings();
@ -3388,7 +3393,7 @@ class Parser
return $this->FunctionsReturningDatetime(); return $this->FunctionsReturningDatetime();
default: default:
return $this->CustomFunctionDeclaration(); $this->syntaxError('known function', $token);
} }
} }
@ -3416,7 +3421,7 @@ class Parser
return $this->CustomFunctionsReturningDatetime(); return $this->CustomFunctionsReturningDatetime();
default: default:
$this->syntaxError('known function', $token); return null;
} }
} }