xref: /netbsd-src/external/gpl3/gcc/dist/contrib/vim-gcc-dev/syntax/gcc-match.vim (revision 181254a7b1bdde6873432bffef2d2decc4b5c22f)
1*181254a7Smrg" Vim syntax highlighting rules for GCC match-and-simplify language.
2*181254a7Smrg"
3*181254a7Smrg" Copyright (C) 2018 Free Software Foundation, Inc.
4*181254a7Smrg"
5*181254a7Smrg" This script is free software; you can redistribute it and/or modify
6*181254a7Smrg" it under the terms of the GNU General Public License as published by
7*181254a7Smrg" the Free Software Foundation; either version 3, or (at your option)
8*181254a7Smrg" any later version
9*181254a7Smrg
10*181254a7Smrgif exists("b:current_syntax")
11*181254a7Smrg    finish
12*181254a7Smrgendif
13*181254a7Smrg
14*181254a7Smrg" Some keywords have a question mark, e.g. 'convert?'
15*181254a7Smrgsetl isk=@,48-57,_,?
16*181254a7Smrg
17*181254a7Smrgsyn keyword pdTodo contained TODO FIXME XXX
18*181254a7Smrg
19*181254a7Smrgsyn keyword pdCtrl match simplify
20*181254a7Smrgsyn keyword pdCtrl define_predicates define_operator_list
21*181254a7Smrgsyn keyword pdCtrl if switch for with
22*181254a7Smrg
23*181254a7Smrgsyn keyword pdType type
24*181254a7Smrg
25*181254a7Smrgsyn keyword pdOp view_convert view_convert?
26*181254a7Smrg               \ convert convert? convert1 convert2 convert1? convert2?
27*181254a7Smrg               \ realpart imagpart
28*181254a7Smrg               \ cond vec_cond vec_perm
29*181254a7Smrg               \ pointer_plus pointer_diff
30*181254a7Smrg               \ plus minus mult mult_highpart
31*181254a7Smrg               \ trunc_div ceil_div floor_div round_div
32*181254a7Smrg               \ trunc_mod ceil_mod floor_mod round_mod
33*181254a7Smrg               \ rdiv exact_div
34*181254a7Smrg               \ fix_trunc float negate min max abs absu
35*181254a7Smrg               \ lshift rshift lrotate rrotate
36*181254a7Smrg               \ bit_ior bit_xor bit_and bit_not
37*181254a7Smrg               \ truth_andif truth_orif truth_and
38*181254a7Smrg               \ truth_or truth_xor truth_not
39*181254a7Smrg               \ lt le gt ge eq ne unordered ordered
40*181254a7Smrg               \ unlt unle ungt unge uneq ltgt
41*181254a7Smrg               \ addr_space_convert fixed_convert
42*181254a7Smrg               \ bit_insert complex conj
43*181254a7Smrg               \ reduc_max reduc_min reduc_plus
44*181254a7Smrg               \ dot_prod widen_sum sad fma
45*181254a7Smrg               \ widen_mult widen_mult_plus widen_mult_minus widen_lshift
46*181254a7Smrg               \ vec_widen_mult_hi vec_widen_mult_lo
47*181254a7Smrg               \ vec_widen_mult_even vec_widen_mult_odd
48*181254a7Smrg               \ vec_unpack_hi vec_unpack_lo
49*181254a7Smrg               \ vec_unpack_float_hi vec_unpack_float_lo
50*181254a7Smrg               \ vec_pack_trunc vec_pack_sat vec_pack_fix_trunc
51*181254a7Smrg               \ vec_widen_lshift_hi vec_widen_lshift_lo
52*181254a7Smrg
53*181254a7Smrg" Match commutative/single-use specifiers: :C, :c, :s, :cs, etc.
54*181254a7Smrgsyn match pdOpSpec  ":[CcSs]\+\>"
55*181254a7Smrg
56*181254a7Smrgsyn match pdCapture "@@\?[a-zA-Z0-9_]\+"
57*181254a7Smrg
58*181254a7Smrgsyn region pdComment start="/\*" end="\*/" contains=pdTodo
59*181254a7Smrg
60*181254a7Smrgsyn region pdPreProc start="^\s*#" skip="\\$" end="$" keepend
61*181254a7Smrg
62*181254a7Smrghi def link pdCtrl    Statement
63*181254a7Smrghi def link pdType    Identifier
64*181254a7Smrghi def link pdOp      Constant
65*181254a7Smrghi def link pdOpSpec  Operator
66*181254a7Smrghi def link pdCapture Special
67*181254a7Smrghi def link pdComment Comment
68*181254a7Smrghi def link pdTodo    Todo
69*181254a7Smrghi def link pdPreProc PreProc
70*181254a7Smrg
71*181254a7Smrglet b:current_syntax = "gcc-match"
72