mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-15 14:16:07 -06:00
CodeEditor: Cuda syntax highlighting
This commit is contained in:
parent
d67bb3b9c3
commit
feb1939298
3 changed files with 18 additions and 3 deletions
|
|
@ -78,6 +78,19 @@ void CSyntax::InitKeywords()
|
|||
"hash_t",
|
||||
NULL
|
||||
};
|
||||
static const char *cuda[] = {
|
||||
"char1", "uchar1", "char2", "uchar2", "char3", "uchar3", "char4", "uchar4",
|
||||
"short1", "ushort1", "short2", "ushort2", "short3", "ushort3", "short4", "ushort4",
|
||||
"int1", "uint1", "int2", "uint2", "int3", "uint3", "int4", "uint4",
|
||||
"long1", "ulong1", "long2", "ulong2", "long3", "ulong3", "long4", "ulong4",
|
||||
"longlong1", "ulonglong1", "longlong2", "ulonglong2", "longlong3",
|
||||
"ulonglong3", "longlong4", "ulonglong4", "float1", "float2", "float3", "float4",
|
||||
"double1", "double2", "double3", "double4",
|
||||
"dim3", "", "__host__", "__device__", "__global__", "__noinline__", "__forceinline__",
|
||||
"__inline_hint__", "__constant__", "__shared__", "__grid_constant__", "__managed__",
|
||||
"__restrict__ ", "gridDim", "blockIdx", "blockDim", "threadIdx", "warpSize",
|
||||
NULL
|
||||
};
|
||||
static const char *usc[] = {
|
||||
"void", "self", "if", "else", "while", "do", "case",
|
||||
"default", "break", "return", "switch", "operator", "for",
|
||||
|
|
@ -360,7 +373,8 @@ void CSyntax::InitKeywords()
|
|||
LoadSyntax(empty, empty); // This is JSON - no keywords to highlights
|
||||
LoadSyntax(php, php2);
|
||||
LoadSyntax(dbg, dbglib);
|
||||
LoadSyntax(cpp, empty); // Order here is important, must be the same as enum
|
||||
LoadSyntax(cpp, empty);
|
||||
LoadSyntax(cpp, cuda);
|
||||
|
||||
kw_macros = InitUpp(upp_macros);
|
||||
kw_logs = InitUpp(upp_logs);
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ public:
|
|||
HIGHLIGHT_NONE = -1, HIGHLIGHT_CPP = 0, HIGHLIGHT_USC, HIGHLIGHT_JAVA, HIGHLIGHT_T,
|
||||
HIGHLIGHT_CALC, HIGHLIGHT_LAY, HIGHLIGHT_SCH, HIGHLIGHT_SQL, HIGHLIGHT_CS,
|
||||
HIGHLIGHT_JAVASCRIPT, HIGHLIGHT_CSS, HIGHLIGHT_JSON, HIGHLIGHT_PHP, HIGHLIGHT_DBG,
|
||||
HIGHLIGHT_GLSL,
|
||||
HIGHLIGHT_GLSL, HIGHLIGHT_CUDA,
|
||||
HIGHLIGHT_COUNT
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -36,8 +36,9 @@ void CreateLogSyntax(One<EditorSyntax>& e)
|
|||
void RegisterSyntaxModules()
|
||||
{
|
||||
RegisterCSyntax("cpp", CSyntax::HIGHLIGHT_CPP,
|
||||
"*.c *.cpp *.cc *.cxx *.h *.hpp *.hh *.hxx *.m *.mm *.icpp *.conf *.cu",
|
||||
"*.c *.cpp *.cc *.cxx *.h *.hpp *.hh *.hxx *.m *.mm *.icpp *.conf",
|
||||
"C/C++");
|
||||
RegisterCSyntax("cpp", CSyntax::HIGHLIGHT_CUDA, "*.cu", "Cuda");
|
||||
RegisterCSyntax("java", CSyntax::HIGHLIGHT_JAVA, "*.java", "Java");
|
||||
RegisterCSyntax("js", CSyntax::HIGHLIGHT_JAVASCRIPT, "*.js", "JavaScript");
|
||||
RegisterCSyntax("cs", CSyntax::HIGHLIGHT_CS, "*.cs", "C#");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue