Ticket #3686: 0001-Initial-support-of-CUDA-syntax-highlighting.patch

File 0001-Initial-support-of-CUDA-syntax-highlighting.patch, 6.2 KB (added by sergey, 8 years ago)

Fixed copy-paste typo in Syntax file

  • misc/syntax/Makefile.am

    From e8aa0fc900d46d4f0df1be1a72dd9be910116892 Mon Sep 17 00:00:00 2001
    From: Sergey Sharybin <sergey.vfx@gmail.com>
    Date: Thu, 8 Sep 2016 13:00:29 +0200
    Subject: [PATCH] Initial support of CUDA syntax highlighting
    
    Based on existing cxx.syntax file with some extra keywords added.
    
    Colors could be tweaked a bit still, and perhaps list of keywords
    and built-in types could be extended further, but it should be a
    good starting point already.
    ---
     misc/syntax/Makefile.am |   1 +
     misc/syntax/Syntax.in   |   3 +
     misc/syntax/cuda.syntax | 159 ++++++++++++++++++++++++++++++++++++++++++++++++
     3 files changed, 163 insertions(+)
     create mode 100644 misc/syntax/cuda.syntax
    
    diff --git a/misc/syntax/Makefile.am b/misc/syntax/Makefile.am
    index 04c3ba4..a606cb7 100644
    a b SYNTAXFILES = \ 
    1515        cmake.syntax            \ 
    1616        cs.syntax               \ 
    1717        css.syntax              \ 
     18        cuda.syntax             \ 
    1819        cxx.syntax              \ 
    1920        d.syntax                \ 
    2021        dlink.syntax            \ 
  • misc/syntax/Syntax.in

    diff --git a/misc/syntax/Syntax.in b/misc/syntax/Syntax.in
    index 611cfca..d8da1b9 100644
    a b include puppet.syntax 
    265265file .\*\\.(glsl|vert|frag|geom)$ GLSL\sProgram 
    266266include glsl.syntax 
    267267 
     268file .\*\\.(cu|cuh)$ CUDA\sProgram 
     269include cuda.syntax 
     270 
    268271file .\* unknown 
    269272include unknown.syntax 
  • new file misc/syntax/cuda.syntax

    diff --git a/misc/syntax/cuda.syntax b/misc/syntax/cuda.syntax
    new file mode 100644
    index 0000000..96cc8be
    - +  
     1# Cuda syntax file 
     2 
     3# Authors: 
     4#    Sergey Sharybin <sergey.vfx@gmail.com> 
     5# 
     6# Based on cxx.syntax file with some extra keywords to be 
     7# highlighted, 
     8 
     9context default 
     10    keyword whole auto yellow 
     11    keyword whole break yellow 
     12    keyword whole case yellow 
     13    keyword whole char yellow 
     14    keyword whole const yellow 
     15    keyword whole continue yellow 
     16    keyword whole default yellow 
     17    keyword whole do yellow 
     18    keyword whole double yellow 
     19    keyword whole else yellow 
     20    keyword whole enum yellow 
     21    keyword whole extern yellow 
     22    keyword whole float yellow 
     23    keyword whole for yellow 
     24    keyword whole goto yellow 
     25    keyword whole if yellow 
     26    keyword whole int yellow 
     27    keyword whole long yellow 
     28    keyword whole register yellow 
     29    keyword whole return yellow 
     30    keyword whole short yellow 
     31    keyword whole signed yellow 
     32    keyword whole sizeof yellow 
     33    keyword whole static yellow 
     34    keyword whole struct yellow 
     35    keyword whole switch yellow 
     36    keyword whole typedef yellow 
     37    keyword whole union yellow 
     38    keyword whole unsigned yellow 
     39    keyword whole void yellow 
     40    keyword whole volatile yellow 
     41    keyword whole while yellow 
     42    keyword whole asm yellow 
     43    keyword whole catch yellow 
     44    keyword whole class yellow 
     45    keyword whole friend yellow 
     46    keyword whole delete yellow 
     47    keyword whole inline yellow 
     48    keyword whole new yellow 
     49    keyword whole operator yellow 
     50    keyword whole private yellow 
     51    keyword whole protected yellow 
     52    keyword whole public yellow 
     53    keyword whole this yellow 
     54    keyword whole throw yellow 
     55    keyword whole template yellow 
     56    keyword whole try yellow 
     57    keyword whole virtual yellow 
     58    keyword whole bool yellow 
     59    keyword whole const_cast yellow 
     60    keyword whole dynamic_cast yellow 
     61    keyword whole explicit yellow 
     62    keyword whole false yellow 
     63    keyword whole mutable yellow 
     64    keyword whole namespace yellow 
     65    keyword whole reinterpret_cast yellow 
     66    keyword whole static_cast yellow 
     67    keyword whole true yellow 
     68    keyword whole typeid yellow 
     69    keyword whole typename yellow 
     70    keyword whole using yellow 
     71    keyword whole wchar_t yellow 
     72    keyword whole ... yellow 
     73    keyword whole linestart \{\s\t\}\[\s\t\]#*\n brightmagenta 
     74 
     75# Function type qualifiers 
     76    keyword whole __device__ white 
     77    keyword whole __global__ white 
     78    keyword whole __host__ white 
     79 
     80    keyword whole __noinline__ white 
     81    keyword whole __forceinline__ white 
     82 
     83# Variable type qualifiers 
     84    keyword whole __constant__ white 
     85    keyword whole __shared__ white 
     86    keyword whole __managed__ white 
     87    keyword whole __restrict__ white 
     88 
     89# Built-in variables 
     90    keyword whole threadIdx white 
     91    keyword whole blockIdx white 
     92    keyword whole blockDim white 
     93    keyword whole gridDim white 
     94    keyword whole warpSize white 
     95 
     96# Synchronization 
     97    keyword whole __syncthreads white 
     98    keyword whole __threadfence white 
     99 
     100    keyword /\* brown 
     101    keyword \*/ brown 
     102    keyword // brown 
     103 
     104    keyword '\\\{"abtnvfr\}' brightgreen 
     105    keyword '\\\{0123\}\{01234567\}\{01234567\}' brightgreen 
     106    keyword '\\'' brightgreen 
     107    keyword '\\\\' brightgreen 
     108    keyword '\\0' brightgreen 
     109    keyword '\{\s!"#$%&()\*\+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ\}' brightgreen 
     110 
     111    keyword > yellow 
     112    keyword < yellow 
     113    keyword \+ yellow 
     114    keyword - yellow 
     115    keyword \* yellow 
     116    keyword / yellow 
     117    keyword % yellow 
     118    keyword = yellow 
     119    keyword != yellow 
     120    keyword == yellow 
     121    keyword { brightcyan 
     122    keyword } brightcyan 
     123    keyword ( brightcyan 
     124    keyword ) brightcyan 
     125    keyword [ brightcyan 
     126    keyword ] brightcyan 
     127    keyword , brightcyan 
     128    keyword : brightcyan 
     129    keyword ? brightcyan 
     130    keyword ; brightmagenta 
     131 
     132context exclusive /\* \*/ brown 
     133    spellcheck 
     134 
     135context exclusive // \n brown 
     136    spellcheck 
     137 
     138context linestart # \n brightred 
     139    keyword \\\n yellow 
     140    keyword /\**\*/ brown 
     141    keyword //*\n brown 
     142    keyword "+" red 
     143    keyword <+> red 
     144 
     145context " " green 
     146    spellcheck 
     147    keyword \\" brightgreen 
     148    keyword %% brightgreen 
     149    keyword %\[#0\s-\+,\]\[0123456789\*\]\[.\]\[0123456789\*\]\[L\]\{eEfgGoxX\} brightgreen 
     150    keyword %\[0\s-\+,\]\[0123456789\*\]\[.\]\[0123456789\*\]\[hl\]\{diuxX\} brightgreen 
     151    keyword %\[hl\]n brightgreen 
     152    keyword %\[-\]\[0123456789\*\]\[.\]\[0123456789\*\]s brightgreen 
     153    keyword %[*] brightgreen 
     154    keyword %c brightgreen 
     155    keyword %p brightgreen 
     156    keyword \\\{0123\}\{01234567\}\{01234567\} brightgreen 
     157    keyword \\\\ brightgreen 
     158    keyword \\' brightgreen 
     159    keyword \\\{abtnvfr\} brightgreen