Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 340 lines (290 sloc) 10.456 kb
c948728d »
2012-05-04 Initial commit.
1 /*
2 Copyright (c) 2012, Yahoo! Inc. All rights reserved.
3
4 Redistribution and use of this software in source and binary forms,
5 with or without modification, are permitted provided that the following
6 conditions are met:
7
8 * Redistributions of source code must retain the above
9 copyright notice, this list of conditions and the
10 following disclaimer.
11
12 * Redistributions in binary form must reproduce the above
13 copyright notice, this list of conditions and the
14 following disclaimer in the documentation and/or other
15 materials provided with the distribution.
16
17 * Neither the name of Yahoo! Inc. nor the names of its
18 contributors may be used to endorse or promote products
19 derived from this software without specific prior
20 written permission of Yahoo! Inc.
21
22 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
23 IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
24 TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
25 PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
26 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
28 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35 {
e00c6475 »
2012-05-04 Remove my personal filesets, create examples.
36 options: "-s-", // Default command line options
c948728d »
2012-05-04 Initial commit.
37
e00c6475 »
2012-05-04 Remove my personal filesets, create examples.
38 patterns:
39 {
40 MATCHINGBRACES: "(? ( LBRACE | LPAREN | [ ) .* C:1 )",
41 //"(?( \{| \(| \[).*!\\1)"
c948728d »
2012-05-04 Initial commit.
42
e00c6475 »
2012-05-04 Remove my personal filesets, create examples.
43 NONBRACE: "(! LPAREN LBRACE [ , ; )",
44 // "(! \{ \( \[ , ;)"
c948728d »
2012-05-04 Initial commit.
45
e00c6475 »
2012-05-04 Remove my personal filesets, create examples.
46 //NAME: "/.*/",
47 //STRING: "/'.*'/",
c948728d »
2012-05-04 Initial commit.
48
e00c6475 »
2012-05-04 Remove my personal filesets, create examples.
49 ANY:
50 {
51 match: "."
52 },
c948728d »
2012-05-04 Initial commit.
53
54 NONTERM: "(!:\{};)",
55
e00c6475 »
2012-05-04 Remove my personal filesets, create examples.
56 ALLFUNCS:
57 {
58 comment: "ALLFUNCS - list all declared functions",
59 match: "(? function NAME% ) | (? NAME%: function ) | (? NAME% = new? function)"
60 },
61
62 CALLEDFUNCS:
63 {
64 comment: "CALLEDFUNCS - list all functions which are being called",
65 match: "NAME% LPAREN"
66 },
67
68 FUNCSINMOD:
69 {
70 match: "DOT add LPAREN .% , function LPAREN . RPAREN (LBRACE) (.*? ALLFUNCS)* .* C:1"
71 },
72
73 FUNCSUSEDBYMOD:
74 {
75 match: "DOT add LPAREN .% , function LPAREN . RPAREN (LBRACE) (.*? CALLEDFUNCS)* .* C:1"
76 },
77
78 ALLREQUIRES:
79 {
80 match: "add LPAREN .% .*? (LBRACE) .* C:1 .* requires:(\[) (? STRING% ,?)* C:2"
81 },
82
83 CFT:
84 {
85 comment: "CFT - case fallthrough",
86 match: "(! break ) ; case"
87 },
88
89 DOT:
90 {
91 comment: "DOT - Synonym for \.",
92 match: "\."
93 },
94
95 LPAREN:
96 {
97 comment: "LPAREN - Synonym for \(",
98 match: "\("
99 },
100
101 NOT:
102 {
103 comment: "NOT:token - Synonym for (!token)",
104 pattern: "(.)",
105 match: "(! \1)"
106 },
107
108
109 RPAREN:
110 {
111 comment: "RPAREN - Synonum for \)",
112 match: "\)"
113 },
114
115 LBRACE:
116 {
117 comment: "LBRACE - Synonym for \{",
118 match: "\{"
119 },
120
121 F:
122 {
123 comment: "F:fun_name - show the declaration of function 'fun_name'",
124 pattern: "(.)",
125 match: "(? function \1%)|(? \1% : function)|(? \1% = new? function)"
126 },
127
128 FA:
129 {
130 comment: "FA:fun_name - show the declaration of 'fun_name' along with its arguments",
131 pattern: "(NAME)",
132 match: "F:\1(LPAREN).* C:1"
133 },
134
135 FB:
136 {
137 comment: "FB:fun_name - show the entire body of functions named 'fun_name'",
138 pattern: "(NAME)",
139 match: "FA:\1(LBRACE).*% C:1"
140 },
141
142 FC:
143 {
144 comment: "FC:fun_name - show call to function 'fun_name'",
145 pattern: "(NAME)",
146 match: "\1 (LPAREN) .* C:1"
147 },
148
149 FCF:
150 {
151 comment: "FCF:fun_name - show functions which call function 'fun_name'",
152 pattern: "(NAME)",
153 match: "F:.% (LPAREN) .* C:1 (LBRACE) ((!function)|(function (LPAREN) .* C:5 (LBRACE) .* C:6))* \1 LPAREN .* C:2"
154 },
155
156 FIF:
157 {
158 comment: "FIF:fun_name_1:fun_name_2 - show calls to fun_name_2 inside fun_name_1",
159 pattern: "(NAME):(NAME)",
160 match: "F:\1 (LPAREN) .* \2 .* C:1"
161 },
162
163 FM:
164 {
165 comment: "FM:mod_name - show all functions in module 'mod_name'",
166 pattern: "(STRING)",
167 match: "DOT add LPAREN \1 ,function LPAREN .? \) ( LBRACE ) (.*? F:.)* .* C:1"
168 },
169
170 FMF:
171 {
172 comment: "FMF:fun_name - (slow) show all functions in the module which defines 'fun_name'",
173 pattern: "(.)",
174 match: "DOT add LPAREN STRING% ,function LPAREN .? \) ( LBRACE ) (.*? F:.%)* .* F:\1 (.*? F:.%)* .* C:1"
175 },
176
177 FNB:
178 {
179 comment: "FNB - for statements without braces (code coverage tool can't handle this.)",
180 match: "(for (LPAREN) .* C:2)% (!LBRACE)"
181 },
182
183 FR:
184 {
185 comment: "FR:symbol - show functions which reference 'symbol'",
186 pattern: "(NAME)",
187 match: "F:.% (LPAREN) .* C:1 (LBRACE) ((!function)|(function (LPAREN) .* C:5 (LBRACE) .* C:6))* \1 .* C:2"
188 },
189
190 M:
191 {
192 comment: "M:mod_name - show module info (the add & requires parts) for 'mod_name'",
193 pattern: "(.)",
194 match: "add LPAREN \1% .*? (LBRACE) .* C:1 .* requires:(\[) (? STRING% ,?)* C:2"
195 },
196
197 MA:
198 {
199 comment: "MA - show all modules",
200 match: "add LPAREN STRING%"
201 },
202
203 MF:
204 {
205 comment: "MF:fun_name - show the module which defines function 'fun_name'",
206 pattern: "(NAME)",
207 match: "DOT add LPAREN STRING% ,function LPAREN .? \) ( LBRACE ) .* F:\1 .* C:1"
208 },
209
210 MCF:
211 {
212 comment: "MCF:fun_name - show modules which call function 'fun_name'",
213 pattern: "(NAME)",
214 match: "DOT add LPAREN STRING% ,function LPAREN .? \) ( LBRACE ) .* FC:\1 .* C:1"
215 },
216
217 MR:
218 {
219 comment: "MR:symbol - show modules which reference 'symbol'",
220 pattern: "(NAME)",
221 match: "DOT add LPAREN STRING% ,function LPAREN .? \) ( LBRACE ) .*? \1 .* C:1"
222 },
223
224 OI:
225 {
226 comment: "OI:symbol - show static object initialization for 'symbol'",
227 pattern: "(NAME)",
228 match: "\1 =|: ({|[) .* C:1"
229 },
230
231 REQUIRE:
232 {
233 comment: "REQUIRE:mod_name - show modules which require 'mod_name'",
234 pattern: "(.)",
235 match: "DOT add LPAREN .% ,function LPAREN .? \) (LBRACE) .* C:1 .* requires:(\[) .* \1 .* C:2"
236 },
237
238 TC:
239 {
240 comment: "TC - Show arrays and objects with trailing commas",
241 match: ", ]|}"
242 },
243
244 UC:
245 {
246 comment: "UC:mod_name - Show the use() callback for all uses of mod_name",
247 pattern: "(STRING)",
248 match: "use (LPAREN) \1, .* C:1"
249 },
250
251 USED:
252 {
253 comment: "USED:mod_name",
254 pattern: "(STRING)",
255 match: "(use (LPAREN).* \1 .* C:2) | (requires:([) .* \1 .* C:4)"
256 },
257
258 USES:
259 {
260 comment: "USES:mod_name - show calls to use() within module 'mod_name'",
261 pattern: "(STRING)",
262 match: "DOT add LPAREN \1 .*? (LBRACE) (? .*? use LPAREN STRING%)* .* C:1"
263 },
264
265 USEDBY:
266 {
267 comment: "USEDBY:mod_name - show modules which call use() on 'mod_name'",
268 pattern: "(STRING)",
269 match: "DOT add LPAREN STRING% ,function LPAREN .? \) (LBRACE) .* DOT use LPAREN \1 .* C:1"
270 },
271
272 V:
273 {
274 comment: "V:var_name - show the declaration of a variable named 'var_name'",
275 pattern: "(NAME)",
276 match: "var (?(! \1)(? =(? NONBRACE+| MATCHINGBRACES+)+ ,)| ,)*? \1%"
277 },
278
279 VF:
280 {
281 comment: "VF:var_name:fun_name - show all uses of 'var_name' inside function 'fun_name'",
282 pattern: "(NAME):(NAME)",
283 match: "F:\2(LPAREN).* C:1 (\{) (? (! \1%)* \1%)* .* C:2"
284 }
285 },
286
287 default: "src",
288
fd97a9d4 »
2012-05-04 Minor tweak
289 // Example filesets. Customize this for your environment.
e00c6475 »
2012-05-04 Remove my personal filesets, create examples.
290 searches:
291 {
292 current: { root: "." },
293 src: { root: "~/src" },
294
295 mustache:
296 {
297 root: "~/src",
298 directories:
299 [
300 "js/templates",
301 "php/templates"
302 ],
c948728d »
2012-05-04 Initial commit.
303 filepatterns:
304 [
305 "*.js",
e00c6475 »
2012-05-04 Remove my personal filesets, create examples.
306 "*.mu"
c948728d »
2012-05-04 Initial commit.
307 ],
308 exclude:
309 [
310 "mods.js"
e00c6475 »
2012-05-04 Remove my personal filesets, create examples.
311 ]
312 },
c948728d »
2012-05-04 Initial commit.
313 php:
314 {
e00c6475 »
2012-05-04 Remove my personal filesets, create examples.
315 root: "~/src",
c948728d »
2012-05-04 Initial commit.
316 filepatterns:
317 [
318 "*.js",
319 "*.mu",
e00c6475 »
2012-05-04 Remove my personal filesets, create examples.
320 "*.php",
321 "*.inc",
322 "*.templ"
323 ]
324 },
325 yui:
326 {
327 root: "~/yui3/build",
c948728d »
2012-05-04 Initial commit.
328 exclude:
329 [
e00c6475 »
2012-05-04 Remove my personal filesets, create examples.
330 "simpleyui",
331 "*-min.js",
332 "*-debug.js"
333 ]
334 },
335 test:
336 {
337 root: "~/src/test"
338 }
339 }
c948728d »
2012-05-04 Initial commit.
340 }
Something went wrong with that request. Please try again.