summaryrefslogtreecommitdiff
path: root/sheets/js.ssh
blob: 86a64b16888feebb357dabee953b989c2bd6c89d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# Style sheet for JavaScript
# Copyright (C) 1999 Scott Pakin

#
# This file is part of a2ps.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; see the file COPYING.  If not, write to
# the Free Software Foundation, 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
#

style JavaScript is
written by "Scott Pakin <pakin@uiuc.edu>"
version is 1.1
requires a2ps version 4.12g

first alphabet is
   "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_"
second alphabet is
   "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_0123456789"
case sensitive

documentation is
  "Keywords used are everything listed in the Client-Side JavaScript"
  "Reference 1.3, plus \"undefined\" (why isn't that listed?) and"
  "\"prototype\".  I omitted the semi-standard a2ps optional operators for"
  "equality, because JavaScript's use of both strict- and non-strict equality"
  "might ambiguate the output.  Finally, regular expressions are formatted"
  "like strings."
end documentation

keywords in Keyword are
   abstract, boolean, byte, char, const, debugger, double, false, float,
   int, long, null, prototype, short, this, true, undefined, void
end keywords

keywords in Keyword_strong are
   break, "case", catch, class, continue, default, delete, do, else, enum,
   export, extends, final, finally, for, goto, if, implements, import,
   "in", instanceof, interface, native, new, package, private, protected,
   public, return, static, super, switch, synchronized, throw, throws,
   transient, try, typeof, var, volatile, while, with
end keywords

operators are
   (/(function)([[:blank:]]+)([^ \t(]+)/
     \1 Keyword_strong, \2 Plain, \3 Label)
end operators

optional operators are
   # Actual
   && \wedge,
   || \vee,
   <= \leq,
   >= \geq,
   ! \not,
   # Protected from the above
   <<<=,
   <<=,
   >>=,
   >>>=,
   !=,
   !==
end operators

sequences are
   # Regular expressions
   (/(=)/                   # \1 = assignment
    /([[:blank:]]+)/        # \2 = spaces
    /(\/)/                  # \3 = "/"
    /([^*\/])/              # \4 = first character of regexp
    \1 Plain, \2 Plain, \3 Plain, \4 String) String "/" Plain
      exceptions are
         "\\\\", "\\/"
      end exceptions,
   "/*" Comment Comment "*/" Comment,
   "//" Comment,
   C-string,
   "'" Plain String "'" Plain
      exceptions are
         "\\\\", "\\'"
      end exceptions
end sequences
end style