| | 'string' => '/' . $str . '/', |
| | 'comment' => '/(\/\/[^\r\n]*|\/\*.*?\*\/)/ms', |
| | - 'preprocessor' => '/(^\s*#[^\r\n]*)/', |
| | - 'keyword' => '/\b(auto|break|case|const|continue|default|do|else|enum|extern|for|goto|if|register|return|signed|sizeof|static|struct|switch|typedef|union|unsigned|void|volatile|while)\b/', |
| | + 'include' => '/(^\s*#include[^\r\n]*)/m', |
| | + 'preprocessor' => '/(^\s*#(?!include\b)[^\r\n]*)/m', |
| | + 'keyword' => '/\b(auto|break|case|const|continue|default|do|else|enum|extern|for|goto|if|noreturn|register|return|signed|sizeof|static|struct|switch|typedef|union|unsigned|void|volatile|while)\b/', |
| | 'type' => '/\b(char|double|float|int|long|short|void)\b/', |
| | 'function' => '/\b([a-zA-Z_][a-zA-Z0-9_]*)\s*(?=\()/', |
| | 'number' => '/' . $int . '/', |
| | ], |
| | 'cpp' => [ |
| | 'string' => '/' . $str . '/', |
| | 'comment' => '/(\/\/[^\r\n]*|\/\*.*?\*\/)/ms', |
| | - 'preprocessor' => '/(^\s*#[^\r\n]*)/', |
| | - '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|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/', |
| | + '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/', |
| | 'type' => '/\b(bool|char|char16_t|char32_t|double|float|int|long|short|signed|unsigned|void|wchar_t)\b/', |
| | 'boolean' => '/\b(true|false)\b/', |