The GNU of Life, the Universe and Everything

June 30, 2007

lolcode syntax highlight for nano

Filed under: lolcode, nano — Tags: , , , , — Pedro Carvalho @ 9:59 pm

I always get a few laughts when i visit a lol* site. Today i stumble upon lolcode! oh the joy!
lolcode
so, since i’m writing an article about bash and things related, i decided to create a lolcode syntax highlight for nano so i could grasp teh language!

They have plenty of implementations, like BNF Grammar, interpreters, translators (including a lol2sh ) and a vim syntax highlighter! this gave me the idea to make one for nano.


## Here iz TEH syntax highlight for lolcode
## based on the example for C/C++.
## no can has moar color
syntax "lolcode" "\.lol"
## things
color brightred "\<[A-Z_][0-9A-Z_]+\>"
color brightred "\<[[:alnum:]]*\>"

##
## types
color green "\<(YARN|NUMBR|TROOF|BUKKIT|NOOB)\>"
##
## stuff
color brightgreen "\<(LINE|WORD|LETTAR)\>"
##
## aritmetric (TIEMZ xould be in TIEM?) anyway, all 3 stay as a keyword
## also the MODZ (not in yr spec 1.1) iz highlighted for modulo
color brightgreen "\<(UP|UPZ|NERF|NERFZ|TIEM|TIEMZ|TIEMZD|OVAR|OVARZ|MODZ)\>"
##
## condixonal operatorz.
color brightgreen "\<(BIGR THAN|SMALR THAN|LIEK|NOT|AND|OR|XOR|\!|\~|\&\&)|\|\||\||\^|\!\!)\>"
##
## 4fun
color red "\<(PRON)\>"
##
## varabal related
color brightyellow "\<(BYES|DIAF|GIMMEH|OUTTA|I HAS A|ITZ|IN MAH|LOL|R|VISIBLE|INVISIBLE)\>"
##
## l00p
color brightyellow "\<(IM IN YR|IZ|YARLY|NOWAI|KTHX|WTF|OIC)\>"
##
## added the keywords for dealing with file.
## sorry for the "low lol lolcode <-- say it again :D
color brightyellow "\<(CLOZ|OPEN|REED|RIT)\>"
##
## loops' stuff. added the keywords for try/exepshun
color magenta "\<(GTFO|PLZ|AWSUM THX|O NOES)\>"
##
## begin and end lolcode
color brightcyan "^[[:space:]]*(HAI|CAN HAS|KTHXBYE|)"
##
## not sure what it does, leave it
#color brightmagenta "'([^'\]|(\\["'abfnrtv\\]))'" "'\\(([0-3]?[0-7]{1,2}))'" "'\\x[0-9A-Fa-f]{1,2}'"
##
## String highlighting. You will in general want your comments and
## strings to come last, because syntax highlighting rules will be
## applied in the order they are read in. <-- said the previous c/c++ s.h. writer
color brightwhite "<[^=]*>" " ""(\\.|[^"])*""
##
## This string is VERY resource intensive! <-- omg! let's use it :D
color brightyellow start=""(\\.|[^"])*\\[[:space:]]*$" end="^(\\.|[^"])*""
##
## Comment highlighting
color brightblue "BTW.*"
color cyan start="OBTW" end="TLDR"


nano lolcode in action
ROFL!

pick it here: lolcode SH
save it, change the extension (.png) to .nanorc and put it in the usual place. See the previous posts on how to do just that.

i had so much fun doing this!

NOTE: most of the !!, && and alike are not being correctly highlighted.. help me if u can :D

About these ads

3 Comments »

  1. i want to use linux for everything! linux is the best!!!

    Comment by Inês — August 14, 2007 @ 11:43 pm

  2. Thanks form Serbia! Automaticly applyed in my carpet store computer! :)

    Comment by tepisi — February 17, 2011 @ 3:09 pm

  3. [...] have a thing for code and colours. Let it be lolcode, lpsolve syntax for whatever the editor i’m using at the time, i have to tweak [...]

    Pingback by Syntax hightlight theme for Ruby/Rails/Haml in Aptana « The GNU of Life, the Universe and Everything — March 8, 2012 @ 12:21 am


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

The Shocking Blue Green Theme Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: