C-- source highlighting using source-highlight

Hi, I've thrown together a small source-highlight language file for C--. You can use it to e.g. highlight C-- code when piped through less. ### Installion ### # This works on Debian/Ubuntu $ sudo apt-get install source-highlight # Put this file anywhere $ cat $HOME/cmm.lang comment start "//" # multi-line comments comment delim "/*" "*/" multiline string delim "\"" "\"" escape "\\" keyword = "aborts|align|aligned|also|as|big|bits|byteorder|case|const", "continuation|cut|cuts|else|equal|export|foreign|goto|if|import|in", "invariant|invisible|jump|little|memsize|pragma|reads|register", "return|returns|section|semi|span|stackdata|switch|target|targets|to", "typedef|unicode|unwinds|writes" number = '\<[+-]?((0x[[:xdigit:]]+)|(([[:digit:]]*\.)? [[:digit:]]+([eE][+-]?[[:digit:]]+)?))u?((int(?:8|16|32|64))|L)?\>' ### Usage ### $ ghc <source> -ddump-cmm | source-highlight --lang-def=$HOME/cmm.lang -f esc -s cmm | less -R Johan

On 14 April 2011 17:04, Johan Tibell
I've thrown together a small source-highlight language file for C--. You can use it to e.g. highlight C-- code when piped through less.
Nice! It would also be nice to have highlighted C-- output in ghc-core[1] too! Bas [1] http://hackage.haskell.org/package/ghc-core
participants (2)
-
Bas van Dijk
-
Johan Tibell