[MINOR: allow to use frame rather than window for search. argot@x9c.fr**20120803091407 Ignore-this: cd73cbb7d92e9b05bffed59f2ef46ed ] hunk ./src/args.ml 23 +let search_frame = ref false + hunk ./src/args.ml 41 + ("-search-frame", + Arg.Set search_frame, + "\n\t\tSearch from a frame"); + Odoc_info.Args.add_option hunk ./src/args.mli 27 +val search_frame : bool ref +(** Whether search should appear in a frame. *) + hunk ./src/main.ml 177 - if !Args.search then Buffer.add_string b Search.link + if !Args.search && not !Args.search_frame then + Buffer.add_string b Search.link hunk ./src/main.ml 182 - if !Args.search then Buffer.add_string b Search.link + if !Args.search && not !Args.search_frame then + Buffer.add_string b Search.link hunk ./src/search.ml 201 + let where = + if !Args.search_frame then "'frame'" else "'window'" in hunk ./src/search.ml 215 - "
"; - " "; + " "; + " "; hunk ./src/search.ml 219 - "  by name  "; - "  by regexp  "; - "  by type  "; + "  by name
"; + "  by regexp
"; + "  by type
"; hunk ./src/search.ml 225 - "
"; + (if !Args.search_frame then + "
" + else + "
"); hunk ./src/search.ml 230 - "" ] + " "; + "" ]; + if !Args.search then begin + let filename = Filename.concat path "argot_index.html" in + let title = match !Odoc_args.title with Some x -> x | None -> "Argot search" in + Utils.write_lines + filename + [ ""; + ""; + " "; + " " ^ title ^ ""; + " "; + " "; + " "; + " "; + " frames are not supported"; + " "; + "" ]; + end hunk ./src/search_js.ml 25 - "symbols_: {\"error\":2,\"signature\":3,\"type\":4,\"EOF\":5,\"IDENT\":6,\"VAR\":7,\"*\":8,\"->\":9,\"(\":10,\"type_list\":11,\")\":12,\"ident_list\":13,\",\":14,\"$accept\":0,\"$end\":1},"; - "terminals_: {2:\"error\",5:\"EOF\",6:\"IDENT\",7:\"VAR\",8:\"*\",9:\"->\",10:\"(\",12:\")\",14:\",\"},"; - "productions_: [0,[3,2],[4,1],[4,1],[4,3],[4,3],[4,3],[4,4],[4,2],[4,2],[13,2],[13,1],[11,3],[11,1]],"; + "symbols_: {\"error\":2,\"signature\":3,\"type\":4,\"EOF\":5,\"IDENT\":6,\"VAR\":7,\"*\":8,\"->\":9,\":\":10,\"?\":11,\"(\":12,\"type_list\":13,\")\":14,\"ident_list\":15,\",\":16,\"$accept\":0,\"$end\":1},"; + "terminals_: {2:\"error\",5:\"EOF\",6:\"IDENT\",7:\"VAR\",8:\"*\",9:\"->\",10:\":\",11:\"?\",12:\"(\",14:\")\",16:\",\"},"; + "productions_: [0,[3,2],[4,1],[4,1],[4,3],[4,3],[4,5],[4,6],[4,3],[4,4],[4,2],[4,2],[15,2],[15,1],[13,3],[13,1]],"; hunk ./src/search_js.ml 42 - "case 6: if ($$[$0-1].length == 1) { this.$ = $$[$0-1][0]; }"; - " else { throw \"invalid input\"; } "; + "case 6: this.$ = arrow($$[$0-2], $$[$0]); "; hunk ./src/search_js.ml 44 - "case 7: $$[$0-2].kind = KIND_TYPE_LIST;"; - " $$[$0].unshift($$[$0-2]); $$[$0].kind = KIND_TYPE_APP; this.$ = $$[$0]; "; + "case 7: var opt = [$$[$0-2]];"; + " opt.kind = KIND_OPTIONAL_PARAMETER;"; + " this.$ = arrow(opt, $$[$0]); "; hunk ./src/search_js.ml 48 - "case 8: $$[$0].unshift($$[$0-1]); $$[$0].kind = KIND_TYPE_APP; this.$ = $$[$0]; "; + "case 8: if ($$[$0-1].length == 1) {"; + " this.$ = $$[$0-1][0];"; + " } else {"; + " throw \"invalid input\";"; + " } "; hunk ./src/search_js.ml 54 - "case 9: $$[$0].unshift($$[$0-1]); $$[$0].kind = KIND_TYPE_APP; this.$ = $$[$0]; "; + "case 9: $$[$0-2].kind = KIND_TYPE_LIST;"; + " $$[$0].unshift($$[$0-2]);"; + " $$[$0].kind = KIND_TYPE_APP;"; + " this.$ = $$[$0]; "; hunk ./src/search_js.ml 59 - "case 10: this.$ = $$[$0-1].concat($$[$0]); "; + "case 10: $$[$0].unshift($$[$0-1]);"; + " $$[$0].kind = KIND_TYPE_APP;"; + " this.$ = $$[$0]; "; hunk ./src/search_js.ml 63 - "case 11: this.$ = [$$[$0]]; "; + "case 11: $$[$0].unshift($$[$0-1]);"; + " $$[$0].kind = KIND_TYPE_APP;"; + " this.$ = $$[$0]; "; hunk ./src/search_js.ml 67 - "case 12: this.$ = $$[$0-2].concat($$[$0]); "; + "case 12: this.$ = $$[$0-1].concat($$[$0]); "; hunk ./src/search_js.ml 71 + "case 14: this.$ = $$[$0-2].concat($$[$0]); "; + "break;"; + "case 15: this.$ = [$$[$0]]; "; + "break;"; hunk ./src/search_js.ml 77 - "table: [{3:1,4:2,6:[1,3],7:[1,4],10:[1,5]},{1:[3]},{5:[1,6],8:[1,7],9:[1,8]},{5:[2,2],6:[1,10],8:[2,2],9:[2,2],12:[2,2],13:9,14:[2,2]},{5:[2,3],6:[1,10],8:[2,3],9:[2,3],12:[2,3],13:11,14:[2,3]},{4:13,6:[1,3],7:[1,4],10:[1,5],11:12},{1:[2,1]},{4:14,6:[1,3],7:[1,4],10:[1,5]},{4:15,6:[1,3],7:[1,4],10:[1,5]},{5:[2,8],6:[1,16],8:[2,8],9:[2,8],12:[2,8],14:[2,8]},{5:[2,11],6:[2,11],8:[2,11],9:[2,11],12:[2,11],14:[2,11]},{5:[2,9],6:[1,16],8:[2,9],9:[2,9],12:[2,9],14:[2,9]},{12:[1,17],14:[1,18]},{8:[1,7],9:[1,8],12:[2,13],14:[2,13]},{5:[2,4],8:[2,4],9:[2,4],12:[2,4],14:[2,4]},{5:[2,5],8:[1,7],9:[1,8],12:[2,5],14:[2,5]},{5:[2,10],6:[2,10],8:[2,10],9:[2,10],12:[2,10],14:[2,10]},{5:[2,6],6:[1,10],8:[2,6],9:[2,6],12:[2,6],13:19,14:[2,6]},{4:20,6:[1,3],7:[1,4],10:[1,5]},{5:[2,7],6:[1,16],8:[2,7],9:[2,7],12:[2,7],14:[2,7]},{8:[1,7],9:[1,8],12:[2,12],14:[2,12]}],"; - "defaultActions: {6:[2,1]},"; + "table: [{3:1,4:2,6:[1,3],7:[1,4],11:[1,5],12:[1,6]},{1:[3]},{5:[1,7],8:[1,8],9:[1,9]},{5:[2,2],6:[1,12],8:[2,2],9:[2,2],10:[1,10],14:[2,2],15:11,16:[2,2]},{5:[2,3],6:[1,12],8:[2,3],9:[2,3],14:[2,3],15:13,16:[2,3]},{6:[1,14]},{4:16,6:[1,3],7:[1,4],11:[1,5],12:[1,6],13:15},{1:[2,1]},{4:17,6:[1,3],7:[1,4],11:[1,5],12:[1,6]},{4:18,6:[1,3],7:[1,4],11:[1,5],12:[1,6]},{4:19,6:[1,3],7:[1,4],11:[1,5],12:[1,6]},{5:[2,10],6:[1,20],8:[2,10],9:[2,10],14:[2,10],16:[2,10]},{5:[2,13],6:[2,13],8:[2,13],9:[2,13],14:[2,13],16:[2,13]},{5:[2,11],6:[1,20],8:[2,11],9:[2,11],14:[2,11],16:[2,11]},{10:[1,21]},{14:[1,22],16:[1,23]},{8:[1,8],9:[1,9],14:[2,15],16:[2,15]},{5:[2,4],8:[2,4],9:[2,4],14:[2,4],16:[2,4]},{5:[2,5],8:[1,8],9:[1,9],14:[2,5],16:[2,5]},{8:[1,8],9:[1,24]},{5:[2,12],6:[2,12],8:[2,12],9:[2,12],14:[2,12],16:[2,12]},{4:25,6:[1,3],7:[1,4],11:[1,5],12:[1,6]},{5:[2,8],6:[1,12],8:[2,8],9:[2,8],14:[2,8],15:26,16:[2,8]},{4:27,6:[1,3],7:[1,4],11:[1,5],12:[1,6]},{4:28,6:[1,3],7:[1,4],11:[1,5],12:[1,6]},{8:[1,8],9:[1,29]},{5:[2,9],6:[1,20],8:[2,9],9:[2,9],14:[2,9],16:[2,9]},{8:[1,8],9:[1,9],14:[2,14],16:[2,14]},{5:[2,6],8:[1,8],9:[1,9],14:[2,6],16:[2,6]},{4:30,6:[1,3],7:[1,4],11:[1,5],12:[1,6]},{5:[2,7],8:[1,8],9:[1,9],14:[2,7],16:[2,7]}],"; + "defaultActions: {7:[2,1]},"; hunk ./src/search_js.ml 389 - "case 3: return 10; "; + "case 3: return 12; "; hunk ./src/search_js.ml 391 - "case 4: return 12; "; + "case 4: return 14; "; hunk ./src/search_js.ml 397 - "case 7: return 14; "; + "case 7: return 16; "; + "break;"; + "case 8: return 10; "; + "break;"; + "case 9: return 11; "; hunk ./src/search_js.ml 403 - "case 8: return 5; "; + "case 10: return 5; "; hunk ./src/search_js.ml 405 - "case 9: return 'INVALID'; "; + "case 11: return 'INVALID'; "; hunk ./src/search_js.ml 409 - "lexer.rules = [/^\\s+/,/^[a-zA-Z_\\.][a-zA-Z0-9_\\'\\.]*/,/^'[a-zA-Z_\\.][a-zA-Z0-9_\\'\\.]*/,/^\\(/,/^\\)/,/^\\*/,/^->/,/^,/,/^$/,/^./];"; - "lexer.conditions = {\"INITIAL\":{\"rules\":[0,1,2,3,4,5,6,7,8,9],\"inclusive\":true}};return lexer;})()"; + "lexer.rules = [/^\\s+/,/^[a-zA-Z_\\.][a-zA-Z0-9_\\'\\.]*/,/^'[a-zA-Z_\\.][a-zA-Z0-9_\\'\\.]*/,/^\\(/,/^\\)/,/^\\*/,/^->/,/^,/,/^:/,/^\\?/,/^$/,/^./];"; + "lexer.conditions = {\"INITIAL\":{\"rules\":[0,1,2,3,4,5,6,7,8,9,10,11],\"inclusive\":true}};return lexer;})()"; hunk ./src/search_js.ml 525 - "function point_to(addr) {"; + "function point_to_window(addr) {"; hunk ./src/search_js.ml 533 + "// Points the main frame to the passed address"; + "function point_to_frame(addr) {"; + " if (addr != '') {"; + " var f = parent.frames[1];"; + " f.location = addr;"; + " }"; + "}"; + ""; hunk ./src/search_js.ml 542 - "function format(addr, name, alt, type, doc) {"; - " var action = \"javascript:point_to('\" + addr + \"');\";"; + "function format(where, addr, name, alt, type, doc) {"; + " //XXXvar action = \"javascript:point_to_window('\" + addr + \"');\";"; + " var action = where == 'window'"; + " ? \"javascript:point_to_window('\" + addr + \"');\""; + " : \"javascript:point_to_frame('\" + addr + \"');\";"; hunk ./src/search_js.ml 554 - "function set_result(res) {"; + "function set_result(where, res) {"; hunk ./src/search_js.ml 560 - " text += format(elem.reference,"; + " text += format(where, "; + " elem.reference,"; hunk ./src/search_js.ml 571 - "function search_by_name(query) {"; + "function search_by_name(where, query) {"; hunk ./src/search_js.ml 573 - " set_result(res);"; + " set_result(where, res);"; hunk ./src/search_js.ml 581 - " set_result(res);"; + " set_result(where, res);"; hunk ./src/search_js.ml 585 - "function search_by_regexp(query) {"; + "function search_by_regexp(where, query) {"; hunk ./src/search_js.ml 587 - " set_result(res);"; + " set_result(where, res);"; hunk ./src/search_js.ml 597 - " set_result(res);"; + " set_result(where, res);"; hunk ./src/search_js.ml 601 - "function search_by_type(query) {"; + "function search_by_type(where, query) {"; hunk ./src/search_js.ml 603 - " set_result(res);"; + " set_result(where, res);"; hunk ./src/search_js.ml 612 - " set_result(res);"; + " set_result(where, res);"; hunk ./src/search_js.ml 616 - "function exec_query() {"; + "function exec_query(where) {"; hunk ./src/search_js.ml 621 - " search_by_name(q);"; + " search_by_name(where, q);"; hunk ./src/search_js.ml 623 - " search_by_regexp(q);"; + " search_by_regexp(where, q);"; hunk ./src/search_js.ml 625 - " search_by_type(q);"; + " search_by_type(where, q);"; hunk ./src/search_js.ml 661 + "var KIND_OPTIONAL_PARAMETER = 8;";