diff --git a/components/prism-c.js b/components/prism-c.js index ea2452daaf..faa6c4981c 100644 --- a/components/prism-c.js +++ b/components/prism-c.js @@ -1,7 +1,11 @@ Prism.languages.c = Prism.languages.extend('clike', { + 'class-name': { + pattern: /(\b(?:enum|struct)\s+)\w+/, + lookbehind: true + }, 'keyword': /\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|asm|typeof|inline|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|union|unsigned|void|volatile|while)\b/, 'operator': />>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/, - 'number': /(?:\b0x[\da-f]+|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?)[ful]*/i + 'number': /(?:\b0x(?:[\da-f]+\.?[\da-f]*|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?)[ful]*/i }); Prism.languages.insertBefore('c', 'string', { @@ -29,5 +33,4 @@ Prism.languages.insertBefore('c', 'string', { 'constant': /\b(?:__FILE__|__LINE__|__DATE__|__TIME__|__TIMESTAMP__|__func__|EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|stdin|stdout|stderr)\b/ }); -delete Prism.languages.c['class-name']; delete Prism.languages.c['boolean']; diff --git a/components/prism-c.min.js b/components/prism-c.min.js index 78b49c98e8..2516c04747 100644 --- a/components/prism-c.min.js +++ b/components/prism-c.min.js @@ -1 +1 @@ -Prism.languages.c=Prism.languages.extend("clike",{keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|asm|typeof|inline|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|union|unsigned|void|volatile|while)\b/,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*\/%&|^!=<>]=?/,number:/(?:\b0x[\da-f]+|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?)[ful]*/i}),Prism.languages.insertBefore("c","string",{macro:{pattern:/(^\s*)#\s*[a-z]+(?:[^\r\n\\]|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,alias:"property",inside:{string:{pattern:/(#\s*include\s*)(?:<.+?>|("|')(?:\\?.)+?\2)/,lookbehind:!0},directive:{pattern:/(#\s*)\b(?:define|defined|elif|else|endif|error|ifdef|ifndef|if|import|include|line|pragma|undef|using)\b/,lookbehind:!0,alias:"keyword"}}},constant:/\b(?:__FILE__|__LINE__|__DATE__|__TIME__|__TIMESTAMP__|__func__|EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|stdin|stdout|stderr)\b/}),delete Prism.languages.c["class-name"],delete Prism.languages.c["boolean"]; \ No newline at end of file +Prism.languages.c=Prism.languages.extend("clike",{"class-name":{pattern:/(\b(?:enum|struct)\s+)\w+/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|asm|typeof|inline|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|union|unsigned|void|volatile|while)\b/,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*\/%&|^!=<>]=?/,number:/(?:\b0x(?:[\da-f]+\.?[\da-f]*|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?)[ful]*/i}),Prism.languages.insertBefore("c","string",{macro:{pattern:/(^\s*)#\s*[a-z]+(?:[^\r\n\\]|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,alias:"property",inside:{string:{pattern:/(#\s*include\s*)(?:<.+?>|("|')(?:\\?.)+?\2)/,lookbehind:!0},directive:{pattern:/(#\s*)\b(?:define|defined|elif|else|endif|error|ifdef|ifndef|if|import|include|line|pragma|undef|using)\b/,lookbehind:!0,alias:"keyword"}}},constant:/\b(?:__FILE__|__LINE__|__DATE__|__TIME__|__TIMESTAMP__|__func__|EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|stdin|stdout|stderr)\b/}),delete Prism.languages.c["boolean"]; \ No newline at end of file diff --git a/components/prism-cpp.js b/components/prism-cpp.js index 3d66ba252a..ba709be38e 100644 --- a/components/prism-cpp.js +++ b/components/prism-cpp.js @@ -1,16 +1,13 @@ Prism.languages.cpp = Prism.languages.extend('c', { + 'class-name': { + pattern: /(\b(?:class|enum|struct)\s+)\w+/, + lookbehind: true + }, 'keyword': /\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|class|compl|const|constexpr|const_cast|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|float|for|friend|goto|if|inline|int|int8_t|int16_t|int32_t|int64_t|uint8_t|uint16_t|uint32_t|uint64_t|long|mutable|namespace|new|noexcept|nullptr|operator|private|protected|public|register|reinterpret_cast|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/, 'boolean': /\b(?:true|false)\b/, 'operator': />>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/ }); -Prism.languages.insertBefore('cpp', 'keyword', { - 'class-name': { - pattern: /(class\s+)\w+/i, - lookbehind: true - } -}); - Prism.languages.insertBefore('cpp', 'string', { 'raw-string': { pattern: /R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/, diff --git a/components/prism-cpp.min.js b/components/prism-cpp.min.js index c0c6a0071c..3b7a981d9c 100644 --- a/components/prism-cpp.min.js +++ b/components/prism-cpp.min.js @@ -1 +1 @@ -Prism.languages.cpp=Prism.languages.extend("c",{keyword:/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|class|compl|const|constexpr|const_cast|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|float|for|friend|goto|if|inline|int|int8_t|int16_t|int32_t|int64_t|uint8_t|uint16_t|uint32_t|uint64_t|long|mutable|namespace|new|noexcept|nullptr|operator|private|protected|public|register|reinterpret_cast|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,"boolean":/\b(?:true|false)\b/,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*\/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/}),Prism.languages.insertBefore("cpp","keyword",{"class-name":{pattern:/(class\s+)\w+/i,lookbehind:!0}}),Prism.languages.insertBefore("cpp","string",{"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}); \ No newline at end of file +Prism.languages.cpp=Prism.languages.extend("c",{"class-name":{pattern:/(\b(?:class|enum|struct)\s+)\w+/,lookbehind:!0},keyword:/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|class|compl|const|constexpr|const_cast|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|float|for|friend|goto|if|inline|int|int8_t|int16_t|int32_t|int64_t|uint8_t|uint16_t|uint32_t|uint64_t|long|mutable|namespace|new|noexcept|nullptr|operator|private|protected|public|register|reinterpret_cast|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,"boolean":/\b(?:true|false)\b/,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*\/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/}),Prism.languages.insertBefore("cpp","string",{"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}); \ No newline at end of file diff --git a/components/prism-objectivec.js b/components/prism-objectivec.js index a9cf6980b4..b2ccb8775b 100644 --- a/components/prism-objectivec.js +++ b/components/prism-objectivec.js @@ -3,3 +3,5 @@ Prism.languages.objectivec = Prism.languages.extend('c', { 'string': /("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1|@"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/, 'operator': /-[->]?|\+\+?|!=?|<>?=?|==?|&&?|\|\|?|[~^%?*\/@]/ }); + +delete Prism.languages.objectivec['class-name']; diff --git a/components/prism-objectivec.min.js b/components/prism-objectivec.min.js index 4805fc9af1..d80cfb3dc0 100644 --- a/components/prism-objectivec.min.js +++ b/components/prism-objectivec.min.js @@ -1 +1 @@ -Prism.languages.objectivec=Prism.languages.extend("c",{keyword:/\b(?:asm|typeof|inline|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|union|unsigned|void|volatile|while|in|self|super)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,string:/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1|@"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,operator:/-[->]?|\+\+?|!=?|<>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}); \ No newline at end of file +Prism.languages.objectivec=Prism.languages.extend("c",{keyword:/\b(?:asm|typeof|inline|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|union|unsigned|void|volatile|while|in|self|super)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,string:/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1|@"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,operator:/-[->]?|\+\+?|!=?|<>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete Prism.languages.objectivec["class-name"]; \ No newline at end of file diff --git a/tests/languages/c/class-name_feature.test b/tests/languages/c/class-name_feature.test new file mode 100644 index 0000000000..356fd0fd66 --- /dev/null +++ b/tests/languages/c/class-name_feature.test @@ -0,0 +1,17 @@ +struct foo +enum bar + +struct foo var; + +---------------------------------------------------- + +[ + ["keyword", "struct"], ["class-name", "foo"], + ["keyword", "enum"], ["class-name", "bar"], + + ["keyword", "struct"], ["class-name", "foo"], " var", ["punctuation", ";"] +] + +---------------------------------------------------- + +Checks for structs and enums. diff --git a/tests/languages/c/keyword_feature.test b/tests/languages/c/keyword_feature.test index feb9ff9377..29077e875a 100644 --- a/tests/languages/c/keyword_feature.test +++ b/tests/languages/c/keyword_feature.test @@ -3,27 +3,31 @@ _Complex _Generic _Imaginary _Noreturn _Static_assert _Thread_local asm typeof inline auto break case char const continue default -do double else enum extern +do double else enum; +extern float for goto if int long register return short signed -sizeof static struct switch typedef +sizeof static struct; +switch typedef union unsigned void volatile while ---------------------------------------------------- [ ["keyword", "_Alignas"], ["keyword", "_Alignof"], ["keyword", "_Atomic"], ["keyword", "_Bool"], - ["keyword", "_Complex"], ["keyword", "_Generic"], ["keyword", "_Imaginary"], - ["keyword", "_Noreturn"], ["keyword", "_Static_assert"], ["keyword", "_Thread_local"], + ["keyword", "_Complex"], ["keyword", "_Generic"], ["keyword", "_Imaginary"], + ["keyword", "_Noreturn"], ["keyword", "_Static_assert"], ["keyword", "_Thread_local"], ["keyword", "asm"], ["keyword", "typeof"], ["keyword", "inline"], ["keyword", "auto"], ["keyword", "break"], ["keyword", "case"], ["keyword", "char"], ["keyword", "const"], ["keyword", "continue"], ["keyword", "default"], - ["keyword", "do"], ["keyword", "double"], ["keyword", "else"], ["keyword", "enum"], ["keyword", "extern"], + ["keyword", "do"], ["keyword", "double"], ["keyword", "else"], ["keyword", "enum"], ["punctuation", ";"], + ["keyword", "extern"], ["keyword", "float"], ["keyword", "for"], ["keyword", "goto"], ["keyword", "if"], ["keyword", "int"], ["keyword", "long"], ["keyword", "register"], ["keyword", "return"], ["keyword", "short"], ["keyword", "signed"], - ["keyword", "sizeof"], ["keyword", "static"], ["keyword", "struct"], ["keyword", "switch"], ["keyword", "typedef"], + ["keyword", "sizeof"], ["keyword", "static"], ["keyword", "struct"], ["punctuation", ";"], + ["keyword", "switch"], ["keyword", "typedef"], ["keyword", "union"], ["keyword", "unsigned"], ["keyword", "void"], ["keyword", "volatile"], ["keyword", "while"] ] ---------------------------------------------------- -Checks for all keywords. \ No newline at end of file +Checks for all keywords. diff --git a/tests/languages/c/number_feature.test b/tests/languages/c/number_feature.test index 0542683404..c2975870c6 100644 --- a/tests/languages/c/number_feature.test +++ b/tests/languages/c/number_feature.test @@ -5,6 +5,9 @@ 0.4e+2 0xbabe 0xBABE +0x1.2 +0x0.3p-3 +0x0.3p4L 42f 42F 42u @@ -22,6 +25,9 @@ ["number", "0.4e+2"], ["number", "0xbabe"], ["number", "0xBABE"], + ["number", "0x1.2"], + ["number", "0x0.3p-3"], + ["number", "0x0.3p4L"], ["number", "42f"], ["number", "42F"], ["number", "42u"], @@ -32,4 +38,4 @@ ---------------------------------------------------- -Checks for decimal numbers and hexadecimal numbers. \ No newline at end of file +Checks for decimal numbers and hexadecimal numbers. diff --git a/tests/languages/cpp/class-name_feature.test b/tests/languages/cpp/class-name_feature.test index f3d5df5f63..e61733c3ce 100644 --- a/tests/languages/cpp/class-name_feature.test +++ b/tests/languages/cpp/class-name_feature.test @@ -1,13 +1,17 @@ class Foo class Foo_bar +struct foo +enum bar ---------------------------------------------------- [ ["keyword", "class"], ["class-name", "Foo"], - ["keyword", "class"], ["class-name", "Foo_bar"] + ["keyword", "class"], ["class-name", "Foo_bar"], + ["keyword", "struct"], ["class-name", "foo"], + ["keyword", "enum"], ["class-name", "bar"] ] ---------------------------------------------------- -Checks for class names. \ No newline at end of file +Checks for class names. diff --git a/tests/languages/cpp/keyword_feature.test b/tests/languages/cpp/keyword_feature.test index 180f68ef09..b782149ce7 100644 --- a/tests/languages/cpp/keyword_feature.test +++ b/tests/languages/cpp/keyword_feature.test @@ -4,14 +4,16 @@ class; compl const constexpr const_cast continue decltype default delete do double dynamic_cast -else enum explicit export extern +else enum; +explicit export extern float for friend goto if inline int long mutable namespace new noexcept nullptr operator private protected public register reinterpret_cast return short signed sizeof static static_assert -static_cast struct switch template +static_cast struct; +switch template this thread_local throw try typedef typeid typename union unsigned using virtual void @@ -28,14 +30,16 @@ uint8_t uint16_t uint32_t uint64_t ["keyword", "compl"], ["keyword", "const"], ["keyword", "constexpr"], ["keyword", "const_cast"], ["keyword", "continue"], ["keyword", "decltype"], ["keyword", "default"], ["keyword", "delete"], ["keyword", "do"], ["keyword", "double"], ["keyword", "dynamic_cast"], - ["keyword", "else"], ["keyword", "enum"], ["keyword", "explicit"], ["keyword", "export"], ["keyword", "extern"], + ["keyword", "else"], ["keyword", "enum"], ["punctuation", ";"], + ["keyword", "explicit"], ["keyword", "export"], ["keyword", "extern"], ["keyword", "float"], ["keyword", "for"], ["keyword", "friend"], ["keyword", "goto"], ["keyword", "if"], ["keyword", "inline"], ["keyword", "int"], ["keyword", "long"], ["keyword", "mutable"], ["keyword", "namespace"], ["keyword", "new"], ["keyword", "noexcept"], ["keyword", "nullptr"], ["keyword", "operator"], ["keyword", "private"], ["keyword", "protected"], ["keyword", "public"], ["keyword", "register"], ["keyword", "reinterpret_cast"], ["keyword", "return"], ["keyword", "short"], ["keyword", "signed"], ["keyword", "sizeof"], ["keyword", "static"], ["keyword", "static_assert"], - ["keyword", "static_cast"], ["keyword", "struct"], ["keyword", "switch"], ["keyword", "template"], + ["keyword", "static_cast"], ["keyword", "struct"], ["punctuation", ";"], + ["keyword", "switch"], ["keyword", "template"], ["keyword", "this"], ["keyword", "thread_local"], ["keyword", "throw"], ["keyword", "try"], ["keyword", "typedef"], ["keyword", "typeid"], ["keyword", "typename"], ["keyword", "union"], ["keyword", "unsigned"], ["keyword", "using"], ["keyword", "virtual"], ["keyword", "void"], @@ -46,4 +50,4 @@ uint8_t uint16_t uint32_t uint64_t ---------------------------------------------------- -Checks for all keywords \ No newline at end of file +Checks for all keywords. diff --git a/tests/languages/opencl/keyword_feature.test b/tests/languages/opencl/keyword_feature.test index 47613f7b00..b171c054e5 100644 --- a/tests/languages/opencl/keyword_feature.test +++ b/tests/languages/opencl/keyword_feature.test @@ -71,7 +71,7 @@ double8x2 double8x4 double8x8 else -enum +enum; event_t extern float @@ -168,7 +168,7 @@ short4 short8 size_t static -struct +struct; switch typedef uchar @@ -202,218 +202,218 @@ ushort8 void volatile while -write_only - ----------------------------------------------------- - -[ - ["keyword", "__attribute__"], - ["keyword", "__constant"], - ["keyword", "__global"], - ["keyword", "__kernel"], - ["keyword", "__local"], - ["keyword", "__private"], - ["keyword", "__read_only"], - ["keyword", "__read_write"], - ["keyword", "__write_only"], - ["keyword", "_cl_command_queue"], - ["keyword", "_cl_context"], - ["keyword", "_cl_device_id"], - ["keyword", "_cl_event"], - ["keyword", "_cl_kernel"], - ["keyword", "_cl_mem"], - ["keyword", "_cl_platform_id"], - ["keyword", "_cl_program"], - ["keyword", "_cl_sampler"], - ["keyword", "auto"], - ["keyword", "bool"], - ["keyword", "bool16"], - ["keyword", "bool2"], - ["keyword", "bool3"], - ["keyword", "bool4"], - ["keyword", "bool8"], - ["keyword", "break"], - ["keyword", "case"], - ["keyword", "char"], - ["keyword", "char16"], - ["keyword", "char2"], - ["keyword", "char3"], - ["keyword", "char4"], - ["keyword", "char8"], - ["keyword", "cl_image_format"], - ["keyword", "cl_mem_fence_flags"], - ["keyword", "clk_event_t"], - ["keyword", "complex"], - ["keyword", "const"], - ["keyword", "constant"], - ["keyword", "continue"], - ["keyword", "do"], - ["keyword", "double"], - ["keyword", "double16"], - ["keyword", "double16x1"], - ["keyword", "double16x16"], - ["keyword", "double16x2"], - ["keyword", "double16x4"], - ["keyword", "double16x8"], - ["keyword", "double1x1"], - ["keyword", "double1x16"], - ["keyword", "double1x2"], - ["keyword", "double1x4"], - ["keyword", "double1x8"], - ["keyword", "double2"], - ["keyword", "double2x1"], - ["keyword", "double2x16"], - ["keyword", "double2x2"], - ["keyword", "double2x4"], - ["keyword", "double2x8"], - ["keyword", "double3"], - ["keyword", "double4"], - ["keyword", "double4x1"], - ["keyword", "double4x16"], - ["keyword", "double4x2"], - ["keyword", "double4x4"], - ["keyword", "double4x8"], - ["keyword", "double8"], - ["keyword", "double8x1"], - ["keyword", "double8x16"], - ["keyword", "double8x2"], - ["keyword", "double8x4"], - ["keyword", "double8x8"], - ["keyword", "else"], - ["keyword", "enum"], - ["keyword", "event_t"], - ["keyword", "extern"], - ["keyword", "float"], - ["keyword", "float16"], - ["keyword", "float16x1"], - ["keyword", "float16x16"], - ["keyword", "float16x2"], - ["keyword", "float16x4"], - ["keyword", "float16x8"], - ["keyword", "float1x1"], - ["keyword", "float1x16"], - ["keyword", "float1x2"], - ["keyword", "float1x4"], - ["keyword", "float1x8"], - ["keyword", "float2"], - ["keyword", "float2x1"], - ["keyword", "float2x16"], - ["keyword", "float2x2"], - ["keyword", "float2x4"], - ["keyword", "float2x8"], - ["keyword", "float3"], - ["keyword", "float4"], - ["keyword", "float4x1"], - ["keyword", "float4x16"], - ["keyword", "float4x2"], - ["keyword", "float4x4"], - ["keyword", "float4x8"], - ["keyword", "float8"], - ["keyword", "float8x1"], - ["keyword", "float8x16"], - ["keyword", "float8x2"], - ["keyword", "float8x4"], - ["keyword", "float8x8"], - ["keyword", "for"], - ["keyword", "global"], - ["keyword", "half"], - ["keyword", "half16"], - ["keyword", "half2"], - ["keyword", "half3"], - ["keyword", "half4"], - ["keyword", "half8"], - ["keyword", "if"], - ["keyword", "image1d_array_t"], - ["keyword", "image1d_buffer_t"], - ["keyword", "image1d_t"], - ["keyword", "image2d_array_depth_t"], - ["keyword", "image2d_array_msaa_depth_t"], - ["keyword", "image2d_array_msaa_t"], - ["keyword", "image2d_array_t"], - ["keyword", "image2d_depth_t"], - ["keyword", "image2d_msaa_depth_t"], - ["keyword", "image2d_msaa_t"], - ["keyword", "image2d_t"], - ["keyword", "image3d_t"], - ["keyword", "imaginary"], - ["keyword", "int"], - ["keyword", "int16"], - ["keyword", "int2"], - ["keyword", "int3"], - ["keyword", "int4"], - ["keyword", "int8"], - ["keyword", "intptr_t"], - ["keyword", "kernel"], - ["keyword", "local"], - ["keyword", "long"], - ["keyword", "long16"], - ["keyword", "long2"], - ["keyword", "long3"], - ["keyword", "long4"], - ["keyword", "long8"], - ["keyword", "ndrange_t"], - ["keyword", "packed"], - ["keyword", "pipe"], - ["keyword", "private"], - ["keyword", "ptrdiff_t"], - ["keyword", "quad"], - ["keyword", "quad16"], - ["keyword", "quad2"], - ["keyword", "quad3"], - ["keyword", "quad4"], - ["keyword", "quad8"], - ["keyword", "queue_t"], - ["keyword", "read_only"], - ["keyword", "read_write"], - ["keyword", "register"], - ["keyword", "reserve_id_t"], - ["keyword", "restrict"], - ["keyword", "sampler_t"], - ["keyword", "short"], - ["keyword", "short16"], - ["keyword", "short2"], - ["keyword", "short3"], - ["keyword", "short4"], - ["keyword", "short8"], - ["keyword", "size_t"], - ["keyword", "static"], - ["keyword", "struct"], - ["keyword", "switch"], - ["keyword", "typedef"], - ["keyword", "uchar"], - ["keyword", "uchar16"], - ["keyword", "uchar2"], - ["keyword", "uchar3"], - ["keyword", "uchar4"], - ["keyword", "uchar8"], - ["keyword", "uint"], - ["keyword", "uint16"], - ["keyword", "uint2"], - ["keyword", "uint3"], - ["keyword", "uint4"], - ["keyword", "uint8"], - ["keyword", "uintptr_t"], - ["keyword", "ulong"], - ["keyword", "ulong16"], - ["keyword", "ulong2"], - ["keyword", "ulong3"], - ["keyword", "ulong4"], - ["keyword", "ulong8"], - ["keyword", "uniform"], - ["keyword", "union"], - ["keyword", "unsigned"], - ["keyword", "ushort"], - ["keyword", "ushort16"], - ["keyword", "ushort2"], - ["keyword", "ushort3"], - ["keyword", "ushort4"], - ["keyword", "ushort8"], - ["keyword", "void"], - ["keyword", "volatile"], - ["keyword", "while"], - ["keyword", "write_only"] -] - ----------------------------------------------------- - -Checks for all keywords in OpenCL kernel code. \ No newline at end of file +write_only + +---------------------------------------------------- + +[ + ["keyword", "__attribute__"], + ["keyword", "__constant"], + ["keyword", "__global"], + ["keyword", "__kernel"], + ["keyword", "__local"], + ["keyword", "__private"], + ["keyword", "__read_only"], + ["keyword", "__read_write"], + ["keyword", "__write_only"], + ["keyword", "_cl_command_queue"], + ["keyword", "_cl_context"], + ["keyword", "_cl_device_id"], + ["keyword", "_cl_event"], + ["keyword", "_cl_kernel"], + ["keyword", "_cl_mem"], + ["keyword", "_cl_platform_id"], + ["keyword", "_cl_program"], + ["keyword", "_cl_sampler"], + ["keyword", "auto"], + ["keyword", "bool"], + ["keyword", "bool16"], + ["keyword", "bool2"], + ["keyword", "bool3"], + ["keyword", "bool4"], + ["keyword", "bool8"], + ["keyword", "break"], + ["keyword", "case"], + ["keyword", "char"], + ["keyword", "char16"], + ["keyword", "char2"], + ["keyword", "char3"], + ["keyword", "char4"], + ["keyword", "char8"], + ["keyword", "cl_image_format"], + ["keyword", "cl_mem_fence_flags"], + ["keyword", "clk_event_t"], + ["keyword", "complex"], + ["keyword", "const"], + ["keyword", "constant"], + ["keyword", "continue"], + ["keyword", "do"], + ["keyword", "double"], + ["keyword", "double16"], + ["keyword", "double16x1"], + ["keyword", "double16x16"], + ["keyword", "double16x2"], + ["keyword", "double16x4"], + ["keyword", "double16x8"], + ["keyword", "double1x1"], + ["keyword", "double1x16"], + ["keyword", "double1x2"], + ["keyword", "double1x4"], + ["keyword", "double1x8"], + ["keyword", "double2"], + ["keyword", "double2x1"], + ["keyword", "double2x16"], + ["keyword", "double2x2"], + ["keyword", "double2x4"], + ["keyword", "double2x8"], + ["keyword", "double3"], + ["keyword", "double4"], + ["keyword", "double4x1"], + ["keyword", "double4x16"], + ["keyword", "double4x2"], + ["keyword", "double4x4"], + ["keyword", "double4x8"], + ["keyword", "double8"], + ["keyword", "double8x1"], + ["keyword", "double8x16"], + ["keyword", "double8x2"], + ["keyword", "double8x4"], + ["keyword", "double8x8"], + ["keyword", "else"], + ["keyword", "enum"], ["punctuation", ";"], + ["keyword", "event_t"], + ["keyword", "extern"], + ["keyword", "float"], + ["keyword", "float16"], + ["keyword", "float16x1"], + ["keyword", "float16x16"], + ["keyword", "float16x2"], + ["keyword", "float16x4"], + ["keyword", "float16x8"], + ["keyword", "float1x1"], + ["keyword", "float1x16"], + ["keyword", "float1x2"], + ["keyword", "float1x4"], + ["keyword", "float1x8"], + ["keyword", "float2"], + ["keyword", "float2x1"], + ["keyword", "float2x16"], + ["keyword", "float2x2"], + ["keyword", "float2x4"], + ["keyword", "float2x8"], + ["keyword", "float3"], + ["keyword", "float4"], + ["keyword", "float4x1"], + ["keyword", "float4x16"], + ["keyword", "float4x2"], + ["keyword", "float4x4"], + ["keyword", "float4x8"], + ["keyword", "float8"], + ["keyword", "float8x1"], + ["keyword", "float8x16"], + ["keyword", "float8x2"], + ["keyword", "float8x4"], + ["keyword", "float8x8"], + ["keyword", "for"], + ["keyword", "global"], + ["keyword", "half"], + ["keyword", "half16"], + ["keyword", "half2"], + ["keyword", "half3"], + ["keyword", "half4"], + ["keyword", "half8"], + ["keyword", "if"], + ["keyword", "image1d_array_t"], + ["keyword", "image1d_buffer_t"], + ["keyword", "image1d_t"], + ["keyword", "image2d_array_depth_t"], + ["keyword", "image2d_array_msaa_depth_t"], + ["keyword", "image2d_array_msaa_t"], + ["keyword", "image2d_array_t"], + ["keyword", "image2d_depth_t"], + ["keyword", "image2d_msaa_depth_t"], + ["keyword", "image2d_msaa_t"], + ["keyword", "image2d_t"], + ["keyword", "image3d_t"], + ["keyword", "imaginary"], + ["keyword", "int"], + ["keyword", "int16"], + ["keyword", "int2"], + ["keyword", "int3"], + ["keyword", "int4"], + ["keyword", "int8"], + ["keyword", "intptr_t"], + ["keyword", "kernel"], + ["keyword", "local"], + ["keyword", "long"], + ["keyword", "long16"], + ["keyword", "long2"], + ["keyword", "long3"], + ["keyword", "long4"], + ["keyword", "long8"], + ["keyword", "ndrange_t"], + ["keyword", "packed"], + ["keyword", "pipe"], + ["keyword", "private"], + ["keyword", "ptrdiff_t"], + ["keyword", "quad"], + ["keyword", "quad16"], + ["keyword", "quad2"], + ["keyword", "quad3"], + ["keyword", "quad4"], + ["keyword", "quad8"], + ["keyword", "queue_t"], + ["keyword", "read_only"], + ["keyword", "read_write"], + ["keyword", "register"], + ["keyword", "reserve_id_t"], + ["keyword", "restrict"], + ["keyword", "sampler_t"], + ["keyword", "short"], + ["keyword", "short16"], + ["keyword", "short2"], + ["keyword", "short3"], + ["keyword", "short4"], + ["keyword", "short8"], + ["keyword", "size_t"], + ["keyword", "static"], + ["keyword", "struct"], ["punctuation", ";"], + ["keyword", "switch"], + ["keyword", "typedef"], + ["keyword", "uchar"], + ["keyword", "uchar16"], + ["keyword", "uchar2"], + ["keyword", "uchar3"], + ["keyword", "uchar4"], + ["keyword", "uchar8"], + ["keyword", "uint"], + ["keyword", "uint16"], + ["keyword", "uint2"], + ["keyword", "uint3"], + ["keyword", "uint4"], + ["keyword", "uint8"], + ["keyword", "uintptr_t"], + ["keyword", "ulong"], + ["keyword", "ulong16"], + ["keyword", "ulong2"], + ["keyword", "ulong3"], + ["keyword", "ulong4"], + ["keyword", "ulong8"], + ["keyword", "uniform"], + ["keyword", "union"], + ["keyword", "unsigned"], + ["keyword", "ushort"], + ["keyword", "ushort16"], + ["keyword", "ushort2"], + ["keyword", "ushort3"], + ["keyword", "ushort4"], + ["keyword", "ushort8"], + ["keyword", "void"], + ["keyword", "volatile"], + ["keyword", "while"], + ["keyword", "write_only"] +] + +---------------------------------------------------- + +Checks for all keywords in OpenCL kernel code.