dotfiles

My dotfiles.
Log | Files | Refs | LICENSE

c.jsf (28012B)


      1 # JOE syntax highlight file for C
      2 
      3 # A (deterministic) state machine which performs lexical analysis of C.
      4 # (This is the "assembly language" of syntax highlighting.  A separate
      5 # program could be used to convert a regular expression NFA syntax into this
      6 # format).
      7 
      8 # Each state begins with ':<name> <color-name>'
      9 # <color-name> is the color used for characters eaten by the state
     10 # (really a symbol for a user definable color).
     11 
     12 # The first state defined is the initial state.
     13 
     14 # Within a state, define transitions (jumps) to other states.  Each
     15 # jump has the form: <character-list> <target-state> [<option>s]
     16 
     17 # There are two ways to specify <character-list>s, either * for any
     18 # character not otherwise specified, or a literal list of characters within
     19 # quotes (ranges and escape sequences allows).  When the next character
     20 # matches any in the list, a jump to the target-state is taken and the
     21 # character is eaten (we advance to the next character of the file to be
     22 # colored).
     23 #
     24 # The * transition should be the first transition specified in the state.
     25 #
     26 # There are several options:
     27 #   noeat       do not eat the character, instead feed it to the next state
     28 #               (this tends to make the states smaller, but be careful: you
     29 #       can make infinite loops).
     30 #
     31 #   recolor=-N  Recolor the past N characters with the color of the
     32 #       target-state.  For example once /* is recognized as the
     33 #       start of C comment, you want to color the /* with the C
     34 #       comment color.
     35 #
     36 #   buffer      start copying characters to a buffer, beginning with this
     37 #       one (it's ok, to not terminate buffering with a matching
     38 #       'strings' option- the buffer is limited to leading 19
     39 #       characters).
     40 #
     41 #   strings A list of strings follows.  If the buffer matches any of the
     42 #       given strings, a jump to the target-state in the string list
     43 #       is taken instead of the normal jump.
     44 #
     45 #   istrings    Same as strings, but case is ignored.
     46 #
     47 #   The format of the string list is:
     48 #
     49 #      "string"   <target-state>
     50 #      "string"   <target-state>
     51 #      done
     52 #
     53 # Weirdness: only states have colors, not transitions.  This means that you
     54 # sometimes have to make dummy states with '* next-state noeat' just to get
     55 # a color specification.
     56 
     57 # Define no. sync lines
     58 # You can say:
     59 # -200     means 200 lines
     60 # -        means always start parsing from beginning of file when we lose sync
     61 #          if nothing is specified, the default is -50
     62 # THIS SETTING IS IGNORED BY Ad-hoc programming editor for DOSBox.
     63 -3000
     64 
     65 
     66 # Define colors
     67 #
     68 # Colors 
     69 # white cyan magenta blue yellow green red black
     70 # bg_white bg_cyan bg_magenta bg_blue bg_yellow bg_green bg_red bg_black
     71 # THIS SETTING IS DIFFERENT IN Ad-hoc programming editor for DOSBox.
     72 # OUR COLORS ARE 8-BIT HEXADECIMAL NUMBERS:
     73 #   IRGBirgb
     74 #   \\\\\\\\_bit 0: blue for foreground
     75 #    \\\\\\\_bit 1: green for foreground
     76 #     \\\\\\_bit 2: red for foreground
     77 #      \\\\\_bit 3: intensity bit for foreground
     78 #       \\\\_bit 4: blue for background
     79 #        \\\_bit 5: green for background
     80 #         \\_bit 6: red for background
     81 #          \_bit 7: intensity bit for background
     82 # For example, 03 = black background, cyan foreground.
     83 
     84 
     85 
     86 =Background    	
     87 =CPreproc 	    bold cyan
     88 =CPreprocKW 		bold cyan
     89 =CPreproc_cKW	bold cyan
     90 =CPreproc_sym	bold blue
     91 =CPreprocCComment	yellow
     92 =CPreprocUnknown	bold cyan / bg_blue
     93 =OpenMP			green
     94 =OpenMPkw		bold green
     95 =OpenMPkw2		bold green
     96 =OpenMPcomment	yellow
     97 =OpenMPnonkw	red / bg_green
     98 =OpenMP_space	bold cyan
     99 =CComment		bold green
    100 =Special		cyan
    101 =Special2		green
    102 =GlueColor		cyan
    103 =AssignColor	bold green
    104 =Numeric		bold blue
    105 =InvalidNumber	bold magenta / bg_red
    106 =NumericSuffix	magenta
    107 =String			bold green
    108 =StringContent	green
    109 =WString		bold blue
    110 =WStringContent	cyan
    111 =Char			bold magenta
    112 =CharContent	magenta
    113 =WChar			bold blue
    114 =WCharContent	cyan
    115 =AbruptStringTermination	bold green / bg_red
    116 =CKeyword		bold
    117 =CType			bold
    118 =STLkw			bold
    119 =Identifier		
    120 =Mystery		bold green / bg_red
    121 =TrailingSpace	black / bg_cyan
    122 
    123 
    124 ########################
    125 # The rules begin here.
    126 :newline Background
    127     *       idle noeat
    128     "#"     pre_hash recolor=-1
    129     " \t"   newline_space
    130 :newline_space Background
    131     *       newline noeat
    132     "\n"        trailing_space recolor=-2
    133 
    134 :pre_hash CPreprocKW
    135     *       pre noeat
    136 :pre CPreproc
    137     *       preident recolor=-1 buffer
    138     "/"     pre1_slash recolor=-1
    139     " \t"       pre
    140     "\n"        newline
    141 :preident CPreprocUnknown
    142     *       preproc noeat strings
    143     "define"    preproc_known
    144     "elif"      preproc_known
    145     "else"      preproc_known
    146     "endif"     preproc_known
    147     "error"     preproc_known
    148     "if"        preproc_known
    149     "ifdef"     preproc_known
    150     "ifndef"    preproc_known
    151     "include"   preproc_known
    152     "include_next"  preproc_known
    153     "line"      preproc_known
    154     "pragma"    preproc_pragma
    155     "undef"     preproc_known
    156     "warning"   preproc_known
    157 done
    158     "a-z$0-9A-Z_"   preident
    159 
    160 # CPreprocessor directives that begin with an actual keyword
    161 :preproc_known CPreprocKW
    162     *       preproc noeat
    163 :preproc CPreproc
    164     *       preproc
    165     " \t"   preproc_space
    166     "\n"        newline
    167     "a-z$A-Z_"  preproc_ident recolor=-1 buffer
    168     "-()?~[]{},;:!<>=+*%&|^" preproc_sym recolor=-1 noeat
    169     "/"         pre2_slash recolor=-1
    170     "\""        pre2_string recolor=-1
    171     "'"     pre2_char recolor=-1
    172     "\\"        preproc_cont recolor=-1
    173 :preproc_space CPreproc
    174     *       preproc noeat
    175     "\n"        trailing_space recolor=-2
    176 :preproc_sym CPreproc_sym
    177     *       preproc
    178 :preproc_cont CPreproc_sym
    179     *       preproc_cont
    180     "\n"        preproc_newline
    181 :preproc_newline Background
    182     *       preproc noeat
    183     " \t"   preproc_newline_space
    184 :preproc_newline_space CPreproc
    185     *       preproc_newline noeat
    186     "\n"        trailing_space recolor=-2
    187 :preproc_ident CPreproc
    188     *       preproc noeat strings
    189     "auto"      preproc_ident_known
    190     "char"      preproc_ident_known
    191     "const"     preproc_ident_known
    192     "decltype"  preproc_ident_known
    193     "double"    preproc_ident_known
    194     "enum"      preproc_ident_known
    195     "extern"    preproc_ident_known
    196     "float"     preproc_ident_known
    197     "inline"    preproc_ident_known
    198     "int"       preproc_ident_known
    199     "long"      preproc_ident_known
    200     "register"  preproc_ident_known
    201     "short"     preproc_ident_known
    202     "signed"    preproc_ident_known
    203     "static"    preproc_ident_known
    204     "struct"    preproc_ident_known
    205     "typedef"   preproc_ident_known
    206     "union"     preproc_ident_known
    207     "unsigned"  preproc_ident_known
    208     "void"      preproc_ident_known
    209     "volatile"  preproc_ident_known
    210     "break"     preproc_ident_known
    211     "case"      preproc_ident_known
    212     "continue"  preproc_ident_known
    213     "default"   preproc_ident_known
    214     "do"        preproc_ident_known
    215     "else"      preproc_ident_known
    216     "for"       preproc_ident_known
    217     "goto"      preproc_ident_known
    218     "if"        preproc_ident_known
    219     "return"    preproc_ident_known
    220     "sizeof"    preproc_ident_known
    221     "switch"    preproc_ident_known
    222     "while"     preproc_ident_known
    223     "bitand"    preproc_ident_known   #c++
    224     "bitor"     preproc_ident_known   #c++
    225     "catch"     preproc_ident_known   #c++
    226     "compl"     preproc_ident_known   #c++
    227     "delete"        preproc_ident_known   #c++
    228     "explicit"  preproc_ident_known   #c++
    229     "export"    preproc_ident_known   #c++
    230     "false"     preproc_ident_known   #c++
    231     "friend"        preproc_ident_known   #c++
    232     "namespace"     preproc_ident_known   #c++
    233     "new"           preproc_ident_known   #c++
    234     "not"       preproc_ident_known   #c++
    235     "not_eq"    preproc_ident_known   #c++
    236     "operator"  preproc_ident_known   #c++
    237     "or"        preproc_ident_known   #c++
    238     "or_eq"     preproc_ident_known   #c++
    239     "private"   preproc_ident_known   #c++
    240     "protected" preproc_ident_known   #c++
    241     "public"    preproc_ident_known   #c++
    242     "throw"     preproc_ident_known   #c++
    243     "true"      preproc_ident_known   #c++
    244     "try"       preproc_ident_known   #c++
    245     "using"         preproc_ident_known   #c++
    246     "virtual"   preproc_ident_known   #c++
    247     "xor"       preproc_ident_known   #c++
    248     "xor_eq"    preproc_ident_known   #c++
    249 done
    250     "a-z$A-Z0-9_"   preproc_ident
    251 :preproc_ident_known CPreproc_cKW
    252     *       preproc noeat
    253 
    254 :pre2_slash CPreproc_sym
    255     *       preproc recolor=-1
    256     "*"     pre2_comment        recolor=-2
    257     "/"     pre2_line_comment   recolor=-2
    258 :pre2_comment CPreprocCComment
    259     *       pre2_comment
    260     "*"     pre2_comment_maybe_end
    261 :pre2_comment_maybe_end CPreprocCComment
    262     *       pre2_comment
    263     "/"     preproc
    264     "*"     pre2_comment_maybe_end
    265 :pre2_line_comment CPreprocCComment
    266     *       pre2_line_comment
    267     "\\"        pre2_line_comment_escape
    268     "\n"        newline
    269 :pre2_line_comment_escape CPreprocCComment
    270     *       pre2_line_comment
    271 :pre2_string CPreproc_sym
    272     *       pre2_string
    273     "\""        preproc
    274     "\\"        pre2_string_escape
    275 :pre2_string_escape CPreproc_sym
    276     *       pre2_string
    277 :pre2_char CPreproc_sym
    278     *       pre2_char
    279     "'"     preproc
    280     "\\"        pre2_char_escape
    281 :pre2_char_escape CPreproc_sym
    282     *       pre2_char
    283 
    284 # CPreprocessor directives that just begin with #, no keyword
    285 :pre1_slash CPreprocUnknown
    286     *       pre recolor=-1
    287     "*"     pre1_comment        recolor=-2
    288     "/"     pre1_line_comment   recolor=-2
    289 :pre1_comment CPreprocCComment
    290     *       pre1_comment
    291     " "     pre1_comment_space
    292     "*"     pre1_comment_maybe_end
    293 :pre1_comment_space CPreprocCComment
    294     *       pre1_comment noeat
    295     "\n"        pre1_comment_trailing_space recolor=-2
    296 :pre1_comment_trailing_space TrailingSpace
    297     *       pre1_comment noeat
    298 :pre1_comment_maybe_end CPreprocCComment
    299     *       pre1_comment
    300     "/"     pre
    301     "*"     pre1_comment_maybe_end
    302 :pre1_line_comment CPreprocCComment
    303     *       pre1_line_comment
    304     "\\"        pre1_line_comment_escape
    305     "\n"        newline
    306 :pre1_line_comment_escape CPreprocCComment
    307     *       pre1_line_comment
    308 
    309 
    310 # Special care about OpenMP #pragma constructs
    311 :preproc_pragma CPreprocKW
    312     *       preproc_pragma0 noeat
    313 :preproc_pragma0 CPreproc
    314     *       preproc noeat
    315     " "     preproc_pragma0
    316     "o"     openmp1
    317 :openmp1 CPreproc
    318     *       preproc noeat
    319     "m"     openmp2
    320 :openmp2 CPreproc
    321     *       preproc noeat
    322     "p"     openmp3
    323 :openmp3 CPreproc
    324     *       preproc noeat
    325     " "     openmp_keyword_known recolor=-12
    326 
    327 :openmp OpenMP
    328     *       openmp
    329     " \t"   openmp_space recolor=-1
    330     "("     openmp_parens
    331     "\\"        openmp_cont
    332     "a-z_"      openmp_keyword recolor=-1 buffer
    333     "/"     openmp_slash
    334     "\n"        newline
    335 :openmp_space OpenMP_space
    336     *       openmp noeat
    337     "\n"        trailing_space recolor=-2
    338 :openmp_slash OpenMP
    339     *       openmp
    340     "*"     openmp_comment recolor=-2
    341     "/"     openmp_line_comment recolor=-2
    342 :openmp_comment OpenMPcomment
    343     *       openmp_comment
    344     "*"     openmp_comment_maybe_end
    345 :openmp_comment_maybe_end OpenMPcomment
    346     *       openmp_comment
    347     "*"     openmp_comment_maybe_end
    348     "/"     openmp
    349 :openmp_line_comment OpenMPcomment
    350     *       openmp_line_comment
    351     "\\"        openmp_line_comment_escape
    352     "\n"        newline
    353 :openmp_line_comment_escape OpenMPcomment
    354     *       openmp_line_comment
    355 
    356 :openmp_parens OpenMP
    357     *       openmp_parens
    358     "\\"        openmp_parens_cont
    359     "/"     openmp_parens_slash
    360     ")"     openmp
    361     "\n"        newline
    362 :openmp_cont OpenMP
    363     *       openmp
    364 :openmp_parens_cont OpenMP
    365     *       openmp_parens
    366 :openmp_parens_slash OpenMP
    367     *       openmp_parens noeat
    368     "*"     openmp_parens_comment recolor=-2
    369 :openmp_parens_comment OpenMPcomment
    370     *       openmp_parens_comment
    371     "*"     openmp_parens_comment_maybe_end
    372 :openmp_parens_comment_maybe_end OpenMPcomment
    373     *       openmp_parens_comment
    374     "*"     openmp_parens_comment_maybe_end
    375     "/"     openmp_parens
    376 
    377 :openmp_keyword OpenMPnonkw
    378     *       openmp noeat strings
    379     "atomic"    openmp_keyword_known2
    380     "barrier"   openmp_keyword_known2
    381     "collapse"  openmp_keyword_known
    382     "copyin"    openmp_keyword_known
    383     "copyprivate"   openmp_keyword_known
    384     "critical"  openmp_keyword_known2
    385     "default"   openmp_keyword_known_do_parens
    386     "dynamic"   openmp_keyword_known_end_parens
    387     "firstprivate"  openmp_keyword_known
    388     "for"       openmp_keyword_known2
    389     "flush"     openmp_keyword_known2
    390     "guided"    openmp_keyword_known_end_parens
    391     "if"        openmp_keyword_known
    392     "lastprivate"   openmp_keyword_known
    393     "master"    openmp_keyword_known2
    394     "nowait"    openmp_keyword_known
    395     "none"      openmp_keyword_known_end_parens
    396     "num_threads"   openmp_keyword_known
    397     "ordered"   openmp_keyword_known2
    398     "parallel"  openmp_keyword_known2
    399     "private"   openmp_keyword_known_end_parens
    400     "reduction" openmp_keyword_known
    401     "schedule"  openmp_keyword_known_do_parens
    402     "section"   openmp_keyword_known2
    403     "sections"  openmp_keyword_known2
    404     "shared"    openmp_keyword_known_end_parens
    405     "single"    openmp_keyword_known2
    406     "static"    openmp_keyword_known_end_parens
    407     "task"      openmp_keyword_known2
    408     "taskwait"  openmp_keyword_known
    409     "threadprivate" openmp_keyword_known
    410     "untied"    openmp_keyword_known
    411 done
    412     "a-z0-9A-Z_"    openmp_keyword
    413 :openmp_keyword_known OpenMPkw
    414     *       openmp noeat
    415 :openmp_keyword_known2 OpenMPkw2
    416     *       openmp noeat
    417 :openmp_keyword_known_do_parens OpenMPkw
    418     *       openmp noeat
    419     "("     openmp_keyword_known_do_parens1 recolor=-1
    420 :openmp_keyword_known_end_parens OpenMPkw
    421     *       openmp_keyword_known_end_parens1 noeat
    422 :openmp_keyword_known_end_parens1 OpenMP
    423     *       openmp noeat
    424     " "     openmp_keyword_known_end_parens1
    425     ","     openmp_parens
    426 :openmp_keyword_known_do_parens1 OpenMP
    427     *       openmp_parens noeat
    428         "a-z_"          openmp_keyword recolor=-1 buffer
    429 
    430 # All following states are for when we're not in a preprocessor line
    431 
    432 :idle Background
    433     *       idle_mystery    recolor=-1
    434     "()?~"      special     recolor=-1
    435     "[]{},;"    special2    recolor=-1
    436     ":"     maybe_glue  recolor=-1
    437     "!<>"       maybe_comp  recolor=-1
    438     "="     maybe_comp_eq   recolor=-1
    439     "-+*%&|^"   maybe_op_assign recolor=-1
    440     " \t"   space       recolor=-1
    441     "/"     slash       recolor=-1
    442     "0"     first_digit_0   recolor=-1
    443     "1-9"       first_digit recolor=-1
    444     "."     period      recolor=-1
    445     "\""        stringbegin recolor=-1 noeat
    446     "'"     charbegin   recolor=-1 noeat
    447     "a-z$A-Z_"  ident       recolor=-1 buffer
    448     "L"     maybe_wide      recolor=-1 buffer
    449     "\n"        newline recolor=-1
    450 :idle_mystery Mystery
    451     *       idle noeat
    452 :space Background
    453         *               idle noeat
    454         "\n"        trailing_space recolor=-2
    455 :trailing_space TrailingSpace
    456     *       newline noeat
    457 
    458 # Delimiters
    459 :special Special
    460     *       idle noeat
    461 :special2 Special2
    462     *       idle noeat
    463 :period Special
    464     *       idle noeat
    465     ":"     typoed_glue recolor=-2
    466     "0-9"       float       recolor=-2
    467 :slash Special
    468     *       idle noeat
    469     "*"     comment     recolor=-2 # "/*"
    470     "/"     line_comment    recolor=-2 # "//"
    471     "="     was_op_assign   recolor=-2 # "/="
    472 
    473 # "::"
    474 :maybe_glue Special
    475     *       idle noeat
    476     "."     typoed_glue recolor=-2
    477     ":"     was_glue recolor=-2
    478 :was_glue GlueColor
    479     *       idle noeat
    480 
    481 :typoed_glue InvalidNumber
    482     *       idle noeat
    483 
    484 # "==" vs "="
    485 :maybe_comp_eq AssignColor
    486     *       idle noeat
    487     "="     was_comp recolor=-2
    488 # "<=", ">=", "==", "!="
    489 :maybe_comp Special
    490     *       idle noeat
    491     "="     was_comp recolor=-2
    492 :was_comp Special
    493     *       idle noeat
    494 
    495 # "+=", "-=", "*=", "/=", "%=", "&=", "|="
    496 :maybe_op_assign Special
    497     *       idle noeat
    498     "="     was_op_assign recolor=-2
    499 :was_op_assign AssignColor
    500     *       idle noeat
    501 
    502 
    503 # CComments
    504 :comment CComment
    505     *       comment
    506     " "     comment_space
    507     "*"     maybe_end_comment
    508 :comment_space CComment
    509     *       comment noeat
    510     "\n"        comment_trailing_space recolor=-2
    511 :comment_trailing_space TrailingSpace
    512     *       comment noeat
    513 :maybe_end_comment CComment
    514     *       comment
    515     "/"     idle
    516     "*"     maybe_end_comment
    517 :line_comment CComment
    518     *       line_comment
    519     "\\"        line_comment_escape
    520     "\n"        newline recolor=-1
    521 :line_comment_escape CComment
    522     *       line_comment
    523 
    524 # Numeric constants
    525 :first_digit_0 Numeric
    526     *       first_digit noeat
    527     "xX"            hex_first
    528 :first_digit Numeric
    529     *       number_before_e noeat
    530 
    531 :hex_first Numeric
    532     *       end_number_suffix noeat recolor=-2
    533     "0-9A-Fa-f" hex
    534     "."     hexfloat
    535 :hex Numeric
    536     *       end_int noeat
    537     "0-9A-Fa-f" hex
    538     "."     hexfloat
    539     "pP"        epart
    540 :hexfloat Numeric
    541     *       end_number_suffix noeat recolor=-2
    542     "0-9A-Fa-f" hexfloat
    543     "pP"        epart
    544 :number_before_e Numeric
    545     *       end_int noeat
    546     "0-9"       number_before_e
    547     "."     float
    548     "eE"            epart
    549 
    550 :float Numeric
    551     *       end_float noeat
    552     "eE"        epart
    553     "0-9"       float
    554 :epart Numeric
    555     *       enum_first noeat
    556     "-+"        enum_first
    557 :enum_first Numeric
    558     *       end_number_suffix noeat recolor=-2
    559     "0-9"       enum
    560 :enum Numeric
    561     *       end_float noeat
    562     "0-9"       enum
    563 :end_float NumericSuffix
    564     *       end_number_suffix noeat
    565     "fFlL"      end_number_suffix #f, #l
    566 :end_int NumericSuffix
    567     *       end_number_suffix noeat
    568     "uU"        int_suffix_u    #u
    569     "lL"        int_suffix_l    #l
    570 :int_suffix_u NumericSuffix
    571     *       end_number_suffix noeat
    572     "lL"        int_suffix_ul   #ul
    573 :int_suffix_ul NumericSuffix
    574     *       end_number_suffix noeat
    575     "lL"        end_number_suffix #ull
    576 :int_suffix_l NumericSuffix
    577     *       end_number_suffix noeat
    578     "uU"        end_number_suffix  #lu
    579     "lL"        int_suffix_ll   #ll
    580 :int_suffix_ll NumericSuffix
    581     *       end_number_suffix noeat
    582     "uU"        end_number_suffix #llu
    583 :end_number_suffix InvalidNumber
    584     *       idle noeat
    585     "a-z$A-Z_0-9"   end_number_suffix
    586 
    587 # Strings
    588 :stringbegin String
    589     *       string
    590 :stringend String
    591     *       idle
    592 
    593 :string StringContent
    594     *       string
    595     "\""        stringend noeat
    596     "\\"        string_escape
    597     "\n"        invalid_string_char_flush recolor=-2
    598 :string_escape StringContent
    599     *       string
    600     "\n"        string
    601     ""       string_escape_ignore noeat
    602 :string_escape_ignore Background
    603     *       string_escape
    604 
    605 :wstringbegin WString
    606     *       wstring
    607 :wstringend WString
    608     *       idle
    609 
    610 :wstring    WStringContent
    611     *       wstring
    612     "\""        wstringend noeat
    613     "\\"        wstring_escape
    614     "\n"        invalid_string_char_flush recolor=-2
    615 :wstring_escape WStringContent
    616     *       wstring
    617     "\n"        wstring
    618     ""       wstring_escape_ignore noeat
    619 :wstring_escape_ignore Background
    620     *       wstring_escape
    621 
    622 
    623 # Chars
    624 :charbegin Char
    625     *       char
    626 :charend Char
    627     *       idle
    628 
    629 :char CharContent
    630     *       char
    631     "'"     charend noeat
    632     "\\"        char_escape
    633     "\n"        invalid_string_char_flush recolor=-2
    634 :char_escape    CharContent
    635     *       char
    636     "\n"        char
    637 :char_escape_ignore Background
    638     *       char_escape
    639 
    640 :wcharbegin WChar
    641     *       wchar
    642 :wcharend WChar
    643     *       idle
    644 :wchar WCharContent
    645     *       wchar
    646     "'"     wcharend noeat
    647     "\\"        wchar_escape
    648     "\n"        invalid_string_char_flush recolor=-2
    649 :wchar_escape   WCharContent
    650     *       wchar
    651     "\n"        wchar
    652 :wchar_escape_ignore Background
    653     *       wchar_escape
    654 
    655 
    656 :maybe_wide Identifier
    657     *               ident noeat
    658     "'"     wcharbegin noeat recolor=-2
    659     "\""        wstringbegin noeat recolor=-2
    660 
    661 
    662 # This is if a "\n" is met inside a string or char constant.
    663 # It serves two purposes:
    664 #   Helps getting back in sync
    665 #   Minimizes terminal traffic when entering strings
    666 :invalid_string_char_flush AbruptStringTermination
    667     *       newline noeat
    668 
    669 # Special identifiers
    670 :ident Identifier
    671     *       idle noeat strings
    672     "auto"      type
    673     "char"      type
    674     "const"     type
    675     "decltype"  type
    676     "double"    type
    677     "enum"      type
    678     "extern"    type
    679     "float"     type
    680     "inline"    type
    681     "int"       type
    682     "long"      type
    683     "register"  type
    684     "short"     type
    685     "signed"    type
    686     "static"    type
    687     "struct"    type
    688     "typedef"   type
    689     "union"     type
    690     "unsigned"  type
    691     "void"      type
    692     "volatile"  type
    693     "bool"          type   #c++
    694     "class"         type   #c++
    695     "const_cast"    type   #c++
    696     "dynamic_cast"  type   #c++
    697     "mutable"   type   #c++
    698     "reinterpret_cast" type   #c++
    699     "static_cast"   type   #c++
    700     "template"      type   #c++
    701     "typeid"    type   #c++
    702     "typename"      type   #c++
    703     "wchar_t"       type   #c++
    704     "break"     kw
    705     "case"      kw
    706     "continue"  kw
    707     "default"   kw
    708     "do"        kw
    709     "else"      kw
    710     "for"       kw
    711     "goto"      kw
    712     "if"        kw
    713     "return"    kw
    714     "sizeof"    kw
    715     "switch"    kw
    716     "while"     kw
    717     "bitand"    kw   #c++
    718     "nullptr"    kw   #c++
    719     "module"    kw   #c++
    720     "import"    kw   #c++
    721     "constexpr" kw   #c++
    722     "bitor"     kw   #c++
    723     "catch"     kw   #c++
    724     "compl"     kw   #c++
    725     "delete"        kw   #c++
    726     "explicit"  kw   #c++
    727     "export"    kw   #c++
    728     "false"     kw   #c++
    729     "friend"        kw   #c++
    730     "namespace"     kw   #c++
    731     "new"           kw   #c++
    732     "not"       kw   #c++
    733     "not_eq"    kw   #c++
    734     "operator"  kw   #c++
    735     "or"        kw   #c++
    736     "or_eq"     kw   #c++
    737     "private"   kw   #c++
    738     "protected" kw   #c++
    739     "public"    kw   #c++
    740     "this"      kw   #c++
    741     "throw"     kw   #c++
    742     "true"      kw   #c++
    743     "try"       kw   #c++
    744     "using"         kw   #c++
    745     "virtual"   kw   #c++
    746     "xor"       kw   #c++
    747     "xor_eq"    kw   #c++
    748         "accumulate"               stlkw
    749         "adjacent_difference"          stlkw
    750         "adjacent_find"            stlkw
    751         "advance"              stlkw
    752         "allocator"            stlkw
    753         "auto_ptr"             stlkw
    754         "back_insert_iterator"         stlkw
    755         "back_inserter"            stlkw
    756         "basic_string"             stlkw
    757         "binary_function"          stlkw
    758         "binary_negate"            stlkw
    759         "binary_search"            stlkw
    760         "bind1st"              stlkw
    761         "bind2nd"              stlkw
    762         "binder1st"            stlkw
    763         "binder2nd"            stlkw
    764         "bitset"               stlkw
    765         "complex"              stlkw
    766         "copy"                 stlkw
    767         "copy_backward"            stlkw
    768         "count"                stlkw
    769         "count_if"             stlkw
    770         "deque"                stlkw
    771         "distance"             stlkw
    772         "distance_type"            stlkw
    773         "divides"              stlkw
    774         "equal"                stlkw
    775         "equal_range"              stlkw
    776         "equal_to"             stlkw
    777         "exception"            stlkw
    778         "fill"                 stlkw
    779         "fill_n"               stlkw
    780         "find"                 stlkw
    781         "find_end"             stlkw
    782         "find_first_of"            stlkw
    783         "find_if"              stlkw
    784         "for_each"             stlkw
    785         "front_insert_iterator"        stlkw
    786         "front_inserter"           stlkw
    787         "generate"             stlkw
    788         "generate_n"               stlkw
    789         "get_temporary_buffer"         stlkw
    790         "greater"              stlkw
    791         "greater_equal"            stlkw
    792         "includes"             stlkw
    793         "inner_product"            stlkw
    794         "inplace_merge"            stlkw
    795         "insert_iterator"          stlkw
    796         "inserter"             stlkw
    797         "istream_iterator"         stlkw
    798         "iter_swap"            stlkw
    799         "iterator_category"        stlkw
    800         "less"                 stlkw
    801         "less_equal"               stlkw
    802         "lexicographical_compare"      stlkw
    803         "limits"               stlkw
    804         "list"                 stlkw
    805         "logical_and"              stlkw
    806         "logical_not"              stlkw
    807         "logical_or"               stlkw
    808         "lower_bound"              stlkw
    809         "make_heap"            stlkw
    810         "map"                  stlkw
    811         "max"                  stlkw
    812         "max_element"              stlkw
    813         "merge"                stlkw
    814         "min"                  stlkw
    815         "min_element"              stlkw
    816         "minus"                stlkw
    817         "mismatch"             stlkw
    818         "modulus"              stlkw
    819         "move"                 stlkw
    820         "multimap"             stlkw
    821         "multiset"             stlkw
    822         "negate"               stlkw
    823         "next_permutation"         stlkw
    824         "not1"                 stlkw
    825         "not2"                 stlkw
    826         "not_equal_to"             stlkw
    827         "nth_element"              stlkw
    828         "numeric_limits"           stlkw
    829         "ostream_iterator"         stlkw
    830         "pair"                 stlkw
    831         "partial_sort"             stlkw
    832         "partial_sort_copy"        stlkw
    833         "partial_sum"              stlkw
    834         "partition"            stlkw
    835         "permutation"              stlkw
    836         "plus"                 stlkw
    837         "pointer_to_binary_function"       stlkw
    838         "pointer_to_unary_function"    stlkw
    839         "pop_heap"             stlkw
    840         "prev_permutation"         stlkw
    841         "priority_queue"           stlkw
    842         "ptr_fun"              stlkw
    843         "push_heap"            stlkw
    844         "queue"                stlkw
    845         "random_shuffle"           stlkw
    846         "raw_storage_iterator"         stlkw
    847         "remove"               stlkw
    848         "remove_copy"              stlkw
    849         "remove_copy_if"           stlkw
    850         "remove_if"            stlkw
    851         "replace"              stlkw
    852         "replace_copy"             stlkw
    853         "replace_copy_if"          stlkw
    854         "replace_if"               stlkw
    855         "return_temporary_buffer"      stlkw
    856         "reverse"              stlkw
    857         "reverse_bidirectional_iterator"   stlkw
    858         "reverse_copy"             stlkw
    859         "reverse_iterator"         stlkw
    860         "rotate"               stlkw
    861         "rotate_copy"              stlkw
    862         "search"               stlkw
    863         "search_n"             stlkw
    864         "set"                  stlkw
    865         "set_difference"           stlkw
    866         "set_intersection"         stlkw
    867         "set_symmetric_difference"     stlkw
    868         "set_union"            stlkw
    869         "sort"                 stlkw
    870         "sort_heap"            stlkw
    871         "stable_partition"         stlkw
    872         "stable_sort"              stlkw
    873         "stack"                stlkw
    874         "string"               stlkw
    875         "string_char_traits"           stlkw
    876         "swap"                 stlkw
    877         "swap_ranges"              stlkw
    878         "times"                stlkw
    879         "transform"            stlkw
    880         "unary_function"           stlkw
    881         "unary_negate"             stlkw
    882         "uninitialized_copy"           stlkw
    883         "uninitialized_fill"           stlkw
    884         "uninitialized_fill_n"         stlkw
    885         "unique"               stlkw
    886         "unique_copy"              stlkw
    887         "upper_bound"              stlkw
    888         "value_type"               stlkw
    889         "vector"               stlkw
    890         "wstring"              stlkw
    891     "std" stlkw
    892     "iterator" stlkw
    893     "const_iterator" stlkw
    894     "const_reverse_iterator" stlkw
    895 done
    896     "a-z$A-Z0-9_"   ident
    897 
    898 
    899 
    900 
    901 :type CType
    902     *   idle noeat
    903 :kw CKeyword
    904     *   idle noeat
    905 :stlkw STLkw
    906     *   idle noeat
    907     ":" stlkw_colon recolor=-1
    908 :stlkw_colon InvalidNumber
    909     *   idle noeat
    910     ":" was_glue recolor=-2