Sublime Text Syntax highlighting support for (GNU) flex files, you know, for parsers and stuff. Tested on ST3.
# In linux
mkdir ~/.config/sublime-text-3/Packages/FlexLex
cp * ~/.config/sublime-text-3/Packages/FlexLex
You should see a new "Flex/Lex" syntax highlighter available under the 'User' sub-menu in the List of highlighters at the bottom right corner of the editor.
Sublime's syntax highlighting is quite powerful, but not quite powerful enough to handle everything found in .l files.
This Does:
- Syntax highlight the C/C++ code found within the %{ %} delimiters.
- Highlight definition names, in both the definitions and rules sections.
This Does not:
- Syntax highlight the C/C++ code for rule actions.
- Syntax highlight the regexp's found in the definitions/rules sections
If you wrap the C/C++ code normally found after the rules section with the following comments (exactly!):
/\*\* BEGIN CPP_SOURCECODE \*\*/
<... Your code here...>
/\*\* END CPP_SOURCECODE \*\*/
It will sort-of highlight that code as C/C++ code, but not very well. It should work but... it doesn't. Perhaps a bug in ST.
The .YAML-tmLanguage
file is the grammar definition, you only need
this if you want to tweak the definitions, the compiled version is
the .tmLanguage
file and thats is what Sublime uses.
See http://docs.sublimetext.info/en/latest/extensibility/syntaxdefs.html
For the guide on writing and compiling these YAML files.
Too many hoops to jump through. You're welcome to fork the repo and submit it yourself.
Oh, you mean your google search came up with this SO question too? Imagine that.
This one's better.
No thanks. Fork and have at it.