Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@WhileRomeBurns
Created August 13, 2013 15:50
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save WhileRomeBurns/6222589 to your computer and use it in GitHub Desktop.
Save WhileRomeBurns/6222589 to your computer and use it in GitHub Desktop.
Save the definition as VEX.tmLanguage and place it in the app data directory: C:\Users\ <<user>> \AppData\Roaming\Sublime Text 2\Packages\User By default ".vfl" files will open as VEX syntax whilst ".h" header files will still open as C/C++ unless you override the settings. http://shawnlipowski.com/git/vex_tmlanguage_screenshot.png
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>fileTypes</key>
<array>
<string>vfl</string>
<string>vflh</string>
</array>
<key>foldingStartMarker</key>
<string>(\{\s*(//.*)?$|^\s*// \{\{\{)</string>
<key>foldingStopMarker</key>
<string>^\s*(\}|// \}\}\}$)</string>
<key>name</key>
<string>VEX</string>
<key>patterns</key>
<array>
<dict>
<key>begin</key>
<string>\b(chop|cop|cvex|displace|fog|image3d|light|pop|shadow|sop|surface)\b</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>keyword.context.vex</string>
</dict>
</dict>
<key>comment</key>
<string>Defines the context of the VEX code.</string>
<key>end</key>
<string>\b(\w*)\s?(\()</string>
<key>endCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>entity.name.class.vex</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>punctuation.group.vex</string>
</dict>
</dict>
</dict>
<dict>
<key>match</key>
<string>\b(break|continue|do|else|for|if|return|while)\b</string>
<key>name</key>
<string>keyword.control.vex</string>
</dict>
<dict>
<key>match</key>
<string>\b(bsdf|char|color|float|int|integer|matrix|normal|point|string|struct|typedef|union|vector|vector2|vector4)\b</string>
<key>name</key>
<string>storage.type.builtin.vex</string>
</dict>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>support.function.library.vex</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>punctuation.group.vex</string>
</dict>
</dict>
<key>match</key>
<string>\b(Du|Dv|Dw|abs|acos|addattribute|addgroup|addvariablename|albedo|alphaname|ambient|anoise|area|array|arraylength|ashikhmin|asin|assign|atan|atan2|atof|atoi|atten|avg|binput|blinn|blinnBRDF|bumpmap|bumpmapA|bumpmapB|bumpmapG|bumpmapL|bumpmapR|bumpname|ceil|ch|chend|chendf|chendt|chinput|chname|chnumchan|chrate|chstart|chstartf|chstartt|cinput|ckspline|clamp|clip|colormap|colorname|computenormal|concat|cone|cos|cosh|cracktransform|cross|cspline|ctransform|degrees|depthmap|depthname|determinant|diffuse|diffuseBRDF|dihedral|dimport|distance|distance2|dot|dsmpixel|emission_bsdf|environment|erf|erfc|eval_bsdf|exp|fastshadow|filtershadow|filterstep|finput|fit|floor|flownoise|flowpnoise|fntransform|foreach|forpoints|frac|fresnel|fromNDC|frontface|ftransform|fvtransform|gather|getattribute|getbbox|getblurP|getbounces|getbounds|getcomp|getglobalraylevel|getlightname|getlights|getneighbour|getneighbourcount|getneighbours|getobjectname|getphotonlight|getraylevel|getrayweight|gradient|gradient3d|hasplane|henyeygreenstein|hscript_noise|hscript_rand|hscript_snoise|hscript_sturb|hscript_turb|hsvtorgb|iaspect|ichname|ident|iend|iendtime|ihasplane|illuminance|import|importance_light|ingroup|int|integrate3d|integrate3dClip|interpolate|intersect|intersect3d|intersect_lights|inumplanes|invert|iplaneindex|iplanename|iplanesize|irate|irradiance|isbound|isconnected|isfogray|isframes|isotropic|issamples|isseconds|isshadowray|istart|istarttime|ixres|iyres|kspline|length|length2|lerp|limport|lkspline|lntransform|log|log10|lookat|lspline|ltransform|luminance|lumname|lvtransform|maketransform|maskname|match|matchvex_blinn|matchvex_specular|mattrib|max|mdensity|metaimport|metamarch|metanext|metastart|metaweight|min|mspace|nbouncetypes|newgroup|newsampler|nextsample|ninput|noise|normal_bsdf|normalize|normalname|npoints|nprimitives|nrandom|ntransform|occlusion|onoise|ontransform|optransform|otransform|ovtransform|ow_nspace|ow_space|ow_vspace|pathtrace|pcclose|pcconvex|pcexport|pcfarthest|pcfilter|pcgenerate|pcimport|pciterate|pcnumfound|pcopen|pcopenlod|pcunshaded|pcwrite|phong|phongBRDF|phonglobe|photonmap|planeindex|planename|planesize|pnoise|pointname|pop|pow|prim_attribute|prim_normal|printf|ptlined|ptransform|push|qconvert|qmultiply|quaternion|radians|random|rawbumpmap|rawbumpmapA|rawbumpmapB|rawbumpmapG|rawbumpmapL|rawbumpmapR|rawcolormap|rayhittest|rayimport|reflect|reflectlight|refract|refractlight|relbbox|removegroup|renderstate|resize|resolvemissedray|rgbtohsv|rint|rotate|sample_bsdf|sample_geometry|sample_light|scale|serialize|set|setcomp|shadow|shadow_light|shadowmap|shimport|shl|shr|simport|sin|sinh|sleep|slerp|smooth|snoise|specular|specularBRDF|spline|sprintf|sqrt|storelightexports|strlen|swizzle|tan|tanh|teximport|texture|texture3d|texture3dBox|toNDC|trace|translate|transpose|tw_nspace|tw_space|tw_vspace|unserialize|variadicarguments|velocityname|vnoise|volume|volumegradient|volumesample|vtransform|wireblinn|wirediffuse|wnoise|wo_nspace|wo_space|wo_vspace|wt_nspace|wt_space|wt_vspace)\b\s*(\()</string>
</dict>
<dict>
<key>begin</key>
<string>(\w+)\s*\(</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>entity.name.function.vex</string>
</dict>
</dict>
<key>end</key>
<string>\)</string>
<key>name</key>
<string>meta.method.identifier.vex</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>$self</string>
</dict>
</array>
</dict>
<dict>
<key>match</key>
<string>\b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\.?[0-9]*)|(\.[0-9]+))((e|E)(\+|-)?[0-9]+)?)(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\b</string>
<key>name</key>
<string>constant.numeric.vex</string>
</dict>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>comment.block.preprocessor.vex</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>keyword.preprocessor.vex</string>
</dict>
</dict>
<key>match</key>
<string>\s*((#define|#else|#endif|#ifndef|#ifdef|#if|#include|#pragma|#undef).*$\n?)</string>
</dict>
<dict>
<key>begin</key>
<string>"</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.begin.vex</string>
</dict>
</dict>
<key>end</key>
<string>"</string>
<key>endCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.end.vex</string>
</dict>
</dict>
<key>name</key>
<string>string.quoted.double.vex</string>
<key>patterns</key>
<array>
<dict>
<key>match</key>
<string>\\.</string>
<key>name</key>
<string>constant.character.escape.vex</string>
</dict>
</array>
</dict>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>comment.line.double-slash.vex</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>punctuation.definition.comment.vex</string>
</dict>
</dict>
<key>match</key>
<string>\s*((//).*$\n?)</string>
</dict>
<dict>
<key>begin</key>
<string>/\*</string>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.comment.vex</string>
</dict>
</dict>
<key>end</key>
<string>\*/</string>
<key>name</key>
<string>comment.block.vex</string>
</dict>
<dict>
<key>match</key>
<string>\(|\)|,|:|;</string>
<key>name</key>
<string>punctuation.group.vex</string>
</dict>
<dict>
<key>match</key>
<string>\+\+?|--?|\*|\^=?|\|\|?|\|=|&amp;&amp;?|&amp;=|%=?|!=?|==?|~=?|&lt;=?|&gt;=?|\+=|\*=|-=|\/=?</string>
<key>name</key>
<string>keyword.operator.vex</string>
</dict>
<dict>
<key>match</key>
<string>\b(LN10|LN2|LOG10E|LOG2E|PI|PI_2|PI_4|SQRT1_2|SQRT2|TOLERANCE)\b</string>
<key>name</key>
<string>constant.language</string>
</dict>
</array>
<key>scopeName</key>
<string>source.vex</string>
<key>uuid</key>
<string>edd78512-59d9-4cb6-9733-a6adcc972160</string>
</dict>
</plist>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment