(file) Return to wmlscript.st CVS log (file) (dir) Up to [RizwankCVS] / testProject / source / states / hl

  1 rizwank 1.1 /**
  2              * Name: wmlscript
  3              * Description: WMLScript language.
  4              * Author: Markku Rossi <mtr@iki.fi>
  5              */
  6             
  7             state wmlscript_string extends Highlight
  8             {
  9               /\\\\./ {
 10                 language_print ($0);
 11               }
 12               /[\']/ {
 13                 language_print ($0);
 14                 return;
 15               }
 16             }
 17             
 18             state wmlscript extends HighlightEntry
 19             {
 20               /* Comments. */
 21               /\/\*/ {
 22 rizwank 1.1     comment_face (true);
 23                 language_print ($0);
 24                 call (c_comment);
 25                 comment_face (false);
 26               }
 27               /\/\// {
 28                 comment_face (true);
 29                 language_print ($0);
 30                 call (eat_one_line);
 31                 comment_face (false);
 32               }
 33             
 34               /* String constants. */
 35               /\"/ {
 36                 string_face (true);
 37                 language_print ($0);
 38                 call (c_string);
 39                 string_face (false);
 40               }
 41             
 42               /* '' strings. */
 43 rizwank 1.1   /[\']/ {
 44                 string_face (true);
 45                 language_print ($0);
 46                 call (wmlscript_string);
 47                 string_face (false);
 48               }
 49             
 50               /* Function definitions. */
 51               /\b(function)([ \t]+)([A-Za-z\$_][A-Za-z\$_0-9]*)([ \t]*\()/ {
 52                 keyword_face (true);
 53                 language_print ($1);
 54                 keyword_face (false);
 55             
 56                 language_print ($2);
 57             
 58                 function_name_face (true);
 59                 language_print ($3);
 60                 function_name_face (false);
 61             
 62                 language_print ($4);
 63               }
 64 rizwank 1.1 
 65               /* This is actually punctuation.  We define it here so the `div'
 66                  part won't get accidentally highlighted. */
 67               /\bdiv=/ {
 68                 language_print($0);
 69               }
 70             
 71               /* Keywords.
 72                  (build-re '(access agent break case catch class const continue
 73                  debugger default delete div do domain else enum equiv export
 74                  extends extern false finally for function header http if import
 75                  in invalid isvalid lib meta name new null path private public
 76                  return sizeof struct super switch this throw true try typeof use
 77                  user var void with ))
 78               */
 79               /\b(a(ccess|gent)|break|c(a(se|tch)|lass|on(st|tinue))\
 80             |d(e(bugger|fault|lete)|iv|o(|main))\
 81             |e(lse|num|quiv|x(port|te(nds|rn)))|f(alse|inally|or|unction)\
 82             |h(eader|ttp)|i(f|mport|n(|valid)|svalid)|lib|meta|n(ame|ew|ull)\
 83             |p(ath|rivate|ublic)|return|s(izeof|truct|uper|witch)\
 84             |t(h(is|row)|r(ue|y)|ypeof)|use(|r)|v(ar|oid)|with)\b/ {
 85 rizwank 1.1     keyword_face (true);
 86                 language_print ($0);
 87                 keyword_face (false);
 88               }
 89             
 90               /* Built-in libraries.
 91                  (build-re '(Lang Float String URL WmlBrowser Dialogs))
 92                */
 93               /\b(Dialogs|Float|Lang|String|URL|WmlBrowser)(\.)\
 94             ([a-zA-Z_][a-zA-Z_0-9]*)\b/ {
 95                 builtin_face (true);
 96                 language_print ($1);
 97                 builtin_face (false);
 98             
 99                 language_print($2);
100             
101                 builtin_face (true);
102                 language_print ($3);
103                 builtin_face (false);
104               }
105             }
106 rizwank 1.1 
107             
108             /*
109             Local variables:
110             mode: c
111             End:
112             */

Rizwan Kassim
Powered by
ViewCVS 0.9.2