author | Mario Ferraro <fadinlight@gmail.com> |
Mon, 07 Sep 2009 15:20:49 +0200 | |
changeset 2873 | 4fb030d43575 |
parent 2803 | ef8303b31490 |
permissions | -rw-r--r-- |
2802
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1 |
// jslint.js |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2 |
// 2009-08-22 |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4 |
/* |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5 |
Copyright (c) 2002 Douglas Crockford (www.JSLint.com) |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
6 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
7 |
Permission is hereby granted, free of charge, to any person obtaining a copy of |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
8 |
this software and associated documentation files (the "Software"), to deal in |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
9 |
the Software without restriction, including without limitation the rights to |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
10 |
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
11 |
of the Software, and to permit persons to whom the Software is furnished to do |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
12 |
so, subject to the following conditions: |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
13 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
14 |
The above copyright notice and this permission notice shall be included in all |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
15 |
copies or substantial portions of the Software. |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
16 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
17 |
The Software shall be used for Good, not Evil. |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
18 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
19 |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
20 |
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
21 |
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
22 |
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
23 |
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
24 |
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
25 |
SOFTWARE. |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
26 |
*/ |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
27 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
28 |
/* |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
29 |
JSLINT is a global function. It takes two parameters. |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
30 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
31 |
var myResult = JSLINT(source, option); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
32 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
33 |
The first parameter is either a string or an array of strings. If it is a |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
34 |
string, it will be split on '\n' or '\r'. If it is an array of strings, it |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
35 |
is assumed that each string represents one line. The source can be a |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
36 |
JavaScript text, or HTML text, or a Konfabulator text. |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
37 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
38 |
The second parameter is an optional object of options which control the |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
39 |
operation of JSLINT. Most of the options are booleans: They are all are |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
40 |
optional and have a default value of false. |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
41 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
42 |
If it checks out, JSLINT returns true. Otherwise, it returns false. |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
43 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
44 |
If false, you can inspect JSLINT.errors to find out the problems. |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
45 |
JSLINT.errors is an array of objects containing these members: |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
46 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
47 |
{ |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
48 |
line : The line (relative to 0) at which the lint was found |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
49 |
character : The character (relative to 0) at which the lint was found |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
50 |
reason : The problem |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
51 |
evidence : The text line in which the problem occurred |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
52 |
raw : The raw message before the details were inserted |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
53 |
a : The first detail |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
54 |
b : The second detail |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
55 |
c : The third detail |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
56 |
d : The fourth detail |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
57 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
58 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
59 |
If a fatal error was found, a null will be the last element of the |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
60 |
JSLINT.errors array. |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
61 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
62 |
You can request a Function Report, which shows all of the functions |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
63 |
and the parameters and vars that they use. This can be used to find |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
64 |
implied global variables and other problems. The report is in HTML and |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
65 |
can be inserted in an HTML <body>. |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
66 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
67 |
var myReport = JSLINT.report(limited); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
68 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
69 |
If limited is true, then the report will be limited to only errors. |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
70 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
71 |
You can request a data structure which contains JSLint's results. |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
72 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
73 |
var myData = JSLINT.data(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
74 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
75 |
It returns a structure with this form: |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
76 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
77 |
{ |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
78 |
errors: [ |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
79 |
{ |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
80 |
line: NUMBER, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
81 |
character: NUMBER, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
82 |
reason: STRING, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
83 |
evidence: STRING |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
84 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
85 |
], |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
86 |
functions: [ |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
87 |
name: STRING, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
88 |
line: NUMBER, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
89 |
last: NUMBER, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
90 |
param: [ |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
91 |
STRING |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
92 |
], |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
93 |
closure: [ |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
94 |
STRING |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
95 |
], |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
96 |
var: [ |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
97 |
STRING |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
98 |
], |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
99 |
exception: [ |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
100 |
STRING |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
101 |
], |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
102 |
outer: [ |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
103 |
STRING |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
104 |
], |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
105 |
unused: [ |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
106 |
STRING |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
107 |
], |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
108 |
global: [ |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
109 |
STRING |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
110 |
], |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
111 |
label: [ |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
112 |
STRING |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
113 |
] |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
114 |
], |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
115 |
globals: [ |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
116 |
STRING |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
117 |
], |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
118 |
member: { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
119 |
STRING: NUMBER |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
120 |
}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
121 |
unuseds: [ |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
122 |
{ |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
123 |
name: STRING, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
124 |
line: NUMBER |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
125 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
126 |
], |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
127 |
implieds: [ |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
128 |
{ |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
129 |
name: STRING, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
130 |
line: NUMBER |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
131 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
132 |
], |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
133 |
urls: [ |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
134 |
STRING |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
135 |
], |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
136 |
json: BOOLEAN |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
137 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
138 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
139 |
Empty arrays will not be included. |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
140 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
141 |
*/ |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
142 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
143 |
/*jslint |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
144 |
evil: true, nomen: false, onevar: false, regexp: false, strict: true |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
145 |
*/ |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
146 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
147 |
/*members "\b", "\t", "\n", "\f", "\r", "\"", "%", "(begin)", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
148 |
"(breakage)", "(context)", "(error)", "(global)", "(identifier)", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
149 |
"(last)", "(line)", "(loopage)", "(name)", "(onevar)", "(params)", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
150 |
"(scope)", "(verb)", "++", "--", "\/", ADSAFE, Array, Boolean, COM, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
151 |
Canvas, CustomAnimation, Date, Debug, E, Error, EvalError, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
152 |
FadeAnimation, Flash, FormField, Frame, Function, HotKey, Image, JSON, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
153 |
LN10, LN2, LOG10E, LOG2E, MAX_VALUE, MIN_VALUE, Math, MenuItem, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
154 |
MoveAnimation, NEGATIVE_INFINITY, Number, Object, Option, PI, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
155 |
POSITIVE_INFINITY, Point, RangeError, Rectangle, ReferenceError, RegExp, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
156 |
ResizeAnimation, RotateAnimation, SQRT1_2, SQRT2, ScrollBar, String, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
157 |
Style, SyntaxError, System, Text, TextArea, Timer, TypeError, URIError, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
158 |
URL, Web, Window, XMLDOM, XMLHttpRequest, "\\", a, abbr, acronym, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
159 |
addEventListener, address, adsafe, alert, aliceblue, animator, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
160 |
antiquewhite, appleScript, applet, apply, approved, aqua, aquamarine, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
161 |
area, arguments, arity, autocomplete, azure, b, background, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
162 |
"background-attachment", "background-color", "background-image", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
163 |
"background-position", "background-repeat", base, bdo, beep, beige, big, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
164 |
bisque, bitwise, black, blanchedalmond, block, blockquote, blue, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
165 |
blueviolet, blur, body, border, "border-bottom", "border-bottom-color", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
166 |
"border-bottom-style", "border-bottom-width", "border-collapse", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
167 |
"border-color", "border-left", "border-left-color", "border-left-style", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
168 |
"border-left-width", "border-right", "border-right-color", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
169 |
"border-right-style", "border-right-width", "border-spacing", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
170 |
"border-style", "border-top", "border-top-color", "border-top-style", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
171 |
"border-top-width", "border-width", bottom, br, brown, browser, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
172 |
burlywood, button, bytesToUIString, c, cadetblue, call, callee, caller, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
173 |
canvas, cap, caption, "caption-side", cases, center, charAt, charCodeAt, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
174 |
character, chartreuse, chocolate, chooseColor, chooseFile, chooseFolder, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
175 |
cite, clear, clearInterval, clearTimeout, clip, close, closeWidget, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
176 |
closed, closure, cm, code, col, colgroup, color, comment, condition, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
177 |
confirm, console, constructor, content, convertPathToHFS, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
178 |
convertPathToPlatform, coral, cornflowerblue, cornsilk, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
179 |
"counter-increment", "counter-reset", create, crimson, css, cursor, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
180 |
cyan, d, darkblue, darkcyan, darkgoldenrod, darkgray, darkgreen, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
181 |
darkkhaki, darkmagenta, darkolivegreen, darkorange, darkorchid, darkred, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
182 |
darksalmon, darkseagreen, darkslateblue, darkslategray, darkturquoise, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
183 |
darkviolet, data, dd, debug, decodeURI, decodeURIComponent, deeppink, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
184 |
deepskyblue, defaultStatus, defineClass, del, deserialize, dfn, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
185 |
dimension, dimgray, dir, direction, display, div, dl, document, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
186 |
dodgerblue, dt, edition, else, em, embed, empty, "empty-cells", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
187 |
encodeURI, encodeURIComponent, entityify, eqeqeq, errors, escape, eval, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
188 |
event, evidence, evil, ex, exception, exec, exps, fieldset, filesystem, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
189 |
firebrick, first, float, floor, floralwhite, focus, focusWidget, font, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
190 |
"font-face", "font-family", "font-size", "font-size-adjust", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
191 |
"font-stretch", "font-style", "font-variant", "font-weight", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
192 |
forestgreen, forin, form, fragment, frame, frames, frameset, from, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
193 |
fromCharCode, fuchsia, fud, funct, function, functions, g, gainsboro, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
194 |
gc, getComputedStyle, ghostwhite, global, globals, gold, goldenrod, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
195 |
gray, green, greenyellow, h1, h2, h3, h4, h5, h6, hasOwnProperty, head, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
196 |
height, help, history, honeydew, hotpink, hr, html, i, iTunes, id, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
197 |
identifier, iframe, img, immed, implieds, import, in, include, indent, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
198 |
indexOf, indianred, indigo, init, input, ins, isAlpha, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
199 |
isApplicationRunning, isDigit, isFinite, isNaN, ivory, join, jslint, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
200 |
json, kbd, khaki, konfabulatorVersion, label, labelled, lang, last, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
201 |
lavender, lavenderblush, lawngreen, laxbreak, lbp, led, left, legend, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
202 |
lemonchiffon, length, "letter-spacing", li, lib, lightblue, lightcoral, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
203 |
lightcyan, lightgoldenrodyellow, lightgreen, lightpink, lightsalmon, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
204 |
lightseagreen, lightskyblue, lightslategray, lightsteelblue, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
205 |
lightyellow, lime, limegreen, line, "line-height", linen, link, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
206 |
"list-style", "list-style-image", "list-style-position", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
207 |
"list-style-type", load, loadClass, location, log, m, magenta, map, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
208 |
margin, "margin-bottom", "margin-left", "margin-right", "margin-top", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
209 |
"marker-offset", maroon, match, "max-height", "max-width", maxerr, md5, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
210 |
media, mediumaquamarine, mediumblue, mediumorchid, mediumpurple, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
211 |
mediumseagreen, mediumslateblue, mediumspringgreen, mediumturquoise, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
212 |
mediumvioletred, member, menu, message, meta, midnightblue, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
213 |
"min-height", "min-width", mintcream, mistyrose, mm, moccasin, moveBy, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
214 |
moveTo, name, navajowhite, navigator, navy, new, newcap, noframes, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
215 |
nomen, noscript, nud, object, ol, oldlace, olive, olivedrab, on, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
216 |
onbeforeunload, onblur, onerror, onevar, onfocus, onload, onresize, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
217 |
onunload, opacity, open, openURL, opener, opera, optgroup, option, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
218 |
orange, orangered, orchid, outer, outline, "outline-color", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
219 |
"outline-style", "outline-width", overflow, "overflow-x", "overflow-y", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
220 |
p, padding, "padding-bottom", "padding-left", "padding-right", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
221 |
"padding-top", page, "page-break-after", "page-break-before", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
222 |
palegoldenrod, palegreen, paleturquoise, palevioletred, papayawhip, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
223 |
param, parent, parseFloat, parseInt, passfail, pc, peachpuff, peru, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
224 |
pink, play, plum, plusplus, pop, popupMenu, position, powderblue, pre, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
225 |
predef, preferenceGroups, preferences, print, prompt, prototype, pt, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
226 |
purple, push, px, q, quit, quotes, random, range, raw, reach, readFile, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
227 |
readUrl, reason, red, regexp, reloadWidget, removeEventListener, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
228 |
replace, report, reserved, resizeBy, resizeTo, resolvePath, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
229 |
resumeUpdates, rhino, right, rosybrown, royalblue, runCommand, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
230 |
runCommandInBg, saddlebrown, safe, salmon, samp, sandybrown, saveAs, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
231 |
savePreferences, screen, script, scroll, scrollBy, scrollTo, seagreen, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
232 |
seal, search, seashell, select, serialize, setInterval, setTimeout, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
233 |
shift, showWidgetPreferences, sidebar, sienna, silver, skyblue, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
234 |
slateblue, slategray, sleep, slice, small, snow, sort, span, spawn, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
235 |
speak, split, springgreen, src, status, steelblue, strict, strong, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
236 |
style, styleproperty, sub, substr, sup, supplant, suppressUpdates, sync, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
237 |
system, table, "table-layout", tan, tbody, td, teal, tellWidget, test, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
238 |
"text-align", "text-decoration", "text-indent", "text-shadow", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
239 |
"text-transform", textarea, tfoot, th, thead, thistle, title, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
240 |
toLowerCase, toString, toUpperCase, toint32, token, tomato, top, tr, tt, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
241 |
turquoise, type, u, ul, undef, unescape, "unicode-bidi", unused, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
242 |
unwatch, updateNow, urls, value, valueOf, var, version, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
243 |
"vertical-align", violet, visibility, watch, wheat, white, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
244 |
"white-space", whitesmoke, widget, width, "word-spacing", "word-wrap", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
245 |
yahooCheckLogin, yahooLogin, yahooLogout, yellow, yellowgreen, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
246 |
"z-index" |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
247 |
*/ |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
248 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
249 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
250 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
251 |
// We build the application inside a function so that we produce only a single |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
252 |
// global variable. The function will be invoked, its return value is the JSLINT |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
253 |
// application itself. |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
254 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
255 |
"use strict"; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
256 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
257 |
var JSLINT = (function () { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
258 |
var adsafe_id, // The widget's ADsafe id. |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
259 |
adsafe_may, // The widget may load approved scripts. |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
260 |
adsafe_went, // ADSAFE.go has been called. |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
261 |
anonname, // The guessed name for anonymous functions. |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
262 |
approved, // ADsafe approved urls. |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
263 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
264 |
atrule = { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
265 |
media : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
266 |
'font-face': true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
267 |
page : true |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
268 |
}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
269 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
270 |
// These are members that should not be permitted in the safe subset. |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
271 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
272 |
banned = { // the member names that ADsafe prohibits. |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
273 |
'arguments' : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
274 |
callee : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
275 |
caller : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
276 |
constructor : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
277 |
'eval' : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
278 |
prototype : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
279 |
unwatch : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
280 |
valueOf : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
281 |
watch : true |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
282 |
}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
283 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
284 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
285 |
// These are the JSLint boolean options. |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
286 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
287 |
boolOptions = { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
288 |
adsafe : true, // if ADsafe should be enforced |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
289 |
bitwise : true, // if bitwise operators should not be allowed |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
290 |
browser : true, // if the standard browser globals should be predefined |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
291 |
cap : true, // if upper case HTML should be allowed |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
292 |
css : true, // if CSS workarounds should be tolerated |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
293 |
debug : true, // if debugger statements should be allowed |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
294 |
eqeqeq : true, // if === should be required |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
295 |
evil : true, // if eval should be allowed |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
296 |
forin : true, // if for in statements must filter |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
297 |
fragment : true, // if HTML fragments should be allowed |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
298 |
immed : true, // if immediate invocations must be wrapped in parens |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
299 |
laxbreak : true, // if line breaks should not be checked |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
300 |
newcap : true, // if constructor names must be capitalized |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
301 |
nomen : true, // if names should be checked |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
302 |
on : true, // if HTML event handlers should be allowed |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
303 |
onevar : true, // if only one var statement per function should be allowed |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
304 |
passfail : true, // if the scan should stop on first error |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
305 |
plusplus : true, // if increment/decrement should not be allowed |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
306 |
regexp : true, // if the . should not be allowed in regexp literals |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
307 |
rhino : true, // if the Rhino environment globals should be predefined |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
308 |
undef : true, // if variables should be declared before used |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
309 |
safe : true, // if use of some browser features should be restricted |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
310 |
sidebar : true, // if the System object should be predefined |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
311 |
strict : true, // require the "use strict"; pragma |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
312 |
sub : true, // if all forms of subscript notation are tolerated |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
313 |
white : true, // if strict whitespace rules apply |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
314 |
widget : true // if the Yahoo Widgets globals should be predefined |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
315 |
}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
316 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
317 |
// browser contains a set of global names which are commonly provided by a |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
318 |
// web browser environment. |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
319 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
320 |
browser = { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
321 |
addEventListener: false, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
322 |
alert : false, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
323 |
blur : false, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
324 |
clearInterval : false, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
325 |
clearTimeout : false, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
326 |
close : false, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
327 |
closed : false, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
328 |
confirm : false, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
329 |
console : false, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
330 |
Debug : false, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
331 |
defaultStatus : false, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
332 |
document : false, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
333 |
event : false, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
334 |
focus : false, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
335 |
frames : false, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
336 |
getComputedStyle: false, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
337 |
history : false, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
338 |
Image : false, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
339 |
length : false, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
340 |
location : false, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
341 |
moveBy : false, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
342 |
moveTo : false, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
343 |
name : false, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
344 |
navigator : false, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
345 |
onbeforeunload : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
346 |
onblur : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
347 |
onerror : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
348 |
onfocus : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
349 |
onload : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
350 |
onresize : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
351 |
onunload : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
352 |
open : false, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
353 |
opener : false, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
354 |
opera : false, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
355 |
Option : false, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
356 |
parent : false, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
357 |
print : false, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
358 |
prompt : false, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
359 |
removeEventListener: false, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
360 |
resizeBy : false, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
361 |
resizeTo : false, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
362 |
screen : false, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
363 |
scroll : false, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
364 |
scrollBy : false, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
365 |
scrollTo : false, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
366 |
setInterval : false, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
367 |
setTimeout : false, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
368 |
status : false, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
369 |
top : false, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
370 |
XMLHttpRequest : false |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
371 |
}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
372 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
373 |
cssAttributeData, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
374 |
cssAny, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
375 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
376 |
cssColorData = { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
377 |
"aliceblue" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
378 |
"antiquewhite" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
379 |
"aqua" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
380 |
"aquamarine" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
381 |
"azure" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
382 |
"beige" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
383 |
"bisque" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
384 |
"black" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
385 |
"blanchedalmond" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
386 |
"blue" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
387 |
"blueviolet" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
388 |
"brown" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
389 |
"burlywood" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
390 |
"cadetblue" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
391 |
"chartreuse" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
392 |
"chocolate" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
393 |
"coral" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
394 |
"cornflowerblue" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
395 |
"cornsilk" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
396 |
"crimson" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
397 |
"cyan" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
398 |
"darkblue" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
399 |
"darkcyan" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
400 |
"darkgoldenrod" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
401 |
"darkgray" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
402 |
"darkgreen" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
403 |
"darkkhaki" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
404 |
"darkmagenta" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
405 |
"darkolivegreen" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
406 |
"darkorange" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
407 |
"darkorchid" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
408 |
"darkred" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
409 |
"darksalmon" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
410 |
"darkseagreen" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
411 |
"darkslateblue" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
412 |
"darkslategray" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
413 |
"darkturquoise" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
414 |
"darkviolet" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
415 |
"deeppink" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
416 |
"deepskyblue" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
417 |
"dimgray" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
418 |
"dodgerblue" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
419 |
"firebrick" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
420 |
"floralwhite" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
421 |
"forestgreen" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
422 |
"fuchsia" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
423 |
"gainsboro" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
424 |
"ghostwhite" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
425 |
"gold" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
426 |
"goldenrod" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
427 |
"gray" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
428 |
"green" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
429 |
"greenyellow" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
430 |
"honeydew" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
431 |
"hotpink" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
432 |
"indianred" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
433 |
"indigo" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
434 |
"ivory" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
435 |
"khaki" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
436 |
"lavender" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
437 |
"lavenderblush" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
438 |
"lawngreen" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
439 |
"lemonchiffon" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
440 |
"lightblue" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
441 |
"lightcoral" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
442 |
"lightcyan" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
443 |
"lightgoldenrodyellow" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
444 |
"lightgreen" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
445 |
"lightpink" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
446 |
"lightsalmon" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
447 |
"lightseagreen" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
448 |
"lightskyblue" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
449 |
"lightslategray" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
450 |
"lightsteelblue" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
451 |
"lightyellow" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
452 |
"lime" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
453 |
"limegreen" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
454 |
"linen" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
455 |
"magenta" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
456 |
"maroon" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
457 |
"mediumaquamarine" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
458 |
"mediumblue" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
459 |
"mediumorchid" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
460 |
"mediumpurple" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
461 |
"mediumseagreen" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
462 |
"mediumslateblue" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
463 |
"mediumspringgreen" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
464 |
"mediumturquoise" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
465 |
"mediumvioletred" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
466 |
"midnightblue" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
467 |
"mintcream" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
468 |
"mistyrose" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
469 |
"moccasin" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
470 |
"navajowhite" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
471 |
"navy" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
472 |
"oldlace" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
473 |
"olive" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
474 |
"olivedrab" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
475 |
"orange" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
476 |
"orangered" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
477 |
"orchid" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
478 |
"palegoldenrod" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
479 |
"palegreen" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
480 |
"paleturquoise" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
481 |
"palevioletred" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
482 |
"papayawhip" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
483 |
"peachpuff" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
484 |
"peru" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
485 |
"pink" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
486 |
"plum" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
487 |
"powderblue" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
488 |
"purple" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
489 |
"red" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
490 |
"rosybrown" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
491 |
"royalblue" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
492 |
"saddlebrown" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
493 |
"salmon" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
494 |
"sandybrown" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
495 |
"seagreen" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
496 |
"seashell" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
497 |
"sienna" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
498 |
"silver" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
499 |
"skyblue" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
500 |
"slateblue" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
501 |
"slategray" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
502 |
"snow" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
503 |
"springgreen" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
504 |
"steelblue" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
505 |
"tan" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
506 |
"teal" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
507 |
"thistle" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
508 |
"tomato" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
509 |
"turquoise" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
510 |
"violet" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
511 |
"wheat" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
512 |
"white" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
513 |
"whitesmoke" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
514 |
"yellow" : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
515 |
"yellowgreen" : true |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
516 |
}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
517 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
518 |
cssBorderStyle, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
519 |
cssBreak, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
520 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
521 |
cssLengthData = { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
522 |
'%': true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
523 |
'cm': true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
524 |
'em': true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
525 |
'ex': true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
526 |
'in': true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
527 |
'mm': true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
528 |
'pc': true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
529 |
'pt': true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
530 |
'px': true |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
531 |
}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
532 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
533 |
cssOverflow, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
534 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
535 |
escapes = { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
536 |
'\b': '\\b', |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
537 |
'\t': '\\t', |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
538 |
'\n': '\\n', |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
539 |
'\f': '\\f', |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
540 |
'\r': '\\r', |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
541 |
'"' : '\\"', |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
542 |
'/' : '\\/', |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
543 |
'\\': '\\\\' |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
544 |
}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
545 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
546 |
funct, // The current function |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
547 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
548 |
functionicity = [ |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
549 |
'closure', 'exception', 'global', 'label', |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
550 |
'outer', 'unused', 'var' |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
551 |
], |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
552 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
553 |
functions, // All of the functions |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
554 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
555 |
global, // The global scope |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
556 |
htmltag = { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
557 |
a: {}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
558 |
abbr: {}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
559 |
acronym: {}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
560 |
address: {}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
561 |
applet: {}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
562 |
area: {empty: true, parent: ' map '}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
563 |
b: {}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
564 |
base: {empty: true, parent: ' head '}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
565 |
bdo: {}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
566 |
big: {}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
567 |
blockquote: {}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
568 |
body: {parent: ' html noframes '}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
569 |
br: {empty: true}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
570 |
button: {}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
571 |
canvas: {parent: ' body p div th td '}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
572 |
caption: {parent: ' table '}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
573 |
center: {}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
574 |
cite: {}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
575 |
code: {}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
576 |
col: {empty: true, parent: ' table colgroup '}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
577 |
colgroup: {parent: ' table '}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
578 |
dd: {parent: ' dl '}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
579 |
del: {}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
580 |
dfn: {}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
581 |
dir: {}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
582 |
div: {}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
583 |
dl: {}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
584 |
dt: {parent: ' dl '}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
585 |
em: {}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
586 |
embed: {}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
587 |
fieldset: {}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
588 |
font: {}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
589 |
form: {}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
590 |
frame: {empty: true, parent: ' frameset '}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
591 |
frameset: {parent: ' html frameset '}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
592 |
h1: {}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
593 |
h2: {}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
594 |
h3: {}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
595 |
h4: {}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
596 |
h5: {}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
597 |
h6: {}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
598 |
head: {parent: ' html '}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
599 |
html: {parent: '*'}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
600 |
hr: {empty: true}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
601 |
i: {}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
602 |
iframe: {}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
603 |
img: {empty: true}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
604 |
input: {empty: true}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
605 |
ins: {}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
606 |
kbd: {}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
607 |
label: {}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
608 |
legend: {parent: ' fieldset '}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
609 |
li: {parent: ' dir menu ol ul '}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
610 |
link: {empty: true, parent: ' head '}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
611 |
map: {}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
612 |
menu: {}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
613 |
meta: {empty: true, parent: ' head noframes noscript '}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
614 |
noframes: {parent: ' html body '}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
615 |
noscript: {parent: ' body head noframes '}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
616 |
object: {}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
617 |
ol: {}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
618 |
optgroup: {parent: ' select '}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
619 |
option: {parent: ' optgroup select '}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
620 |
p: {}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
621 |
param: {empty: true, parent: ' applet object '}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
622 |
pre: {}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
623 |
q: {}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
624 |
samp: {}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
625 |
script: {empty: true, parent: ' body div frame head iframe p pre span '}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
626 |
select: {}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
627 |
small: {}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
628 |
span: {}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
629 |
strong: {}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
630 |
style: {parent: ' head ', empty: true}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
631 |
sub: {}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
632 |
sup: {}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
633 |
table: {}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
634 |
tbody: {parent: ' table '}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
635 |
td: {parent: ' tr '}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
636 |
textarea: {}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
637 |
tfoot: {parent: ' table '}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
638 |
th: {parent: ' tr '}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
639 |
thead: {parent: ' table '}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
640 |
title: {parent: ' head '}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
641 |
tr: {parent: ' table tbody thead tfoot '}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
642 |
tt: {}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
643 |
u: {}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
644 |
ul: {}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
645 |
'var': {} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
646 |
}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
647 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
648 |
ids, // HTML ids |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
649 |
implied, // Implied globals |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
650 |
inblock, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
651 |
indent, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
652 |
jsonmode, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
653 |
lines, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
654 |
lookahead, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
655 |
member, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
656 |
membersOnly, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
657 |
nexttoken, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
658 |
noreach, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
659 |
option, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
660 |
predefined, // Global variables defined by option |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
661 |
prereg, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
662 |
prevtoken, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
663 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
664 |
rhino = { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
665 |
defineClass : false, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
666 |
deserialize : false, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
667 |
gc : false, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
668 |
help : false, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
669 |
load : false, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
670 |
loadClass : false, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
671 |
print : false, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
672 |
quit : false, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
673 |
readFile : false, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
674 |
readUrl : false, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
675 |
runCommand : false, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
676 |
seal : false, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
677 |
serialize : false, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
678 |
spawn : false, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
679 |
sync : false, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
680 |
toint32 : false, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
681 |
version : false |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
682 |
}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
683 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
684 |
scope, // The current scope |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
685 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
686 |
sidebar = { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
687 |
System : false |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
688 |
}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
689 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
690 |
src, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
691 |
stack, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
692 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
693 |
// standard contains the global names that are provided by the |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
694 |
// ECMAScript standard. |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
695 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
696 |
standard = { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
697 |
Array : false, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
698 |
Boolean : false, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
699 |
Date : false, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
700 |
decodeURI : false, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
701 |
decodeURIComponent : false, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
702 |
encodeURI : false, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
703 |
encodeURIComponent : false, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
704 |
Error : false, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
705 |
'eval' : false, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
706 |
EvalError : false, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
707 |
Function : false, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
708 |
hasOwnProperty : false, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
709 |
isFinite : false, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
710 |
isNaN : false, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
711 |
JSON : false, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
712 |
Math : false, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
713 |
Number : false, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
714 |
Object : false, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
715 |
parseInt : false, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
716 |
parseFloat : false, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
717 |
RangeError : false, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
718 |
ReferenceError : false, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
719 |
RegExp : false, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
720 |
String : false, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
721 |
SyntaxError : false, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
722 |
TypeError : false, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
723 |
URIError : false |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
724 |
}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
725 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
726 |
standard_member = { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
727 |
E : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
728 |
LN2 : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
729 |
LN10 : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
730 |
LOG2E : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
731 |
LOG10E : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
732 |
PI : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
733 |
SQRT1_2 : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
734 |
SQRT2 : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
735 |
MAX_VALUE : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
736 |
MIN_VALUE : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
737 |
NEGATIVE_INFINITY : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
738 |
POSITIVE_INFINITY : true |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
739 |
}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
740 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
741 |
syntax = {}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
742 |
tab, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
743 |
token, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
744 |
urls, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
745 |
warnings, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
746 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
747 |
// widget contains the global names which are provided to a Yahoo |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
748 |
// (fna Konfabulator) widget. |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
749 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
750 |
widget = { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
751 |
alert : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
752 |
animator : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
753 |
appleScript : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
754 |
beep : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
755 |
bytesToUIString : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
756 |
Canvas : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
757 |
chooseColor : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
758 |
chooseFile : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
759 |
chooseFolder : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
760 |
closeWidget : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
761 |
COM : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
762 |
convertPathToHFS : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
763 |
convertPathToPlatform : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
764 |
CustomAnimation : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
765 |
escape : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
766 |
FadeAnimation : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
767 |
filesystem : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
768 |
Flash : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
769 |
focusWidget : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
770 |
form : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
771 |
FormField : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
772 |
Frame : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
773 |
HotKey : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
774 |
Image : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
775 |
include : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
776 |
isApplicationRunning : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
777 |
iTunes : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
778 |
konfabulatorVersion : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
779 |
log : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
780 |
md5 : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
781 |
MenuItem : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
782 |
MoveAnimation : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
783 |
openURL : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
784 |
play : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
785 |
Point : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
786 |
popupMenu : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
787 |
preferenceGroups : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
788 |
preferences : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
789 |
print : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
790 |
prompt : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
791 |
random : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
792 |
Rectangle : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
793 |
reloadWidget : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
794 |
ResizeAnimation : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
795 |
resolvePath : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
796 |
resumeUpdates : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
797 |
RotateAnimation : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
798 |
runCommand : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
799 |
runCommandInBg : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
800 |
saveAs : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
801 |
savePreferences : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
802 |
screen : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
803 |
ScrollBar : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
804 |
showWidgetPreferences : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
805 |
sleep : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
806 |
speak : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
807 |
Style : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
808 |
suppressUpdates : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
809 |
system : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
810 |
tellWidget : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
811 |
Text : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
812 |
TextArea : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
813 |
Timer : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
814 |
unescape : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
815 |
updateNow : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
816 |
URL : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
817 |
Web : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
818 |
widget : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
819 |
Window : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
820 |
XMLDOM : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
821 |
XMLHttpRequest : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
822 |
yahooCheckLogin : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
823 |
yahooLogin : true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
824 |
yahooLogout : true |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
825 |
}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
826 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
827 |
// xmode is used to adapt to the exceptions in html parsing. |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
828 |
// It can have these states: |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
829 |
// false .js script file |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
830 |
// html |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
831 |
// outer |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
832 |
// script |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
833 |
// style |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
834 |
// scriptstring |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
835 |
// styleproperty |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
836 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
837 |
xmode, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
838 |
xquote, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
839 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
840 |
// unsafe comment or string |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
841 |
ax = /@cc|<\/?|script|\]*s\]|<\s*!|</i, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
842 |
// unsafe characters that are silently deleted by one or more browsers |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
843 |
cx = /[\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
844 |
// token |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
845 |
tx = /^\s*([(){}\[.,:;'"~\?\]#@]|==?=?|\/(\*(jslint|members?|global)?|=|\/)?|\*[\/=]?|\+[+=]?|-[\-=]?|%=?|&[&=]?|\|[|=]?|>>?>?=?|<([\/=!]|\!(\[|--)?|<=?)?|\^=?|\!=?=?|[a-zA-Z_$][a-zA-Z0-9_$]*|[0-9]+([xX][0-9a-fA-F]+|\.[0-9]*)?([eE][+\-]?[0-9]+)?)/, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
846 |
// html token |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
847 |
hx = /^\s*(['"=>\/&#]|<(?:\/|\!(?:--)?)?|[a-zA-Z][a-zA-Z0-9_\-]*|[0-9]+|--|.)/, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
848 |
// characters in strings that need escapement |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
849 |
nx = /[\u0000-\u001f&<"\/\\\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
850 |
nxg = /[\u0000-\u001f&<"\/\\\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
851 |
// outer html token |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
852 |
ox = /[>&]|<[\/!]?|--/, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
853 |
// star slash |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
854 |
lx = /\*\/|\/\*/, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
855 |
// identifier |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
856 |
ix = /^([a-zA-Z_$][a-zA-Z0-9_$]*)$/, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
857 |
// javascript url |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
858 |
jx = /^(?:javascript|jscript|ecmascript|vbscript|mocha|livescript)\s*:/i, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
859 |
// url badness |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
860 |
ux = /&|\+|\u00AD|\.\.|\/\*|%[^;]|base64|url|expression|data|mailto/i, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
861 |
// style |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
862 |
sx = /^\s*([{:#%.=,>+\[\]@()"';]|\*=?|\$=|\|=|\^=|~=|[a-zA-Z_][a-zA-Z0-9_\-]*|[0-9]+|<\/|\/\*)/, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
863 |
ssx = /^\s*([@#!"'};:\-%.=,+\[\]()*_]|[a-zA-Z][a-zA-Z0-9._\-]*|\/\*?|\d+(?:\.\d+)?|<\/)/, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
864 |
// attributes characters |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
865 |
qx = /[^a-zA-Z0-9-_\/ ]/, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
866 |
// query characters for ids |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
867 |
dx = /[\[\]\/\\"'*<>.&:(){}+=#]/, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
868 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
869 |
rx = { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
870 |
outer: hx, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
871 |
html: hx, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
872 |
style: sx, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
873 |
styleproperty: ssx |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
874 |
}; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
875 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
876 |
function F() {} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
877 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
878 |
if (typeof Object.create !== 'function') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
879 |
Object.create = function (o) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
880 |
F.prototype = o; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
881 |
return new F(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
882 |
}; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
883 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
884 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
885 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
886 |
function is_own(object, name) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
887 |
return Object.prototype.hasOwnProperty.call(object, name); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
888 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
889 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
890 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
891 |
function combine(t, o) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
892 |
var n; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
893 |
for (n in o) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
894 |
if (is_own(o, n)) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
895 |
t[n] = o[n]; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
896 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
897 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
898 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
899 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
900 |
String.prototype.entityify = function () { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
901 |
return this. |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
902 |
replace(/&/g, '&'). |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
903 |
replace(/</g, '<'). |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
904 |
replace(/>/g, '>'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
905 |
}; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
906 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
907 |
String.prototype.isAlpha = function () { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
908 |
return (this >= 'a' && this <= 'z\uffff') || |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
909 |
(this >= 'A' && this <= 'Z\uffff'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
910 |
}; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
911 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
912 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
913 |
String.prototype.isDigit = function () { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
914 |
return (this >= '0' && this <= '9'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
915 |
}; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
916 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
917 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
918 |
String.prototype.supplant = function (o) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
919 |
return this.replace(/\{([^{}]*)\}/g, function (a, b) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
920 |
var r = o[b]; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
921 |
return typeof r === 'string' || typeof r === 'number' ? r : a; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
922 |
}); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
923 |
}; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
924 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
925 |
String.prototype.name = function () { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
926 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
927 |
// If the string looks like an identifier, then we can return it as is. |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
928 |
// If the string contains no control characters, no quote characters, and no |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
929 |
// backslash characters, then we can simply slap some quotes around it. |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
930 |
// Otherwise we must also replace the offending characters with safe |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
931 |
// sequences. |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
932 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
933 |
if (ix.test(this)) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
934 |
return this; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
935 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
936 |
if (nx.test(this)) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
937 |
return '"' + this.replace(nxg, function (a) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
938 |
var c = escapes[a]; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
939 |
if (c) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
940 |
return c; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
941 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
942 |
return '\\u' + ('0000' + a.charCodeAt().toString(16)).slice(-4); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
943 |
}) + '"'; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
944 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
945 |
return '"' + this + '"'; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
946 |
}; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
947 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
948 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
949 |
function assume() { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
950 |
if (!option.safe) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
951 |
if (option.rhino) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
952 |
combine(predefined, rhino); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
953 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
954 |
if (option.browser || option.sidebar) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
955 |
combine(predefined, browser); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
956 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
957 |
if (option.sidebar) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
958 |
combine(predefined, sidebar); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
959 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
960 |
if (option.widget) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
961 |
combine(predefined, widget); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
962 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
963 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
964 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
965 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
966 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
967 |
// Produce an error warning. |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
968 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
969 |
function quit(m, l, ch) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
970 |
throw { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
971 |
name: 'JSLintError', |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
972 |
line: l, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
973 |
character: ch, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
974 |
message: m + " (" + Math.floor((l / lines.length) * 100) + |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
975 |
"% scanned)." |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
976 |
}; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
977 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
978 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
979 |
function warning(m, t, a, b, c, d) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
980 |
var ch, l, w; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
981 |
t = t || nexttoken; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
982 |
if (t.id === '(end)') { // `~ |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
983 |
t = token; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
984 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
985 |
l = t.line || 0; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
986 |
ch = t.from || 0; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
987 |
w = { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
988 |
id: '(error)', |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
989 |
raw: m, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
990 |
evidence: lines[l - 1] || '', |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
991 |
line: l, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
992 |
character: ch, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
993 |
a: a, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
994 |
b: b, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
995 |
c: c, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
996 |
d: d |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
997 |
}; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
998 |
w.reason = m.supplant(w); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
999 |
JSLINT.errors.push(w); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1000 |
if (option.passfail) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1001 |
quit('Stopping. ', l, ch); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1002 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1003 |
warnings += 1; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1004 |
if (warnings >= option.maxerr) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1005 |
quit("Too many errors.", l, ch); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1006 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1007 |
return w; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1008 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1009 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1010 |
function warningAt(m, l, ch, a, b, c, d) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1011 |
return warning(m, { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1012 |
line: l, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1013 |
from: ch |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1014 |
}, a, b, c, d); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1015 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1016 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1017 |
function error(m, t, a, b, c, d) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1018 |
var w = warning(m, t, a, b, c, d); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1019 |
quit("Stopping, unable to continue.", w.line, w.character); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1020 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1021 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1022 |
function errorAt(m, l, ch, a, b, c, d) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1023 |
return error(m, { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1024 |
line: l, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1025 |
from: ch |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1026 |
}, a, b, c, d); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1027 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1028 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1029 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1030 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1031 |
// lexical analysis |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1032 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1033 |
var lex = (function lex() { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1034 |
var character, from, line, s; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1035 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1036 |
// Private lex methods |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1037 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1038 |
function nextLine() { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1039 |
var at; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1040 |
if (line >= lines.length) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1041 |
return false; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1042 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1043 |
character = 1; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1044 |
s = lines[line].replace(/\t/g, tab); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1045 |
line += 1; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1046 |
at = s.search(cx); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1047 |
if (at >= 0) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1048 |
warningAt("Unsafe character.", line, at); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1049 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1050 |
return true; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1051 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1052 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1053 |
// Produce a token object. The token inherits from a syntax symbol. |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1054 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1055 |
function it(type, value) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1056 |
var i, t; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1057 |
if (type === '(color)') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1058 |
t = {type: type}; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1059 |
} else if (type === '(punctuator)' || |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1060 |
(type === '(identifier)' && is_own(syntax, value))) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1061 |
t = syntax[value] || syntax['(error)']; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1062 |
} else { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1063 |
t = syntax[type]; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1064 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1065 |
t = Object.create(t); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1066 |
if (type === '(string)' || type === '(range)') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1067 |
if (jx.test(value)) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1068 |
warningAt("Script URL.", line, from); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1069 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1070 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1071 |
if (type === '(identifier)') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1072 |
t.identifier = true; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1073 |
if (option.nomen && value.charAt(0) === '_') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1074 |
warningAt("Unexpected '_' in '{a}'.", line, from, value); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1075 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1076 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1077 |
t.value = value; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1078 |
t.line = line; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1079 |
t.character = character; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1080 |
t.from = from; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1081 |
i = t.id; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1082 |
if (i !== '(endline)') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1083 |
prereg = i && |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1084 |
(('(,=:[!&|?{};'.indexOf(i.charAt(i.length - 1)) >= 0) || |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1085 |
i === 'return'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1086 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1087 |
return t; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1088 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1089 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1090 |
// Public lex methods |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1091 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1092 |
return { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1093 |
init: function (source) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1094 |
if (typeof source === 'string') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1095 |
lines = source. |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1096 |
replace(/\r\n/g, '\n'). |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1097 |
replace(/\r/g, '\n'). |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1098 |
split('\n'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1099 |
} else { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1100 |
lines = source; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1101 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1102 |
line = 0; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1103 |
nextLine(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1104 |
from = 1; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1105 |
}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1106 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1107 |
range: function (begin, end) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1108 |
var c, value = ''; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1109 |
from = character; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1110 |
if (s.charAt(0) !== begin) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1111 |
errorAt("Expected '{a}' and instead saw '{b}'.", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1112 |
line, character, begin, s.charAt(0)); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1113 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1114 |
for (;;) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1115 |
s = s.slice(1); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1116 |
character += 1; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1117 |
c = s.charAt(0); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1118 |
switch (c) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1119 |
case '': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1120 |
errorAt("Missing '{a}'.", line, character, c); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1121 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1122 |
case end: |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1123 |
s = s.slice(1); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1124 |
character += 1; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1125 |
return it('(range)', value); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1126 |
case xquote: |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1127 |
case '\\': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1128 |
warningAt("Unexpected '{a}'.", line, character, c); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1129 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1130 |
value += c; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1131 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1132 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1133 |
}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1134 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1135 |
// token -- this is called by advance to get the next token. |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1136 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1137 |
token: function () { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1138 |
var b, c, captures, d, depth, high, i, l, low, q, t; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1139 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1140 |
function match(x) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1141 |
var r = x.exec(s), r1; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1142 |
if (r) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1143 |
l = r[0].length; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1144 |
r1 = r[1]; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1145 |
c = r1.charAt(0); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1146 |
s = s.substr(l); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1147 |
from = character + l - r1.length; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1148 |
character += l; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1149 |
return r1; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1150 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1151 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1152 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1153 |
function string(x) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1154 |
var c, j, r = ''; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1155 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1156 |
if (jsonmode && x !== '"') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1157 |
warningAt("Strings must use doublequote.", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1158 |
line, character); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1159 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1160 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1161 |
if (xquote === x || (xmode === 'scriptstring' && !xquote)) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1162 |
return it('(punctuator)', x); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1163 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1164 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1165 |
function esc(n) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1166 |
var i = parseInt(s.substr(j + 1, n), 16); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1167 |
j += n; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1168 |
if (i >= 32 && i <= 126 && |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1169 |
i !== 34 && i !== 92 && i !== 39) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1170 |
warningAt("Unnecessary escapement.", line, character); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1171 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1172 |
character += n; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1173 |
c = String.fromCharCode(i); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1174 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1175 |
j = 0; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1176 |
for (;;) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1177 |
while (j >= s.length) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1178 |
j = 0; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1179 |
if (xmode !== 'html' || !nextLine()) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1180 |
errorAt("Unclosed string.", line, from); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1181 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1182 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1183 |
c = s.charAt(j); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1184 |
if (c === x) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1185 |
character += 1; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1186 |
s = s.substr(j + 1); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1187 |
return it('(string)', r, x); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1188 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1189 |
if (c < ' ') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1190 |
if (c === '\n' || c === '\r') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1191 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1192 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1193 |
warningAt("Control character in string: {a}.", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1194 |
line, character + j, s.slice(0, j)); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1195 |
} else if (c === xquote) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1196 |
warningAt("Bad HTML string", line, character + j); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1197 |
} else if (c === '<') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1198 |
if (option.safe && xmode === 'html') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1199 |
warningAt("ADsafe string violation.", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1200 |
line, character + j); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1201 |
} else if (s.charAt(j + 1) === '/' && (xmode || option.safe)) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1202 |
warningAt("Expected '<\\/' and instead saw '</'.", line, character); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1203 |
} else if (s.charAt(j + 1) === '!' && (xmode || option.safe)) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1204 |
warningAt("Unexpected '<!' in a string.", line, character); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1205 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1206 |
} else if (c === '\\') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1207 |
if (xmode === 'html') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1208 |
if (option.safe) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1209 |
warningAt("ADsafe string violation.", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1210 |
line, character + j); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1211 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1212 |
} else if (xmode === 'styleproperty') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1213 |
j += 1; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1214 |
character += 1; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1215 |
c = s.charAt(j); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1216 |
if (c !== x) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1217 |
warningAt("Escapement in style string.", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1218 |
line, character + j); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1219 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1220 |
} else { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1221 |
j += 1; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1222 |
character += 1; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1223 |
c = s.charAt(j); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1224 |
switch (c) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1225 |
case xquote: |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1226 |
warningAt("Bad HTML string", line, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1227 |
character + j); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1228 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1229 |
case '\\': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1230 |
case '\'': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1231 |
case '"': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1232 |
case '/': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1233 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1234 |
case 'b': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1235 |
c = '\b'; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1236 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1237 |
case 'f': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1238 |
c = '\f'; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1239 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1240 |
case 'n': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1241 |
c = '\n'; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1242 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1243 |
case 'r': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1244 |
c = '\r'; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1245 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1246 |
case 't': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1247 |
c = '\t'; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1248 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1249 |
case 'u': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1250 |
esc(4); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1251 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1252 |
case 'v': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1253 |
c = '\v'; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1254 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1255 |
case 'x': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1256 |
if (jsonmode) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1257 |
warningAt("Avoid \\x-.", line, character); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1258 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1259 |
esc(2); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1260 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1261 |
default: |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1262 |
warningAt("Bad escapement.", line, character); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1263 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1264 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1265 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1266 |
r += c; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1267 |
character += 1; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1268 |
j += 1; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1269 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1270 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1271 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1272 |
for (;;) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1273 |
if (!s) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1274 |
return it(nextLine() ? '(endline)' : '(end)', ''); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1275 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1276 |
while (xmode === 'outer') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1277 |
i = s.search(ox); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1278 |
if (i === 0) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1279 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1280 |
} else if (i > 0) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1281 |
character += 1; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1282 |
s = s.slice(i); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1283 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1284 |
} else { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1285 |
if (!nextLine()) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1286 |
return it('(end)', ''); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1287 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1288 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1289 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1290 |
t = match(rx[xmode] || tx); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1291 |
if (!t) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1292 |
if (xmode === 'html') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1293 |
return it('(error)', s.charAt(0)); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1294 |
} else { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1295 |
t = ''; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1296 |
c = ''; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1297 |
while (s && s < '!') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1298 |
s = s.substr(1); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1299 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1300 |
if (s) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1301 |
errorAt("Unexpected '{a}'.", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1302 |
line, character, s.substr(0, 1)); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1303 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1304 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1305 |
} else { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1306 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1307 |
// identifier |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1308 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1309 |
if (c.isAlpha() || c === '_' || c === '$') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1310 |
return it('(identifier)', t); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1311 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1312 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1313 |
// number |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1314 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1315 |
if (c.isDigit()) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1316 |
if (xmode !== 'style' && !isFinite(Number(t))) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1317 |
warningAt("Bad number '{a}'.", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1318 |
line, character, t); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1319 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1320 |
if (xmode !== 'style' && |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1321 |
xmode !== 'styleproperty' && |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1322 |
s.substr(0, 1).isAlpha()) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1323 |
warningAt("Missing space after '{a}'.", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1324 |
line, character, t); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1325 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1326 |
if (c === '0') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1327 |
d = t.substr(1, 1); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1328 |
if (d.isDigit()) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1329 |
if (token.id !== '.' && xmode !== 'styleproperty') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1330 |
warningAt("Don't use extra leading zeros '{a}'.", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1331 |
line, character, t); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1332 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1333 |
} else if (jsonmode && (d === 'x' || d === 'X')) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1334 |
warningAt("Avoid 0x-. '{a}'.", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1335 |
line, character, t); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1336 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1337 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1338 |
if (t.substr(t.length - 1) === '.') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1339 |
warningAt( |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1340 |
"A trailing decimal point can be confused with a dot '{a}'.", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1341 |
line, character, t); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1342 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1343 |
return it('(number)', t); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1344 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1345 |
switch (t) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1346 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1347 |
// string |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1348 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1349 |
case '"': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1350 |
case "'": |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1351 |
return string(t); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1352 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1353 |
// // comment |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1354 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1355 |
case '//': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1356 |
if (src || (xmode && xmode !== 'script')) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1357 |
warningAt("Unexpected comment.", line, character); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1358 |
} else if (xmode === 'script' && /<\s*\//i.test(s)) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1359 |
warningAt("Unexpected <\/ in comment.", line, character); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1360 |
} else if ((option.safe || xmode === 'script') && ax.test(s)) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1361 |
warningAt("Dangerous comment.", line, character); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1362 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1363 |
s = ''; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1364 |
token.comment = true; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1365 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1366 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1367 |
// /* comment |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1368 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1369 |
case '/*': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1370 |
if (src || (xmode && xmode !== 'script' && xmode !== 'style' && xmode !== 'styleproperty')) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1371 |
warningAt("Unexpected comment.", line, character); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1372 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1373 |
if (option.safe && ax.test(s)) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1374 |
warningAt("ADsafe comment violation.", line, character); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1375 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1376 |
for (;;) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1377 |
i = s.search(lx); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1378 |
if (i >= 0) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1379 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1380 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1381 |
if (!nextLine()) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1382 |
errorAt("Unclosed comment.", line, character); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1383 |
} else { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1384 |
if (option.safe && ax.test(s)) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1385 |
warningAt("ADsafe comment violation.", line, character); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1386 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1387 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1388 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1389 |
character += i + 2; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1390 |
if (s.substr(i, 1) === '/') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1391 |
errorAt("Nested comment.", line, character); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1392 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1393 |
s = s.substr(i + 2); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1394 |
token.comment = true; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1395 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1396 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1397 |
// /*members /*jslint /*global |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1398 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1399 |
case '/*members': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1400 |
case '/*member': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1401 |
case '/*jslint': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1402 |
case '/*global': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1403 |
case '*/': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1404 |
return { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1405 |
value: t, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1406 |
type: 'special', |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1407 |
line: line, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1408 |
character: character, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1409 |
from: from |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1410 |
}; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1411 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1412 |
case '': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1413 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1414 |
// / |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1415 |
case '/': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1416 |
if (prereg) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1417 |
depth = 0; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1418 |
captures = 0; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1419 |
l = 0; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1420 |
for (;;) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1421 |
b = true; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1422 |
c = s.charAt(l); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1423 |
l += 1; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1424 |
switch (c) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1425 |
case '': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1426 |
errorAt("Unclosed regular expression.", line, from); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1427 |
return; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1428 |
case '/': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1429 |
if (depth > 0) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1430 |
warningAt("Unescaped '{a}'.", line, from + l, '/'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1431 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1432 |
c = s.substr(0, l - 1); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1433 |
q = { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1434 |
g: true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1435 |
i: true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1436 |
m: true |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1437 |
}; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1438 |
while (q[s.charAt(l)] === true) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1439 |
q[s.charAt(l)] = false; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1440 |
l += 1; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1441 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1442 |
character += l; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1443 |
s = s.substr(l); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1444 |
return it('(regexp)', c); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1445 |
case '\\': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1446 |
c = s.charAt(l); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1447 |
if (c < ' ') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1448 |
warningAt("Unexpected control character in regular expression.", line, from + l); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1449 |
} else if (c === '<') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1450 |
warningAt("Unexpected escaped character '{a}' in regular expression.", line, from + l, c); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1451 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1452 |
l += 1; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1453 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1454 |
case '(': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1455 |
depth += 1; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1456 |
b = false; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1457 |
if (s.charAt(l) === '?') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1458 |
l += 1; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1459 |
switch (s.charAt(l)) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1460 |
case ':': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1461 |
case '=': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1462 |
case '!': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1463 |
l += 1; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1464 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1465 |
default: |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1466 |
warningAt("Expected '{a}' and instead saw '{b}'.", line, from + l, ':', s.charAt(l)); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1467 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1468 |
} else { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1469 |
captures += 1; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1470 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1471 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1472 |
case '|': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1473 |
b = false; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1474 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1475 |
case ')': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1476 |
if (depth === 0) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1477 |
warningAt("Unescaped '{a}'.", line, from + l, ')'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1478 |
} else { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1479 |
depth -= 1; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1480 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1481 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1482 |
case ' ': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1483 |
q = 1; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1484 |
while (s.charAt(l) === ' ') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1485 |
l += 1; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1486 |
q += 1; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1487 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1488 |
if (q > 1) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1489 |
warningAt("Spaces are hard to count. Use {{a}}.", line, from + l, q); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1490 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1491 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1492 |
case '[': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1493 |
c = s.charAt(l); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1494 |
if (c === '^') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1495 |
l += 1; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1496 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1497 |
q = false; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1498 |
if (c === ']') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1499 |
warningAt("Empty class.", line, from + l - 1); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1500 |
q = true; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1501 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1502 |
klass: do { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1503 |
c = s.charAt(l); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1504 |
l += 1; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1505 |
switch (c) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1506 |
case '[': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1507 |
case '^': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1508 |
warningAt("Unescaped '{a}'.", line, from + l, c); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1509 |
q = true; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1510 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1511 |
case '-': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1512 |
if (q) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1513 |
q = false; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1514 |
} else { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1515 |
warningAt("Unescaped '{a}'.", line, from + l, '-'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1516 |
q = true; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1517 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1518 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1519 |
case ']': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1520 |
if (!q) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1521 |
warningAt("Unescaped '{a}'.", line, from + l - 1, ']'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1522 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1523 |
break klass; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1524 |
case '\\': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1525 |
c = s.charAt(l); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1526 |
if (c < ' ') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1527 |
warningAt("Unexpected control character in regular expression.", line, from + l); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1528 |
} else if (c === '<') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1529 |
warningAt("Unexpected escaped character '{a}' in regular expression.", line, from + l, c); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1530 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1531 |
l += 1; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1532 |
q = true; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1533 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1534 |
case '/': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1535 |
warningAt("Unescaped '{a}'.", line, from + l - 1, '/'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1536 |
q = true; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1537 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1538 |
case '<': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1539 |
if (xmode === 'script') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1540 |
c = s.charAt(l); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1541 |
if (c === '!' || c === '/') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1542 |
warningAt("HTML confusion in regular expression '<{a}'.", line, from + l, c); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1543 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1544 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1545 |
q = true; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1546 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1547 |
default: |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1548 |
q = true; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1549 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1550 |
} while (c); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1551 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1552 |
case '.': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1553 |
if (option.regexp) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1554 |
warningAt("Unexpected '{a}'.", line, from + l, c); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1555 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1556 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1557 |
case ']': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1558 |
case '?': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1559 |
case '{': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1560 |
case '}': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1561 |
case '+': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1562 |
case '*': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1563 |
warningAt("Unescaped '{a}'.", line, from + l, c); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1564 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1565 |
case '<': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1566 |
if (xmode === 'script') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1567 |
c = s.charAt(l); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1568 |
if (c === '!' || c === '/') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1569 |
warningAt("HTML confusion in regular expression '<{a}'.", line, from + l, c); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1570 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1571 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1572 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1573 |
if (b) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1574 |
switch (s.charAt(l)) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1575 |
case '?': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1576 |
case '+': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1577 |
case '*': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1578 |
l += 1; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1579 |
if (s.charAt(l) === '?') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1580 |
l += 1; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1581 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1582 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1583 |
case '{': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1584 |
l += 1; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1585 |
c = s.charAt(l); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1586 |
if (c < '0' || c > '9') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1587 |
warningAt("Expected a number and instead saw '{a}'.", line, from + l, c); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1588 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1589 |
l += 1; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1590 |
low = +c; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1591 |
for (;;) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1592 |
c = s.charAt(l); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1593 |
if (c < '0' || c > '9') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1594 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1595 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1596 |
l += 1; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1597 |
low = +c + (low * 10); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1598 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1599 |
high = low; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1600 |
if (c === ',') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1601 |
l += 1; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1602 |
high = Infinity; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1603 |
c = s.charAt(l); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1604 |
if (c >= '0' && c <= '9') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1605 |
l += 1; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1606 |
high = +c; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1607 |
for (;;) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1608 |
c = s.charAt(l); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1609 |
if (c < '0' || c > '9') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1610 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1611 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1612 |
l += 1; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1613 |
high = +c + (high * 10); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1614 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1615 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1616 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1617 |
if (s.charAt(l) !== '}') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1618 |
warningAt("Expected '{a}' and instead saw '{b}'.", line, from + l, '}', c); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1619 |
} else { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1620 |
l += 1; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1621 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1622 |
if (s.charAt(l) === '?') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1623 |
l += 1; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1624 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1625 |
if (low > high) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1626 |
warningAt("'{a}' should not be greater than '{b}'.", line, from + l, low, high); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1627 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1628 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1629 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1630 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1631 |
c = s.substr(0, l - 1); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1632 |
character += l; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1633 |
s = s.substr(l); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1634 |
return it('(regexp)', c); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1635 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1636 |
return it('(punctuator)', t); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1637 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1638 |
// punctuator |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1639 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1640 |
case '<!--': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1641 |
l = line; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1642 |
c = character; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1643 |
for (;;) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1644 |
i = s.indexOf('--'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1645 |
if (i >= 0) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1646 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1647 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1648 |
i = s.indexOf('<!'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1649 |
if (i >= 0) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1650 |
errorAt("Nested HTML comment.", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1651 |
line, character + i); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1652 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1653 |
if (!nextLine()) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1654 |
errorAt("Unclosed HTML comment.", l, c); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1655 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1656 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1657 |
l = s.indexOf('<!'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1658 |
if (l >= 0 && l < i) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1659 |
errorAt("Nested HTML comment.", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1660 |
line, character + l); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1661 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1662 |
character += i; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1663 |
if (s[i + 2] !== '>') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1664 |
errorAt("Expected -->.", line, character); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1665 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1666 |
character += 3; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1667 |
s = s.slice(i + 3); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1668 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1669 |
case '#': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1670 |
if (xmode === 'html' || xmode === 'styleproperty') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1671 |
for (;;) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1672 |
c = s.charAt(0); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1673 |
if ((c < '0' || c > '9') && |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1674 |
(c < 'a' || c > 'f') && |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1675 |
(c < 'A' || c > 'F')) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1676 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1677 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1678 |
character += 1; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1679 |
s = s.substr(1); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1680 |
t += c; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1681 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1682 |
if (t.length !== 4 && t.length !== 7) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1683 |
warningAt("Bad hex color '{a}'.", line, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1684 |
from + l, t); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1685 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1686 |
return it('(color)', t); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1687 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1688 |
return it('(punctuator)', t); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1689 |
default: |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1690 |
if (xmode === 'outer' && c === '&') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1691 |
character += 1; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1692 |
s = s.substr(1); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1693 |
for (;;) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1694 |
c = s.charAt(0); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1695 |
character += 1; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1696 |
s = s.substr(1); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1697 |
if (c === ';') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1698 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1699 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1700 |
if (!((c >= '0' && c <= '9') || |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1701 |
(c >= 'a' && c <= 'z') || |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1702 |
c === '#')) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1703 |
errorAt("Bad entity", line, from + l, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1704 |
character); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1705 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1706 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1707 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1708 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1709 |
return it('(punctuator)', t); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1710 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1711 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1712 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1713 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1714 |
}; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1715 |
}()); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1716 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1717 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1718 |
function addlabel(t, type) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1719 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1720 |
if (option.safe && funct['(global)'] && typeof predefined[t] !== 'boolean') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1721 |
warning('ADsafe global: ' + t + '.', token); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1722 |
} else if (t === 'hasOwnProperty') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1723 |
warning("'hasOwnProperty' is a really bad name."); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1724 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1725 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1726 |
// Define t in the current function in the current scope. |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1727 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1728 |
if (is_own(funct, t) && !funct['(global)']) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1729 |
warning(funct[t] === true ? |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1730 |
"'{a}' was used before it was defined." : |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1731 |
"'{a}' is already defined.", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1732 |
nexttoken, t); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1733 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1734 |
funct[t] = type; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1735 |
if (type === 'label') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1736 |
scope[t] = funct; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1737 |
} else if (funct['(global)']) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1738 |
global[t] = funct; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1739 |
if (is_own(implied, t)) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1740 |
warning("'{a}' was used before it was defined.", nexttoken, t); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1741 |
delete implied[t]; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1742 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1743 |
} else { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1744 |
funct['(scope)'][t] = funct; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1745 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1746 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1747 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1748 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1749 |
function doOption() { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1750 |
var b, obj, filter, o = nexttoken.value, t, v; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1751 |
switch (o) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1752 |
case '*/': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1753 |
error("Unbegun comment."); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1754 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1755 |
case '/*members': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1756 |
case '/*member': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1757 |
o = '/*members'; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1758 |
if (!membersOnly) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1759 |
membersOnly = {}; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1760 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1761 |
obj = membersOnly; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1762 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1763 |
case '/*jslint': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1764 |
if (option.safe) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1765 |
warning("ADsafe restriction."); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1766 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1767 |
obj = option; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1768 |
filter = boolOptions; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1769 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1770 |
case '/*global': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1771 |
if (option.safe) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1772 |
warning("ADsafe restriction."); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1773 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1774 |
obj = predefined; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1775 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1776 |
default: |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1777 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1778 |
t = lex.token(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1779 |
loop: for (;;) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1780 |
for (;;) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1781 |
if (t.type === 'special' && t.value === '*/') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1782 |
break loop; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1783 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1784 |
if (t.id !== '(endline)' && t.id !== ',') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1785 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1786 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1787 |
t = lex.token(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1788 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1789 |
if (t.type !== '(string)' && t.type !== '(identifier)' && |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1790 |
o !== '/*members') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1791 |
error("Bad option.", t); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1792 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1793 |
v = lex.token(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1794 |
if (v.id === ':') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1795 |
v = lex.token(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1796 |
if (obj === membersOnly) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1797 |
error("Expected '{a}' and instead saw '{b}'.", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1798 |
t, '*/', ':'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1799 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1800 |
if (t.value === 'indent' && o === '/*jslint') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1801 |
b = +v.value; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1802 |
if (typeof b !== 'number' || !isFinite(b) || b <= 0 || |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1803 |
Math.floor(b) !== b) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1804 |
error("Expected a small integer and instead saw '{a}'.", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1805 |
v, v.value); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1806 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1807 |
obj.white = true; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1808 |
obj.indent = b; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1809 |
} else if (t.value === 'maxerr' && o === '/*jslint') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1810 |
b = +v.value; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1811 |
if (typeof b !== 'number' || !isFinite(b) || b <= 0 || |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1812 |
Math.floor(b) !== b) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1813 |
error("Expected a small integer and instead saw '{a}'.", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1814 |
v, v.value); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1815 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1816 |
obj.maxerr = b; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1817 |
} else if (v.value === 'true') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1818 |
obj[t.value] = true; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1819 |
} else if (v.value === 'false') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1820 |
obj[t.value] = false; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1821 |
} else { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1822 |
error("Bad option value.", v); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1823 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1824 |
t = lex.token(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1825 |
} else { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1826 |
if (o === '/*jslint') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1827 |
error("Missing option value.", t); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1828 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1829 |
obj[t.value] = false; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1830 |
t = v; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1831 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1832 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1833 |
if (filter) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1834 |
assume(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1835 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1836 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1837 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1838 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1839 |
// We need a peek function. If it has an argument, it peeks that much farther |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1840 |
// ahead. It is used to distinguish |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1841 |
// for ( var i in ... |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1842 |
// from |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1843 |
// for ( var i = ... |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1844 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1845 |
function peek(p) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1846 |
var i = p || 0, j = 0, t; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1847 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1848 |
while (j <= i) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1849 |
t = lookahead[j]; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1850 |
if (!t) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1851 |
t = lookahead[j] = lex.token(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1852 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1853 |
j += 1; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1854 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1855 |
return t; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1856 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1857 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1858 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1859 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1860 |
// Produce the next token. It looks for programming errors. |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1861 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1862 |
function advance(id, t) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1863 |
switch (token.id) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1864 |
case '(number)': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1865 |
if (nexttoken.id === '.') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1866 |
warning( |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1867 |
"A dot following a number can be confused with a decimal point.", token); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1868 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1869 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1870 |
case '-': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1871 |
if (nexttoken.id === '-' || nexttoken.id === '--') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1872 |
warning("Confusing minusses."); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1873 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1874 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1875 |
case '+': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1876 |
if (nexttoken.id === '+' || nexttoken.id === '++') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1877 |
warning("Confusing plusses."); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1878 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1879 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1880 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1881 |
if (token.type === '(string)' || token.identifier) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1882 |
anonname = token.value; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1883 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1884 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1885 |
if (id && nexttoken.id !== id) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1886 |
if (t) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1887 |
if (nexttoken.id === '(end)') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1888 |
warning("Unmatched '{a}'.", t, t.id); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1889 |
} else { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1890 |
warning("Expected '{a}' to match '{b}' from line {c} and instead saw '{d}'.", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1891 |
nexttoken, id, t.id, t.line, nexttoken.value); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1892 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1893 |
} else if (nexttoken.type !== '(identifier)' || |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1894 |
nexttoken.value !== id) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1895 |
warning("Expected '{a}' and instead saw '{b}'.", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1896 |
nexttoken, id, nexttoken.value); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1897 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1898 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1899 |
prevtoken = token; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1900 |
token = nexttoken; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1901 |
for (;;) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1902 |
nexttoken = lookahead.shift() || lex.token(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1903 |
if (nexttoken.id === '(end)' || nexttoken.id === '(error)') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1904 |
return; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1905 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1906 |
if (nexttoken.type === 'special') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1907 |
doOption(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1908 |
} else { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1909 |
if (nexttoken.id !== '(endline)') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1910 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1911 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1912 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1913 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1914 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1915 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1916 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1917 |
// This is the heart of JSLINT, the Pratt parser. In addition to parsing, it |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1918 |
// is looking for ad hoc lint patterns. We add to Pratt's model .fud, which is |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1919 |
// like nud except that it is only used on the first token of a statement. |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1920 |
// Having .fud makes it much easier to define JavaScript. I retained Pratt's |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1921 |
// nomenclature. |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1922 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1923 |
// .nud Null denotation |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1924 |
// .fud First null denotation |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1925 |
// .led Left denotation |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1926 |
// lbp Left binding power |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1927 |
// rbp Right binding power |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1928 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1929 |
// They are key to the parsing method called Top Down Operator Precedence. |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1930 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1931 |
function parse(rbp, initial) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1932 |
var left, o; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1933 |
if (nexttoken.id === '(end)') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1934 |
error("Unexpected early end of program.", token); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1935 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1936 |
advance(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1937 |
if (option.safe && typeof predefined[token.value] === 'boolean' && |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1938 |
(nexttoken.id !== '(' && nexttoken.id !== '.')) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1939 |
warning('ADsafe violation.', token); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1940 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1941 |
if (initial) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1942 |
anonname = 'anonymous'; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1943 |
funct['(verb)'] = token.value; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1944 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1945 |
if (initial === true && token.fud) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1946 |
left = token.fud(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1947 |
} else { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1948 |
if (token.nud) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1949 |
o = token.exps; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1950 |
left = token.nud(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1951 |
} else { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1952 |
if (nexttoken.type === '(number)' && token.id === '.') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1953 |
warning( |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1954 |
"A leading decimal point can be confused with a dot: '.{a}'.", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1955 |
token, nexttoken.value); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1956 |
advance(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1957 |
return token; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1958 |
} else { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1959 |
error("Expected an identifier and instead saw '{a}'.", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1960 |
token, token.id); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1961 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1962 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1963 |
while (rbp < nexttoken.lbp) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1964 |
o = nexttoken.exps; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1965 |
advance(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1966 |
if (token.led) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1967 |
left = token.led(left); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1968 |
} else { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1969 |
error("Expected an operator and instead saw '{a}'.", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1970 |
token, token.id); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1971 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1972 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1973 |
if (initial && !o) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1974 |
warning( |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1975 |
"Expected an assignment or function call and instead saw an expression.", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1976 |
token); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1977 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1978 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1979 |
return left; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1980 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1981 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1982 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1983 |
// Functions for conformance of style. |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1984 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1985 |
function adjacent(left, right) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1986 |
left = left || token; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1987 |
right = right || nexttoken; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1988 |
if (option.white || xmode === 'styleproperty' || xmode === 'style') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1989 |
if (left.character !== right.from && left.line === right.line) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1990 |
warning("Unexpected space after '{a}'.", right, left.value); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1991 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1992 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1993 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1994 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1995 |
function nospace(left, right) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1996 |
left = left || token; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1997 |
right = right || nexttoken; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1998 |
if (option.white && !left.comment) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
1999 |
if (left.line === right.line) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2000 |
adjacent(left, right); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2001 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2002 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2003 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2004 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2005 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2006 |
function nonadjacent(left, right) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2007 |
if (option.white) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2008 |
left = left || token; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2009 |
right = right || nexttoken; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2010 |
if (left.character === right.from) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2011 |
warning("Missing space after '{a}'.", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2012 |
nexttoken, left.value); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2013 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2014 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2015 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2016 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2017 |
function nobreaknonadjacent(left, right) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2018 |
left = left || token; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2019 |
right = right || nexttoken; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2020 |
if (!option.laxbreak && left.line !== right.line) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2021 |
warning("Bad line breaking before '{a}'.", right, right.id); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2022 |
} else if (option.white) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2023 |
left = left || token; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2024 |
right = right || nexttoken; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2025 |
if (left.character === right.from) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2026 |
warning("Missing space after '{a}'.", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2027 |
nexttoken, left.value); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2028 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2029 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2030 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2031 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2032 |
function indentation(bias) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2033 |
var i; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2034 |
if (option.white && nexttoken.id !== '(end)') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2035 |
i = indent + (bias || 0); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2036 |
if (nexttoken.from !== i) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2037 |
warning("Expected '{a}' to have an indentation at {b} instead at {c}.", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2038 |
nexttoken, nexttoken.value, i, nexttoken.from); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2039 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2040 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2041 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2042 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2043 |
function nolinebreak(t) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2044 |
t = t || token; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2045 |
if (t.line !== nexttoken.line) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2046 |
warning("Line breaking error '{a}'.", t, t.value); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2047 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2048 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2049 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2050 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2051 |
function comma() { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2052 |
if (token.line !== nexttoken.line) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2053 |
if (!option.laxbreak) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2054 |
warning("Bad line breaking before '{a}'.", token, nexttoken.id); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2055 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2056 |
} else if (token.character !== nexttoken.from && option.white) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2057 |
warning("Unexpected space after '{a}'.", nexttoken, token.value); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2058 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2059 |
advance(','); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2060 |
nonadjacent(token, nexttoken); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2061 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2062 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2063 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2064 |
// Functional constructors for making the symbols that will be inherited by |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2065 |
// tokens. |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2066 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2067 |
function symbol(s, p) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2068 |
var x = syntax[s]; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2069 |
if (!x || typeof x !== 'object') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2070 |
syntax[s] = x = { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2071 |
id: s, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2072 |
lbp: p, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2073 |
value: s |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2074 |
}; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2075 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2076 |
return x; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2077 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2078 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2079 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2080 |
function delim(s) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2081 |
return symbol(s, 0); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2082 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2083 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2084 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2085 |
function stmt(s, f) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2086 |
var x = delim(s); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2087 |
x.identifier = x.reserved = true; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2088 |
x.fud = f; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2089 |
return x; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2090 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2091 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2092 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2093 |
function blockstmt(s, f) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2094 |
var x = stmt(s, f); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2095 |
x.block = true; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2096 |
return x; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2097 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2098 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2099 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2100 |
function reserveName(x) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2101 |
var c = x.id.charAt(0); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2102 |
if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2103 |
x.identifier = x.reserved = true; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2104 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2105 |
return x; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2106 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2107 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2108 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2109 |
function prefix(s, f) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2110 |
var x = symbol(s, 150); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2111 |
reserveName(x); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2112 |
x.nud = (typeof f === 'function') ? f : function () { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2113 |
this.right = parse(150); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2114 |
this.arity = 'unary'; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2115 |
if (this.id === '++' || this.id === '--') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2116 |
if (option.plusplus) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2117 |
warning("Unexpected use of '{a}'.", this, this.id); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2118 |
} else if ((!this.right.identifier || this.right.reserved) && |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2119 |
this.right.id !== '.' && this.right.id !== '[') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2120 |
warning("Bad operand.", this); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2121 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2122 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2123 |
return this; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2124 |
}; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2125 |
return x; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2126 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2127 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2128 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2129 |
function type(s, f) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2130 |
var x = delim(s); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2131 |
x.type = s; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2132 |
x.nud = f; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2133 |
return x; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2134 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2135 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2136 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2137 |
function reserve(s, f) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2138 |
var x = type(s, f); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2139 |
x.identifier = x.reserved = true; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2140 |
return x; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2141 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2142 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2143 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2144 |
function reservevar(s, v) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2145 |
return reserve(s, function () { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2146 |
if (option.safe && |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2147 |
(this.id === 'this' || this.id === 'arguments')) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2148 |
warning("ADsafe violation.", this); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2149 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2150 |
return this; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2151 |
}); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2152 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2153 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2154 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2155 |
function infix(s, f, p, w) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2156 |
var x = symbol(s, p); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2157 |
reserveName(x); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2158 |
x.led = function (left) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2159 |
if (!w) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2160 |
nobreaknonadjacent(prevtoken, token); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2161 |
nonadjacent(token, nexttoken); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2162 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2163 |
if (typeof f === 'function') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2164 |
return f(left, this); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2165 |
} else { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2166 |
this.left = left; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2167 |
this.right = parse(p); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2168 |
return this; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2169 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2170 |
}; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2171 |
return x; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2172 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2173 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2174 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2175 |
function relation(s, f) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2176 |
var x = symbol(s, 100); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2177 |
x.led = function (left) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2178 |
nobreaknonadjacent(prevtoken, token); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2179 |
nonadjacent(token, nexttoken); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2180 |
var right = parse(100); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2181 |
if ((left && left.id === 'NaN') || (right && right.id === 'NaN')) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2182 |
warning("Use the isNaN function to compare with NaN.", this); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2183 |
} else if (f) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2184 |
f.apply(this, [left, right]); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2185 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2186 |
this.left = left; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2187 |
this.right = right; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2188 |
return this; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2189 |
}; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2190 |
return x; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2191 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2192 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2193 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2194 |
function isPoorRelation(node) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2195 |
return (node.type === '(number)' && !+node.value) || |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2196 |
(node.type === '(string)' && !node.value) || |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2197 |
node.type === 'true' || |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2198 |
node.type === 'false' || |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2199 |
node.type === 'undefined' || |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2200 |
node.type === 'null'; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2201 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2202 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2203 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2204 |
function assignop(s, f) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2205 |
symbol(s, 20).exps = true; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2206 |
return infix(s, function (left, that) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2207 |
var l; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2208 |
that.left = left; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2209 |
if (predefined[left.value] === false && |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2210 |
scope[left.value]['(global)'] === true) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2211 |
warning('Read only.', left); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2212 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2213 |
if (option.safe) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2214 |
l = left; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2215 |
do { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2216 |
if (typeof predefined[l.value] === 'boolean') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2217 |
warning('ADsafe violation.', l); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2218 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2219 |
l = l.left; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2220 |
} while (l); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2221 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2222 |
if (left) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2223 |
if (left.id === '.' || left.id === '[') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2224 |
if (left.left.value === 'arguments') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2225 |
warning('Bad assignment.', that); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2226 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2227 |
that.right = parse(19); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2228 |
return that; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2229 |
} else if (left.identifier && !left.reserved) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2230 |
if (funct[left.value] === 'exception') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2231 |
warning("Do not assign to the exception parameter.", left); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2232 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2233 |
that.right = parse(19); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2234 |
return that; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2235 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2236 |
if (left === syntax['function']) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2237 |
warning( |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2238 |
"Expected an identifier in an assignment and instead saw a function invocation.", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2239 |
token); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2240 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2241 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2242 |
error("Bad assignment.", that); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2243 |
}, 20); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2244 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2245 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2246 |
function bitwise(s, f, p) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2247 |
var x = symbol(s, p); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2248 |
reserveName(x); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2249 |
x.led = (typeof f === 'function') ? f : function (left) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2250 |
if (option.bitwise) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2251 |
warning("Unexpected use of '{a}'.", this, this.id); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2252 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2253 |
this.left = left; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2254 |
this.right = parse(p); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2255 |
return this; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2256 |
}; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2257 |
return x; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2258 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2259 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2260 |
function bitwiseassignop(s) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2261 |
symbol(s, 20).exps = true; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2262 |
return infix(s, function (left, that) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2263 |
if (option.bitwise) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2264 |
warning("Unexpected use of '{a}'.", that, that.id); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2265 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2266 |
nonadjacent(prevtoken, token); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2267 |
nonadjacent(token, nexttoken); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2268 |
if (left) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2269 |
if (left.id === '.' || left.id === '[' || |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2270 |
(left.identifier && !left.reserved)) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2271 |
parse(19); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2272 |
return left; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2273 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2274 |
if (left === syntax['function']) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2275 |
warning( |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2276 |
"Expected an identifier in an assignment, and instead saw a function invocation.", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2277 |
token); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2278 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2279 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2280 |
error("Bad assignment.", that); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2281 |
}, 20); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2282 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2283 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2284 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2285 |
function suffix(s, f) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2286 |
var x = symbol(s, 150); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2287 |
x.led = function (left) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2288 |
if (option.plusplus) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2289 |
warning("Unexpected use of '{a}'.", this, this.id); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2290 |
} else if ((!left.identifier || left.reserved) && left.id !== '.' && left.id !== '[') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2291 |
warning("Bad operand.", this); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2292 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2293 |
this.left = left; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2294 |
return this; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2295 |
}; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2296 |
return x; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2297 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2298 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2299 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2300 |
function optionalidentifier() { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2301 |
if (nexttoken.reserved) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2302 |
warning("Expected an identifier and instead saw '{a}' (a reserved word).", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2303 |
nexttoken, nexttoken.id); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2304 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2305 |
if (nexttoken.identifier) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2306 |
advance(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2307 |
return token.value; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2308 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2309 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2310 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2311 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2312 |
function identifier() { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2313 |
var i = optionalidentifier(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2314 |
if (i) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2315 |
return i; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2316 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2317 |
if (token.id === 'function' && nexttoken.id === '(') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2318 |
warning("Missing name in function statement."); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2319 |
} else { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2320 |
error("Expected an identifier and instead saw '{a}'.", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2321 |
nexttoken, nexttoken.value); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2322 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2323 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2324 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2325 |
function reachable(s) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2326 |
var i = 0, t; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2327 |
if (nexttoken.id !== ';' || noreach) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2328 |
return; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2329 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2330 |
for (;;) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2331 |
t = peek(i); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2332 |
if (t.reach) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2333 |
return; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2334 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2335 |
if (t.id !== '(endline)') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2336 |
if (t.id === 'function') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2337 |
warning( |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2338 |
"Inner functions should be listed at the top of the outer function.", t); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2339 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2340 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2341 |
warning("Unreachable '{a}' after '{b}'.", t, t.value, s); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2342 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2343 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2344 |
i += 1; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2345 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2346 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2347 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2348 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2349 |
function statement(noindent) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2350 |
var i = indent, r, s = scope, t = nexttoken; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2351 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2352 |
// We don't like the empty statement. |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2353 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2354 |
if (t.id === ';') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2355 |
warning("Unnecessary semicolon.", t); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2356 |
advance(';'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2357 |
return; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2358 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2359 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2360 |
// Is this a labelled statement? |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2361 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2362 |
if (t.identifier && !t.reserved && peek().id === ':') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2363 |
advance(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2364 |
advance(':'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2365 |
scope = Object.create(s); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2366 |
addlabel(t.value, 'label'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2367 |
if (!nexttoken.labelled) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2368 |
warning("Label '{a}' on {b} statement.", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2369 |
nexttoken, t.value, nexttoken.value); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2370 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2371 |
if (jx.test(t.value + ':')) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2372 |
warning("Label '{a}' looks like a javascript url.", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2373 |
t, t.value); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2374 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2375 |
nexttoken.label = t.value; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2376 |
t = nexttoken; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2377 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2378 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2379 |
// Parse the statement. |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2380 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2381 |
if (!noindent) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2382 |
indentation(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2383 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2384 |
r = parse(0, true); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2385 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2386 |
// Look for the final semicolon. |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2387 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2388 |
if (!t.block) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2389 |
if (nexttoken.id !== ';') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2390 |
warningAt("Missing semicolon.", token.line, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2391 |
token.from + token.value.length); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2392 |
} else { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2393 |
adjacent(token, nexttoken); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2394 |
advance(';'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2395 |
nonadjacent(token, nexttoken); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2396 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2397 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2398 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2399 |
// Restore the indentation. |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2400 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2401 |
indent = i; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2402 |
scope = s; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2403 |
return r; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2404 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2405 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2406 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2407 |
function use_strict() { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2408 |
if (nexttoken.value === 'use strict') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2409 |
advance(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2410 |
advance(';'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2411 |
return true; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2412 |
} else { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2413 |
return false; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2414 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2415 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2416 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2417 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2418 |
function statements(begin) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2419 |
var a = [], f, p; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2420 |
if (begin && !use_strict() && option.strict) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2421 |
warning('Missing "use strict" statement.', nexttoken); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2422 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2423 |
if (option.adsafe) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2424 |
switch (begin) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2425 |
case 'script': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2426 |
if (!adsafe_may) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2427 |
if (nexttoken.value !== 'ADSAFE' || |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2428 |
peek(0).id !== '.' || |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2429 |
(peek(1).value !== 'id' && |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2430 |
peek(1).value !== 'go')) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2431 |
error('ADsafe violation: Missing ADSAFE.id or ADSAFE.go.', |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2432 |
nexttoken); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2433 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2434 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2435 |
if (nexttoken.value === 'ADSAFE' && |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2436 |
peek(0).id === '.' && |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2437 |
peek(1).value === 'id') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2438 |
if (adsafe_may) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2439 |
error('ADsafe violation.', nexttoken); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2440 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2441 |
advance('ADSAFE'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2442 |
advance('.'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2443 |
advance('id'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2444 |
advance('('); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2445 |
if (nexttoken.value !== adsafe_id) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2446 |
error('ADsafe violation: id does not match.', nexttoken); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2447 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2448 |
advance('(string)'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2449 |
advance(')'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2450 |
advance(';'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2451 |
adsafe_may = true; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2452 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2453 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2454 |
case 'lib': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2455 |
if (nexttoken.value === 'ADSAFE') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2456 |
advance('ADSAFE'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2457 |
advance('.'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2458 |
advance('lib'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2459 |
advance('('); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2460 |
advance('(string)'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2461 |
comma(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2462 |
f = parse(0); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2463 |
if (f.id !== 'function') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2464 |
error('The second argument to lib must be a function.', f); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2465 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2466 |
p = f.funct['(params)']; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2467 |
p = p && p.join(', '); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2468 |
if (p && p !== 'lib') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2469 |
error("Expected '{a}' and instead saw '{b}'.", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2470 |
f, '(lib)', '(' + p + ')'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2471 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2472 |
advance(')'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2473 |
advance(';'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2474 |
return a; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2475 |
} else { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2476 |
error("ADsafe lib violation."); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2477 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2478 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2479 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2480 |
while (!nexttoken.reach && nexttoken.id !== '(end)') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2481 |
if (nexttoken.id === ';') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2482 |
warning("Unnecessary semicolon."); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2483 |
advance(';'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2484 |
} else { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2485 |
a.push(statement()); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2486 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2487 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2488 |
return a; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2489 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2490 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2491 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2492 |
function block(f) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2493 |
var a, b = inblock, s = scope, t; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2494 |
inblock = f; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2495 |
if (f) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2496 |
scope = Object.create(scope); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2497 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2498 |
nonadjacent(token, nexttoken); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2499 |
t = nexttoken; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2500 |
if (nexttoken.id === '{') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2501 |
advance('{'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2502 |
if (nexttoken.id !== '}' || token.line !== nexttoken.line) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2503 |
indent += option.indent; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2504 |
if (!f && nexttoken.from === indent + option.indent) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2505 |
indent += option.indent; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2506 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2507 |
if (!f) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2508 |
use_strict(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2509 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2510 |
a = statements(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2511 |
indent -= option.indent; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2512 |
indentation(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2513 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2514 |
advance('}', t); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2515 |
} else { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2516 |
warning("Expected '{a}' and instead saw '{b}'.", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2517 |
nexttoken, '{', nexttoken.value); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2518 |
noreach = true; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2519 |
a = [statement()]; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2520 |
noreach = false; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2521 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2522 |
funct['(verb)'] = null; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2523 |
scope = s; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2524 |
inblock = b; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2525 |
return a; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2526 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2527 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2528 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2529 |
// An identity function, used by string and number tokens. |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2530 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2531 |
function idValue() { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2532 |
return this; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2533 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2534 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2535 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2536 |
function countMember(m) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2537 |
if (membersOnly && typeof membersOnly[m] !== 'boolean') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2538 |
warning("Unexpected /*member '{a}'.", token, m); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2539 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2540 |
if (typeof member[m] === 'number') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2541 |
member[m] += 1; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2542 |
} else { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2543 |
member[m] = 1; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2544 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2545 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2546 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2547 |
function note_implied(token) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2548 |
var name = token.value, line = token.line, a = implied[name]; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2549 |
if (typeof a === 'function') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2550 |
a = false; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2551 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2552 |
if (!a) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2553 |
a = [line]; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2554 |
implied[name] = a; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2555 |
} else if (a[a.length - 1] !== line) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2556 |
a.push(line); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2557 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2558 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2559 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2560 |
// CSS parsing. |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2561 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2562 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2563 |
function cssName() { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2564 |
if (nexttoken.identifier) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2565 |
advance(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2566 |
return true; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2567 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2568 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2569 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2570 |
function cssNumber() { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2571 |
if (nexttoken.id === '-') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2572 |
advance('-'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2573 |
adjacent(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2574 |
nolinebreak(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2575 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2576 |
if (nexttoken.type === '(number)') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2577 |
advance('(number)'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2578 |
return true; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2579 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2580 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2581 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2582 |
function cssString() { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2583 |
if (nexttoken.type === '(string)') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2584 |
advance(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2585 |
return true; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2586 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2587 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2588 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2589 |
function cssColor() { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2590 |
var i, number; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2591 |
if (nexttoken.identifier) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2592 |
if (nexttoken.value === 'rgb') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2593 |
advance(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2594 |
advance('('); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2595 |
for (i = 0; i < 3; i += 1) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2596 |
number = nexttoken.value; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2597 |
if (nexttoken.type !== '(number)' || number < 0) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2598 |
warning("Expected a positive number and instead saw '{a}'", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2599 |
nexttoken, number); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2600 |
advance(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2601 |
} else { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2602 |
advance(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2603 |
if (nexttoken.id === '%') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2604 |
advance('%'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2605 |
if (number > 100) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2606 |
warning("Expected a percentage and instead saw '{a}'", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2607 |
token, number); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2608 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2609 |
} else { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2610 |
if (number > 255) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2611 |
warning("Expected a small number and instead saw '{a}'", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2612 |
token, number); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2613 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2614 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2615 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2616 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2617 |
advance(')'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2618 |
return true; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2619 |
} else if (cssColorData[nexttoken.value] === true) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2620 |
advance(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2621 |
return true; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2622 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2623 |
} else if (nexttoken.type === '(color)') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2624 |
advance(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2625 |
return true; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2626 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2627 |
return false; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2628 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2629 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2630 |
function cssLength() { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2631 |
if (nexttoken.id === '-') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2632 |
advance('-'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2633 |
adjacent(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2634 |
nolinebreak(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2635 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2636 |
if (nexttoken.type === '(number)') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2637 |
advance(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2638 |
if (nexttoken.type !== '(string)' && |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2639 |
cssLengthData[nexttoken.value] === true) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2640 |
adjacent(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2641 |
advance(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2642 |
} else if (+token.value !== 0) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2643 |
warning("Expected a linear unit and instead saw '{a}'.", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2644 |
nexttoken, nexttoken.value); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2645 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2646 |
return true; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2647 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2648 |
return false; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2649 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2650 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2651 |
function cssLineHeight() { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2652 |
if (nexttoken.id === '-') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2653 |
advance('-'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2654 |
adjacent(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2655 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2656 |
if (nexttoken.type === '(number)') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2657 |
advance(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2658 |
if (nexttoken.type !== '(string)' && |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2659 |
cssLengthData[nexttoken.value] === true) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2660 |
adjacent(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2661 |
advance(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2662 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2663 |
return true; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2664 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2665 |
return false; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2666 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2667 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2668 |
function cssWidth() { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2669 |
if (nexttoken.identifier) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2670 |
switch (nexttoken.value) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2671 |
case 'thin': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2672 |
case 'medium': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2673 |
case 'thick': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2674 |
advance(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2675 |
return true; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2676 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2677 |
} else { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2678 |
return cssLength(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2679 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2680 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2681 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2682 |
function cssMargin() { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2683 |
if (nexttoken.identifier) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2684 |
if (nexttoken.value === 'auto') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2685 |
advance(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2686 |
return true; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2687 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2688 |
} else { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2689 |
return cssLength(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2690 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2691 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2692 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2693 |
function cssAttr() { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2694 |
if (nexttoken.identifier && nexttoken.value === 'attr') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2695 |
advance(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2696 |
advance('('); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2697 |
if (!nexttoken.identifier) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2698 |
warning("Expected a name and instead saw '{a}'.", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2699 |
nexttoken, nexttoken.value); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2700 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2701 |
advance(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2702 |
advance(')'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2703 |
return true; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2704 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2705 |
return false; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2706 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2707 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2708 |
function cssCommaList() { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2709 |
while (nexttoken.id !== ';') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2710 |
if (!cssName() && !cssString()) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2711 |
warning("Expected a name and instead saw '{a}'.", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2712 |
nexttoken, nexttoken.value); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2713 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2714 |
if (nexttoken.id !== ',') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2715 |
return true; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2716 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2717 |
comma(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2718 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2719 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2720 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2721 |
function cssCounter() { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2722 |
if (nexttoken.identifier && nexttoken.value === 'counter') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2723 |
advance(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2724 |
advance('('); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2725 |
if (!nexttoken.identifier) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2726 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2727 |
advance(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2728 |
if (nexttoken.id === ',') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2729 |
comma(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2730 |
if (nexttoken.type !== '(string)') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2731 |
warning("Expected a string and instead saw '{a}'.", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2732 |
nexttoken, nexttoken.value); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2733 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2734 |
advance(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2735 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2736 |
advance(')'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2737 |
return true; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2738 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2739 |
if (nexttoken.identifier && nexttoken.value === 'counters') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2740 |
advance(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2741 |
advance('('); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2742 |
if (!nexttoken.identifier) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2743 |
warning("Expected a name and instead saw '{a}'.", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2744 |
nexttoken, nexttoken.value); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2745 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2746 |
advance(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2747 |
if (nexttoken.id === ',') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2748 |
comma(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2749 |
if (nexttoken.type !== '(string)') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2750 |
warning("Expected a string and instead saw '{a}'.", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2751 |
nexttoken, nexttoken.value); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2752 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2753 |
advance(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2754 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2755 |
if (nexttoken.id === ',') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2756 |
comma(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2757 |
if (nexttoken.type !== '(string)') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2758 |
warning("Expected a string and instead saw '{a}'.", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2759 |
nexttoken, nexttoken.value); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2760 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2761 |
advance(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2762 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2763 |
advance(')'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2764 |
return true; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2765 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2766 |
return false; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2767 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2768 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2769 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2770 |
function cssShape() { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2771 |
var i; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2772 |
if (nexttoken.identifier && nexttoken.value === 'rect') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2773 |
advance(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2774 |
advance('('); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2775 |
for (i = 0; i < 4; i += 1) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2776 |
if (!cssLength()) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2777 |
warning("Expected a number and instead saw '{a}'.", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2778 |
nexttoken, nexttoken.value); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2779 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2780 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2781 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2782 |
advance(')'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2783 |
return true; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2784 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2785 |
return false; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2786 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2787 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2788 |
function cssUrl() { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2789 |
var c, url; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2790 |
if (nexttoken.identifier && nexttoken.value === 'url') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2791 |
nexttoken = lex.range('(', ')'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2792 |
url = nexttoken.value; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2793 |
c = url.charAt(0); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2794 |
if (c === '"' || c === '\'') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2795 |
if (url.slice(-1) !== c) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2796 |
warning("Bad url string."); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2797 |
} else { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2798 |
url = url.slice(1, -1); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2799 |
if (url.indexOf(c) >= 0) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2800 |
warning("Bad url string."); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2801 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2802 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2803 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2804 |
if (!url) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2805 |
warning("Missing url."); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2806 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2807 |
advance(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2808 |
if (option.safe && ux.test(url)) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2809 |
error("ADsafe URL violation."); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2810 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2811 |
urls.push(url); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2812 |
return true; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2813 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2814 |
return false; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2815 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2816 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2817 |
cssAny = [cssUrl, function () { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2818 |
for (;;) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2819 |
if (nexttoken.identifier) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2820 |
switch (nexttoken.value.toLowerCase()) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2821 |
case 'url': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2822 |
cssUrl(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2823 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2824 |
case 'expression': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2825 |
warning("Unexpected expression '{a}'.", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2826 |
nexttoken, nexttoken.value); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2827 |
advance(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2828 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2829 |
default: |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2830 |
advance(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2831 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2832 |
} else { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2833 |
if (nexttoken.id === ';' || nexttoken.id === '!' || |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2834 |
nexttoken.id === '(end)' || nexttoken.id === '}') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2835 |
return true; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2836 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2837 |
advance(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2838 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2839 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2840 |
}]; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2841 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2842 |
cssBorderStyle = [ |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2843 |
'none', 'hidden', 'dotted', 'dashed', 'solid', 'double', 'ridge', |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2844 |
'inset', 'outset' |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2845 |
]; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2846 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2847 |
cssBreak = [ |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2848 |
'auto', 'always', 'avoid', 'left', 'right' |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2849 |
]; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2850 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2851 |
cssOverflow = [ |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2852 |
'auto', 'hidden', 'scroll', 'visible' |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2853 |
]; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2854 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2855 |
cssAttributeData = { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2856 |
background: [ |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2857 |
true, 'background-attachment', 'background-color', |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2858 |
'background-image', 'background-position', 'background-repeat' |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2859 |
], |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2860 |
'background-attachment': ['scroll', 'fixed'], |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2861 |
'background-color': ['transparent', cssColor], |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2862 |
'background-image': ['none', cssUrl], |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2863 |
'background-position': [ |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2864 |
2, [cssLength, 'top', 'bottom', 'left', 'right', 'center'] |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2865 |
], |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2866 |
'background-repeat': [ |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2867 |
'repeat', 'repeat-x', 'repeat-y', 'no-repeat' |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2868 |
], |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2869 |
'border': [true, 'border-color', 'border-style', 'border-width'], |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2870 |
'border-bottom': [ |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2871 |
true, 'border-bottom-color', 'border-bottom-style', |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2872 |
'border-bottom-width' |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2873 |
], |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2874 |
'border-bottom-color': cssColor, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2875 |
'border-bottom-style': cssBorderStyle, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2876 |
'border-bottom-width': cssWidth, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2877 |
'border-collapse': ['collapse', 'separate'], |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2878 |
'border-color': ['transparent', 4, cssColor], |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2879 |
'border-left': [ |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2880 |
true, 'border-left-color', 'border-left-style', 'border-left-width' |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2881 |
], |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2882 |
'border-left-color': cssColor, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2883 |
'border-left-style': cssBorderStyle, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2884 |
'border-left-width': cssWidth, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2885 |
'border-right': [ |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2886 |
true, 'border-right-color', 'border-right-style', |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2887 |
'border-right-width' |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2888 |
], |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2889 |
'border-right-color': cssColor, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2890 |
'border-right-style': cssBorderStyle, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2891 |
'border-right-width': cssWidth, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2892 |
'border-spacing': [2, cssLength], |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2893 |
'border-style': [4, cssBorderStyle], |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2894 |
'border-top': [ |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2895 |
true, 'border-top-color', 'border-top-style', 'border-top-width' |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2896 |
], |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2897 |
'border-top-color': cssColor, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2898 |
'border-top-style': cssBorderStyle, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2899 |
'border-top-width': cssWidth, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2900 |
'border-width': [4, cssWidth], |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2901 |
bottom: [cssLength, 'auto'], |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2902 |
'caption-side' : ['bottom', 'left', 'right', 'top'], |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2903 |
clear: ['both', 'left', 'none', 'right'], |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2904 |
clip: [cssShape, 'auto'], |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2905 |
color: cssColor, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2906 |
content: [ |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2907 |
'open-quote', 'close-quote', 'no-open-quote', 'no-close-quote', |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2908 |
cssString, cssUrl, cssCounter, cssAttr |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2909 |
], |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2910 |
'counter-increment': [ |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2911 |
cssName, 'none' |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2912 |
], |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2913 |
'counter-reset': [ |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2914 |
cssName, 'none' |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2915 |
], |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2916 |
cursor: [ |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2917 |
cssUrl, 'auto', 'crosshair', 'default', 'e-resize', 'help', 'move', |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2918 |
'n-resize', 'ne-resize', 'nw-resize', 'pointer', 's-resize', |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2919 |
'se-resize', 'sw-resize', 'w-resize', 'text', 'wait' |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2920 |
], |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2921 |
direction: ['ltr', 'rtl'], |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2922 |
display: [ |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2923 |
'block', 'compact', 'inline', 'inline-block', 'inline-table', |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2924 |
'list-item', 'marker', 'none', 'run-in', 'table', 'table-caption', |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2925 |
'table-cell', 'table-column', 'table-column-group', |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2926 |
'table-footer-group', 'table-header-group', 'table-row', |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2927 |
'table-row-group' |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2928 |
], |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2929 |
'empty-cells': ['show', 'hide'], |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2930 |
'float': ['left', 'none', 'right'], |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2931 |
font: [ |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2932 |
'caption', 'icon', 'menu', 'message-box', 'small-caption', |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2933 |
'status-bar', true, 'font-size', 'font-style', 'font-weight', |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2934 |
'font-family' |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2935 |
], |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2936 |
'font-family': cssCommaList, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2937 |
'font-size': [ |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2938 |
'xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2939 |
'xx-large', 'larger', 'smaller', cssLength |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2940 |
], |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2941 |
'font-size-adjust': ['none', cssNumber], |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2942 |
'font-stretch': [ |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2943 |
'normal', 'wider', 'narrower', 'ultra-condensed', |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2944 |
'extra-condensed', 'condensed', 'semi-condensed', |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2945 |
'semi-expanded', 'expanded', 'extra-expanded' |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2946 |
], |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2947 |
'font-style': [ |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2948 |
'normal', 'italic', 'oblique' |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2949 |
], |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2950 |
'font-variant': [ |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2951 |
'normal', 'small-caps' |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2952 |
], |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2953 |
'font-weight': [ |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2954 |
'normal', 'bold', 'bolder', 'lighter', cssNumber |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2955 |
], |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2956 |
height: [cssLength, 'auto'], |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2957 |
left: [cssLength, 'auto'], |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2958 |
'letter-spacing': ['normal', cssLength], |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2959 |
'line-height': ['normal', cssLineHeight], |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2960 |
'list-style': [ |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2961 |
true, 'list-style-image', 'list-style-position', 'list-style-type' |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2962 |
], |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2963 |
'list-style-image': ['none', cssUrl], |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2964 |
'list-style-position': ['inside', 'outside'], |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2965 |
'list-style-type': [ |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2966 |
'circle', 'disc', 'square', 'decimal', 'decimal-leading-zero', |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2967 |
'lower-roman', 'upper-roman', 'lower-greek', 'lower-alpha', |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2968 |
'lower-latin', 'upper-alpha', 'upper-latin', 'hebrew', 'katakana', |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2969 |
'hiragana-iroha', 'katakana-oroha', 'none' |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2970 |
], |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2971 |
margin: [4, cssMargin], |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2972 |
'margin-bottom': cssMargin, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2973 |
'margin-left': cssMargin, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2974 |
'margin-right': cssMargin, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2975 |
'margin-top': cssMargin, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2976 |
'marker-offset': [cssLength, 'auto'], |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2977 |
'max-height': [cssLength, 'none'], |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2978 |
'max-width': [cssLength, 'none'], |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2979 |
'min-height': cssLength, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2980 |
'min-width': cssLength, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2981 |
opacity: cssNumber, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2982 |
outline: [true, 'outline-color', 'outline-style', 'outline-width'], |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2983 |
'outline-color': ['invert', cssColor], |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2984 |
'outline-style': [ |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2985 |
'dashed', 'dotted', 'double', 'groove', 'inset', 'none', |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2986 |
'outset', 'ridge', 'solid' |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2987 |
], |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2988 |
'outline-width': cssWidth, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2989 |
overflow: cssOverflow, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2990 |
'overflow-x': cssOverflow, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2991 |
'overflow-y': cssOverflow, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2992 |
padding: [4, cssLength], |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2993 |
'padding-bottom': cssLength, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2994 |
'padding-left': cssLength, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2995 |
'padding-right': cssLength, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2996 |
'padding-top': cssLength, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2997 |
'page-break-after': cssBreak, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2998 |
'page-break-before': cssBreak, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
2999 |
position: ['absolute', 'fixed', 'relative', 'static'], |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3000 |
quotes: [8, cssString], |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3001 |
right: [cssLength, 'auto'], |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3002 |
'table-layout': ['auto', 'fixed'], |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3003 |
'text-align': ['center', 'justify', 'left', 'right'], |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3004 |
'text-decoration': [ |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3005 |
'none', 'underline', 'overline', 'line-through', 'blink' |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3006 |
], |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3007 |
'text-indent': cssLength, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3008 |
'text-shadow': ['none', 4, [cssColor, cssLength]], |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3009 |
'text-transform': ['capitalize', 'uppercase', 'lowercase', 'none'], |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3010 |
top: [cssLength, 'auto'], |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3011 |
'unicode-bidi': ['normal', 'embed', 'bidi-override'], |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3012 |
'vertical-align': [ |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3013 |
'baseline', 'bottom', 'sub', 'super', 'top', 'text-top', 'middle', |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3014 |
'text-bottom', cssLength |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3015 |
], |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3016 |
visibility: ['visible', 'hidden', 'collapse'], |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3017 |
'white-space': [ |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3018 |
'normal', 'nowrap', 'pre', 'pre-line', 'pre-wrap', 'inherit' |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3019 |
], |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3020 |
width: [cssLength, 'auto'], |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3021 |
'word-spacing': ['normal', cssLength], |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3022 |
'word-wrap': ['break-word', 'normal'], |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3023 |
'z-index': ['auto', cssNumber] |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3024 |
}; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3025 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3026 |
function styleAttribute() { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3027 |
var v; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3028 |
while (nexttoken.id === '*' || nexttoken.id === '#' || |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3029 |
nexttoken.value === '_') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3030 |
if (!option.css) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3031 |
warning("Unexpected '{a}'.", nexttoken, nexttoken.value); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3032 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3033 |
advance(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3034 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3035 |
if (nexttoken.id === '-') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3036 |
if (!option.css) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3037 |
warning("Unexpected '{a}'.", nexttoken, nexttoken.value); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3038 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3039 |
advance('-'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3040 |
if (!nexttoken.identifier) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3041 |
warning( |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3042 |
"Expected a non-standard style attribute and instead saw '{a}'.", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3043 |
nexttoken, nexttoken.value); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3044 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3045 |
advance(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3046 |
return cssAny; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3047 |
} else { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3048 |
if (!nexttoken.identifier) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3049 |
warning("Excepted a style attribute, and instead saw '{a}'.", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3050 |
nexttoken, nexttoken.value); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3051 |
} else { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3052 |
if (is_own(cssAttributeData, nexttoken.value)) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3053 |
v = cssAttributeData[nexttoken.value]; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3054 |
} else { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3055 |
v = cssAny; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3056 |
if (!option.css) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3057 |
warning("Unrecognized style attribute '{a}'.", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3058 |
nexttoken, nexttoken.value); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3059 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3060 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3061 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3062 |
advance(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3063 |
return v; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3064 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3065 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3066 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3067 |
function styleValue(v) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3068 |
var i = 0, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3069 |
n, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3070 |
once, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3071 |
match, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3072 |
round, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3073 |
start = 0, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3074 |
vi; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3075 |
switch (typeof v) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3076 |
case 'function': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3077 |
return v(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3078 |
case 'string': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3079 |
if (nexttoken.identifier && nexttoken.value === v) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3080 |
advance(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3081 |
return true; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3082 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3083 |
return false; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3084 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3085 |
for (;;) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3086 |
if (i >= v.length) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3087 |
return false; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3088 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3089 |
vi = v[i]; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3090 |
i += 1; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3091 |
if (vi === true) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3092 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3093 |
} else if (typeof vi === 'number') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3094 |
n = vi; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3095 |
vi = v[i]; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3096 |
i += 1; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3097 |
} else { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3098 |
n = 1; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3099 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3100 |
match = false; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3101 |
while (n > 0) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3102 |
if (styleValue(vi)) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3103 |
match = true; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3104 |
n -= 1; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3105 |
} else { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3106 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3107 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3108 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3109 |
if (match) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3110 |
return true; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3111 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3112 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3113 |
start = i; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3114 |
once = []; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3115 |
for (;;) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3116 |
round = false; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3117 |
for (i = start; i < v.length; i += 1) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3118 |
if (!once[i]) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3119 |
if (styleValue(cssAttributeData[v[i]])) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3120 |
match = true; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3121 |
round = true; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3122 |
once[i] = true; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3123 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3124 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3125 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3126 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3127 |
if (!round) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3128 |
return match; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3129 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3130 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3131 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3132 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3133 |
function styleChild() { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3134 |
if (nexttoken.id === '(number)') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3135 |
advance(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3136 |
if (nexttoken.value === 'n' && nexttoken.identifier) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3137 |
adjacent(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3138 |
advance(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3139 |
if (nexttoken.id === '+') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3140 |
adjacent(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3141 |
advance('+'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3142 |
adjacent(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3143 |
advance('(number)'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3144 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3145 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3146 |
return; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3147 |
} else { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3148 |
switch (nexttoken.value) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3149 |
case 'odd': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3150 |
case 'even': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3151 |
if (nexttoken.identifier) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3152 |
advance(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3153 |
return; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3154 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3155 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3156 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3157 |
warning("Unexpected token '{a}'.", nexttoken, nexttoken.value); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3158 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3159 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3160 |
function substyle() { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3161 |
var v; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3162 |
for (;;) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3163 |
if (nexttoken.id === '}' || nexttoken.id === '(end)' || |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3164 |
xquote && nexttoken.id === xquote) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3165 |
return; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3166 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3167 |
while (nexttoken.id === ';') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3168 |
warning("Misplaced ';'."); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3169 |
advance(';'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3170 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3171 |
v = styleAttribute(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3172 |
advance(':'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3173 |
if (nexttoken.identifier && nexttoken.value === 'inherit') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3174 |
advance(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3175 |
} else { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3176 |
if (!styleValue(v)) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3177 |
warning("Unexpected token '{a}'.", nexttoken, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3178 |
nexttoken.value); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3179 |
advance(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3180 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3181 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3182 |
if (nexttoken.id === '!') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3183 |
advance('!'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3184 |
adjacent(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3185 |
if (nexttoken.identifier && nexttoken.value === 'important') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3186 |
advance(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3187 |
} else { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3188 |
warning("Expected '{a}' and instead saw '{b}'.", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3189 |
nexttoken, 'important', nexttoken.value); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3190 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3191 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3192 |
if (nexttoken.id === '}' || nexttoken.id === xquote) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3193 |
warning("Missing '{a}'.", nexttoken, ';'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3194 |
} else { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3195 |
advance(';'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3196 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3197 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3198 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3199 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3200 |
function styleSelector() { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3201 |
if (nexttoken.identifier) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3202 |
if (!is_own(htmltag, nexttoken.value)) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3203 |
warning("Expected a tagName, and instead saw {a}.", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3204 |
nexttoken, nexttoken.value); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3205 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3206 |
advance(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3207 |
} else { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3208 |
switch (nexttoken.id) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3209 |
case '>': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3210 |
case '+': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3211 |
advance(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3212 |
styleSelector(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3213 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3214 |
case ':': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3215 |
advance(':'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3216 |
switch (nexttoken.value) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3217 |
case 'active': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3218 |
case 'after': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3219 |
case 'before': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3220 |
case 'checked': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3221 |
case 'disabled': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3222 |
case 'empty': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3223 |
case 'enabled': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3224 |
case 'first-child': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3225 |
case 'first-letter': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3226 |
case 'first-line': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3227 |
case 'first-of-type': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3228 |
case 'focus ': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3229 |
case 'hover': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3230 |
case 'last-of-type': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3231 |
case 'link': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3232 |
case 'only-of-type': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3233 |
case 'root': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3234 |
case 'target': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3235 |
case 'visited': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3236 |
advance(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3237 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3238 |
case 'lang': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3239 |
advance(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3240 |
advance('('); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3241 |
if (!nexttoken.identifier) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3242 |
warning("Expected a lang code, and instead saw :{a}.", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3243 |
nexttoken, nexttoken.value); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3244 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3245 |
advance(')'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3246 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3247 |
case 'nth-child': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3248 |
case 'nth-last-child': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3249 |
case 'nth-last-of-type': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3250 |
case 'nth-of-type': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3251 |
advance(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3252 |
advance('('); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3253 |
styleChild(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3254 |
advance(')'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3255 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3256 |
case 'not': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3257 |
advance(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3258 |
advance('('); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3259 |
if (nexttoken.id === ':' && peek(0).value === 'not') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3260 |
warning("Nested not."); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3261 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3262 |
styleSelector(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3263 |
advance(')'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3264 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3265 |
default: |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3266 |
warning("Expected a pseudo, and instead saw :{a}.", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3267 |
nexttoken, nexttoken.value); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3268 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3269 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3270 |
case '#': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3271 |
advance('#'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3272 |
if (!nexttoken.identifier) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3273 |
warning("Expected an id, and instead saw #{a}.", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3274 |
nexttoken, nexttoken.value); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3275 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3276 |
advance(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3277 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3278 |
case '*': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3279 |
advance('*'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3280 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3281 |
case '.': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3282 |
advance('.'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3283 |
if (!nexttoken.identifier) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3284 |
warning("Expected a class, and instead saw #.{a}.", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3285 |
nexttoken, nexttoken.value); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3286 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3287 |
advance(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3288 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3289 |
case '[': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3290 |
advance('['); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3291 |
if (!nexttoken.identifier) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3292 |
warning("Expected an attribute, and instead saw [{a}].", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3293 |
nexttoken, nexttoken.value); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3294 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3295 |
advance(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3296 |
if (nexttoken.id === '=' || nexttoken.value === '~=' || |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3297 |
nexttoken.value === '$=' || |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3298 |
nexttoken.value === '|=' || |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3299 |
nexttoken.id === '*=' || |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3300 |
nexttoken.id === '^=') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3301 |
advance(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3302 |
if (nexttoken.type !== '(string)') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3303 |
warning("Expected a string, and instead saw {a}.", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3304 |
nexttoken, nexttoken.value); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3305 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3306 |
advance(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3307 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3308 |
advance(']'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3309 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3310 |
default: |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3311 |
error("Expected a CSS selector, and instead saw {a}.", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3312 |
nexttoken, nexttoken.value); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3313 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3314 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3315 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3316 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3317 |
function stylePattern() { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3318 |
var name; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3319 |
if (nexttoken.id === '{') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3320 |
warning("Expected a style pattern, and instead saw '{a}'.", nexttoken, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3321 |
nexttoken.id); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3322 |
} else if (nexttoken.id === '@') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3323 |
advance('@'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3324 |
name = nexttoken.value; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3325 |
if (nexttoken.identifier && atrule[name] === true) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3326 |
advance(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3327 |
return name; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3328 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3329 |
warning("Expected an at-rule, and instead saw @{a}.", nexttoken, name); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3330 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3331 |
for (;;) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3332 |
styleSelector(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3333 |
if (nexttoken.id === '</' || nexttoken.id === '{' || |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3334 |
nexttoken.id === '(end)') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3335 |
return ''; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3336 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3337 |
if (nexttoken.id === ',') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3338 |
comma(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3339 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3340 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3341 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3342 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3343 |
function styles() { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3344 |
var i; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3345 |
while (nexttoken.id === '@') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3346 |
i = peek(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3347 |
if (i.identifier && i.value === 'import') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3348 |
advance('@'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3349 |
advance(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3350 |
if (!cssUrl()) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3351 |
warning("Expected '{a}' and instead saw '{b}'.", nexttoken, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3352 |
'url', nexttoken.value); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3353 |
advance(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3354 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3355 |
advance(';'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3356 |
} else { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3357 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3358 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3359 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3360 |
while (nexttoken.id !== '</' && nexttoken.id !== '(end)') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3361 |
stylePattern(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3362 |
xmode = 'styleproperty'; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3363 |
if (nexttoken.id === ';') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3364 |
advance(';'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3365 |
} else { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3366 |
advance('{'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3367 |
substyle(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3368 |
xmode = 'style'; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3369 |
advance('}'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3370 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3371 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3372 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3373 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3374 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3375 |
// HTML parsing. |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3376 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3377 |
function doBegin(n) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3378 |
if (n !== 'html' && !option.fragment) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3379 |
if (n === 'div' && option.adsafe) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3380 |
error("ADSAFE: Use the fragment option."); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3381 |
} else { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3382 |
error("Expected '{a}' and instead saw '{b}'.", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3383 |
token, 'html', n); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3384 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3385 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3386 |
if (option.adsafe) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3387 |
if (n === 'html') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3388 |
error( |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3389 |
"Currently, ADsafe does not operate on whole HTML documents. It operates on <div> fragments and .js files.", token); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3390 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3391 |
if (option.fragment) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3392 |
if (n !== 'div') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3393 |
error("ADsafe violation: Wrap the widget in a div.", token); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3394 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3395 |
} else { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3396 |
error("Use the fragment option.", token); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3397 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3398 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3399 |
option.browser = true; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3400 |
assume(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3401 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3402 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3403 |
function doAttribute(n, a, v) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3404 |
var u, x; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3405 |
if (a === 'id') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3406 |
u = typeof v === 'string' ? v.toUpperCase() : ''; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3407 |
if (ids[u] === true) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3408 |
warning("Duplicate id='{a}'.", nexttoken, v); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3409 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3410 |
if (option.adsafe) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3411 |
if (adsafe_id) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3412 |
if (v.slice(0, adsafe_id.length) !== adsafe_id) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3413 |
warning("ADsafe violation: An id must have a '{a}' prefix", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3414 |
nexttoken, adsafe_id); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3415 |
} else if (!/^[A-Z]+_[A-Z]+$/.test(v)) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3416 |
warning("ADSAFE violation: bad id."); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3417 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3418 |
} else { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3419 |
adsafe_id = v; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3420 |
if (!/^[A-Z]+_$/.test(v)) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3421 |
warning("ADSAFE violation: bad id."); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3422 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3423 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3424 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3425 |
x = v.search(dx); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3426 |
if (x >= 0) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3427 |
warning("Unexpected character '{a}' in {b}.", token, v.charAt(x), a); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3428 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3429 |
ids[u] = true; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3430 |
} else if (a === 'class' || a === 'type' || a === 'name') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3431 |
x = v.search(qx); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3432 |
if (x >= 0) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3433 |
warning("Unexpected character '{a}' in {b}.", token, v.charAt(x), a); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3434 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3435 |
ids[u] = true; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3436 |
} else if (a === 'href' || a === 'background' || |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3437 |
a === 'content' || a === 'data' || |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3438 |
a.indexOf('src') >= 0 || a.indexOf('url') >= 0) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3439 |
if (option.safe && ux.test(v)) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3440 |
error("ADsafe URL violation."); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3441 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3442 |
urls.push(v); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3443 |
} else if (a === 'for') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3444 |
if (option.adsafe) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3445 |
if (adsafe_id) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3446 |
if (v.slice(0, adsafe_id.length) !== adsafe_id) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3447 |
warning("ADsafe violation: An id must have a '{a}' prefix", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3448 |
nexttoken, adsafe_id); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3449 |
} else if (!/^[A-Z]+_[A-Z]+$/.test(v)) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3450 |
warning("ADSAFE violation: bad id."); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3451 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3452 |
} else { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3453 |
warning("ADSAFE violation: bad id."); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3454 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3455 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3456 |
} else if (a === 'name') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3457 |
if (option.adsafe && v.indexOf('_') >= 0) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3458 |
warning("ADsafe name violation."); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3459 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3460 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3461 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3462 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3463 |
function doTag(n, a) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3464 |
var i, t = htmltag[n], x; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3465 |
src = false; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3466 |
if (!t) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3467 |
error("Unrecognized tag '<{a}>'.", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3468 |
nexttoken, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3469 |
n === n.toLowerCase() ? n : |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3470 |
n + ' (capitalization error)'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3471 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3472 |
if (stack.length > 0) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3473 |
if (n === 'html') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3474 |
error("Too many <html> tags.", token); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3475 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3476 |
x = t.parent; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3477 |
if (x) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3478 |
if (x.indexOf(' ' + stack[stack.length - 1].name + ' ') < 0) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3479 |
error("A '<{a}>' must be within '<{b}>'.", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3480 |
token, n, x); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3481 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3482 |
} else if (!option.adsafe && !option.fragment) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3483 |
i = stack.length; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3484 |
do { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3485 |
if (i <= 0) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3486 |
error("A '<{a}>' must be within '<{b}>'.", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3487 |
token, n, 'body'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3488 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3489 |
i -= 1; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3490 |
} while (stack[i].name !== 'body'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3491 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3492 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3493 |
switch (n) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3494 |
case 'div': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3495 |
if (option.adsafe && stack.length === 1 && !adsafe_id) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3496 |
warning("ADSAFE violation: missing ID_."); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3497 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3498 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3499 |
case 'script': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3500 |
xmode = 'script'; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3501 |
advance('>'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3502 |
indent = nexttoken.from; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3503 |
if (a.lang) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3504 |
warning("lang is deprecated.", token); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3505 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3506 |
if (option.adsafe && stack.length !== 1) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3507 |
warning("ADsafe script placement violation.", token); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3508 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3509 |
if (a.src) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3510 |
if (option.adsafe && (!adsafe_may || !approved[a.src])) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3511 |
warning("ADsafe unapproved script source.", token); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3512 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3513 |
if (a.type) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3514 |
warning("type is unnecessary.", token); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3515 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3516 |
} else { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3517 |
if (adsafe_went) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3518 |
error("ADsafe script violation.", token); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3519 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3520 |
statements('script'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3521 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3522 |
xmode = 'html'; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3523 |
advance('</'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3524 |
if (!nexttoken.identifier && nexttoken.value !== 'script') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3525 |
warning("Expected '{a}' and instead saw '{b}'.", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3526 |
nexttoken, 'script', nexttoken.value); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3527 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3528 |
advance(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3529 |
xmode = 'outer'; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3530 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3531 |
case 'style': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3532 |
xmode = 'style'; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3533 |
advance('>'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3534 |
styles(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3535 |
xmode = 'html'; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3536 |
advance('</'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3537 |
if (!nexttoken.identifier && nexttoken.value !== 'style') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3538 |
warning("Expected '{a}' and instead saw '{b}'.", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3539 |
nexttoken, 'style', nexttoken.value); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3540 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3541 |
advance(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3542 |
xmode = 'outer'; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3543 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3544 |
case 'input': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3545 |
switch (a.type) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3546 |
case 'radio': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3547 |
case 'checkbox': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3548 |
case 'button': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3549 |
case 'reset': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3550 |
case 'submit': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3551 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3552 |
case 'text': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3553 |
case 'file': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3554 |
case 'password': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3555 |
case 'file': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3556 |
case 'hidden': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3557 |
case 'image': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3558 |
if (option.adsafe && a.autocomplete !== 'off') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3559 |
warning("ADsafe autocomplete violation."); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3560 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3561 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3562 |
default: |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3563 |
warning("Bad input type."); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3564 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3565 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3566 |
case 'applet': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3567 |
case 'body': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3568 |
case 'embed': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3569 |
case 'frame': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3570 |
case 'frameset': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3571 |
case 'head': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3572 |
case 'iframe': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3573 |
case 'noembed': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3574 |
case 'noframes': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3575 |
case 'object': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3576 |
case 'param': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3577 |
if (option.adsafe) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3578 |
warning("ADsafe violation: Disallowed tag: " + n); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3579 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3580 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3581 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3582 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3583 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3584 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3585 |
function closetag(n) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3586 |
return '</' + n + '>'; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3587 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3588 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3589 |
function html() { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3590 |
var a, attributes, e, n, q, t, v, w = option.white, wmode; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3591 |
xmode = 'html'; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3592 |
xquote = ''; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3593 |
stack = null; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3594 |
for (;;) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3595 |
switch (nexttoken.value) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3596 |
case '<': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3597 |
xmode = 'html'; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3598 |
advance('<'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3599 |
attributes = {}; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3600 |
t = nexttoken; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3601 |
if (!t.identifier) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3602 |
warning("Bad identifier {a}.", t, t.value); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3603 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3604 |
n = t.value; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3605 |
if (option.cap) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3606 |
n = n.toLowerCase(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3607 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3608 |
t.name = n; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3609 |
advance(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3610 |
if (!stack) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3611 |
stack = []; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3612 |
doBegin(n); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3613 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3614 |
v = htmltag[n]; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3615 |
if (typeof v !== 'object') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3616 |
error("Unrecognized tag '<{a}>'.", t, n); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3617 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3618 |
e = v.empty; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3619 |
t.type = n; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3620 |
for (;;) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3621 |
if (nexttoken.id === '/') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3622 |
advance('/'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3623 |
if (nexttoken.id !== '>') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3624 |
warning("Expected '{a}' and instead saw '{b}'.", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3625 |
nexttoken, '>', nexttoken.value); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3626 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3627 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3628 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3629 |
if (nexttoken.id && nexttoken.id.substr(0, 1) === '>') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3630 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3631 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3632 |
if (!nexttoken.identifier) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3633 |
if (nexttoken.id === '(end)' || nexttoken.id === '(error)') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3634 |
error("Missing '>'.", nexttoken); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3635 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3636 |
warning("Bad identifier."); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3637 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3638 |
option.white = true; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3639 |
nonadjacent(token, nexttoken); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3640 |
a = nexttoken.value; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3641 |
option.white = w; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3642 |
advance(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3643 |
if (!option.cap && a !== a.toLowerCase()) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3644 |
warning("Attribute '{a}' not all lower case.", nexttoken, a); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3645 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3646 |
a = a.toLowerCase(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3647 |
xquote = ''; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3648 |
if (is_own(attributes, a)) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3649 |
warning("Attribute '{a}' repeated.", nexttoken, a); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3650 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3651 |
if (a.slice(0, 2) === 'on') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3652 |
if (!option.on) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3653 |
warning("Avoid HTML event handlers."); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3654 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3655 |
xmode = 'scriptstring'; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3656 |
advance('='); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3657 |
q = nexttoken.id; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3658 |
if (q !== '"' && q !== "'") { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3659 |
error("Missing quote."); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3660 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3661 |
xquote = q; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3662 |
wmode = option.white; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3663 |
option.white = false; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3664 |
advance(q); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3665 |
statements('on'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3666 |
option.white = wmode; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3667 |
if (nexttoken.id !== q) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3668 |
error("Missing close quote on script attribute."); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3669 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3670 |
xmode = 'html'; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3671 |
xquote = ''; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3672 |
advance(q); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3673 |
v = false; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3674 |
} else if (a === 'style') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3675 |
xmode = 'scriptstring'; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3676 |
advance('='); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3677 |
q = nexttoken.id; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3678 |
if (q !== '"' && q !== "'") { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3679 |
error("Missing quote."); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3680 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3681 |
xmode = 'styleproperty'; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3682 |
xquote = q; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3683 |
advance(q); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3684 |
substyle(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3685 |
xmode = 'html'; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3686 |
xquote = ''; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3687 |
advance(q); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3688 |
v = false; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3689 |
} else { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3690 |
if (nexttoken.id === '=') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3691 |
advance('='); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3692 |
v = nexttoken.value; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3693 |
if (!nexttoken.identifier && |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3694 |
nexttoken.id !== '"' && |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3695 |
nexttoken.id !== '\'' && |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3696 |
nexttoken.type !== '(string)' && |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3697 |
nexttoken.type !== '(number)' && |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3698 |
nexttoken.type !== '(color)') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3699 |
warning("Expected an attribute value and instead saw '{a}'.", token, a); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3700 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3701 |
advance(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3702 |
} else { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3703 |
v = true; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3704 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3705 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3706 |
attributes[a] = v; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3707 |
doAttribute(n, a, v); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3708 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3709 |
doTag(n, attributes); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3710 |
if (!e) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3711 |
stack.push(t); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3712 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3713 |
xmode = 'outer'; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3714 |
advance('>'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3715 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3716 |
case '</': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3717 |
xmode = 'html'; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3718 |
advance('</'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3719 |
if (!nexttoken.identifier) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3720 |
warning("Bad identifier."); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3721 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3722 |
n = nexttoken.value; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3723 |
if (option.cap) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3724 |
n = n.toLowerCase(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3725 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3726 |
advance(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3727 |
if (!stack) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3728 |
error("Unexpected '{a}'.", nexttoken, closetag(n)); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3729 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3730 |
t = stack.pop(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3731 |
if (!t) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3732 |
error("Unexpected '{a}'.", nexttoken, closetag(n)); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3733 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3734 |
if (t.name !== n) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3735 |
error("Expected '{a}' and instead saw '{b}'.", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3736 |
nexttoken, closetag(t.name), closetag(n)); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3737 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3738 |
if (nexttoken.id !== '>') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3739 |
error("Missing '{a}'.", nexttoken, '>'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3740 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3741 |
xmode = 'outer'; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3742 |
advance('>'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3743 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3744 |
case '<!': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3745 |
if (option.safe) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3746 |
warning("ADsafe HTML violation."); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3747 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3748 |
xmode = 'html'; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3749 |
for (;;) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3750 |
advance(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3751 |
if (nexttoken.id === '>' || nexttoken.id === '(end)') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3752 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3753 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3754 |
if (nexttoken.value.indexOf('--') >= 0) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3755 |
warning("Unexpected --."); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3756 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3757 |
if (nexttoken.value.indexOf('<') >= 0) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3758 |
warning("Unexpected <."); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3759 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3760 |
if (nexttoken.value.indexOf('>') >= 0) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3761 |
warning("Unexpected >."); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3762 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3763 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3764 |
xmode = 'outer'; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3765 |
advance('>'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3766 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3767 |
case '(end)': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3768 |
return; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3769 |
default: |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3770 |
if (nexttoken.id === '(end)') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3771 |
error("Missing '{a}'.", nexttoken, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3772 |
'</' + stack[stack.length - 1].value + '>'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3773 |
} else { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3774 |
advance(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3775 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3776 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3777 |
if (stack && stack.length === 0 && (option.adsafe || |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3778 |
!option.fragment || nexttoken.id === '(end)')) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3779 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3780 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3781 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3782 |
if (nexttoken.id !== '(end)') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3783 |
error("Unexpected material after the end."); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3784 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3785 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3786 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3787 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3788 |
// Build the syntax table by declaring the syntactic elements of the language. |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3789 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3790 |
type('(number)', idValue); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3791 |
type('(string)', idValue); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3792 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3793 |
syntax['(identifier)'] = { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3794 |
type: '(identifier)', |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3795 |
lbp: 0, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3796 |
identifier: true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3797 |
nud: function () { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3798 |
var v = this.value, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3799 |
s = scope[v], |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3800 |
f; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3801 |
if (typeof s === 'function') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3802 |
s = undefined; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3803 |
} else if (typeof s === 'boolean') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3804 |
f = funct; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3805 |
funct = functions[0]; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3806 |
addlabel(v, 'var'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3807 |
s = funct; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3808 |
funct = f; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3809 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3810 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3811 |
// The name is in scope and defined in the current function. |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3812 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3813 |
if (funct === s) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3814 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3815 |
// Change 'unused' to 'var', and reject labels. |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3816 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3817 |
switch (funct[v]) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3818 |
case 'unused': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3819 |
funct[v] = 'var'; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3820 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3821 |
case 'label': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3822 |
warning("'{a}' is a statement label.", token, v); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3823 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3824 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3825 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3826 |
// The name is not defined in the function. If we are in the global scope, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3827 |
// then we have an undefined variable. |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3828 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3829 |
} else if (funct['(global)']) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3830 |
if (option.undef && predefined[v] !== 'boolean') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3831 |
warning("'{a}' is not defined.", token, v); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3832 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3833 |
note_implied(token); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3834 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3835 |
// If the name is already defined in the current |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3836 |
// function, but not as outer, then there is a scope error. |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3837 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3838 |
} else { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3839 |
switch (funct[v]) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3840 |
case 'closure': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3841 |
case 'function': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3842 |
case 'var': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3843 |
case 'unused': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3844 |
warning("'{a}' used out of scope.", token, v); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3845 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3846 |
case 'label': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3847 |
warning("'{a}' is a statement label.", token, v); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3848 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3849 |
case 'outer': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3850 |
case 'global': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3851 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3852 |
default: |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3853 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3854 |
// If the name is defined in an outer function, make an outer entry, and if |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3855 |
// it was unused, make it var. |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3856 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3857 |
if (s === true) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3858 |
funct[v] = true; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3859 |
} else if (typeof s !== 'object') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3860 |
if (option.undef) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3861 |
warning("'{a}' is not defined.", token, v); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3862 |
} else { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3863 |
funct[v] = true; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3864 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3865 |
note_implied(token); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3866 |
} else { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3867 |
switch (s[v]) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3868 |
case 'function': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3869 |
case 'var': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3870 |
case 'unused': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3871 |
s[v] = 'closure'; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3872 |
funct[v] = s['(global)'] ? 'global' : 'outer'; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3873 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3874 |
case 'closure': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3875 |
case 'parameter': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3876 |
funct[v] = s['(global)'] ? 'global' : 'outer'; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3877 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3878 |
case 'label': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3879 |
warning("'{a}' is a statement label.", token, v); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3880 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3881 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3882 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3883 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3884 |
return this; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3885 |
}, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3886 |
led: function () { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3887 |
error("Expected an operator and instead saw '{a}'.", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3888 |
nexttoken, nexttoken.value); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3889 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3890 |
}; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3891 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3892 |
type('(regexp)', function () { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3893 |
return this; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3894 |
}); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3895 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3896 |
delim('(endline)'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3897 |
delim('(begin)'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3898 |
delim('(end)').reach = true; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3899 |
delim('</').reach = true; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3900 |
delim('<!'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3901 |
delim('<!--'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3902 |
delim('-->'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3903 |
delim('(error)').reach = true; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3904 |
delim('}').reach = true; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3905 |
delim(')'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3906 |
delim(']'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3907 |
delim('"').reach = true; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3908 |
delim("'").reach = true; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3909 |
delim(';'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3910 |
delim(':').reach = true; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3911 |
delim(','); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3912 |
delim('#'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3913 |
delim('@'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3914 |
reserve('else'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3915 |
reserve('case').reach = true; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3916 |
reserve('catch'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3917 |
reserve('default').reach = true; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3918 |
reserve('finally'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3919 |
reservevar('arguments'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3920 |
reservevar('eval'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3921 |
reservevar('false'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3922 |
reservevar('Infinity'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3923 |
reservevar('NaN'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3924 |
reservevar('null'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3925 |
reservevar('this'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3926 |
reservevar('true'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3927 |
reservevar('undefined'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3928 |
assignop('=', 'assign', 20); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3929 |
assignop('+=', 'assignadd', 20); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3930 |
assignop('-=', 'assignsub', 20); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3931 |
assignop('*=', 'assignmult', 20); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3932 |
assignop('/=', 'assigndiv', 20).nud = function () { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3933 |
error("A regular expression literal can be confused with '/='."); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3934 |
}; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3935 |
assignop('%=', 'assignmod', 20); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3936 |
bitwiseassignop('&=', 'assignbitand', 20); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3937 |
bitwiseassignop('|=', 'assignbitor', 20); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3938 |
bitwiseassignop('^=', 'assignbitxor', 20); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3939 |
bitwiseassignop('<<=', 'assignshiftleft', 20); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3940 |
bitwiseassignop('>>=', 'assignshiftright', 20); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3941 |
bitwiseassignop('>>>=', 'assignshiftrightunsigned', 20); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3942 |
infix('?', function (left, that) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3943 |
that.left = left; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3944 |
that.right = parse(10); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3945 |
advance(':'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3946 |
that['else'] = parse(10); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3947 |
return that; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3948 |
}, 30); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3949 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3950 |
infix('||', 'or', 40); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3951 |
infix('&&', 'and', 50); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3952 |
bitwise('|', 'bitor', 70); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3953 |
bitwise('^', 'bitxor', 80); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3954 |
bitwise('&', 'bitand', 90); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3955 |
relation('==', function (left, right) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3956 |
if (option.eqeqeq) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3957 |
warning("Expected '{a}' and instead saw '{b}'.", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3958 |
this, '===', '=='); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3959 |
} else if (isPoorRelation(left)) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3960 |
warning("Use '{a}' to compare with '{b}'.", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3961 |
this, '===', left.value); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3962 |
} else if (isPoorRelation(right)) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3963 |
warning("Use '{a}' to compare with '{b}'.", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3964 |
this, '===', right.value); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3965 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3966 |
return this; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3967 |
}); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3968 |
relation('==='); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3969 |
relation('!=', function (left, right) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3970 |
if (option.eqeqeq) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3971 |
warning("Expected '{a}' and instead saw '{b}'.", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3972 |
this, '!==', '!='); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3973 |
} else if (isPoorRelation(left)) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3974 |
warning("Use '{a}' to compare with '{b}'.", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3975 |
this, '!==', left.value); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3976 |
} else if (isPoorRelation(right)) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3977 |
warning("Use '{a}' to compare with '{b}'.", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3978 |
this, '!==', right.value); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3979 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3980 |
return this; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3981 |
}); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3982 |
relation('!=='); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3983 |
relation('<'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3984 |
relation('>'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3985 |
relation('<='); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3986 |
relation('>='); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3987 |
bitwise('<<', 'shiftleft', 120); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3988 |
bitwise('>>', 'shiftright', 120); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3989 |
bitwise('>>>', 'shiftrightunsigned', 120); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3990 |
infix('in', 'in', 120); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3991 |
infix('instanceof', 'instanceof', 120); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3992 |
infix('+', function (left, that) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3993 |
var right = parse(130); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3994 |
if (left && right && left.id === '(string)' && right.id === '(string)') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3995 |
left.value += right.value; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3996 |
left.character = right.character; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3997 |
if (jx.test(left.value)) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3998 |
warning("JavaScript URL.", left); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
3999 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4000 |
return left; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4001 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4002 |
that.left = left; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4003 |
that.right = right; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4004 |
return that; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4005 |
}, 130); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4006 |
prefix('+', 'num'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4007 |
infix('-', 'sub', 130); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4008 |
prefix('-', 'neg'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4009 |
infix('*', 'mult', 140); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4010 |
infix('/', 'div', 140); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4011 |
infix('%', 'mod', 140); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4012 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4013 |
suffix('++', 'postinc'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4014 |
prefix('++', 'preinc'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4015 |
syntax['++'].exps = true; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4016 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4017 |
suffix('--', 'postdec'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4018 |
prefix('--', 'predec'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4019 |
syntax['--'].exps = true; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4020 |
prefix('delete', function () { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4021 |
var p = parse(0); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4022 |
if (!p || (p.id !== '.' && p.id !== '[')) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4023 |
warning("Expected '{a}' and instead saw '{b}'.", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4024 |
nexttoken, '.', nexttoken.value); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4025 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4026 |
}).exps = true; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4027 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4028 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4029 |
prefix('~', function () { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4030 |
if (option.bitwise) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4031 |
warning("Unexpected '{a}'.", this, '~'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4032 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4033 |
parse(150); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4034 |
return this; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4035 |
}); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4036 |
prefix('!', 'not'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4037 |
prefix('typeof', 'typeof'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4038 |
prefix('new', function () { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4039 |
var c = parse(155), i; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4040 |
if (c && c.id !== 'function') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4041 |
if (c.identifier) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4042 |
c['new'] = true; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4043 |
switch (c.value) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4044 |
case 'Object': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4045 |
warning("Use the object literal notation {}.", token); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4046 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4047 |
case 'Array': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4048 |
if (nexttoken.id !== '(') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4049 |
warning("Use the array literal notation [].", token); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4050 |
} else { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4051 |
advance('('); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4052 |
if (nexttoken.id === ')') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4053 |
warning("Use the array literal notation [].", token); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4054 |
} else { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4055 |
i = parse(0); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4056 |
c.dimension = i; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4057 |
if ((i.id === '(number)' && /[.+\-Ee]/.test(i.value)) || |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4058 |
(i.id === '-' && !i.right) || |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4059 |
i.id === '(string)' || i.id === '[' || |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4060 |
i.id === '{' || i.id === 'true' || |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4061 |
i.id === 'false' || |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4062 |
i.id === 'null' || i.id === 'undefined' || |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4063 |
i.id === 'Infinity') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4064 |
warning("Use the array literal notation [].", token); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4065 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4066 |
if (nexttoken.id !== ')') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4067 |
error("Use the array literal notation [].", token); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4068 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4069 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4070 |
advance(')'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4071 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4072 |
this.first = c; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4073 |
return this; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4074 |
case 'Number': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4075 |
case 'String': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4076 |
case 'Boolean': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4077 |
case 'Math': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4078 |
case 'JSON': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4079 |
warning("Do not use {a} as a constructor.", token, c.value); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4080 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4081 |
case 'Function': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4082 |
if (!option.evil) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4083 |
warning("The Function constructor is eval."); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4084 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4085 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4086 |
case 'Date': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4087 |
case 'RegExp': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4088 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4089 |
default: |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4090 |
if (c.id !== 'function') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4091 |
i = c.value.substr(0, 1); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4092 |
if (option.newcap && (i < 'A' || i > 'Z')) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4093 |
warning( |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4094 |
"A constructor name should start with an uppercase letter.", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4095 |
token); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4096 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4097 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4098 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4099 |
} else { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4100 |
if (c.id !== '.' && c.id !== '[' && c.id !== '(') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4101 |
warning("Bad constructor.", token); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4102 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4103 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4104 |
} else { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4105 |
warning("Weird construction. Delete 'new'.", this); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4106 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4107 |
adjacent(token, nexttoken); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4108 |
if (nexttoken.id !== '(') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4109 |
warning("Missing '()' invoking a constructor."); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4110 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4111 |
this.first = c; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4112 |
return this; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4113 |
}); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4114 |
syntax['new'].exps = true; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4115 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4116 |
infix('.', function (left, that) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4117 |
adjacent(prevtoken, token); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4118 |
var m = identifier(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4119 |
if (typeof m === 'string') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4120 |
countMember(m); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4121 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4122 |
that.left = left; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4123 |
that.right = m; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4124 |
if (!option.evil && left && left.value === 'document' && |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4125 |
(m === 'write' || m === 'writeln')) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4126 |
warning("document.write can be a form of eval.", left); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4127 |
} else if (option.adsafe) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4128 |
if (left && left.value === 'ADSAFE') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4129 |
if (m === 'id' || m === 'lib') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4130 |
warning("ADsafe violation.", that); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4131 |
} else if (m === 'go') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4132 |
if (xmode !== 'script') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4133 |
warning("ADsafe violation.", that); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4134 |
} else if (adsafe_went || nexttoken.id !== '(' || |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4135 |
peek(0).id !== '(string)' || |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4136 |
peek(0).value !== adsafe_id || |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4137 |
peek(1).id !== ',') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4138 |
error("ADsafe violation: go.", that); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4139 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4140 |
adsafe_went = true; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4141 |
adsafe_may = false; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4142 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4143 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4144 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4145 |
if (!option.evil && (m === 'eval' || m === 'execScript')) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4146 |
warning('eval is evil.'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4147 |
} else if (option.safe) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4148 |
for (;;) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4149 |
if (banned[m] === true) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4150 |
warning("ADsafe restricted word '{a}'.", token, m); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4151 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4152 |
if (typeof predefined[left.value] !== 'boolean' || |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4153 |
nexttoken.id === '(') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4154 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4155 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4156 |
if (standard_member[m] === true) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4157 |
if (nexttoken.id === '.') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4158 |
warning("ADsafe violation.", that); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4159 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4160 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4161 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4162 |
if (nexttoken.id !== '.') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4163 |
warning("ADsafe violation.", that); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4164 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4165 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4166 |
advance('.'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4167 |
token.left = that; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4168 |
token.right = m; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4169 |
that = token; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4170 |
m = identifier(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4171 |
if (typeof m === 'string') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4172 |
countMember(m); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4173 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4174 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4175 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4176 |
return that; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4177 |
}, 160, true); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4178 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4179 |
infix('(', function (left, that) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4180 |
adjacent(prevtoken, token); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4181 |
nospace(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4182 |
var n = 0, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4183 |
p = []; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4184 |
if (left) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4185 |
if (left.type === '(identifier)') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4186 |
if (left.value.match(/^[A-Z]([A-Z0-9_$]*[a-z][A-Za-z0-9_$]*)?$/)) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4187 |
if (left.value !== 'Number' && left.value !== 'String' && |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4188 |
left.value !== 'Boolean' && |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4189 |
left.value !== 'Date') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4190 |
if (left.value === 'Math') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4191 |
warning("Math is not a function.", left); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4192 |
} else if (option.newcap) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4193 |
warning( |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4194 |
"Missing 'new' prefix when invoking a constructor.", left); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4195 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4196 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4197 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4198 |
} else if (left.id === '.') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4199 |
if (option.safe && left.left.value === 'Math' && |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4200 |
left.right === 'random') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4201 |
warning("ADsafe violation.", left); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4202 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4203 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4204 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4205 |
if (nexttoken.id !== ')') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4206 |
for (;;) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4207 |
p[p.length] = parse(10); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4208 |
n += 1; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4209 |
if (nexttoken.id !== ',') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4210 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4211 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4212 |
comma(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4213 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4214 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4215 |
advance(')'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4216 |
if (option.immed && left.id === 'function' && nexttoken.id !== ')') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4217 |
warning("Wrap the entire immediate function invocation in parens.", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4218 |
that); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4219 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4220 |
nospace(prevtoken, token); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4221 |
if (typeof left === 'object') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4222 |
if (left.value === 'parseInt' && n === 1) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4223 |
warning("Missing radix parameter.", left); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4224 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4225 |
if (!option.evil) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4226 |
if (left.value === 'eval' || left.value === 'Function' || |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4227 |
left.value === 'execScript') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4228 |
warning("eval is evil.", left); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4229 |
} else if (p[0] && p[0].id === '(string)' && |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4230 |
(left.value === 'setTimeout' || |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4231 |
left.value === 'setInterval')) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4232 |
warning( |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4233 |
"Implied eval is evil. Pass a function instead of a string.", left); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4234 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4235 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4236 |
if (!left.identifier && left.id !== '.' && left.id !== '[' && |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4237 |
left.id !== '(' && left.id !== '&&' && left.id !== '||' && |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4238 |
left.id !== '?') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4239 |
warning("Bad invocation.", left); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4240 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4241 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4242 |
that.left = left; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4243 |
return that; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4244 |
}, 155, true).exps = true; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4245 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4246 |
prefix('(', function () { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4247 |
nospace(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4248 |
var v = parse(0); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4249 |
advance(')', this); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4250 |
nospace(prevtoken, token); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4251 |
if (option.immed && v.id === 'function') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4252 |
if (nexttoken.id === '(') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4253 |
warning( |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4254 |
"Move the invocation into the parens that contain the function.", nexttoken); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4255 |
} else { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4256 |
warning( |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4257 |
"Do not wrap function literals in parens unless they are to be immediately invoked.", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4258 |
this); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4259 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4260 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4261 |
return v; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4262 |
}); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4263 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4264 |
infix('[', function (left, that) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4265 |
nospace(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4266 |
var e = parse(0), s; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4267 |
if (e && e.type === '(string)') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4268 |
if (option.safe && banned[e.value] === true) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4269 |
warning("ADsafe restricted word '{a}'.", that, e.value); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4270 |
} else if (!option.evil && |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4271 |
(e.value === 'eval' || e.value === 'execScript')) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4272 |
warning("eval is evil.", that); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4273 |
} else if (option.safe && |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4274 |
(e.value.charAt(0) === '_' || e.value.charAt(0) === '-')) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4275 |
warning("ADsafe restricted subscript '{a}'.", that, e.value); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4276 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4277 |
countMember(e.value); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4278 |
if (!option.sub && ix.test(e.value)) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4279 |
s = syntax[e.value]; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4280 |
if (!s || !s.reserved) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4281 |
warning("['{a}'] is better written in dot notation.", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4282 |
e, e.value); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4283 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4284 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4285 |
} else if (!e || e.type !== '(number)' || e.value < 0) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4286 |
if (option.safe) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4287 |
warning('ADsafe subscripting.'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4288 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4289 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4290 |
advance(']', that); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4291 |
nospace(prevtoken, token); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4292 |
that.left = left; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4293 |
that.right = e; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4294 |
return that; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4295 |
}, 160, true); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4296 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4297 |
prefix('[', function () { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4298 |
this.first = []; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4299 |
if (nexttoken.id === ']') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4300 |
advance(']'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4301 |
return this; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4302 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4303 |
var b = token.line !== nexttoken.line; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4304 |
if (b) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4305 |
indent += option.indent; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4306 |
if (nexttoken.from === indent + option.indent) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4307 |
indent += option.indent; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4308 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4309 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4310 |
for (;;) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4311 |
if (b && token.line !== nexttoken.line) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4312 |
indentation(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4313 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4314 |
parse(10); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4315 |
if (nexttoken.id === ',') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4316 |
comma(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4317 |
if (nexttoken.id === ',') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4318 |
warning("Extra comma.", token); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4319 |
} else if (nexttoken.id === ']') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4320 |
warning("Extra comma.", token); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4321 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4322 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4323 |
} else { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4324 |
if (b) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4325 |
indent -= option.indent; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4326 |
indentation(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4327 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4328 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4329 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4330 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4331 |
advance(']', this); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4332 |
return this; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4333 |
}, 160); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4334 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4335 |
(function (x) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4336 |
x.nud = function () { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4337 |
var b, i, s, seen = {}; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4338 |
b = token.line !== nexttoken.line; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4339 |
if (b) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4340 |
indent += option.indent; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4341 |
if (nexttoken.from === indent + option.indent) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4342 |
indent += option.indent; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4343 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4344 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4345 |
for (;;) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4346 |
if (nexttoken.id === '}') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4347 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4348 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4349 |
if (b) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4350 |
indentation(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4351 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4352 |
i = optionalidentifier(true); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4353 |
if (!i) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4354 |
if (nexttoken.id === '(string)') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4355 |
i = nexttoken.value; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4356 |
if (ix.test(i)) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4357 |
s = syntax[i]; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4358 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4359 |
advance(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4360 |
} else if (nexttoken.id === '(number)') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4361 |
i = nexttoken.value.toString(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4362 |
advance(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4363 |
} else { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4364 |
error("Expected '{a}' and instead saw '{b}'.", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4365 |
nexttoken, '}', nexttoken.value); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4366 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4367 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4368 |
if (seen[i] === true) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4369 |
warning("Duplicate member '{a}'.", nexttoken, i); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4370 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4371 |
seen[i] = true; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4372 |
countMember(i); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4373 |
advance(':'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4374 |
nonadjacent(token, nexttoken); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4375 |
parse(10); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4376 |
if (nexttoken.id === ',') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4377 |
comma(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4378 |
if (nexttoken.id === ',' || nexttoken.id === '}') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4379 |
warning("Extra comma.", token); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4380 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4381 |
} else { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4382 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4383 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4384 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4385 |
if (b) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4386 |
indent -= option.indent; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4387 |
indentation(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4388 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4389 |
advance('}', this); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4390 |
return this; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4391 |
}; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4392 |
x.fud = function () { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4393 |
error("Expected to see a statement and instead saw a block.", token); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4394 |
}; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4395 |
}(delim('{'))); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4396 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4397 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4398 |
function varstatement(prefix) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4399 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4400 |
// JavaScript does not have block scope. It only has function scope. So, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4401 |
// declaring a variable in a block can have unexpected consequences. |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4402 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4403 |
var id, name, value; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4404 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4405 |
if (funct['(onevar)'] && option.onevar) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4406 |
warning("Too many var statements."); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4407 |
} else if (!funct['(global)']) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4408 |
funct['(onevar)'] = true; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4409 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4410 |
this.first = []; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4411 |
for (;;) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4412 |
nonadjacent(token, nexttoken); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4413 |
id = identifier(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4414 |
if (funct['(global)'] && predefined[id] === false) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4415 |
warning("Redefinition of '{a}'.", token, id); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4416 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4417 |
addlabel(id, 'unused'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4418 |
if (prefix) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4419 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4420 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4421 |
name = token; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4422 |
this.first.push(token); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4423 |
if (nexttoken.id === '=') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4424 |
nonadjacent(token, nexttoken); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4425 |
advance('='); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4426 |
nonadjacent(token, nexttoken); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4427 |
if (peek(0).id === '=' && nexttoken.identifier) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4428 |
error("Variable {a} was not declared correctly.", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4429 |
nexttoken, nexttoken.value); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4430 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4431 |
value = parse(0); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4432 |
name.first = value; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4433 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4434 |
if (nexttoken.id !== ',') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4435 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4436 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4437 |
comma(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4438 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4439 |
return this; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4440 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4441 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4442 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4443 |
stmt('var', varstatement); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4444 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4445 |
stmt('new', function () { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4446 |
warning("'new' should not be used as a statement."); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4447 |
}); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4448 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4449 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4450 |
function functionparams() { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4451 |
var i, t = nexttoken, p = []; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4452 |
advance('('); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4453 |
nospace(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4454 |
if (nexttoken.id === ')') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4455 |
advance(')'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4456 |
nospace(prevtoken, token); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4457 |
return; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4458 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4459 |
for (;;) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4460 |
i = identifier(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4461 |
p.push(i); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4462 |
addlabel(i, 'parameter'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4463 |
if (nexttoken.id === ',') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4464 |
comma(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4465 |
} else { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4466 |
advance(')', t); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4467 |
nospace(prevtoken, token); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4468 |
return p; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4469 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4470 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4471 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4472 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4473 |
function doFunction(i) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4474 |
var s = scope; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4475 |
scope = Object.create(s); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4476 |
funct = { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4477 |
'(name)' : i || '"' + anonname + '"', |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4478 |
'(line)' : nexttoken.line, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4479 |
'(context)' : funct, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4480 |
'(breakage)': 0, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4481 |
'(loopage)' : 0, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4482 |
'(scope)' : scope |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4483 |
}; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4484 |
token.funct = funct; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4485 |
functions.push(funct); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4486 |
if (i) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4487 |
addlabel(i, 'function'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4488 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4489 |
funct['(params)'] = functionparams(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4490 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4491 |
block(false); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4492 |
scope = s; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4493 |
funct['(last)'] = token.line; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4494 |
funct = funct['(context)']; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4495 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4496 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4497 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4498 |
blockstmt('function', function () { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4499 |
if (inblock) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4500 |
warning( |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4501 |
"Function statements cannot be placed in blocks. Use a function expression or move the statement to the top of the outer function.", token); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4502 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4503 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4504 |
var i = identifier(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4505 |
adjacent(token, nexttoken); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4506 |
addlabel(i, 'unused'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4507 |
doFunction(i); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4508 |
if (nexttoken.id === '(' && nexttoken.line === token.line) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4509 |
error( |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4510 |
"Function statements are not invocable. Wrap the whole function invocation in parens."); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4511 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4512 |
}); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4513 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4514 |
prefix('function', function () { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4515 |
var i = optionalidentifier(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4516 |
if (i) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4517 |
adjacent(token, nexttoken); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4518 |
} else { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4519 |
nonadjacent(token, nexttoken); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4520 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4521 |
doFunction(i); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4522 |
if (funct['(loopage)'] && nexttoken.id !== '(') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4523 |
warning("Be careful when making functions within a loop. Consider putting the function in a closure."); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4524 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4525 |
return this; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4526 |
}); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4527 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4528 |
blockstmt('if', function () { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4529 |
var t = nexttoken; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4530 |
advance('('); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4531 |
nonadjacent(this, t); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4532 |
nospace(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4533 |
parse(20); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4534 |
if (nexttoken.id === '=') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4535 |
warning("Expected a conditional expression and instead saw an assignment."); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4536 |
advance('='); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4537 |
parse(20); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4538 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4539 |
advance(')', t); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4540 |
nospace(prevtoken, token); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4541 |
block(true); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4542 |
if (nexttoken.id === 'else') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4543 |
nonadjacent(token, nexttoken); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4544 |
advance('else'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4545 |
if (nexttoken.id === 'if' || nexttoken.id === 'switch') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4546 |
statement(true); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4547 |
} else { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4548 |
block(true); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4549 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4550 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4551 |
return this; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4552 |
}); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4553 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4554 |
blockstmt('try', function () { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4555 |
var b, e, s; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4556 |
if (option.adsafe) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4557 |
warning("ADsafe try violation.", this); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4558 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4559 |
block(false); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4560 |
if (nexttoken.id === 'catch') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4561 |
advance('catch'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4562 |
nonadjacent(token, nexttoken); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4563 |
advance('('); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4564 |
s = scope; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4565 |
scope = Object.create(s); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4566 |
e = nexttoken.value; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4567 |
if (nexttoken.type !== '(identifier)') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4568 |
warning("Expected an identifier and instead saw '{a}'.", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4569 |
nexttoken, e); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4570 |
} else { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4571 |
addlabel(e, 'exception'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4572 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4573 |
advance(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4574 |
advance(')'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4575 |
block(false); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4576 |
b = true; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4577 |
scope = s; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4578 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4579 |
if (nexttoken.id === 'finally') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4580 |
advance('finally'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4581 |
block(false); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4582 |
return; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4583 |
} else if (!b) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4584 |
error("Expected '{a}' and instead saw '{b}'.", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4585 |
nexttoken, 'catch', nexttoken.value); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4586 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4587 |
}); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4588 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4589 |
blockstmt('while', function () { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4590 |
var t = nexttoken; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4591 |
funct['(breakage)'] += 1; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4592 |
funct['(loopage)'] += 1; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4593 |
advance('('); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4594 |
nonadjacent(this, t); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4595 |
nospace(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4596 |
parse(20); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4597 |
if (nexttoken.id === '=') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4598 |
warning("Expected a conditional expression and instead saw an assignment."); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4599 |
advance('='); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4600 |
parse(20); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4601 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4602 |
advance(')', t); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4603 |
nospace(prevtoken, token); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4604 |
block(true); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4605 |
funct['(breakage)'] -= 1; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4606 |
funct['(loopage)'] -= 1; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4607 |
}).labelled = true; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4608 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4609 |
reserve('with'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4610 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4611 |
blockstmt('switch', function () { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4612 |
var t = nexttoken, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4613 |
g = false; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4614 |
funct['(breakage)'] += 1; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4615 |
advance('('); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4616 |
nonadjacent(this, t); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4617 |
nospace(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4618 |
this.condition = parse(20); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4619 |
advance(')', t); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4620 |
nospace(prevtoken, token); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4621 |
nonadjacent(token, nexttoken); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4622 |
t = nexttoken; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4623 |
advance('{'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4624 |
nonadjacent(token, nexttoken); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4625 |
indent += option.indent; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4626 |
this.cases = []; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4627 |
for (;;) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4628 |
switch (nexttoken.id) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4629 |
case 'case': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4630 |
switch (funct['(verb)']) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4631 |
case 'break': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4632 |
case 'case': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4633 |
case 'continue': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4634 |
case 'return': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4635 |
case 'switch': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4636 |
case 'throw': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4637 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4638 |
default: |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4639 |
warning( |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4640 |
"Expected a 'break' statement before 'case'.", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4641 |
token); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4642 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4643 |
indentation(-option.indent); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4644 |
advance('case'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4645 |
this.cases.push(parse(20)); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4646 |
g = true; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4647 |
advance(':'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4648 |
funct['(verb)'] = 'case'; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4649 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4650 |
case 'default': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4651 |
switch (funct['(verb)']) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4652 |
case 'break': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4653 |
case 'continue': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4654 |
case 'return': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4655 |
case 'throw': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4656 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4657 |
default: |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4658 |
warning( |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4659 |
"Expected a 'break' statement before 'default'.", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4660 |
token); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4661 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4662 |
indentation(-option.indent); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4663 |
advance('default'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4664 |
g = true; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4665 |
advance(':'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4666 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4667 |
case '}': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4668 |
indent -= option.indent; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4669 |
indentation(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4670 |
advance('}', t); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4671 |
if (this.cases.length === 1 || this.condition.id === 'true' || |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4672 |
this.condition.id === 'false') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4673 |
warning("This 'switch' should be an 'if'.", this); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4674 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4675 |
funct['(breakage)'] -= 1; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4676 |
funct['(verb)'] = undefined; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4677 |
return; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4678 |
case '(end)': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4679 |
error("Missing '{a}'.", nexttoken, '}'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4680 |
return; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4681 |
default: |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4682 |
if (g) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4683 |
switch (token.id) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4684 |
case ',': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4685 |
error("Each value should have its own case label."); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4686 |
return; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4687 |
case ':': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4688 |
statements(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4689 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4690 |
default: |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4691 |
error("Missing ':' on a case clause.", token); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4692 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4693 |
} else { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4694 |
error("Expected '{a}' and instead saw '{b}'.", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4695 |
nexttoken, 'case', nexttoken.value); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4696 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4697 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4698 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4699 |
}).labelled = true; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4700 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4701 |
stmt('debugger', function () { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4702 |
if (!option.debug) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4703 |
warning("All 'debugger' statements should be removed."); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4704 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4705 |
}); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4706 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4707 |
stmt('do', function () { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4708 |
funct['(breakage)'] += 1; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4709 |
funct['(loopage)'] += 1; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4710 |
block(true); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4711 |
advance('while'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4712 |
var t = nexttoken; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4713 |
nonadjacent(token, t); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4714 |
advance('('); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4715 |
nospace(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4716 |
parse(20); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4717 |
if (nexttoken.id === '=') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4718 |
warning("Expected a conditional expression and instead saw an assignment."); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4719 |
advance('='); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4720 |
parse(20); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4721 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4722 |
advance(')', t); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4723 |
nospace(prevtoken, token); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4724 |
funct['(breakage)'] -= 1; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4725 |
funct['(loopage)'] -= 1; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4726 |
}).labelled = true; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4727 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4728 |
blockstmt('for', function () { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4729 |
var s, t = nexttoken; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4730 |
funct['(breakage)'] += 1; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4731 |
funct['(loopage)'] += 1; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4732 |
advance('('); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4733 |
nonadjacent(this, t); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4734 |
nospace(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4735 |
if (peek(nexttoken.id === 'var' ? 1 : 0).id === 'in') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4736 |
if (nexttoken.id === 'var') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4737 |
advance('var'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4738 |
varstatement(true); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4739 |
} else { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4740 |
switch (funct[nexttoken.value]) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4741 |
case 'unused': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4742 |
funct[nexttoken.value] = 'var'; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4743 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4744 |
case 'var': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4745 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4746 |
default: |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4747 |
warning("Bad for in variable '{a}'.", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4748 |
nexttoken, nexttoken.value); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4749 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4750 |
advance(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4751 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4752 |
advance('in'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4753 |
parse(20); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4754 |
advance(')', t); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4755 |
s = block(true); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4756 |
if (!option.forin && (s.length > 1 || typeof s[0] !== 'object' || |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4757 |
s[0].value !== 'if')) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4758 |
warning("The body of a for in should be wrapped in an if statement to filter unwanted properties from the prototype.", this); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4759 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4760 |
funct['(breakage)'] -= 1; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4761 |
funct['(loopage)'] -= 1; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4762 |
return this; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4763 |
} else { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4764 |
if (nexttoken.id !== ';') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4765 |
if (nexttoken.id === 'var') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4766 |
advance('var'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4767 |
varstatement(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4768 |
} else { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4769 |
for (;;) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4770 |
parse(0, 'for'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4771 |
if (nexttoken.id !== ',') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4772 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4773 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4774 |
comma(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4775 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4776 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4777 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4778 |
nolinebreak(token); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4779 |
advance(';'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4780 |
if (nexttoken.id !== ';') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4781 |
parse(20); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4782 |
if (nexttoken.id === '=') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4783 |
warning("Expected a conditional expression and instead saw an assignment."); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4784 |
advance('='); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4785 |
parse(20); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4786 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4787 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4788 |
nolinebreak(token); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4789 |
advance(';'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4790 |
if (nexttoken.id === ';') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4791 |
error("Expected '{a}' and instead saw '{b}'.", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4792 |
nexttoken, ')', ';'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4793 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4794 |
if (nexttoken.id !== ')') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4795 |
for (;;) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4796 |
parse(0, 'for'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4797 |
if (nexttoken.id !== ',') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4798 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4799 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4800 |
comma(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4801 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4802 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4803 |
advance(')', t); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4804 |
nospace(prevtoken, token); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4805 |
block(true); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4806 |
funct['(breakage)'] -= 1; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4807 |
funct['(loopage)'] -= 1; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4808 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4809 |
}).labelled = true; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4810 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4811 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4812 |
stmt('break', function () { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4813 |
var v = nexttoken.value; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4814 |
if (funct['(breakage)'] === 0) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4815 |
warning("Unexpected '{a}'.", nexttoken, this.value); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4816 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4817 |
nolinebreak(this); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4818 |
if (nexttoken.id !== ';') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4819 |
if (token.line === nexttoken.line) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4820 |
if (funct[v] !== 'label') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4821 |
warning("'{a}' is not a statement label.", nexttoken, v); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4822 |
} else if (scope[v] !== funct) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4823 |
warning("'{a}' is out of scope.", nexttoken, v); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4824 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4825 |
advance(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4826 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4827 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4828 |
reachable('break'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4829 |
}); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4830 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4831 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4832 |
stmt('continue', function () { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4833 |
var v = nexttoken.value; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4834 |
if (funct['(breakage)'] === 0) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4835 |
warning("Unexpected '{a}'.", nexttoken, this.value); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4836 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4837 |
nolinebreak(this); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4838 |
if (nexttoken.id !== ';') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4839 |
if (token.line === nexttoken.line) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4840 |
if (funct[v] !== 'label') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4841 |
warning("'{a}' is not a statement label.", nexttoken, v); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4842 |
} else if (scope[v] !== funct) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4843 |
warning("'{a}' is out of scope.", nexttoken, v); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4844 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4845 |
advance(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4846 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4847 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4848 |
reachable('continue'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4849 |
}); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4850 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4851 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4852 |
stmt('return', function () { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4853 |
nolinebreak(this); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4854 |
if (nexttoken.id === '(regexp)') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4855 |
warning("Wrap the /regexp/ literal in parens to disambiguate the slash operator."); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4856 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4857 |
if (nexttoken.id !== ';' && !nexttoken.reach) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4858 |
nonadjacent(token, nexttoken); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4859 |
parse(20); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4860 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4861 |
reachable('return'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4862 |
}); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4863 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4864 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4865 |
stmt('throw', function () { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4866 |
nolinebreak(this); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4867 |
nonadjacent(token, nexttoken); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4868 |
parse(20); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4869 |
reachable('throw'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4870 |
}); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4871 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4872 |
reserve('void'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4873 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4874 |
// Superfluous reserved words |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4875 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4876 |
reserve('class'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4877 |
reserve('const'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4878 |
reserve('enum'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4879 |
reserve('export'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4880 |
reserve('extends'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4881 |
reserve('import'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4882 |
reserve('super'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4883 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4884 |
reserve('let'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4885 |
reserve('yield'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4886 |
reserve('implements'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4887 |
reserve('interface'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4888 |
reserve('package'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4889 |
reserve('private'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4890 |
reserve('protected'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4891 |
reserve('public'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4892 |
reserve('static'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4893 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4894 |
function jsonValue() { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4895 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4896 |
function jsonObject() { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4897 |
var o = {}, t = nexttoken; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4898 |
advance('{'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4899 |
if (nexttoken.id !== '}') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4900 |
for (;;) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4901 |
if (nexttoken.id === '(end)') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4902 |
error("Missing '}' to match '{' from line {a}.", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4903 |
nexttoken, t.line); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4904 |
} else if (nexttoken.id === '}') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4905 |
warning("Unexpected comma.", token); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4906 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4907 |
} else if (nexttoken.id === ',') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4908 |
error("Unexpected comma.", nexttoken); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4909 |
} else if (nexttoken.id !== '(string)') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4910 |
warning("Expected a string and instead saw {a}.", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4911 |
nexttoken, nexttoken.value); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4912 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4913 |
if (o[nexttoken.value] === true) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4914 |
warning("Duplicate key '{a}'.", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4915 |
nexttoken, nexttoken.value); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4916 |
} else if (nexttoken.value === '__proto__') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4917 |
warning("Stupid key '{a}'.", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4918 |
nexttoken, nexttoken.value); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4919 |
} else { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4920 |
o[nexttoken.value] = true; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4921 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4922 |
advance(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4923 |
advance(':'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4924 |
jsonValue(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4925 |
if (nexttoken.id !== ',') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4926 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4927 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4928 |
advance(','); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4929 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4930 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4931 |
advance('}'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4932 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4933 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4934 |
function jsonArray() { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4935 |
var t = nexttoken; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4936 |
advance('['); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4937 |
if (nexttoken.id !== ']') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4938 |
for (;;) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4939 |
if (nexttoken.id === '(end)') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4940 |
error("Missing ']' to match '[' from line {a}.", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4941 |
nexttoken, t.line); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4942 |
} else if (nexttoken.id === ']') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4943 |
warning("Unexpected comma.", token); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4944 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4945 |
} else if (nexttoken.id === ',') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4946 |
error("Unexpected comma.", nexttoken); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4947 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4948 |
jsonValue(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4949 |
if (nexttoken.id !== ',') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4950 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4951 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4952 |
advance(','); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4953 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4954 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4955 |
advance(']'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4956 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4957 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4958 |
switch (nexttoken.id) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4959 |
case '{': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4960 |
jsonObject(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4961 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4962 |
case '[': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4963 |
jsonArray(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4964 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4965 |
case 'true': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4966 |
case 'false': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4967 |
case 'null': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4968 |
case '(number)': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4969 |
case '(string)': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4970 |
advance(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4971 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4972 |
case '-': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4973 |
advance('-'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4974 |
if (token.character !== nexttoken.from) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4975 |
warning("Unexpected space after '-'.", token); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4976 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4977 |
adjacent(token, nexttoken); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4978 |
advance('(number)'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4979 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4980 |
default: |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4981 |
error("Expected a JSON value.", nexttoken); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4982 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4983 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4984 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4985 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4986 |
// The actual JSLINT function itself. |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4987 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4988 |
var itself = function (s, o) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4989 |
var a, i; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4990 |
JSLINT.errors = []; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4991 |
predefined = Object.create(standard); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4992 |
if (o) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4993 |
a = o.predef; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4994 |
if (a instanceof Array) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4995 |
for (i = 0; i < a.length; i += 1) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4996 |
predefined[a[i]] = true; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4997 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4998 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
4999 |
if (o.adsafe) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5000 |
o.safe = true; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5001 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5002 |
if (o.safe) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5003 |
o.browser = false; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5004 |
o.css = false; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5005 |
o.debug = false; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5006 |
o.eqeqeq = true; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5007 |
o.evil = false; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5008 |
o.forin = false; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5009 |
o.nomen = true; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5010 |
o.on = false; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5011 |
o.rhino = false; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5012 |
o.safe = true; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5013 |
o.sidebar = false; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5014 |
o.strict = true; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5015 |
o.sub = false; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5016 |
o.undef = true; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5017 |
o.widget = false; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5018 |
predefined.Date = null; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5019 |
predefined['eval'] = null; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5020 |
predefined.Function = null; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5021 |
predefined.Object = null; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5022 |
predefined.ADSAFE = false; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5023 |
predefined.lib = false; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5024 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5025 |
option = o; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5026 |
} else { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5027 |
option = {}; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5028 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5029 |
option.indent = option.indent || 4; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5030 |
option.maxerr = option.maxerr || 50; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5031 |
adsafe_id = ''; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5032 |
adsafe_may = false; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5033 |
adsafe_went = false; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5034 |
approved = {}; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5035 |
if (option.approved) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5036 |
for (i = 0; i < option.approved.length; i += 1) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5037 |
approved[option.approved[i]] = option.approved[i]; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5038 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5039 |
} else { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5040 |
approved.test = 'test'; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5041 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5042 |
tab = ''; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5043 |
for (i = 0; i < option.indent; i += 1) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5044 |
tab += ' '; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5045 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5046 |
indent = 1; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5047 |
global = Object.create(predefined); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5048 |
scope = global; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5049 |
funct = { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5050 |
'(global)': true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5051 |
'(name)': '(global)', |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5052 |
'(scope)': scope, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5053 |
'(breakage)': 0, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5054 |
'(loopage)': 0 |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5055 |
}; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5056 |
functions = [funct]; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5057 |
ids = {}; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5058 |
urls = []; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5059 |
src = false; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5060 |
xmode = false; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5061 |
stack = null; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5062 |
member = {}; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5063 |
membersOnly = null; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5064 |
implied = {}; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5065 |
inblock = false; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5066 |
lookahead = []; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5067 |
jsonmode = false; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5068 |
warnings = 0; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5069 |
lex.init(s); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5070 |
prereg = true; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5071 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5072 |
prevtoken = token = nexttoken = syntax['(begin)']; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5073 |
assume(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5074 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5075 |
try { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5076 |
advance(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5077 |
if (nexttoken.value.charAt(0) === '<') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5078 |
html(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5079 |
if (option.adsafe && !adsafe_went) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5080 |
warning("ADsafe violation: Missing ADSAFE.go.", this); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5081 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5082 |
} else { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5083 |
switch (nexttoken.id) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5084 |
case '{': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5085 |
case '[': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5086 |
option.laxbreak = true; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5087 |
jsonmode = true; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5088 |
jsonValue(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5089 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5090 |
case '@': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5091 |
case '*': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5092 |
case '#': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5093 |
case '.': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5094 |
case ':': |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5095 |
xmode = 'style'; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5096 |
advance(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5097 |
if (token.id !== '@' || !nexttoken.identifier || |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5098 |
nexttoken.value !== 'charset' || token.line !== 1 || |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5099 |
token.from !== 1) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5100 |
error('A css file should begin with @charset "UTF-8";'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5101 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5102 |
advance(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5103 |
if (nexttoken.type !== '(string)' && |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5104 |
nexttoken.value !== 'UTF-8') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5105 |
error('A css file should begin with @charset "UTF-8";'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5106 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5107 |
advance(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5108 |
advance(';'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5109 |
styles(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5110 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5111 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5112 |
default: |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5113 |
if (option.adsafe && option.fragment) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5114 |
error("Expected '{a}' and instead saw '{b}'.", |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5115 |
nexttoken, '<div>', nexttoken.value); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5116 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5117 |
statements('lib'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5118 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5119 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5120 |
advance('(end)'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5121 |
} catch (e) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5122 |
if (e) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5123 |
JSLINT.errors.push({ |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5124 |
reason : e.message, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5125 |
line : e.line || nexttoken.line, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5126 |
character : e.character || nexttoken.from |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5127 |
}, null); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5128 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5129 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5130 |
return JSLINT.errors.length === 0; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5131 |
}; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5132 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5133 |
function is_array(o) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5134 |
return Object.prototype.toString.apply(o) === '[object Array]'; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5135 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5136 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5137 |
function to_array(o) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5138 |
var a = [], k; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5139 |
for (k in o) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5140 |
if (is_own(o, k)) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5141 |
a.push(k); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5142 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5143 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5144 |
return a; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5145 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5146 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5147 |
// Data summary. |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5148 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5149 |
itself.data = function () { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5150 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5151 |
var data = {functions: []}, fu, globals, implieds = [], f, i, j, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5152 |
members = [], n, unused = [], v; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5153 |
if (itself.errors.length) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5154 |
data.errors = itself.errors; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5155 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5156 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5157 |
if (jsonmode) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5158 |
data.json = true; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5159 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5160 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5161 |
for (n in implied) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5162 |
if (is_own(implied, n)) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5163 |
implieds.push({ |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5164 |
name: n, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5165 |
line: implied[n] |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5166 |
}); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5167 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5168 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5169 |
if (implieds.length > 0) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5170 |
data.implieds = implieds; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5171 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5172 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5173 |
if (urls.length > 0) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5174 |
data.urls = urls; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5175 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5176 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5177 |
globals = to_array(scope); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5178 |
if (globals.length > 0) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5179 |
data.globals = globals; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5180 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5181 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5182 |
for (i = 1; i < functions.length; i += 1) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5183 |
f = functions[i]; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5184 |
fu = {}; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5185 |
for (j = 0; j < functionicity.length; j += 1) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5186 |
fu[functionicity[j]] = []; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5187 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5188 |
for (n in f) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5189 |
if (is_own(f, n) && n.charAt(0) !== '(') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5190 |
v = f[n]; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5191 |
if (is_array(fu[v])) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5192 |
fu[v].push(n); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5193 |
if (v === 'unused') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5194 |
unused.push({ |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5195 |
name: n, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5196 |
line: f['(line)'], |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5197 |
'function': f['(name)'] |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5198 |
}); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5199 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5200 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5201 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5202 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5203 |
for (j = 0; j < functionicity.length; j += 1) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5204 |
if (fu[functionicity[j]].length === 0) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5205 |
delete fu[functionicity[j]]; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5206 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5207 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5208 |
fu.name = f['(name)']; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5209 |
fu.param = f['(params)']; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5210 |
fu.line = f['(line)']; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5211 |
fu.last = f['(last)']; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5212 |
data.functions.push(fu); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5213 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5214 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5215 |
if (unused.length > 0) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5216 |
data.unused = unused; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5217 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5218 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5219 |
members = []; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5220 |
for (n in member) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5221 |
if (typeof member[n] === 'number') { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5222 |
data.member = member; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5223 |
break; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5224 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5225 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5226 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5227 |
return data; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5228 |
}; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5229 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5230 |
itself.report = function (option) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5231 |
var data = itself.data(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5232 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5233 |
var a = [], c, e, err, f, i, k, l, m = '', n, o = [], s; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5234 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5235 |
function detail(h, s) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5236 |
if (s) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5237 |
o.push('<div><i>' + h + '</i> ' + |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5238 |
s.sort().join(', ') + '</div>'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5239 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5240 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5241 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5242 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5243 |
if (data.errors || data.implieds || data.unused) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5244 |
err = true; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5245 |
o.push('<div id=errors><i>Error:</i>'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5246 |
if (data.errors) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5247 |
for (i = 0; i < data.errors.length; i += 1) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5248 |
c = data.errors[i]; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5249 |
if (c) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5250 |
e = c.evidence || ''; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5251 |
o.push('<p>Problem' + (isFinite(c.line) ? ' at line ' + |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5252 |
c.line + ' character ' + c.character : '') + |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5253 |
': ' + c.reason.entityify() + |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5254 |
'</p><p class=evidence>' + |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5255 |
(e && (e.length > 80 ? e.slice(0, 77) + '...' : |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5256 |
e).entityify()) + '</p>'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5257 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5258 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5259 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5260 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5261 |
if (data.implieds) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5262 |
s = []; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5263 |
for (i = 0; i < data.implieds.length; i += 1) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5264 |
s[i] = '<code>' + data.implieds[i].name + '</code> <i>' + |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5265 |
data.implieds[i].line + '</i>'; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5266 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5267 |
o.push('<p><i>Implied global:</i> ' + s.join(', ') + '</p>'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5268 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5269 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5270 |
if (data.unused) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5271 |
s = []; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5272 |
for (i = 0; i < data.unused.length; i += 1) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5273 |
s[i] = '<code>' + data.unused[i].name + '</code> <i>' + |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5274 |
data.unused[i].line + '</i> <code>' + |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5275 |
data.unused[i]['function'] + '</code>'; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5276 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5277 |
o.push('<p><i>Unused variable:</i> ' + s.join(', ') + '</p>'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5278 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5279 |
if (data.json) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5280 |
o.push('<p>JSON: bad.</p>'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5281 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5282 |
o.push('</div>'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5283 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5284 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5285 |
if (!option) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5286 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5287 |
o.push('<br><div id=functions>'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5288 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5289 |
if (data.urls) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5290 |
detail("URLs<br>", data.urls, '<br>'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5291 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5292 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5293 |
if (data.json && !err) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5294 |
o.push('<p>JSON: good.</p>'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5295 |
} else if (data.globals) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5296 |
o.push('<div><i>Global</i> ' + |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5297 |
data.globals.sort().join(', ') + '</div>'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5298 |
} else { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5299 |
o.push('<div><i>No new global variables introduced.</i></div>'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5300 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5301 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5302 |
for (i = 0; i < data.functions.length; i += 1) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5303 |
f = data.functions[i]; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5304 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5305 |
o.push('<br><div class=function><i>' + f.line + '-' + |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5306 |
f.last + '</i> ' + (f.name || '') + '(' + |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5307 |
(f.param ? f.param.join(', ') : '') + ')</div>'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5308 |
detail('<big><b>Unused</b></big>', f.unused); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5309 |
detail('Closure', f.closure); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5310 |
detail('Variable', f['var']); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5311 |
detail('Exception', f.exception); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5312 |
detail('Outer', f.outer); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5313 |
detail('Global', f.global); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5314 |
detail('Label', f.label); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5315 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5316 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5317 |
if (data.member) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5318 |
a = to_array(data.member); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5319 |
if (a.length) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5320 |
a = a.sort(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5321 |
m = '<br><pre id=members>/*members '; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5322 |
l = 10; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5323 |
for (i = 0; i < a.length; i += 1) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5324 |
k = a[i]; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5325 |
n = k.name(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5326 |
if (l + n.length > 72) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5327 |
o.push(m + '<br>'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5328 |
m = ' '; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5329 |
l = 1; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5330 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5331 |
l += n.length + 2; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5332 |
if (data.member[k] === 1) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5333 |
n = '<i>' + n + '</i>'; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5334 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5335 |
if (i < a.length - 1) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5336 |
n += ', '; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5337 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5338 |
m += n; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5339 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5340 |
o.push(m + '<br>*/</pre>'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5341 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5342 |
o.push('</div>'); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5343 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5344 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5345 |
return o.join(''); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5346 |
}; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5347 |
itself.jslint = itself; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5348 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5349 |
itself.edition = '2009-08-22'; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5350 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5351 |
return itself; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5352 |
|
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5353 |
}()); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5354 |
(function (a) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5355 |
if (!a[0]) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5356 |
print("Usage: jslint.js file.js"); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5357 |
quit(1); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5358 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5359 |
var input = readFile(a[0]); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5360 |
if (!input) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5361 |
print("jslint: Couldn't open file '" + a[0] + "'."); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5362 |
quit(1); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5363 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5364 |
if (!JSLINT(input, {bitwise: false, eqeqeq: true, immed: true, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5365 |
laxbreak:false, newcap: false, nomen: false, onevar: false, plusplus: false, |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5366 |
regexp: false, browser: true, undef: true, white: true, indent:2,predef:['window','jQuery','google']})) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5367 |
for (var i = 0; i < JSLINT.errors.length; i += 1) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5368 |
var e = JSLINT.errors[i]; |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5369 |
if (e) { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5370 |
print('Lint at line ' + (e.line + 1) + ' character ' + |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5371 |
(e.character + 1) + ': ' + e.reason); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5372 |
print((e.evidence || ''). |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5373 |
replace(/^\s*(\S*(\s+\S+)*)\s*$/, "$1")); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5374 |
print(''); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5375 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5376 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5377 |
quit(2); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5378 |
} else { |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5379 |
print("jslint: No problems found in " + a[0]); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5380 |
quit(); |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5381 |
} |
7d70cef594a9
JSLint updated to uncompressed version.
Mario Ferraro <fadinlight@gmail.com>
parents:
2799
diff
changeset
|
5382 |
}(arguments)); |