jneen/rouge — pull request #172 by radex (2014-08-18 20:16:04+00:00)
Title: Swift Beta 6 + improvements

* new `@availability(...)` attribute, as well as `unowned(safe)`, `unowned(unsafe)` are now rendered properly
* `default:` in switches is fixed
* the function/method name in optional calls (`foo?()`/`foo!()`) is highlighted properly
* coloring custom types properly in a few places
* refactoring

***

Besides the changes in the PR, I started thinking if we shouldn't just highlight all capitalized identifiers as `Name.Constant`. There's nothing, strictly speaking, stopping people from calling their class `foo` or their variable `Bar`, but the convention _strongly_ encourages UpperCamelCase for types (classes, structs, enums) and enum cases, and lowerCamelCase for variables and functions. You can't possibly distinguish the two with a lexer, so there's a chance of a false positive, but I think in 99% of the cases the convention would do a good job at it, and types would stand out better in highlighted code.

Am I thinking about this correctly or am I missing something? @jneen, @ole, thoughts?