Use new syntax highlighting engine from zyedidia/highlight

This changes all the syntax files in the runtime directory and also
changes how syntax highlighting is done from inside micro.
This commit is contained in:
Zachary Yedidia
2017-02-18 15:17:07 -05:00
parent 0adb601f3c
commit 2fcb40d5a9
161 changed files with 2169 additions and 4818 deletions

26
runtime/syntax/glsl.yaml Normal file
View File

@@ -0,0 +1,26 @@
filetype: glsl
detect:
filename: "\\.(frag|vert|fp|vp|glsl)$"
rules:
- identifier: "[A-Za-z_][A-Za-z0-9_]*[[:space:]]*[()]"
- type: "\\<(void|bool|bvec2|bvec3|bvec4|int|ivec2|ivec3|ivec4|float|vec2|vec3|vec4|mat2|mat3|mat4|struct|sampler1D|sampler2D|sampler3D|samplerCUBE|sampler1DShadow|sampler2DShadow)\\>"
- statement: "\\<gl_(DepthRangeParameters|PointParameters|MaterialParameters|LightSourceParameters|LightModelParameters|LightModelProducts|LightProducts|FogParameters)\\>"
- statement: "\\<(const|attribute|varying|uniform|in|out|inout|if|else|return|discard|while|for|do)\\>"
- statement: "\\<(break|continue)\\>"
- constant: "\\<(true|false)\\>"
- statement: "[-+/*=<>?:!~%&|^]"
- constant.number: "\\<([0-9]+|0x[0-9a-fA-F]*)\\>"
- comment:
start: "//"
end: "$"
rules:
- todo: "TODO:?"
- comment:
start: "/\\*"
end: "\\*/"
rules:
- todo: "TODO:?"