Small change to getopt stuff
[enscript.git] / states / hl / ksh.st
1 /**
2  * Name: ksh
3  * Description: Korn shell programming language.
4  * Author: Jean-Marc Calvez <jean-marc.calvez@st.com>
5  */
6
7 state ksh extends HighlightEntry
8 {
9   /(\${*#[a-zA-Z0-9_]*})/ {
10     language_print ($0);
11   }
12
13   /* Comments. */
14   /#/ {
15     comment_face (true);
16     language_print ($0);
17     call (eat_one_line);
18     comment_face (false);
19   }
20
21   /* String constants. */
22   /\"/ {
23     string_face (true);
24     language_print ($0);
25     call (c_string);
26     string_face (false);
27   }
28
29   /* Ignore escaped quote marks */
30   /\\\"/ {
31     language_print ($0);
32   }
33   /\\\'/ {
34     language_print ($0);
35   }
36   /\\\`/ {
37     language_print ($0);
38   }
39
40   /* Excutable script. */
41   /^#!/ {
42     reference_face (true);
43     language_print ($0);
44     call (eat_one_line);
45     reference_face (false);
46   }
47
48   /* Keywords:
49      (build-re '(: alias bg break continue cd command eval exec exit export
50      fc fg getopts hash jobs kill let login newgrp print pwd read readonly
51      return set shift stop suspend test times trap type typeset ulimit umask
52      unalias unset wait whence for in do done select case esac if then elif
53      else fi while until function time))
54   */
55   /\b(:|alias|b(g|reak)|c(ase|d|o(mmand|ntinue))|do(|ne)\
56 |e(l(if|se)|sac|val|x(ec|it|port))|f(c|g|i|or|unction)|getopts|hash\
57 |i(f|n)|jobs|kill|l(et|ogin)|newgrp|p(rint|wd)|re(ad(|only)|turn)\
58 |s(e(lect|t)|hift|top|uspend)|t(est|hen|ime(|s)|rap|ype(|set))\
59 |u(limit|mask|n(alias|set|til))|w(ait|h(ence|ile)))\b/ {
60     keyword_face (true);
61     language_print ($0);
62     keyword_face (false);
63   }
64
65   /* exported aliases (built-in)
66      (build-re '(autoload false functions hash history integer nohup r true
67      type))
68   */
69   /\b(autoload|f(alse|unctions)|h(ash|istory)|integer|nohup|r|t(rue|ype))\b/ {
70     builtin_face (true);
71     language_print ($0);
72     builtin_face (false);
73   }
74 }
75
76 \f
77 /*
78 Local variables:
79 mode: c
80 End:
81 */