csh.st - enscript - GNU Enscript
 (HTM) git clone git://thinkerwim.org/enscript.git
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
       csh.st (2093B)
       ---
            1 /**
            2  * Name: csh
            3  * Description: C-Shell script language
            4  * Author: Jean-Marc Calvez <jean-marc.calvez@st.com>
            5  */
            6 
            7 state csh extends HighlightEntry
            8 {
            9   /* Comments. From sh description */
           10   /#/ {
           11     comment_face (true);
           12     language_print ($0);
           13     call (eat_one_line);
           14     comment_face (false);
           15   }
           16 
           17   /* String constants. From sh */
           18   /\"/ {
           19     string_face (true);
           20     language_print ($0);
           21     call (c_string);
           22     string_face (false);
           23   }
           24 
           25   /* Ignore escaped quote marks */
           26   /\\\"/ {
           27     language_print ($0);
           28   }
           29   /\\\'/ {
           30     language_print ($0);
           31   }
           32   /\\\`/ {
           33     language_print ($0);
           34   }
           35 
           36   /* Excutable script. From sh */
           37   /^#!/ {
           38     reference_face (true);
           39     language_print ($0);
           40     call (eat_one_line);
           41     reference_face (false);
           42   }
           43 
           44   /* Keywords. :
           45      (build-re '(: alias bg break breaksw case cd chdir continue default dirs
           46      echo eval exec exit fg foreach end glob goto hashstat history if then
           47      else endif jobs kill limit login logout nice nohup notify onintr popd
           48      pushd rehash repeat set setenv shift source stop suspend switch case
           49      endsw time umask unalias unhash unlimit unset wait while % @))
           50   */
           51   /\b(%|:|@|alias|b(g|reak(|sw))|c(ase()|d|hdir|ontinue)|d(efault|irs)\
           52 |e(cho|lse|nd(|if|sw)|val|x(ec|it))|f(g|oreach)|g(lob|oto)\
           53 |h(ashstat|istory)|if|jobs|kill|l(imit|og(in|out))|n(ice|o(hup|tify))\
           54 |onintr|p(opd|ushd)|re(hash|peat)\
           55 |s(et(|env)|hift|ource|top|uspend|witch)|t(hen|ime)\
           56 |u(mask|n(alias|hash|limit|set))|w(ait|hile))\b/ {
           57     keyword_face (true);
           58     language_print ($0);
           59     keyword_face (false);
           60   }
           61 
           62   /* Predefined variables:
           63      (build-re '(argv cdpath cwd echo fignore filec hardpaths histchars
           64      history home ignoreeof mail nobeep noclobber noglob nonomatch notify path
           65      prompt savehist shell status verbose)) */
           66   /\b(argv|c(dpath|wd)|echo|fi(gnore|lec)|h(ardpaths|ist(chars|ory)|ome)\
           67 |ignoreeof|mail|no(beep|clobber|glob|nomatch|tify)|p(ath|rompt)\
           68 |s(avehist|hell|tatus)|verbose)\b/ {
           69     builtin_face (true);
           70     language_print ($0);
           71     builtin_face (false);
           72   }
           73 }
           74 
           75 
           76 /*
           77 Local variables:
           78 mode: c
           79 End:
           80 */