textmate/erlang.tmbundle — pull request #8 by squidfunk (2013-01-13 13:07:19+00:00)
Title: Semantically correct highlighting for functions, records, etc. referenced as atoms

When function or record names contain characters other than [a-zA-Z0-9@_], it necessary to enclose them in quotes, exactly like it is with atoms. Github does it the right way, it matches the name as a function(-call):

``` erlang
'foo.bar'(Param, some_atom) ->
'foo.baz'(Param, some_atom);
```

However, currently everything that is enclosed in single quotes is matched as an atom. This leads to confusion when function names are highlighted as atoms, like it is sometimes necessary, especially for generated code. Therefore I propose a fix that introduces the following tweaks:

* Highlight quoted function definitions correctly
* Highlight quoted function calls correctly
* Highlight quoted function references (e.g. `'foo.bar'/2`) correctly
* Highlight quoted record definitions (names and types) correctly
* Highlight quoted record invocations (names and types) correctly
* Introduce behaviour directive, as it is the same context as module, import and export

I hope that this finds its way into the master, as it takes a lot of pain away from the eyes.

I've got a second fix coming up for the type system, but I will place a second pull request, in case this fix isn't accepted.

Best,
Martin