[AST Matchers] Syntax hightlighting for AST Matchers

As you can tell, I’ve been working with Clang’s AST matchers. Some of the more complicated matcher expressions are nontrivial for me to parse, so I created a very simple vim syntax highlighting scheme to make reading them easier. It’s meant to be overlaid on top of C++ syntax highlighting.

In case anyone is interested, try sourcing this syntax file, then running
:call TurnOnMatcherSyntax()
from within a buffer containing matcher code.

Does this seem like it would be useful?

ast.vim (1.68 KB)

This looks cool; just a couple notes about vim syntax highlighting
file conventions.

The convention in vim syntax files is to have the syntax item names be
prefixed by the filetype that they are associated with. So instead of
`astLiterals` you should name them `cppClangAstMatcherLiterals` or
something like that.

Also instead of having these inside of a function which then gets
called, you should probably have these rules just be on by default,
but be `contained` inside a certain group. Check out chapters 45-47 of
http://learnvimscriptthehardway.stevelosh.com/ for more info about how
to do syntax highlighting in vim.

I've also spotted a couple typos like `unsingDecl` and `memberExrpression`.

Finally, it would be nice if you distilled the knowledge that you have
built up using the matchers into a quickstart tutorial so that more
people can benefit from the awesomeness of the AST matchers. For
example, maybe a written walkthrough of something similar to what
Chandler demo'd in that one talk he gave (at BoostCon? I forget where
it was; it's on youtube though); _especially_ the set-up and
boilerplate stuff.

--Sean Silva