# Syntax support file for the Lumina Text Editor # =================================== # C++ language support rules # Written by Ken Moore <ken@ixsystems.com> # Released under the 2-clause BSD license # =================================== { "meta": { "name": "C++", "file_suffix": ["cpp", "hpp", "c", "h"] }, "format": { "line_wrap": false, "highlight_whitespace_eol": true }, "rules": [{ "name": "multi-line comment", "regex_start": "/\\*", "regex_end": "\\*/", "foreground": "colors/comment" }, { "name": "single-line comment", "regex": "//[^\n]*", "foreground": "colors/comment" }, { "name": "keywords", "words": ["char", "class", "const", "double", "enum", "explicit", "extern", "float", "friend", "inline", "int", "long", "namespace", "operator", "private", "protected", "public", "short", "signals", "signed", "slots", "static", "struct", "template", "typedef", "typename", "union", "using","unsigned", "virtual", "void", "volatile", "true", "false", "bool", "and", "or", "not"], "foreground": "colors/keyword", "font_weight": "bold" }, { "name": "alternate keywords", "words": ["for", "while", "switch", "case", "continue", "break", "if", "else", "return", "exit"], "foreground": "colors/altkeyword", "font_weight": "bold" }, { "name": "class names", "regex": "\\b[A-Za-z0-9_-\\.]+(?=::)\\b", "foreground": "colors/class", "font_weight": "bold" }, { "name": "numbers", "regex" : "\\b[0-9]+\\.?[0-9]*\\b", "foreground": "colors/text" }, { "name": "function names", "regex": "\\b[A-Za-z0-9_]+(?=\\()", "foreground": "colors/function" }, { "name": "text", "regex": "\"[^\"\\\\]*(\\\\(.|\\n)[^\"\\\\]*)*\"|'[^'\\\\]*(\\\\(.|\\n)[^'\\\\]*)*'", "foreground": "colors/text" }, { "name": "preprocessor", "regex": "^[\\s]*#[^\n]*", "foreground": "colors/preprocessor" } ] }