/** * Name: groovy * Description: Groovy programming language. * Author: Peter Ledbrook */ state groovy_string extends Highlight { /\\\\./ { language_print ($0); } /(\${[^}]*})/ { reference_face (true); language_print ($0); reference_face (false); } groovy_string_end { language_print ($0); return; } } state normal_string extends Highlight { /\\\\./ { language_print ($0); } normal_string_end { language_print ($0); return; } } state groovy extends HighlightEntry { /* Comments. */ /\/\*/ { comment_face (true); language_print ($0); call (c_comment); comment_face (false); } /\/\// { comment_face (true); language_print ($0); call (eat_one_line); comment_face (false); } /^#!/ { reference_face (true); language_print ($0); call (eat_one_line); reference_face (false); } /* String constants. */ /(\"(|\"\"))/ { groovy_string_end = regexp( $0 ); string_face (true); language_print ($0); call (groovy_string); string_face (false); } /([\'](|[\'][\']))/ { normal_string_end = regexp($0); string_face (true); language_print ($0); call (normal_string); string_face (false); } /* Keywords. (build-re '(abstract boolean break byte case catch char class const continue def default do double else extends false final finally float for goto if implements import in instanceof int interface long native new null package private protected public return short static super switch synchronized this throw throws transient true try void volatile while)) */ /\b(a(bstract|s)|b(oolean|reak|yte)|c(a(se|tch)|har|lass|on(st|tinue))\ |d(ef(|ault)|o(|uble))|e(lse|xtends)|f(alse|inal(|ly)|loat|or)|goto\ |i(f|mp(lements|ort)|n(|stanceof|t(|erface)))|long|n(ative|ew|ull)\ |p(ackage|r(ivate|otected)|ublic)|return\ |s(hort|tatic|uper|witch|ynchronized)|t(h(is|row(|s))|r(ansient|ue|y))\ |vo(id|latile)|while)\b/ { keyword_face (true); language_print ($0); keyword_face (false); } } /* Local variables: mode: c End: */