diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2018-11-12 23:08:32 +0000 |
---|---|---|
committer | David Neto <dneto@google.com> | 2018-11-13 17:13:13 -0500 |
commit | 5bbbd0748757bbcffbc75f800dd5ec3014b2c9c2 (patch) | |
tree | e7842a0e801ce6fc97a197881fcc0642b4150cbc /tools/amber-syntax.vim | |
parent | c55def0bfd686650de1ef33e4ed33f3aabe399f4 (diff) | |
download | amber-5bbbd0748757bbcffbc75f800dd5ec3014b2c9c2.tar.gz |
Add syntax files for Amber
Diffstat (limited to 'tools/amber-syntax.vim')
-rw-r--r-- | tools/amber-syntax.vim | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/tools/amber-syntax.vim b/tools/amber-syntax.vim new file mode 100644 index 0000000..86ae2c5 --- /dev/null +++ b/tools/amber-syntax.vim @@ -0,0 +1,64 @@ +" Vim syntax file +" Language: Amber Script + +if exists("b:current_syntax") + finish +endif + +" Regular int like number with - + or nothing in front +syn match amberNumber '\d\+' contained display +syn match amberNumber '[-+]\d\+' contained display + +" Floating point number with decimal no E or e (+,-) +syn match amberNumber '\d\+\.\d*' contained display +syn match amberNumber '[-+]\d\+\.\d*' contained display + +" Floating point like number with E and no decimal point (+,-) +syn match amberNumber '[-+]\=\d[[:digit:]]*[eE][\-+]\=\d\+' contained display +syn match amberNumber '\d[[:digit:]]*[eE][\-+]\=\d\+' contained display + +" Floating point like number with E and decimal point (+,-) +syn match amberNumber '[-+]\=\d[[:digit:]]*\.\d*[eE][\-+]\=\d\+' contained display +syn match amberNumber '\d[[:digit:]]*\.\d*[eE][\-+]\=\d\+' contained display + +syn region amberString start='"' end='"' contained +syn region amberDesc start='"' end='"' + +syn keyword amberTodo contained TODO FIXME +syn match amberBang "\v#!.*$" +syn match amberComment "#.*$" contains=amberTodo + +syn keyword amberBlockCmd SHADER BUFFER PIPELINE ATTACH END RUN TYPE SIZE FILL +syn keyword amberBlockCmd DESCRIPTOR_SET BINDING IDX TO EXPECT PASSTHROUGH +syn keyword amberBlockCmd DATA_TYPE DIMS DATA SERIES_FROM DRAW_ARRAY IN START_IDX +syn keyword amberBlockCmd COUNT CLEAR CLEAR_COLOR AS POS DRAW_RECT INC_BY +syn keyword amberBlockCmd FRAMEBUFFER ENTRY_POINT SHADER_OPTIMIZATION + +syn keyword amberComparator EQ NE LT LE GT GE EQ_RGB EQ_RGBA + +syn keyword amberKeyword compute vertex geometry fragment graphics +syn keyword amberKeyword tessellation_evaulation tessellation_control + +syn keyword amberFormat GLSL HLSL SPIRV-ASM SPIRV-HEX OPENCL-C + +syn keyword amberTopology point_list line_list line_list_with_adjacency +syn keyword amberTopology line_strip line_strip_with_adjacency triangle_list +syn keyword amberTopology triangle_list_with_adjacench triangle_strip +syn keyword amberTopology triangle_strip_with_adjacency triangle_fan patch_list + +syn keyword amberBufferType uniform storage vertex index sampled storage color +syn keyword amberBufferType framebuffer depth + +let b:current_syntax = "amber" +hi def link amberTodo Todo +hi def link amberBang Comment +hi def link amberComment Comment +hi def link amberBlockCmd Keyword +hi def link amberString String +hi def link amberNumber Number +hi def link amberDesc PreProc +hi def link amberKeyword String +hi def link amberFormat Type +hi def link amberComparator Keyword +hi def link amberTopology Type +hi def link amberBufferType Type |