The functions needs to be in one of the following formats; semicolons are optional:
Code: Select all
void example () { };
void example () = { };
void example () = [$framemacro, thinkfunction] {};
Go to the folder where Notepad++ is installed, and open the file functionList.xml .
Insert this line before the line </associationMap>:
Code: Select all
<association userDefinedLangName="QuakeC" id="qc_function"/>
</associationMap>
Code: Select all
<parser id="qc_function" displayName="QuakeC" commentExpr="((/\*.*?\*)/|(//.*?$))">
<function
mainExpr="^[\t ]*((static|const|virtual)[\s]+)?[\w:]+([\s]+[\w]+)?([\s]+|\*[\s]+|[\s]+\*|[\s]+\*[\s]+)([\w_]+[\s]*::)?(?!(if|while|for))[\w_]+[\s]*\([^\)\(]*\)([\s]*const[\s]*)?[\n\s]*[=\[\{]"
displayMode="$functionName">
<functionName>
<nameExpr expr="(?!(if|while|for))[\w_~]+[\s]*\("/>
<nameExpr expr="(?!(if|while|for))[\w_~]+"/>
</functionName>
</function>
</parser>
</parsers>
And here's a file for syntax highlighting. Right-click on this link and choose the "Save link as..." context menu item: NotepadPlusPlus_QC_highlighting.
Some notes on this syntax highlighting file:
- It includes a hack to highlight preprocessor directives. FrikQcc 2.6 supports these: #include #includelist #define #undef #ifdef #ifndef #else #endif #pragma #warning #error.
- Since builtins can be freely named, standard builtin functions' names are in regular color, but in bold format.
- Constants are in green; this includes variables usually treated as constants, like MOVETYPE_WALK.
- Constant strings have a background color to help tracking them across whitespaces, and vectors are underlined for the same reason.
- Flow control commands (switch case default if else break return do while) use a specific color to make it easier to track instruction flow.
- System globals are in bold dark blue, and system fields are in regular dark blue.
- System global functions and system field functions (.void) are in regular blue.
- Data types are in light blue, to help them stand out.
- Operators and separators are in red. The contrast between red, blue and black makes the separators easier to notice, while being easy on the eyes.
- Line comments have a yellow background, but multi-line comments doesn't, because colored backgrounds on multiline comments is distracting when in header-style text. To compensate for this, multi-line comments are in bold gray.
- Macro sections are in bold with a slightly dark blue color, to differentiate their operators from regular ones.