I've been trying to add new keywords (e.g., module) to Clang for a project, but I want to only add the support for my language extensions (because I want to keep the merges to a minimum and modify as few things as possible). I did this by adding an enum type to the IndentifierTable.cpp namespace:<br>
<br>namespace {<br> enum {<br> KEYC99 = 0x1,<br> KEYCXX = 0x2,<br> KEYCXX0X = 0x4,<br> KEYGNU = 0x8,<br> KEYMS = 0x10,<br> BOOLSUPPORT = 0x20,<br> KEYALTIVEC = 0x40,<br> KEYNOCXX = 0x80,<br> KEYBORLAND = 0x100,<br>
KEYOPENCL = 0x200,<br> KEYC11 = 0x400,<br> KEYARC = 0x800,<br> KEYSCAF = 0x1000, // Scaffold enum<br> KEYALL = 0x1fff<br> };<br>}<br><br>And adding the type to the check in AddKeyword().<br><br>I then added the desired keywords to the TokenFeatures:<br>
<br>//Scaffold added keywords<br>KEYWORD(qreg , KEYSCAF)<br>KEYWORD(qint , KEYSCAF)<br>KEYWORD(module , KEYSCAF)<br>KEYWORD(c2qg , KEYSCAF)<br>
<br>However, once compiled, the keywords are still treated as identifiers, not types or keywords.<br><br>What am I missing?<br><br>-Thanks,<br>-Jeff<br>