aboutsummaryrefslogtreecommitdiff
path: root/lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua')
-rw-r--r--lua/lexers/php.lua80
1 files changed, 40 insertions, 40 deletions
diff --git a/lua/lexers/php.lua b/lua/lexers/php.lua
index 73f44f4..6dae5ea 100644
--- a/lua/lexers/php.lua
+++ b/lua/lexers/php.lua
@@ -34,52 +34,52 @@ local number = token(l.NUMBER, l.float + l.integer)
-- Keywords.
local keyword = token(l.KEYWORD, word_match{
--- keywords
--- http://php.net/manual/en/reserved.keywords.php
+ -- http://php.net/manual/en/reserved.keywords.php
'__halt_compiler', 'abstract', 'and', 'array', 'as', 'break',
- 'callable', 'case', 'catch', 'class', 'clone', 'const', 'continue',
- 'declare', 'default', 'die', 'do', 'echo', 'else', 'elseif', 'empty',
- 'enddeclare', 'endfor', 'endforeach', 'endif', 'endswitch',
- 'endwhile', 'eval', 'exit', 'extends', 'final', 'for', 'foreach',
- 'function', 'global', 'goto', 'if', 'implements', 'include',
- 'list', 'namespace', 'new', 'or', 'print', 'private', 'protected',
- 'public', 'require', 'require_once', 'return', 'static',
- 'switch', 'throw', 'trait', 'try', 'unset', 'use', 'var', 'while', 'xor',
--- predefined _classes
--- http://php.net/manual/en/reserved.classes.php
- 'directory', 'stdclass', '__php_incomplete_class', 'exception', 'errorexception',
- 'closure', 'generator', 'arithmeticerror', 'assertionerror', 'divisionbyzeroerror', 'error',
- 'throwable', 'parseerror', 'typeerror', 'self', 'parent',
--- other_reserved
--- http://php.net/manual/en/reserved.other-reserved-words.php
- 'int', 'float', 'bool', 'string', 'true', 'false', 'null', 'void', 'iterable', 'resource',
- 'object', 'mixed', 'numeric'
+ 'callable', 'case', 'catch', 'class', 'clone', 'const',
+ 'continue', 'declare', 'default', 'die', 'do', 'echo', 'else',
+ 'elseif', 'empty', 'enddeclare', 'endfor', 'endforeach',
+ 'endif', 'endswitch', 'endwhile', 'eval', 'exit', 'extends',
+ 'final', 'for', 'foreach', 'function', 'global', 'goto',
+ 'if', 'implements', 'include', 'list', 'namespace', 'new',
+ 'or', 'print', 'private', 'protected', 'public', 'require',
+ 'require_once', 'return', 'static', 'switch', 'throw', 'trait',
+ 'try', 'unset', 'use', 'var', 'while', 'xor',
+ -- http://php.net/manual/en/reserved.classes.php
+ 'directory', 'stdclass', '__php_incomplete_class', 'exception',
+ 'errorexception', 'closure', 'generator', 'arithmeticerror',
+ 'assertionerror', 'divisionbyzeroerror', 'error', 'throwable',
+ 'parseerror', 'typeerror', 'self', 'parent',
+ -- http://php.net/manual/en/reserved.other-reserved-words.php
+ 'int', 'float', 'bool', 'string', 'true', 'false', 'null',
+ 'void', 'iterable', 'resource', 'object', 'mixed', 'numeric'
})
-
--- Constants
+-- Constants.
local constant = token(l.CONSTANT, word_match{
--- http://php.net/manual/en/reserved.keywords.php
--- compile time constants
- '__CLASS__', '__DIR__', '__FILE__', '__FUNCTION__',
- '__LINE__', '__METHOD__', '__NAMESPACE__', '__TRAIT__',
--- predefined_constants
--- http://php.net/manual/en/reserved.constants.php
- 'PHP_VERSION', 'PHP_MAJOR_VERSION', 'PHP_MINOR_VERSION', 'PHP_RELEASE_VERSION',
- 'PHP_VERSION_ID', 'PHP_EXTRA_VERSION', 'PHP_ZTS', 'PHP_DEBUG',
- 'PHP_MAXPATHLEN', 'PHP_OS', 'PHP_OS_FAMILY', 'PHP_SAPI', 'PHP_EOL',
- 'PHP_INT_MAX', 'PHP_INT_MIN', 'PHP_INT_SIZE', 'PHP_FLOAT_DIG',
- 'PHP_FLOAT_EPSILON', 'PHP_FLOAT_MIN', 'PHP_FLOAT_MAX', 'DEFAULT_INCLUDE_PATH',
- 'PEAR_INSTALL_DIR', 'PEAR_EXTENSION_DIR', 'PHP_EXTENSION_DIR',
- 'PHP_PREFIX', 'PHP_BINDIR', 'PHP_BINARY', 'PHP_MANDIR', 'PHP_LIBDIR', 'PHP_DATADIR',
- 'PHP_SYSCONFDIR', 'PHP_LOCALSTATEDIR', 'PHP_CONFIG_FILE_PATH', 'PHP_CONFIG_FILE_SCAN_DIR',
- 'PHP_SHLIB_SUFFIX', 'PHP_FD_SETSIZE', 'E_ERROR', 'E_WARNING', 'E_PARSE',
- 'E_NOTICE', 'E_CORE_ERROR', 'E_CORE_WARNING', 'E_COMPILE_ERROR', 'E_USER_ERROR',
- 'E_USER_WARNING', 'E_USER_NOTICE', 'E_DEPRECATED', 'E_DEPRECATED', 'E_USER_DEPRECATED',
- 'E_ALL', 'E_STRICT', '__COMPILER_HALT_OFFSET__',
+ -- Compile-time constants
+ -- http://php.net/manual/en/reserved.keywords.php
+ '__CLASS__', '__DIR__', '__FILE__', '__FUNCTION__', '__LINE__',
+ '__METHOD__', '__NAMESPACE__', '__TRAIT__',
+ -- http://php.net/manual/en/reserved.constants.php
+ 'PHP_VERSION', 'PHP_MAJOR_VERSION', 'PHP_MINOR_VERSION',
+ 'PHP_RELEASE_VERSION', 'PHP_VERSION_ID', 'PHP_EXTRA_VERSION',
+ 'PHP_ZTS', 'PHP_DEBUG', 'PHP_MAXPATHLEN', 'PHP_OS',
+ 'PHP_OS_FAMILY', 'PHP_SAPI', 'PHP_EOL', 'PHP_INT_MAX',
+ 'PHP_INT_MIN', 'PHP_INT_SIZE', 'PHP_FLOAT_DIG',
+ 'PHP_FLOAT_EPSILON', 'PHP_FLOAT_MIN', 'PHP_FLOAT_MAX',
+ 'DEFAULT_INCLUDE_PATH', 'PEAR_INSTALL_DIR', 'PEAR_EXTENSION_DIR',
+ 'PHP_EXTENSION_DIR', 'PHP_PREFIX', 'PHP_BINDIR',
+ 'PHP_BINARY', 'PHP_MANDIR', 'PHP_LIBDIR', 'PHP_DATADIR',
+ 'PHP_SYSCONFDIR', 'PHP_LOCALSTATEDIR', 'PHP_CONFIG_FILE_PATH',
+ 'PHP_CONFIG_FILE_SCAN_DIR', 'PHP_SHLIB_SUFFIX', 'PHP_FD_SETSIZE',
+ 'E_ERROR', 'E_WARNING', 'E_PARSE', 'E_NOTICE', 'E_CORE_ERROR',
+ 'E_CORE_WARNING', 'E_COMPILE_ERROR', 'E_USER_ERROR',
+ 'E_USER_WARNING', 'E_USER_NOTICE', 'E_DEPRECATED',
+ 'E_DEPRECATED', 'E_USER_DEPRECATED', 'E_ALL', 'E_STRICT',
+ '__COMPILER_HALT_OFFSET__',
})
-
-- Variables.
local word = (l.alpha + '_' + R('\127\255')) * (l.alnum + '_' + R('\127\255'))^0
local variable = token(l.VARIABLE, '$' * word)