| | 'string' => '/(\'(?:\\\\.|[^\'\\\\])*\')/', |
| | 'comment' => '/(\/\/[^\r\n]*|#[^\r\n]*|\/\*.*?\*\/)/ms', |
| | - 'keyword' => '/\b(class|abstract|and|array|as|break|callable|case|catch|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|eval|exit|extends|final|finally|fn|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|match|namespace|new|or|print|private|protected|public|require|require_once|return|static|switch|throw|trait|try|unset|use|var|while|xor|yield)\b/', |
| | + 'keyword' => '/\b(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|enum|eval|exit|extends|final|finally|fn|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|match|namespace|new|or|print|private|protected|public|readonly|require|require_once|return|static|switch|throw|trait|try|unset|use|var|while|xor|yield)\b/', |
| | 'function' => '/\b([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)\s*(?=\()/', |
| | 'variable' => '/(\$[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)/', |
| | 'number' => '/' . $int . '/', |
| | 'boolean' => '/\b(true|false|null)\b/i', |
| | ], |
| | 'bash' => [ |
| | 'string_interp' => '/("(?:\\\\.|[^"\\\\])*")/', |
| | 'string' => '/(\'.*?\')/', |
| | 'comment' => '/(#[^\n]*)/', |
| | - 'keyword' => '/(?<!-)\b(alias|bg|bind|break|builtin|case|cd|command|compgen|complete|continue|declare|dirs|disown|do|done|echo|elif|else|enable|esac|eval|exec|exit|export|fc|fg|fi|for|function|getopts|hash|help|history|if|jobs|kill|let|local|logout|popd|printf|pushd|pwd|read|readonly|return|set|shift|shopt|source|suspend|test|then|times|trap|type|typeset|ulimit|umask|unalias|unset|until|wait|while)\b/', |
| | + 'keyword' => '/(?<!-)\b(alias|bg|bind|break|builtin|case|cd|command|compgen|complete|continue|coproc|declare|dirs|disown|do|done|echo|elif|else|enable|esac|eval|exec|exit|export|fc|fg|fi|for|function|getopts|hash|help|history|if|jobs|kill|let|local|logout|popd|printf|pushd|pwd|read|readonly|return|select|set|shift|shopt|source|suspend|test|then|time|times|trap|type|typeset|ulimit|umask|unalias|unset|until|wait|while)\b/', |
| | 'function' => '/\b([a-zA-Z_][a-zA-Z0-9_]*)\s*(?=\()/', |
| | 'variable' => '/(\$[a-zA-Z_][a-zA-Z0-9_]*|\$\{[^}]+\})/', |
 |
| | 'include' => '/(^\s*#include[^\r\n]*)/m', |
| | 'preprocessor' => '/(^\s*#(?!include\b)[^\r\n]*)/m', |
| | - 'keyword' => '/\b(alignas|alignof|and|and_eq|asm|auto|bitand|bitor|break|case|catch|class|compl|const|constexpr|const_cast|continue|decltype|default|delete|do|dynamic_cast|else|enum|explicit|export|extern|for|friend|goto|if|inline|mutable|namespace|new|noexcept|noreturn|not|not_eq|nullptr|operator|or|or_eq|private|protected|public|register|reinterpret_cast|return|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|union|using|virtual|volatile|while|xor|xor_eq)\b/', |
| | + 'keyword' => '/\b(alignas|alignof|and|and_eq|asm|auto|bitand|bitor|break|case|catch|class|co_await|co_return|co_yield|compl|concept|const|consteval|constexpr|constinit|const_cast|continue|decltype|default|delete|do|dynamic_cast|else|enum|explicit|export|extern|for|friend|goto|if|inline|mutable|namespace|new|noexcept|noreturn|not|not_eq|nullptr|operator|or|or_eq|private|protected|public|register|reinterpret_cast|requires|return|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|union|using|virtual|volatile|while|xor|xor_eq)\b/', |
| | 'type' => '/\b(bool|char|char16_t|char32_t|double|float|int|long|short|signed|unsigned|void|wchar_t)\b/', |
| | 'boolean' => '/\b(true|false)\b/', |
| | 'function' => '/\b([a-zA-Z_][a-zA-Z0-9_]*)\s*(?=\()/', |
| | 'number' => '/' . $int . '/', |
| | ], |
| | 'java' => [ |
| | 'class' => '/(@[a-zA-Z_][a-zA-Z0-9_]*)/', |
| | 'string' => '/' . $str . '/', |
| | 'comment' => '/(\/\/[^\r\n]*|\/\*.*?\*\/)/ms', |
| | - 'keyword' => '/\b(abstract|assert|break|case|catch|class|const|continue|default|do|else|enum|extends|final|finally|for|goto|if|implements|import|instanceof|interface|native|new|package|private|protected|public|return|static|strictfp|super|switch|synchronized|this|throw|throws|transient|try|void|volatile|while)\b/', |
| | + 'keyword' => '/\b(abstract|assert|break|case|catch|class|const|continue|default|do|else|enum|extends|final|finally|for|goto|if|implements|import|instanceof|interface|native|new|non-sealed|package|permits|private|protected|public|record|return|sealed|static|strictfp|super|switch|synchronized|this|throw|throws|transient|try|var|void|volatile|while|yield)\b/', |
| | 'type' => '/\b(boolean|byte|char|double|float|int|long|short|void)\b/', |
| | 'boolean' => '/\b(true|false|null)\b/', |
 |
| | 'string' => '/' . $str . '/', |
| | 'comment' => '/(\/\/[^\r\n]*|\/\*.*?\*\/)/ms', |
| | - 'keyword' => '/\b(as|break|const|continue|crate|else|enum|extern|fn|for|if|impl|in|let|loop|match|mod|move|mut|pub|ref|return|self|Self|static|struct|super|trait|type|unsafe|use|where|while|async|await|dyn)\b/', |
| | + 'keyword' => '/\b(as|async|await|break|const|continue|crate|dyn|else|enum|extern|fn|for|if|impl|in|let|loop|match|mod|move|mut|pub|ref|return|self|Self|static|struct|super|trait|type|union|unsafe|use|where|while)\b/', |
| | 'boolean' => '/\b(true|false)\b/', |
| | 'function' => '/\b([a-zA-Z_][a-zA-Z0-9_]*)\s*(?=\()/', |
 |
| | 'string' => '/("(?:\\\\.|[^"\\\\])*"|\'(?:\\\\.|[^\'\\\\])*\'|`(?:\\\\.|[^`\\\\])*`)/s', |
| | 'comment' => '/(\/\/[^\r\n]*|\/\*.*?\*\/)/ms', |
| | - 'keyword' => '/\b(async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|export|extends|finally|for|function|if|import|in|instanceof|new|return|super|switch|this|throw|try|typeof|var|void|while|with|yield|let|static|enum)\b/', |
| | + 'keyword' => '/\b(async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|if|import|in|instanceof|let|new|of|return|static|super|switch|this|throw|try|typeof|var|void|while|with|yield)\b/', |
| | 'boolean' => '/\b(true|false|null|undefined)\b/', |
| | 'function' => '/\b([a-zA-Z_$][a-zA-Z0-9_$]*)\s*(?=\()/', |
| | 'number' => '/' . $int . '/', |
| | ], |
| | 'typescript' => [ |
| | 'string' => '/("(?:\\\\.|[^"\\\\])*"|\'(?:\\\\.|[^\'\\\\])*\'|`(?:\\\\.|[^`\\\\])*`)/s', |
| | 'comment' => '/(\/\/[^\r\n]*|\/\*.*?\*\/)/ms', |
| | - 'keyword' => '/\b(any|as|break|case|catch|class|const|continue|debugger|declare|default|delete|do|else|enum|export|extends|finally|for|from|function|if|implements|import|in|instanceof|interface|let|module|namespace|new|of|package|private|protected|public|require|return|static|super|switch|this|throw|try|type|typeof|var|void|while|with|yield)\b/', |
| | + 'keyword' => '/\b(abstract|any|as|break|case|catch|class|const|continue|debugger|declare|default|delete|do|else|enum|export|extends|finally|for|from|function|if|implements|import|in|instanceof|interface|is|let|module|namespace|new|of|package|private|protected|public|readonly|require|return|static|super|switch|this|throw|try|type|typeof|var|void|while|with|yield)\b/', |
| | 'type' => '/\b(boolean|number|string|void|any)\b/', |
| | 'boolean' => '/\b(true|false|null|undefined)\b/', |
 |
| | 'string' => '/(\'.*?\')/', |
| | 'comment' => '/(--[^\r\n]*|\/\*.*?\*\/)/ms', |
| | - 'keyword' => '/(?i)\b(SELECT|FROM|WHERE|INSERT|INTO|UPDATE|DELETE|JOIN|LEFT|RIGHT|INNER|OUTER|ON|GROUP|BY|ORDER|HAVING|LIMIT|OFFSET|CREATE|TABLE|DROP|ALTER|INDEX|KEY|PRIMARY|FOREIGN|CONSTRAINT|DEFAULT|NOT|AND|OR|IN|VALUES|SET|AS|DISTINCT|UNION|ALL|CASE|WHEN|THEN|ELSE|END)\b/', |
| | + 'keyword' => '/(?i)\b(ADD|ALTER|AND|AS|ASC|BEGIN|BETWEEN|BY|CASE|CHECK|COLUMN|COMMIT|CONSTRAINT|CREATE|DATABASE|DEFAULT|DELETE|DESC|DISTINCT|DROP|ELSE|END|EXISTS|FOREIGN|FROM|FULL|FUNCTION|GRANT|GROUP|HAVING|IF|IN|INDEX|INNER|INSERT|INTO|IS|JOIN|KEY|LEFT|LIKE|LIMIT|NOT|NULL|OFFSET|ON|OR|ORDER|OUTER|PRIMARY|PROCEDURE|REFERENCES|REVOKE|RIGHT|ROLLBACK|SCHEMA|SELECT|SET|TABLE|THEN|TRANSACTION|TRIGGER|TRUNCATE|UNION|UNIQUE|UPDATE|VALUES|VIEW|WHEN|WHERE)\b/', |
| | 'boolean' => '/(?i)\b(NULL|TRUE|FALSE)\b/', |
| | 'function' => '/\b([a-zA-Z_][a-zA-Z0-9_]*)\s*(?=\()/', |