Hi, my clone contains a lexer for the monkey language. Monkey is a language similar to basic that compiles to a many different targets (target being "iOS", "Android", "HTML5" etc.).
I wrote the lexer looking at the VisualBasic.Net one, the old BlitzMax lexer and of course the language spec. I am confident I covered even most of the edge cases and would be very glad to get this merged into the main repo :)
Feedback and requests for changes are welcome. I was really unsure what to put into the mimetype field, so i made "text/x-monkey" up ;)
Thanks for the review, i'll fix the things you flagged this weekend :)
You are right about the overuse of the insensitivity flag, I started writing the lexer with strict checking of the case (because the language spec said so), but later I was told that the compiler actually allow almost all variants, even very strange ones like "InTERfacE". The only place the case sensitivity actually helps, is in recognising variables/functions/classes... i'll look into using the global flag instead :)
@Tim Hatch: i made the changes you mentioned and also refined some behavior (especially preprocessor variables, those were not covered before)
I opted to keep the lexer case sensitive, although so many rules override the behavior, because it just felt "cleaner" to me to keep as much strictness as possible and so the lexer can distinguish between variables/functions/constants.