diff --git a/jsgrep.cfg b/jsgrep.cfg index 21ee217..179ed85 100644 --- a/jsgrep.cfg +++ b/jsgrep.cfg @@ -33,385 +33,307 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ { - options: "-s-", // Default command line options + options: "-s-", // Default command line options - patterns: - { - MATCHINGBRACES: "(? ( LBRACE | LPAREN | [ ) .* C:1 )", - //"(?( \{| \(| \[).*!\\1)" + patterns: + { + MATCHINGBRACES: "(? ( LBRACE | LPAREN | [ ) .* C:1 )", + //"(?( \{| \(| \[).*!\\1)" - NONBRACE: "(! LPAREN LBRACE [ , ; )", - // "(! \{ \( \[ , ;)" + NONBRACE: "(! LPAREN LBRACE [ , ; )", + // "(! \{ \( \[ , ;)" - //NAME: "/.*/", - //STRING: "/'.*'/", + //NAME: "/.*/", + //STRING: "/'.*'/", - ANY: - { - match: "." - }, + ANY: + { + match: "." + }, NONTERM: "(!:\{};)", - ALLFUNCS: - { - comment: "ALLFUNCS - list all declared functions", - match: "(? function NAME% ) | (? NAME%: function ) | (? NAME% = new? function)" - }, - - CALLEDFUNCS: - { - comment: "CALLEDFUNCS - list all functions which are being called", - match: "NAME% LPAREN" - }, - - FUNCSINMOD: - { - match: "DOT add LPAREN .% , function LPAREN . RPAREN (LBRACE) (.*? ALLFUNCS)* .* C:1" - }, - - FUNCSUSEDBYMOD: - { - match: "DOT add LPAREN .% , function LPAREN . RPAREN (LBRACE) (.*? CALLEDFUNCS)* .* C:1" - }, - - ALLREQUIRES: - { - match: "add LPAREN .% .*? (LBRACE) .* C:1 .* requires:(\[) (? STRING% ,?)* C:2" - }, - - CFT: - { - comment: "CFT - case fallthrough", - match: "(! break ) ; case" - }, - - DOT: - { - comment: "DOT - Synonym for \.", - match: "\." - }, - - LPAREN: - { - comment: "LPAREN - Synonym for \(", - match: "\(" - }, - - NOT: - { - comment: "NOT:token - Synonym for (!token)", - pattern: "(.)", - match: "(! \1)" - }, - - - RPAREN: - { - comment: "RPAREN - Synonum for \)", - match: "\)" - }, - - LBRACE: - { - comment: "LBRACE - Synonym for \{", - match: "\{" - }, - - F: - { - comment: "F:fun_name - show the declaration of function 'fun_name'", - pattern: "(.)", - match: "(? function \1%)|(? \1% : function)|(? \1% = new? function)" - }, - - FA: - { - comment: "FA:fun_name - show the declaration of 'fun_name' along with its arguments", - pattern: "(NAME)", - match: "F:\1(LPAREN).* C:1" - }, - - FB: - { - comment: "FB:fun_name - show the entire body of functions named 'fun_name'", - pattern: "(NAME)", - match: "FA:\1(LBRACE).*% C:1" - }, - - FC: - { - comment: "FC:fun_name - show call to function 'fun_name'", - pattern: "(NAME)", - match: "\1 (LPAREN) .* C:1" - }, - - FCF: - { - comment: "FCF:fun_name - show functions which call function 'fun_name'", - pattern: "(NAME)", - match: "F:.% (LPAREN) .* C:1 (LBRACE) ((!function)|(function (LPAREN) .* C:5 (LBRACE) .* C:6))* \1 LPAREN .* C:2" - }, - - FIF: - { - comment: "FIF:fun_name_1:fun_name_2 - show calls to fun_name_2 inside fun_name_1", - pattern: "(NAME):(NAME)", - match: "F:\1 (LPAREN) .* \2 .* C:1" - }, - - FM: - { - comment: "FM:mod_name - show all functions in module 'mod_name'", - pattern: "(STRING)", - match: "DOT add LPAREN \1 ,function LPAREN .? \) ( LBRACE ) (.*? F:.)* .* C:1" - }, - - FMF: - { - comment: "FMF:fun_name - (slow) show all functions in the module which defines 'fun_name'", - pattern: "(.)", - match: "DOT add LPAREN STRING% ,function LPAREN .? \) ( LBRACE ) (.*? F:.%)* .* F:\1 (.*? F:.%)* .* C:1" - }, - - FNB: - { - comment: "FNB - for statements without braces (code coverage tool can't handle this.)", - match: "(for (LPAREN) .* C:2)% (!LBRACE)" - }, - - FR: - { - comment: "FR:symbol - show functions which reference 'symbol'", - pattern: "(NAME)", - match: "F:.% (LPAREN) .* C:1 (LBRACE) ((!function)|(function (LPAREN) .* C:5 (LBRACE) .* C:6))* \1 .* C:2" - }, - - M: - { - comment: "M:mod_name - show module info (the add & requires parts) for 'mod_name'", - pattern: "(.)", - match: "add LPAREN \1% .*? (LBRACE) .* C:1 .* requires:(\[) (? STRING% ,?)* C:2" - }, - - MA: - { - comment: "MA - show all modules", - match: "add LPAREN STRING%" - }, - - MF: - { - comment: "MF:fun_name - show the module which defines function 'fun_name'", - pattern: "(NAME)", - match: "DOT add LPAREN STRING% ,function LPAREN .? \) ( LBRACE ) .* F:\1 .* C:1" - }, - - MCF: - { - comment: "MCF:fun_name - show modules which call function 'fun_name'", - pattern: "(NAME)", - match: "DOT add LPAREN STRING% ,function LPAREN .? \) ( LBRACE ) .* FC:\1 .* C:1" - }, - - MR: - { - comment: "MR:symbol - show modules which reference 'symbol'", - pattern: "(NAME)", - match: "DOT add LPAREN STRING% ,function LPAREN .? \) ( LBRACE ) .*? \1 .* C:1" - }, - - OI: - { - comment: "OI:symbol - show static object initialization for 'symbol'", - pattern: "(NAME)", - match: "\1 =|: ({|[) .* C:1" - }, - - REQUIRE: - { - comment: "REQUIRE:mod_name - show modules which require 'mod_name'", - pattern: "(.)", - match: "DOT add LPAREN .% ,function LPAREN .? \) (LBRACE) .* C:1 .* requires:(\[) .* \1 .* C:2" - }, - - TC: - { - comment: "TC - Show arrays and objects with trailing commas", - match: ", ]|}" - }, - - UC: - { - comment: "UC:mod_name - Show the use() callback for all uses of mod_name", - pattern: "(STRING)", - match: "use (LPAREN) \1, .* C:1" - }, - - USED: - { - comment: "USED:mod_name", - pattern: "(STRING)", - match: "(use (LPAREN).* \1 .* C:2) | (requires:([) .* \1 .* C:4)" - }, - - USES: - { - comment: "USES:mod_name - show calls to use() within module 'mod_name'", - pattern: "(STRING)", - match: "DOT add LPAREN \1 .*? (LBRACE) (? .*? use LPAREN STRING%)* .* C:1" - }, - - USEDBY: - { - comment: "USEDBY:mod_name - show modules which call use() on 'mod_name'", - pattern: "(STRING)", - match: "DOT add LPAREN STRING% ,function LPAREN .? \) (LBRACE) .* DOT use LPAREN \1 .* C:1" - }, - - V: - { - comment: "V:var_name - show the declaration of a variable named 'var_name'", - pattern: "(NAME)", - match: "var (?(! \1)(? =(? NONBRACE+| MATCHINGBRACES+)+ ,)| ,)*? \1%" - }, - - VF: - { - comment: "VF:var_name:fun_name - show all uses of 'var_name' inside function 'fun_name'", - pattern: "(NAME):(NAME)", - match: "F:\2(LPAREN).* C:1 (\{) (? (! \1%)* \1%)* .* C:2" - } - }, - - default: "jite", - - searches: - { - current: { root: "." }, - neo: - { - root: "~/dev/yahoo/ymail/neo/src", - filepatterns: - [ - "*.js" - ], - directories: - [ - "common", - "comms", - "contacts", - "galaxy", - //"jite", - "launch", - "mail", - "mods", - "om", - "templates" - ], - exclude: - [ - "data.js" -// "neo.js", -// "mods.js" - ] - }, - mustache: - { - root: "~/dev/yahoo/ymail/neo/src", + ALLFUNCS: + { + comment: "ALLFUNCS - list all declared functions", + match: "(? function NAME% ) | (? NAME%: function ) | (? NAME% = new? function)" + }, + + CALLEDFUNCS: + { + comment: "CALLEDFUNCS - list all functions which are being called", + match: "NAME% LPAREN" + }, + + FUNCSINMOD: + { + match: "DOT add LPAREN .% , function LPAREN . RPAREN (LBRACE) (.*? ALLFUNCS)* .* C:1" + }, + + FUNCSUSEDBYMOD: + { + match: "DOT add LPAREN .% , function LPAREN . RPAREN (LBRACE) (.*? CALLEDFUNCS)* .* C:1" + }, + + ALLREQUIRES: + { + match: "add LPAREN .% .*? (LBRACE) .* C:1 .* requires:(\[) (? STRING% ,?)* C:2" + }, + + CFT: + { + comment: "CFT - case fallthrough", + match: "(! break ) ; case" + }, + + DOT: + { + comment: "DOT - Synonym for \.", + match: "\." + }, + + LPAREN: + { + comment: "LPAREN - Synonym for \(", + match: "\(" + }, + + NOT: + { + comment: "NOT:token - Synonym for (!token)", + pattern: "(.)", + match: "(! \1)" + }, + + + RPAREN: + { + comment: "RPAREN - Synonum for \)", + match: "\)" + }, + + LBRACE: + { + comment: "LBRACE - Synonym for \{", + match: "\{" + }, + + F: + { + comment: "F:fun_name - show the declaration of function 'fun_name'", + pattern: "(.)", + match: "(? function \1%)|(? \1% : function)|(? \1% = new? function)" + }, + + FA: + { + comment: "FA:fun_name - show the declaration of 'fun_name' along with its arguments", + pattern: "(NAME)", + match: "F:\1(LPAREN).* C:1" + }, + + FB: + { + comment: "FB:fun_name - show the entire body of functions named 'fun_name'", + pattern: "(NAME)", + match: "FA:\1(LBRACE).*% C:1" + }, + + FC: + { + comment: "FC:fun_name - show call to function 'fun_name'", + pattern: "(NAME)", + match: "\1 (LPAREN) .* C:1" + }, + + FCF: + { + comment: "FCF:fun_name - show functions which call function 'fun_name'", + pattern: "(NAME)", + match: "F:.% (LPAREN) .* C:1 (LBRACE) ((!function)|(function (LPAREN) .* C:5 (LBRACE) .* C:6))* \1 LPAREN .* C:2" + }, + + FIF: + { + comment: "FIF:fun_name_1:fun_name_2 - show calls to fun_name_2 inside fun_name_1", + pattern: "(NAME):(NAME)", + match: "F:\1 (LPAREN) .* \2 .* C:1" + }, + + FM: + { + comment: "FM:mod_name - show all functions in module 'mod_name'", + pattern: "(STRING)", + match: "DOT add LPAREN \1 ,function LPAREN .? \) ( LBRACE ) (.*? F:.)* .* C:1" + }, + + FMF: + { + comment: "FMF:fun_name - (slow) show all functions in the module which defines 'fun_name'", + pattern: "(.)", + match: "DOT add LPAREN STRING% ,function LPAREN .? \) ( LBRACE ) (.*? F:.%)* .* F:\1 (.*? F:.%)* .* C:1" + }, + + FNB: + { + comment: "FNB - for statements without braces (code coverage tool can't handle this.)", + match: "(for (LPAREN) .* C:2)% (!LBRACE)" + }, + + FR: + { + comment: "FR:symbol - show functions which reference 'symbol'", + pattern: "(NAME)", + match: "F:.% (LPAREN) .* C:1 (LBRACE) ((!function)|(function (LPAREN) .* C:5 (LBRACE) .* C:6))* \1 .* C:2" + }, + + M: + { + comment: "M:mod_name - show module info (the add & requires parts) for 'mod_name'", + pattern: "(.)", + match: "add LPAREN \1% .*? (LBRACE) .* C:1 .* requires:(\[) (? STRING% ,?)* C:2" + }, + + MA: + { + comment: "MA - show all modules", + match: "add LPAREN STRING%" + }, + + MF: + { + comment: "MF:fun_name - show the module which defines function 'fun_name'", + pattern: "(NAME)", + match: "DOT add LPAREN STRING% ,function LPAREN .? \) ( LBRACE ) .* F:\1 .* C:1" + }, + + MCF: + { + comment: "MCF:fun_name - show modules which call function 'fun_name'", + pattern: "(NAME)", + match: "DOT add LPAREN STRING% ,function LPAREN .? \) ( LBRACE ) .* FC:\1 .* C:1" + }, + + MR: + { + comment: "MR:symbol - show modules which reference 'symbol'", + pattern: "(NAME)", + match: "DOT add LPAREN STRING% ,function LPAREN .? \) ( LBRACE ) .*? \1 .* C:1" + }, + + OI: + { + comment: "OI:symbol - show static object initialization for 'symbol'", + pattern: "(NAME)", + match: "\1 =|: ({|[) .* C:1" + }, + + REQUIRE: + { + comment: "REQUIRE:mod_name - show modules which require 'mod_name'", + pattern: "(.)", + match: "DOT add LPAREN .% ,function LPAREN .? \) (LBRACE) .* C:1 .* requires:(\[) .* \1 .* C:2" + }, + + TC: + { + comment: "TC - Show arrays and objects with trailing commas", + match: ", ]|}" + }, + + UC: + { + comment: "UC:mod_name - Show the use() callback for all uses of mod_name", + pattern: "(STRING)", + match: "use (LPAREN) \1, .* C:1" + }, + + USED: + { + comment: "USED:mod_name", + pattern: "(STRING)", + match: "(use (LPAREN).* \1 .* C:2) | (requires:([) .* \1 .* C:4)" + }, + + USES: + { + comment: "USES:mod_name - show calls to use() within module 'mod_name'", + pattern: "(STRING)", + match: "DOT add LPAREN \1 .*? (LBRACE) (? .*? use LPAREN STRING%)* .* C:1" + }, + + USEDBY: + { + comment: "USEDBY:mod_name - show modules which call use() on 'mod_name'", + pattern: "(STRING)", + match: "DOT add LPAREN STRING% ,function LPAREN .? \) (LBRACE) .* DOT use LPAREN \1 .* C:1" + }, + + V: + { + comment: "V:var_name - show the declaration of a variable named 'var_name'", + pattern: "(NAME)", + match: "var (?(! \1)(? =(? NONBRACE+| MATCHINGBRACES+)+ ,)| ,)*? \1%" + }, + + VF: + { + comment: "VF:var_name:fun_name - show all uses of 'var_name' inside function 'fun_name'", + pattern: "(NAME):(NAME)", + match: "F:\2(LPAREN).* C:1 (\{) (? (! \1%)* \1%)* .* C:2" + } + }, + + default: "src", + + searches: + { + current: { root: "." }, + src: { root: "~/src" }, + + mustache: + { + root: "~/src", + directories: + [ + "js/templates", + "php/templates" + ], filepatterns: [ "*.js", - "*.mu" + "*.mu" ], - directories: - [ - "common", - "comms", - "contacts", - "galaxy", - "launch", - "mail", - "mods", - "om", - "templates" - ]/*, exclude: [ - "neo.js", "mods.js" - ]*/ - }, + ] + }, php: { - root: "~/dev/yahoo/ymail/neo/src", + root: "~/src", filepatterns: [ "*.js", "*.mu", - "*.php", - "*.inc", - "*.templ" - ], - directories: - [ - "." -/* "common", - "comms", - "contacts", - "galaxy", - "launch", - "mail", - "mods", - "om", - "templates" -*/ - ]/*, + "*.php", + "*.inc", + "*.templ" + ] + }, + yui: + { + root: "~/yui3/build", exclude: [ - "neo.js", - "mods.js" - ]*/ - }, - yuisrc: - { - root: "~/dev/yahoo/ymail/neo/yui3/src", - exclude: "simpleyui" - }, - yui: - { - root: "~/dev/yahoo/ymail/neo/yui3/build", - exclude: - [ - "simpleyui", - "*-min.js", - "*-debug.js" - ] - }, - test: - { - root: "~/dev/yahoo/ymail/neo/test" - }, - jite: - { - root: "~/dev/yahoo/ymail/neo/tools/jite", - filepatterns: - [ - "*.js", - "*.html" - ], - exclude: - [ - "mockCascadeData.js" - ] - }, - cg: - { - root: "~/dev/yahoo/ymail/dclient/src", - filepatterns: - [ - "*.js" - ] - } - } + "simpleyui", + "*-min.js", + "*-debug.js" + ] + }, + test: + { + root: "~/src/test" + } + } }