Changeset 54053 in webkit
- Timestamp:
- Jan 29, 2010 3:04:09 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 deleted
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r54047 r54053 1 2010-01-29 Pavel Feldman <pfeldman@chromium.org> 2 3 Reviewed by Timothy Hatcher. 4 5 Web Inspector: migrate to tokenizer-based highlighting in the Elements panel. 6 7 https://bugs.webkit.org/show_bug.cgi?id=34273 8 9 * inspector/syntax-highlight-css-expected.txt: 10 * inspector/syntax-highlight-css.html: 11 * inspector/syntax-highlight-javascript-expected.txt: 12 * inspector/syntax-highlight-javascript.html: 13 * inspector/syntax-highlight.js: 14 (frontend_dumpSyntaxHighlight): 15 1 16 2010-01-28 Oliver Hunt <oliver@apple.com> 2 17 -
trunk/LayoutTests/inspector/syntax-highlight-css-expected.txt
r52495 r54053 2 2 3 3 a[href='/']: webkit-css-selector 4 #content > a:hover: webkit-css-selector,*,webkit-css-selector5 @import url(style.css);: webkit-css-at-rule,*,webkit-css- url,*6 @import url("style.css") projection, tv;: webkit-css-at-rule,*,webkit-css- url,*,webkit-css-keyword,*,webkit-css-keyword,*4 #content > a:hover: *,webkit-css-selector,*,webkit-css-selector,*,webkit-css-selector 5 @import url(style.css);: webkit-css-at-rule,*,webkit-css-keyword,* 6 @import url("style.css") projection, tv;: webkit-css-at-rule,*,webkit-css-keyword,*,webkit-css-string,*,webkit-css-keyword,*,webkit-css-keyword,* 7 7 @media screen { body { color: red; } }: webkit-css-at-rule,*,webkit-css-keyword,*,webkit-css-selector,*,webkit-css-property,*,webkit-css-keyword,* 8 8 @font-face { font-family: MyHelvetica; }: webkit-css-at-rule,*,webkit-css-property,* -
trunk/LayoutTests/inspector/syntax-highlight-css.html
r50664 r54053 9 9 function frontend_dumpSyntaxHighlightCSS(str) 10 10 { 11 return frontend_dumpSyntaxHighlight(str, WebInspector.CSSSourceSyntaxHighlighter);11 return frontend_dumpSyntaxHighlight(str, "text/css"); 12 12 } 13 13 -
trunk/LayoutTests/inspector/syntax-highlight-javascript-expected.txt
r52495 r54053 8 8 var foo = 1/*/***//2: webkit-javascript-keyword,*,webkit-javascript-ident,*,webkit-javascript-number,webkit-javascript-comment,*,webkit-javascript-number 9 9 /*comment*//.*/.test('a'): webkit-javascript-comment,webkit-javascript-regexp,*,webkit-javascript-ident,*,webkit-javascript-string,* 10 'f\ oo';: webkit-javascript-string, *10 'f\ oo';: webkit-javascript-string,,webkit-javascript-string,* 11 11 '\f\b\t';: webkit-javascript-string,* 12 '/\ /';: webkit-javascript-string, *13 foo/** / */foo: webkit-javascript-ident,webkit-javascript-comment, webkit-javascript-ident12 '/\ /';: webkit-javascript-string,,webkit-javascript-string,* 13 foo/** / */foo: webkit-javascript-ident,webkit-javascript-comment,,webkit-javascript-comment,,webkit-javascript-comment,webkit-javascript-ident 14 14 -
trunk/LayoutTests/inspector/syntax-highlight-javascript.html
r50582 r54053 9 9 function frontend_dumpSyntaxHighlightJS(str) 10 10 { 11 return frontend_dumpSyntaxHighlight(str, WebInspector.JavaScriptSourceSyntaxHighlighter);11 return frontend_dumpSyntaxHighlight(str, "text/javascript"); 12 12 } 13 13 -
trunk/LayoutTests/inspector/syntax-highlight.js
r52495 r54053 14 14 // Frontend functions. 15 15 16 function frontend_dumpSyntaxHighlight(str, highlighterConstructor)16 function frontend_dumpSyntaxHighlight(str, mimeType) 17 17 { 18 18 var node = document.createElement("span"); 19 19 node.textContent = str; 20 var javascriptSyntaxHighlighter = new highlighterConstructor(null, null);20 var javascriptSyntaxHighlighter = new WebInspector.DOMSyntaxHighlighter(mimeType); 21 21 javascriptSyntaxHighlighter.syntaxHighlightNode(node); 22 22 var node_parts = []; -
trunk/WebCore/ChangeLog
r54052 r54053 1 2010-01-29 Pavel Feldman <pfeldman@chromium.org> 2 3 Reviewed by Timothy Hatcher. 4 5 Web Inspector: migrate to tokenizer-based highlighting in the Elements panel. 6 7 https://bugs.webkit.org/show_bug.cgi?id=34273 8 9 * WebCore.gypi: 10 * WebCore.vcproj/WebCore.vcproj: 11 * inspector/front-end/CSSSourceSyntaxHighlighter.js: Removed. 12 * inspector/front-end/DOMSyntaxHighlighter.js: Added. 13 (WebInspector.DOMSyntaxHighlighter): 14 (WebInspector.DOMSyntaxHighlighter.prototype.createSpan): 15 (WebInspector.DOMSyntaxHighlighter.prototype.syntaxHighlightNode): 16 * inspector/front-end/ElementsTreeOutline.js: 17 * inspector/front-end/JavaScriptSourceSyntaxHighlighter.js: Removed. 18 * inspector/front-end/SourceCSSTokenizer.js: 19 (WebInspector.SourceCSSTokenizer): 20 (WebInspector.SourceCSSTokenizer.prototype.nextToken): 21 * inspector/front-end/SourceCSSTokenizer.re2js: 22 * inspector/front-end/SourceHTMLTokenizer.js: 23 (WebInspector.SourceHTMLTokenizer): 24 (WebInspector.SourceHTMLTokenizer.prototype.nextToken): 25 * inspector/front-end/SourceHTMLTokenizer.re2js: 26 * inspector/front-end/SourceJavaScriptTokenizer.js: 27 (WebInspector.SourceJavaScriptTokenizer): 28 (WebInspector.SourceJavaScriptTokenizer.prototype.nextToken): 29 * inspector/front-end/SourceJavaScriptTokenizer.re2js: 30 * inspector/front-end/SourceSyntaxHighlighter.js: Removed. 31 * inspector/front-end/SourceTokenizer.js: Added. 32 (WebInspector.SourceTokenizer): 33 (WebInspector.SourceTokenizer.prototype.set line): 34 (WebInspector.SourceTokenizer.prototype.set condition): 35 (WebInspector.SourceTokenizer.prototype.get condition): 36 (WebInspector.SourceTokenizer.prototype.hasCondition): 37 (WebInspector.SourceTokenizer.prototype.getLexCondition): 38 (WebInspector.SourceTokenizer.prototype.setLexCondition): 39 (WebInspector.SourceTokenizer.prototype._charAt): 40 (WebInspector.SourceTokenizer.Registry): 41 (WebInspector.SourceTokenizer.Registry.getInstance): 42 (WebInspector.SourceTokenizer.Registry.prototype.getTokenizer): 43 * inspector/front-end/TextEditorHighlighter.js: 44 (WebInspector.TextEditorHighlighter): 45 (WebInspector.TextEditorHighlighter.prototype.set mimeType): 46 * inspector/front-end/WebKit.qrc: 47 * inspector/front-end/inspector.html: 48 1 49 2010-01-29 Pavel Feldman <pfeldman@chromium.org> 2 50 -
trunk/WebCore/WebCore.gypi
r54042 r54053 3684 3684 'inspector/front-end/ContextMenu.js', 3685 3685 'inspector/front-end/CookieItemsView.js', 3686 'inspector/front-end/CSSSourceSyntaxHighlighter.js',3687 3686 'inspector/front-end/Database.js', 3688 3687 'inspector/front-end/DatabaseQueryView.js', … … 3692 3691 'inspector/front-end/DOMStorage.js', 3693 3692 'inspector/front-end/DOMStorageItemsView.js', 3693 'inspector/front-end/DOMSyntaxHighlighter.js', 3694 3694 'inspector/front-end/Drawer.js', 3695 3695 'inspector/front-end/ElementsPanel.js', … … 3703 3703 'inspector/front-end/InjectedScriptAccess.js', 3704 3704 'inspector/front-end/inspector.js', 3705 'inspector/front-end/JavaScriptSourceSyntaxHighlighter.js',3706 3705 'inspector/front-end/KeyboardShortcut.js', 3707 3706 'inspector/front-end/MetricsSidebarPane.js', … … 3734 3733 'inspector/front-end/SourceHTMLTokenizer.js', 3735 3734 'inspector/front-end/SourceJavaScriptTokenizer.js', 3736 'inspector/front-end/Source SyntaxHighlighter.js',3735 'inspector/front-end/SourceTokenizer.js', 3737 3736 'inspector/front-end/SourceView.js', 3738 3737 'inspector/front-end/StatusBarButton.js', -
trunk/WebCore/WebCore.vcproj/WebCore.vcproj
r54009 r54053 42733 42733 </File> 42734 42734 <File 42735 RelativePath="..\inspector\front-end\CSSSourceSyntaxHighlighter.js"42736 >42737 </File>42738 <File42739 42735 RelativePath="..\inspector\front-end\Database.js" 42740 42736 > … … 42765 42761 </File> 42766 42762 <File 42763 RelativePath="..\inspector\front-end\DOMSyntaxHighlighter.js" 42764 > 42765 </File> 42766 <File 42767 42767 RelativePath="..\inspector\front-end\Drawer.js" 42768 42768 > … … 42813 42813 </File> 42814 42814 <File 42815 RelativePath="..\inspector\front-end\JavaScriptSourceSyntaxHighlighter.js"42816 >42817 </File>42818 <File42819 42815 RelativePath="..\inspector\front-end\MetricsSidebarPane.js" 42820 42816 > … … 42933 42929 </File> 42934 42930 <File 42935 RelativePath="..\inspector\front-end\Source SyntaxHighlighter.js"42931 RelativePath="..\inspector\front-end\SourceTokenizer.js" 42936 42932 > 42937 42933 </File> -
trunk/WebCore/inspector/front-end/ElementsTreeOutline.js
r53766 r54053 980 980 newNode.textContent = node.textContent; 981 981 982 var javascriptSyntaxHighlighter = new WebInspector. JavaScriptSourceSyntaxHighlighter(null, null);982 var javascriptSyntaxHighlighter = new WebInspector.DOMSyntaxHighlighter("text/javascript"); 983 983 javascriptSyntaxHighlighter.syntaxHighlightNode(newNode); 984 984 … … 988 988 newNode.textContent = node.textContent; 989 989 990 var cssSyntaxHighlighter = new WebInspector. CSSSourceSyntaxHighlighter(null, null);990 var cssSyntaxHighlighter = new WebInspector.DOMSyntaxHighlighter("text/css"); 991 991 cssSyntaxHighlighter.syntaxHighlightNode(newNode); 992 992 -
trunk/WebCore/inspector/front-end/SourceCSSTokenizer.js
r53846 r54053 1 /* Generated by re2c 0.13.5 on T ue Jan 26 01:16:332010 */1 /* Generated by re2c 0.13.5 on Thu Jan 28 20:49:22 2010 */ 2 2 /* 3 3 * Copyright (C) 2009 Google Inc. All rights reserved. … … 44 44 WebInspector.SourceCSSTokenizer = function() 45 45 { 46 WebInspector. TextEditorHighlighter.Tokenizer.call(this);46 WebInspector.SourceTokenizer.call(this); 47 47 48 48 this._propertyKeywords = [ … … 374 374 case this.case_INITIAL: 375 375 yych = this._charAt(cursor); 376 if (yych <= ' 9') {377 if (yych <= ' &') {376 if (yych <= ';') { 377 if (yych <= '\'') { 378 378 if (yych <= '"') { 379 379 if (yych <= ' ') { gotoCase = 29; continue; }; … … 382 382 } else { 383 383 if (yych == '$') { gotoCase = 31; continue; }; 384 } 385 } else { 386 if (yych <= '-') { 387 if (yych <= '\'') { gotoCase = 34; continue; }; 388 if (yych >= '-') { gotoCase = 35; continue; }; 389 } else { 390 if (yych <= '.') { gotoCase = 36; continue; }; 384 if (yych >= '\'') { gotoCase = 34; continue; }; 385 } 386 } else { 387 if (yych <= '.') { 388 if (yych <= ',') { gotoCase = 29; continue; }; 389 if (yych <= '-') { gotoCase = 35; continue; }; 390 { gotoCase = 36; continue; }; 391 } else { 391 392 if (yych <= '/') { gotoCase = 37; continue; }; 392 { gotoCase = 38; continue; }; 393 } 394 } 395 } else { 396 if (yych <= '_') { 393 if (yych <= '9') { gotoCase = 38; continue; }; 394 if (yych <= ':') { gotoCase = 40; continue; }; 395 { gotoCase = 42; continue; }; 396 } 397 } 398 } else { 399 if (yych <= '^') { 397 400 if (yych <= '?') { 398 if (yych <= ':') { gotoCase = 40; continue; }; 399 if (yych <= ';') { gotoCase = 42; continue; }; 400 } else { 401 if (yych <= 'Z') { gotoCase = 31; continue; }; 402 if (yych >= '_') { gotoCase = 31; continue; }; 403 } 404 } else { 405 if (yych <= '{') { 406 if (yych <= '`') { gotoCase = 29; continue; }; 407 if (yych <= 'z') { gotoCase = 31; continue; }; 408 { gotoCase = 44; continue; }; 409 } else { 401 if (yych == '=') { gotoCase = 31; continue; }; 402 } else { 403 if (yych == '\\') { gotoCase = 29; continue; }; 404 if (yych <= ']') { gotoCase = 31; continue; }; 405 } 406 } else { 407 if (yych <= 'z') { 408 if (yych != '`') { gotoCase = 31; continue; }; 409 } else { 410 if (yych <= '{') { gotoCase = 44; continue; }; 410 411 if (yych == '}') { gotoCase = 46; continue; }; 411 412 } … … 427 428 this.tokenType = "css-at-rule"; 428 429 this._parseCondition = this._parseConditions.AT_RULE; 429 } else 430 } else if (token.indexOf("@") === 0) 431 this.tokenType = "css-at-rule"; 432 else 430 433 this.tokenType = "css-selector"; 431 434 } … … 445 448 yyaccept = 0; 446 449 yych = this._charAt(YYMARKER = ++cursor); 447 if (yych == '\n') { gotoCase = 30; continue; }; 448 if (yych == '\r') { gotoCase = 30; continue; }; 449 { gotoCase = 120; continue; }; 450 if (yych <= '-') { 451 if (yych <= '!') { 452 if (yych <= '\f') { 453 if (yych == '\n') { gotoCase = 32; continue; }; 454 { gotoCase = 124; continue; }; 455 } else { 456 if (yych <= '\r') { gotoCase = 32; continue; }; 457 if (yych <= ' ') { gotoCase = 124; continue; }; 458 { gotoCase = 122; continue; }; 459 } 460 } else { 461 if (yych <= '$') { 462 if (yych <= '"') { gotoCase = 114; continue; }; 463 if (yych <= '#') { gotoCase = 124; continue; }; 464 { gotoCase = 122; continue; }; 465 } else { 466 if (yych == '\'') { gotoCase = 122; continue; }; 467 if (yych <= ',') { gotoCase = 124; continue; }; 468 { gotoCase = 122; continue; }; 469 } 470 } 471 } else { 472 if (yych <= '[') { 473 if (yych <= '<') { 474 if (yych <= '.') { gotoCase = 124; continue; }; 475 if (yych <= '9') { gotoCase = 122; continue; }; 476 { gotoCase = 124; continue; }; 477 } else { 478 if (yych <= '=') { gotoCase = 122; continue; }; 479 if (yych <= '?') { gotoCase = 124; continue; }; 480 { gotoCase = 122; continue; }; 481 } 482 } else { 483 if (yych <= '^') { 484 if (yych <= '\\') { gotoCase = 126; continue; }; 485 if (yych <= ']') { gotoCase = 122; continue; }; 486 { gotoCase = 124; continue; }; 487 } else { 488 if (yych == '`') { gotoCase = 124; continue; }; 489 if (yych <= 'z') { gotoCase = 122; continue; }; 490 { gotoCase = 124; continue; }; 491 } 492 } 493 } 450 494 case 34: 451 495 yyaccept = 0; 452 496 yych = this._charAt(YYMARKER = ++cursor); 453 if (yych == '\n') { gotoCase = 30; continue; }; 454 if (yych == '\r') { gotoCase = 30; continue; }; 455 { gotoCase = 113; continue; }; 497 if (yych <= '-') { 498 if (yych <= '"') { 499 if (yych <= '\f') { 500 if (yych == '\n') { gotoCase = 32; continue; }; 501 { gotoCase = 116; continue; }; 502 } else { 503 if (yych <= '\r') { gotoCase = 32; continue; }; 504 if (yych <= ' ') { gotoCase = 116; continue; }; 505 { gotoCase = 112; continue; }; 506 } 507 } else { 508 if (yych <= '&') { 509 if (yych == '$') { gotoCase = 112; continue; }; 510 { gotoCase = 116; continue; }; 511 } else { 512 if (yych <= '\'') { gotoCase = 114; continue; }; 513 if (yych <= ',') { gotoCase = 116; continue; }; 514 { gotoCase = 112; continue; }; 515 } 516 } 517 } else { 518 if (yych <= '[') { 519 if (yych <= '<') { 520 if (yych <= '.') { gotoCase = 116; continue; }; 521 if (yych <= '9') { gotoCase = 112; continue; }; 522 { gotoCase = 116; continue; }; 523 } else { 524 if (yych <= '=') { gotoCase = 112; continue; }; 525 if (yych <= '?') { gotoCase = 116; continue; }; 526 { gotoCase = 112; continue; }; 527 } 528 } else { 529 if (yych <= '^') { 530 if (yych <= '\\') { gotoCase = 118; continue; }; 531 if (yych <= ']') { gotoCase = 112; continue; }; 532 { gotoCase = 116; continue; }; 533 } else { 534 if (yych == '`') { gotoCase = 116; continue; }; 535 if (yych <= 'z') { gotoCase = 112; continue; }; 536 { gotoCase = 116; continue; }; 537 } 538 } 539 } 456 540 case 35: 457 yyaccept = 1;541 yyaccept = 0; 458 542 yych = this._charAt(YYMARKER = ++cursor); 459 543 if (yych == '.') { gotoCase = 65; continue; }; … … 470 554 yych = this._charAt(YYMARKER = ++cursor); 471 555 if (yych == '*') { gotoCase = 104; continue; }; 472 { gotoCase = 30; continue; };556 { gotoCase = 49; continue; }; 473 557 case 38: 474 yyaccept = 2;558 yyaccept = 1; 475 559 yych = this._charAt(YYMARKER = ++cursor); 476 560 switch (yych) { 477 561 case '!': 562 case '"': 478 563 case '$': 564 case '\'': 479 565 case '-': 566 case '/': 567 case '=': 480 568 case '@': 481 569 case 'A': … … 504 592 case 'Y': 505 593 case 'Z': 594 case '[': 595 case ']': 506 596 case 'a': 507 597 case 'b': … … 593 683 yych = this._charAt(cursor); 594 684 case 49: 595 if (yych <= '/') { 596 if (yych <= '#') { 597 if (yych == '!') { gotoCase = 48; continue; }; 598 { gotoCase = 32; continue; }; 599 } else { 600 if (yych <= '$') { gotoCase = 48; continue; }; 601 if (yych == '-') { gotoCase = 48; continue; }; 602 { gotoCase = 32; continue; }; 603 } 604 } else { 605 if (yych <= '^') { 606 if (yych <= '9') { gotoCase = 48; continue; }; 607 if (yych <= '?') { gotoCase = 32; continue; }; 608 if (yych <= 'Z') { gotoCase = 48; continue; }; 609 { gotoCase = 32; continue; }; 610 } else { 611 if (yych == '`') { gotoCase = 32; continue; }; 612 if (yych <= 'z') { gotoCase = 48; continue; }; 613 { gotoCase = 32; continue; }; 685 if (yych <= '9') { 686 if (yych <= '&') { 687 if (yych <= '"') { 688 if (yych <= ' ') { gotoCase = 32; continue; }; 689 { gotoCase = 48; continue; }; 690 } else { 691 if (yych == '$') { gotoCase = 48; continue; }; 692 { gotoCase = 32; continue; }; 693 } 694 } else { 695 if (yych <= ',') { 696 if (yych <= '\'') { gotoCase = 48; continue; }; 697 { gotoCase = 32; continue; }; 698 } else { 699 if (yych == '.') { gotoCase = 32; continue; }; 700 { gotoCase = 48; continue; }; 701 } 702 } 703 } else { 704 if (yych <= '\\') { 705 if (yych <= '=') { 706 if (yych <= '<') { gotoCase = 32; continue; }; 707 { gotoCase = 48; continue; }; 708 } else { 709 if (yych <= '?') { gotoCase = 32; continue; }; 710 if (yych <= '[') { gotoCase = 48; continue; }; 711 { gotoCase = 32; continue; }; 712 } 713 } else { 714 if (yych <= '_') { 715 if (yych == '^') { gotoCase = 32; continue; }; 716 { gotoCase = 48; continue; }; 717 } else { 718 if (yych <= '`') { gotoCase = 32; continue; }; 719 if (yych <= 'z') { gotoCase = 48; continue; }; 720 { gotoCase = 32; continue; }; 721 } 614 722 } 615 723 } 616 724 case 50: 617 yyaccept = 2;725 yyaccept = 1; 618 726 YYMARKER = ++cursor; 619 727 yych = this._charAt(cursor); 620 728 switch (yych) { 621 729 case '!': 730 case '"': 622 731 case '$': 732 case '\'': 623 733 case '-': 734 case '/': 735 case '=': 624 736 case '@': 625 737 case 'A': … … 648 760 case 'Y': 649 761 case 'Z': 762 case '[': 763 case ']': 650 764 case 'a': 651 765 case 'b': … … 745 859 case 63: 746 860 yych = this._charAt(++cursor); 747 if (yych <= '/') { 748 if (yych <= '#') { 749 if (yych == '!') { gotoCase = 48; continue; }; 750 { gotoCase = 39; continue; }; 751 } else { 752 if (yych <= '$') { gotoCase = 48; continue; }; 753 if (yych == '-') { gotoCase = 48; continue; }; 754 { gotoCase = 39; continue; }; 755 } 756 } else { 757 if (yych <= '^') { 758 if (yych <= '9') { gotoCase = 48; continue; }; 759 if (yych <= '?') { gotoCase = 39; continue; }; 760 if (yych <= 'Z') { gotoCase = 48; continue; }; 761 { gotoCase = 39; continue; }; 762 } else { 763 if (yych == '`') { gotoCase = 39; continue; }; 764 if (yych <= 'z') { gotoCase = 48; continue; }; 765 { gotoCase = 39; continue; }; 861 if (yych <= '9') { 862 if (yych <= '&') { 863 if (yych <= '"') { 864 if (yych <= ' ') { gotoCase = 39; continue; }; 865 { gotoCase = 48; continue; }; 866 } else { 867 if (yych == '$') { gotoCase = 48; continue; }; 868 { gotoCase = 39; continue; }; 869 } 870 } else { 871 if (yych <= ',') { 872 if (yych <= '\'') { gotoCase = 48; continue; }; 873 { gotoCase = 39; continue; }; 874 } else { 875 if (yych == '.') { gotoCase = 39; continue; }; 876 { gotoCase = 48; continue; }; 877 } 878 } 879 } else { 880 if (yych <= '\\') { 881 if (yych <= '=') { 882 if (yych <= '<') { gotoCase = 39; continue; }; 883 { gotoCase = 48; continue; }; 884 } else { 885 if (yych <= '?') { gotoCase = 39; continue; }; 886 if (yych <= '[') { gotoCase = 48; continue; }; 887 { gotoCase = 39; continue; }; 888 } 889 } else { 890 if (yych <= '_') { 891 if (yych == '^') { gotoCase = 39; continue; }; 892 { gotoCase = 48; continue; }; 893 } else { 894 if (yych <= '`') { gotoCase = 39; continue; }; 895 if (yych <= 'z') { gotoCase = 48; continue; }; 896 { gotoCase = 39; continue; }; 897 } 766 898 } 767 899 } … … 776 908 case 66: 777 909 cursor = YYMARKER; 778 if (yyaccept <= 1) { 779 if (yyaccept <= 0) { 780 { gotoCase = 30; continue; }; 781 } else { 782 { gotoCase = 32; continue; }; 783 } 910 if (yyaccept <= 0) { 911 { gotoCase = 32; continue; }; 784 912 } else { 785 913 { gotoCase = 39; continue; }; … … 789 917 { gotoCase = 39; continue; }; 790 918 case 68: 791 yyaccept = 2;919 yyaccept = 1; 792 920 YYMARKER = ++cursor; 793 921 yych = this._charAt(cursor); … … 985 1113 { this.tokenType = "css-comment"; return cursor; } 986 1114 case 112: 987 ++cursor; 988 yych = this._charAt(cursor); 989 case 113: 1115 yyaccept = 0; 1116 YYMARKER = ++cursor; 1117 yych = this._charAt(cursor); 1118 if (yych <= '-') { 1119 if (yych <= '"') { 1120 if (yych <= '\f') { 1121 if (yych == '\n') { gotoCase = 32; continue; }; 1122 { gotoCase = 116; continue; }; 1123 } else { 1124 if (yych <= '\r') { gotoCase = 32; continue; }; 1125 if (yych <= ' ') { gotoCase = 116; continue; }; 1126 { gotoCase = 112; continue; }; 1127 } 1128 } else { 1129 if (yych <= '&') { 1130 if (yych == '$') { gotoCase = 112; continue; }; 1131 { gotoCase = 116; continue; }; 1132 } else { 1133 if (yych <= '\'') { gotoCase = 114; continue; }; 1134 if (yych <= ',') { gotoCase = 116; continue; }; 1135 { gotoCase = 112; continue; }; 1136 } 1137 } 1138 } else { 1139 if (yych <= '[') { 1140 if (yych <= '<') { 1141 if (yych <= '.') { gotoCase = 116; continue; }; 1142 if (yych <= '9') { gotoCase = 112; continue; }; 1143 { gotoCase = 116; continue; }; 1144 } else { 1145 if (yych <= '=') { gotoCase = 112; continue; }; 1146 if (yych <= '?') { gotoCase = 116; continue; }; 1147 { gotoCase = 112; continue; }; 1148 } 1149 } else { 1150 if (yych <= '^') { 1151 if (yych <= '\\') { gotoCase = 118; continue; }; 1152 if (yych <= ']') { gotoCase = 112; continue; }; 1153 { gotoCase = 116; continue; }; 1154 } else { 1155 if (yych == '`') { gotoCase = 116; continue; }; 1156 if (yych <= 'z') { gotoCase = 112; continue; }; 1157 { gotoCase = 116; continue; }; 1158 } 1159 } 1160 } 1161 case 114: 1162 ++cursor; 1163 if ((yych = this._charAt(cursor)) <= '9') { 1164 if (yych <= '&') { 1165 if (yych <= '"') { 1166 if (yych >= '!') { gotoCase = 48; continue; }; 1167 } else { 1168 if (yych == '$') { gotoCase = 48; continue; }; 1169 } 1170 } else { 1171 if (yych <= ',') { 1172 if (yych <= '\'') { gotoCase = 48; continue; }; 1173 } else { 1174 if (yych != '.') { gotoCase = 48; continue; }; 1175 } 1176 } 1177 } else { 1178 if (yych <= '\\') { 1179 if (yych <= '=') { 1180 if (yych >= '=') { gotoCase = 48; continue; }; 1181 } else { 1182 if (yych <= '?') { gotoCase = 115; continue; }; 1183 if (yych <= '[') { gotoCase = 48; continue; }; 1184 } 1185 } else { 1186 if (yych <= '_') { 1187 if (yych != '^') { gotoCase = 48; continue; }; 1188 } else { 1189 if (yych <= '`') { gotoCase = 115; continue; }; 1190 if (yych <= 'z') { gotoCase = 48; continue; }; 1191 } 1192 } 1193 } 1194 case 115: 1195 { return this._stringToken(cursor, true); } 1196 case 116: 1197 ++cursor; 1198 yych = this._charAt(cursor); 990 1199 if (yych <= '\r') { 991 1200 if (yych == '\n') { gotoCase = 66; continue; }; 992 if (yych <= '\f') { gotoCase = 11 2; continue; };1201 if (yych <= '\f') { gotoCase = 116; continue; }; 993 1202 { gotoCase = 66; continue; }; 994 1203 } else { 995 1204 if (yych <= '\'') { 996 if (yych <= '&') { gotoCase = 112; continue; }; 997 { gotoCase = 115; continue; }; 998 } else { 999 if (yych != '\\') { gotoCase = 112; continue; }; 1000 } 1001 } 1205 if (yych <= '&') { gotoCase = 116; continue; }; 1206 { gotoCase = 121; continue; }; 1207 } else { 1208 if (yych != '\\') { gotoCase = 116; continue; }; 1209 } 1210 } 1211 case 118: 1002 1212 ++cursor; 1003 1213 yych = this._charAt(cursor); … … 1006 1216 if (yych <= '\n') { 1007 1217 if (yych <= '\t') { gotoCase = 66; continue; }; 1008 { gotoCase = 117; continue; }; 1009 } else { 1010 if (yych == '\r') { gotoCase = 117; continue; }; 1011 { gotoCase = 66; continue; }; 1218 } else { 1219 if (yych != '\r') { gotoCase = 66; continue; }; 1012 1220 } 1013 1221 } else { 1014 1222 if (yych <= '\'') { 1015 if (yych <= '"') { gotoCase = 11 2; continue; };1223 if (yych <= '"') { gotoCase = 116; continue; }; 1016 1224 if (yych <= '&') { gotoCase = 66; continue; }; 1017 { gotoCase = 11 2; continue; };1018 } else { 1019 if (yych == '\\') { gotoCase = 11 2; continue; };1225 { gotoCase = 116; continue; }; 1226 } else { 1227 if (yych == '\\') { gotoCase = 116; continue; }; 1020 1228 { gotoCase = 66; continue; }; 1021 1229 } … … 1024 1232 if (yych <= 'q') { 1025 1233 if (yych <= 'f') { 1026 if (yych <= 'b') { gotoCase = 11 2; continue; };1234 if (yych <= 'b') { gotoCase = 116; continue; }; 1027 1235 if (yych <= 'e') { gotoCase = 66; continue; }; 1028 { gotoCase = 11 2; continue; };1029 } else { 1030 if (yych == 'n') { gotoCase = 11 2; continue; };1236 { gotoCase = 116; continue; }; 1237 } else { 1238 if (yych == 'n') { gotoCase = 116; continue; }; 1031 1239 { gotoCase = 66; continue; }; 1032 1240 } … … 1034 1242 if (yych <= 't') { 1035 1243 if (yych == 's') { gotoCase = 66; continue; }; 1036 { gotoCase = 11 2; continue; };1037 } else { 1038 if (yych == 'v') { gotoCase = 11 2; continue; };1244 { gotoCase = 116; continue; }; 1245 } else { 1246 if (yych == 'v') { gotoCase = 116; continue; }; 1039 1247 { gotoCase = 66; continue; }; 1040 1248 } 1041 1249 } 1042 1250 } 1043 case 115:1044 ++cursor;1045 { return this._stringToken(cursor, true); }1046 case 117:1047 1251 ++cursor; 1048 1252 this.setLexCondition(this._lexConditions.SSTRING); 1049 1253 { return this._stringToken(cursor); } 1050 case 119: 1051 ++cursor; 1052 yych = this._charAt(cursor); 1053 case 120: 1254 case 121: 1255 yych = this._charAt(++cursor); 1256 { gotoCase = 115; continue; }; 1257 case 122: 1258 yyaccept = 0; 1259 YYMARKER = ++cursor; 1260 yych = this._charAt(cursor); 1261 if (yych <= '-') { 1262 if (yych <= '!') { 1263 if (yych <= '\f') { 1264 if (yych == '\n') { gotoCase = 32; continue; }; 1265 } else { 1266 if (yych <= '\r') { gotoCase = 32; continue; }; 1267 if (yych >= '!') { gotoCase = 122; continue; }; 1268 } 1269 } else { 1270 if (yych <= '$') { 1271 if (yych <= '"') { gotoCase = 114; continue; }; 1272 if (yych >= '$') { gotoCase = 122; continue; }; 1273 } else { 1274 if (yych == '\'') { gotoCase = 122; continue; }; 1275 if (yych >= '-') { gotoCase = 122; continue; }; 1276 } 1277 } 1278 } else { 1279 if (yych <= '[') { 1280 if (yych <= '<') { 1281 if (yych <= '.') { gotoCase = 124; continue; }; 1282 if (yych <= '9') { gotoCase = 122; continue; }; 1283 } else { 1284 if (yych <= '=') { gotoCase = 122; continue; }; 1285 if (yych >= '@') { gotoCase = 122; continue; }; 1286 } 1287 } else { 1288 if (yych <= '^') { 1289 if (yych <= '\\') { gotoCase = 126; continue; }; 1290 if (yych <= ']') { gotoCase = 122; continue; }; 1291 } else { 1292 if (yych == '`') { gotoCase = 124; continue; }; 1293 if (yych <= 'z') { gotoCase = 122; continue; }; 1294 } 1295 } 1296 } 1297 case 124: 1298 ++cursor; 1299 yych = this._charAt(cursor); 1054 1300 if (yych <= '\r') { 1055 1301 if (yych == '\n') { gotoCase = 66; continue; }; 1056 if (yych <= '\f') { gotoCase = 1 19; continue; };1302 if (yych <= '\f') { gotoCase = 124; continue; }; 1057 1303 { gotoCase = 66; continue; }; 1058 1304 } else { 1059 1305 if (yych <= '"') { 1060 if (yych <= '!') { gotoCase = 119; continue; }; 1061 { gotoCase = 115; continue; }; 1062 } else { 1063 if (yych != '\\') { gotoCase = 119; continue; }; 1064 } 1065 } 1306 if (yych <= '!') { gotoCase = 124; continue; }; 1307 { gotoCase = 121; continue; }; 1308 } else { 1309 if (yych != '\\') { gotoCase = 124; continue; }; 1310 } 1311 } 1312 case 126: 1066 1313 ++cursor; 1067 1314 yych = this._charAt(cursor); … … 1075 1322 } else { 1076 1323 if (yych <= '\'') { 1077 if (yych <= '"') { gotoCase = 1 19; continue; };1324 if (yych <= '"') { gotoCase = 124; continue; }; 1078 1325 if (yych <= '&') { gotoCase = 66; continue; }; 1079 { gotoCase = 1 19; continue; };1080 } else { 1081 if (yych == '\\') { gotoCase = 1 19; continue; };1326 { gotoCase = 124; continue; }; 1327 } else { 1328 if (yych == '\\') { gotoCase = 124; continue; }; 1082 1329 { gotoCase = 66; continue; }; 1083 1330 } … … 1086 1333 if (yych <= 'q') { 1087 1334 if (yych <= 'f') { 1088 if (yych <= 'b') { gotoCase = 1 19; continue; };1335 if (yych <= 'b') { gotoCase = 124; continue; }; 1089 1336 if (yych <= 'e') { gotoCase = 66; continue; }; 1090 { gotoCase = 1 19; continue; };1091 } else { 1092 if (yych == 'n') { gotoCase = 1 19; continue; };1337 { gotoCase = 124; continue; }; 1338 } else { 1339 if (yych == 'n') { gotoCase = 124; continue; }; 1093 1340 { gotoCase = 66; continue; }; 1094 1341 } … … 1096 1343 if (yych <= 't') { 1097 1344 if (yych == 's') { gotoCase = 66; continue; }; 1098 { gotoCase = 1 19; continue; };1099 } else { 1100 if (yych == 'v') { gotoCase = 1 19; continue; };1345 { gotoCase = 124; continue; }; 1346 } else { 1347 if (yych == 'v') { gotoCase = 124; continue; }; 1101 1348 { gotoCase = 66; continue; }; 1102 1349 } … … 1110 1357 yych = this._charAt(cursor); 1111 1358 if (yych <= '\r') { 1112 if (yych == '\n') { gotoCase = 1 28; continue; };1113 if (yych <= '\f') { gotoCase = 1 27; continue; };1114 { gotoCase = 1 28; continue; };1359 if (yych == '\n') { gotoCase = 133; continue; }; 1360 if (yych <= '\f') { gotoCase = 132; continue; }; 1361 { gotoCase = 133; continue; }; 1115 1362 } else { 1116 1363 if (yych <= '\'') { 1117 if (yych <= '&') { gotoCase = 1 27; continue; };1118 { gotoCase = 13 0; continue; };1119 } else { 1120 if (yych == '\\') { gotoCase = 13 2; continue; };1121 { gotoCase = 1 27; continue; };1122 } 1123 } 1124 case 1 26:1364 if (yych <= '&') { gotoCase = 132; continue; }; 1365 { gotoCase = 135; continue; }; 1366 } else { 1367 if (yych == '\\') { gotoCase = 137; continue; }; 1368 { gotoCase = 132; continue; }; 1369 } 1370 } 1371 case 131: 1125 1372 { return this._stringToken(cursor); } 1126 case 1 27:1373 case 132: 1127 1374 yyaccept = 0; 1128 1375 yych = this._charAt(YYMARKER = ++cursor); 1129 { gotoCase = 13 4; continue; };1130 case 1 28:1131 ++cursor; 1132 case 1 29:1376 { gotoCase = 139; continue; }; 1377 case 133: 1378 ++cursor; 1379 case 134: 1133 1380 { this.tokenType = null; return cursor; } 1134 case 13 0:1135 ++cursor; 1136 case 13 1:1381 case 135: 1382 ++cursor; 1383 case 136: 1137 1384 this.setLexCondition(this._lexConditions.INITIAL); 1138 1385 { return this._stringToken(cursor, true); } 1139 case 13 2:1386 case 137: 1140 1387 yych = this._charAt(++cursor); 1141 1388 if (yych <= 'e') { 1142 1389 if (yych <= '\'') { 1143 if (yych == '"') { gotoCase = 13 3; continue; };1144 if (yych <= '&') { gotoCase = 1 29; continue; };1390 if (yych == '"') { gotoCase = 138; continue; }; 1391 if (yych <= '&') { gotoCase = 134; continue; }; 1145 1392 } else { 1146 1393 if (yych <= '\\') { 1147 if (yych <= '[') { gotoCase = 1 29; continue; };1148 } else { 1149 if (yych != 'b') { gotoCase = 1 29; continue; };1394 if (yych <= '[') { gotoCase = 134; continue; }; 1395 } else { 1396 if (yych != 'b') { gotoCase = 134; continue; }; 1150 1397 } 1151 1398 } … … 1153 1400 if (yych <= 'r') { 1154 1401 if (yych <= 'm') { 1155 if (yych >= 'g') { gotoCase = 1 29; continue; };1156 } else { 1157 if (yych <= 'n') { gotoCase = 13 3; continue; };1158 if (yych <= 'q') { gotoCase = 1 29; continue; };1402 if (yych >= 'g') { gotoCase = 134; continue; }; 1403 } else { 1404 if (yych <= 'n') { gotoCase = 138; continue; }; 1405 if (yych <= 'q') { gotoCase = 134; continue; }; 1159 1406 } 1160 1407 } else { 1161 1408 if (yych <= 't') { 1162 if (yych <= 's') { gotoCase = 1 29; continue; };1163 } else { 1164 if (yych != 'v') { gotoCase = 1 29; continue; };1165 } 1166 } 1167 } 1168 case 13 3:1409 if (yych <= 's') { gotoCase = 134; continue; }; 1410 } else { 1411 if (yych != 'v') { gotoCase = 134; continue; }; 1412 } 1413 } 1414 } 1415 case 138: 1169 1416 yyaccept = 0; 1170 1417 YYMARKER = ++cursor; 1171 1418 yych = this._charAt(cursor); 1172 case 13 4:1419 case 139: 1173 1420 if (yych <= '\r') { 1174 if (yych == '\n') { gotoCase = 1 26; continue; };1175 if (yych <= '\f') { gotoCase = 13 3; continue; };1176 { gotoCase = 1 26; continue; };1421 if (yych == '\n') { gotoCase = 131; continue; }; 1422 if (yych <= '\f') { gotoCase = 138; continue; }; 1423 { gotoCase = 131; continue; }; 1177 1424 } else { 1178 1425 if (yych <= '\'') { 1179 if (yych <= '&') { gotoCase = 13 3; continue; };1180 { gotoCase = 1 37; continue; };1181 } else { 1182 if (yych != '\\') { gotoCase = 13 3; continue; };1426 if (yych <= '&') { gotoCase = 138; continue; }; 1427 { gotoCase = 142; continue; }; 1428 } else { 1429 if (yych != '\\') { gotoCase = 138; continue; }; 1183 1430 } 1184 1431 } … … 1187 1434 if (yych <= 'e') { 1188 1435 if (yych <= '\'') { 1189 if (yych == '"') { gotoCase = 13 3; continue; };1190 if (yych >= '\'') { gotoCase = 13 3; continue; };1436 if (yych == '"') { gotoCase = 138; continue; }; 1437 if (yych >= '\'') { gotoCase = 138; continue; }; 1191 1438 } else { 1192 1439 if (yych <= '\\') { 1193 if (yych >= '\\') { gotoCase = 13 3; continue; };1194 } else { 1195 if (yych == 'b') { gotoCase = 13 3; continue; };1440 if (yych >= '\\') { gotoCase = 138; continue; }; 1441 } else { 1442 if (yych == 'b') { gotoCase = 138; continue; }; 1196 1443 } 1197 1444 } … … 1199 1446 if (yych <= 'r') { 1200 1447 if (yych <= 'm') { 1201 if (yych <= 'f') { gotoCase = 13 3; continue; };1202 } else { 1203 if (yych <= 'n') { gotoCase = 13 3; continue; };1204 if (yych >= 'r') { gotoCase = 13 3; continue; };1448 if (yych <= 'f') { gotoCase = 138; continue; }; 1449 } else { 1450 if (yych <= 'n') { gotoCase = 138; continue; }; 1451 if (yych >= 'r') { gotoCase = 138; continue; }; 1205 1452 } 1206 1453 } else { 1207 1454 if (yych <= 't') { 1208 if (yych >= 't') { gotoCase = 13 3; continue; };1209 } else { 1210 if (yych == 'v') { gotoCase = 13 3; continue; };1455 if (yych >= 't') { gotoCase = 138; continue; }; 1456 } else { 1457 if (yych == 'v') { gotoCase = 138; continue; }; 1211 1458 } 1212 1459 } 1213 1460 } 1214 1461 cursor = YYMARKER; 1215 { gotoCase = 126; continue; };1216 case 137:1217 ++cursor;1218 yych = this._charAt(cursor);1219 1462 { gotoCase = 131; continue; }; 1463 case 142: 1464 ++cursor; 1465 yych = this._charAt(cursor); 1466 { gotoCase = 136; continue; }; 1220 1467 } 1221 1468 … … 1224 1471 } 1225 1472 1226 WebInspector.SourceCSSTokenizer.prototype.__proto__ = WebInspector. TextEditorHighlighter.Tokenizer.prototype;1473 WebInspector.SourceCSSTokenizer.prototype.__proto__ = WebInspector.SourceTokenizer.prototype; -
trunk/WebCore/inspector/front-end/SourceCSSTokenizer.re2js
r53846 r54053 43 43 WebInspector.SourceCSSTokenizer = function() 44 44 { 45 WebInspector. TextEditorHighlighter.Tokenizer.call(this);45 WebInspector.SourceTokenizer.call(this); 46 46 47 47 this._propertyKeywords = [ … … 213 213 CloseCurlyBracket = "}"; 214 214 215 OpenBracket = "(";216 CloseBracket = ")";217 218 215 Colon = ":"; 219 216 Semicolon = ";"; … … 222 219 "mm" | "in" | "pt" | "pc" | "deg" | "rad" | "grad" | "turn" | "ms" | "s" | "Hz" | "kHz" | "%")?; 223 220 224 Identifier = [@!_\-$0-9a-zA-Z ]+;221 Identifier = [@!_\-$0-9a-zA-Z\[\]='"/]+; 225 222 226 223 DoubleStringContent = ([^\r\n\"\\] | "\\" ['"\\bfnrtv])*; … … 296 293 this.tokenType = "css-at-rule"; 297 294 this._parseCondition = this._parseConditions.AT_RULE; 298 } else 295 } else if (token.indexOf("@") === 0) 296 this.tokenType = "css-at-rule"; 297 else 299 298 this.tokenType = "css-selector"; 300 299 } … … 317 316 } 318 317 319 WebInspector.SourceCSSTokenizer.prototype.__proto__ = WebInspector. TextEditorHighlighter.Tokenizer.prototype;318 WebInspector.SourceCSSTokenizer.prototype.__proto__ = WebInspector.SourceTokenizer.prototype; -
trunk/WebCore/inspector/front-end/SourceHTMLTokenizer.js
r53916 r54053 1 /* Generated by re2c 0.13.5 on T ue Jan 26 23:10:382010 */1 /* Generated by re2c 0.13.5 on Thu Jan 28 20:49:22 2010 */ 2 2 /* 3 3 * Copyright (C) 2009 Google Inc. All rights reserved. … … 44 44 WebInspector.SourceHTMLTokenizer = function() 45 45 { 46 WebInspector. TextEditorHighlighter.Tokenizer.call(this);46 WebInspector.SourceTokenizer.call(this); 47 47 48 48 this._lexConditions = { … … 235 235 case this.case_INITIAL: 236 236 yych = this._charAt(cursor); 237 if (yych <= ' >') {237 if (yych <= '=') { 238 238 if (yych <= '\'') { 239 239 if (yych == '"') { gotoCase = 29; continue; }; 240 240 if (yych >= '\'') { gotoCase = 30; continue; }; 241 241 } else { 242 if (yych <= ';') { gotoCase = 27; continue; }; 243 if (yych <= '<') { gotoCase = 31; continue; }; 244 if (yych <= '=') { gotoCase = 33; continue; }; 245 { gotoCase = 35; continue; }; 246 } 247 } else { 248 if (yych <= '_') { 242 if (yych <= '9') { 243 if (yych >= '0') { gotoCase = 31; continue; }; 244 } else { 245 if (yych <= ';') { gotoCase = 27; continue; }; 246 if (yych <= '<') { gotoCase = 33; continue; }; 247 { gotoCase = 35; continue; }; 248 } 249 } 250 } else { 251 if (yych <= '^') { 252 if (yych <= '>') { gotoCase = 37; continue; }; 249 253 if (yych <= '@') { gotoCase = 27; continue; }; 250 if (yych <= 'Z') { gotoCase = 37; continue; }; 251 if (yych >= '_') { gotoCase = 37; continue; }; 252 } else { 253 if (yych <= '`') { gotoCase = 27; continue; }; 254 if (yych <= 'z') { gotoCase = 37; continue; }; 255 if (yych >= 0x80) { gotoCase = 37; continue; }; 254 if (yych <= 'Z') { gotoCase = 31; continue; }; 255 } else { 256 if (yych <= '`') { 257 if (yych <= '_') { gotoCase = 31; continue; }; 258 } else { 259 if (yych <= 'z') { gotoCase = 31; continue; }; 260 if (yych >= 0x80) { gotoCase = 31; continue; }; 261 } 256 262 } 257 263 } … … 269 275 { gotoCase = 76; continue; }; 270 276 case 31: 271 yyaccept = 1; 272 yych = this._charAt(YYMARKER = ++cursor); 273 if (yych <= '/') { 274 if (yych == '!') { gotoCase = 44; continue; }; 275 if (yych >= '/') { gotoCase = 41; continue; }; 276 } else { 277 if (yych <= 'S') { 278 if (yych >= 'S') { gotoCase = 42; continue; }; 279 } else { 280 if (yych == 's') { gotoCase = 42; continue; }; 281 } 282 } 277 ++cursor; 278 yych = this._charAt(cursor); 279 { gotoCase = 74; continue; }; 283 280 case 32: 284 {285 if (this._parseCondition === this._parseConditions.SCRIPT) {286 this.tokenType = null;287 return cursor;288 }289 290 this.tokenType = "html-tag";291 this._parseCondition = this._parseConditions.TAG;292 return cursor;293 }294 case 33:295 ++cursor;296 {297 if (this._isAttribute()) {298 this.tokenType = null;299 this._setAttributeValue();300 } else if (this._parseCondition === this._parseConditions.DOCTYPE)301 this.tokenType = "html-doctype";302 else303 this.tokenType = null;304 return cursor;305 }306 case 35:307 ++cursor;308 {309 if (this._parseCondition === this._parseConditions.SCRIPT) {310 this.tokenType = null;311 return cursor;312 }313 314 if (this._parseCondition === this._parseConditions.DOCTYPE)315 this.tokenType = "html-doctype";316 else317 this.tokenType = "html-tag";318 319 if (this._parseCondition === this._parseConditions.SCRIPT_ATTRIBUTE)320 this._parseCondition = this._parseConditions.SCRIPT;321 else322 this._parseCondition = this._parseConditions.INITIAL;323 return cursor;324 }325 case 37:326 ++cursor;327 yych = this._charAt(cursor);328 { gotoCase = 40; continue; };329 case 38:330 281 { 331 282 if (this._parseCondition === this._parseConditions.SCRIPT) { … … 347 298 return cursor; 348 299 } 349 case 39: 350 ++cursor; 351 yych = this._charAt(cursor); 352 case 40: 353 if (yych <= '_') { 354 if (yych <= '@') { gotoCase = 38; continue; }; 355 if (yych <= 'Z') { gotoCase = 39; continue; }; 356 if (yych <= '^') { gotoCase = 38; continue; }; 357 { gotoCase = 39; continue; }; 358 } else { 359 if (yych <= '`') { gotoCase = 38; continue; }; 360 if (yych <= 'z') { gotoCase = 39; continue; }; 361 if (yych <= 0x7F) { gotoCase = 38; continue; }; 362 { gotoCase = 39; continue; }; 363 } 364 case 41: 300 case 33: 365 301 yyaccept = 1; 366 302 yych = this._charAt(YYMARKER = ++cursor); 367 if (yych == 'S') { gotoCase = 68; continue; }; 368 if (yych == 's') { gotoCase = 68; continue; }; 369 { gotoCase = 32; continue; }; 370 case 42: 371 yych = this._charAt(++cursor); 372 if (yych == 'C') { gotoCase = 62; continue; }; 373 if (yych == 'c') { gotoCase = 62; continue; }; 374 case 43: 303 if (yych <= '/') { 304 if (yych == '!') { gotoCase = 42; continue; }; 305 if (yych >= '/') { gotoCase = 39; continue; }; 306 } else { 307 if (yych <= 'S') { 308 if (yych >= 'S') { gotoCase = 40; continue; }; 309 } else { 310 if (yych == 's') { gotoCase = 40; continue; }; 311 } 312 } 313 case 34: 314 { 315 if (this._parseCondition === this._parseConditions.SCRIPT) { 316 this.tokenType = null; 317 return cursor; 318 } 319 320 this.tokenType = "html-tag"; 321 this._parseCondition = this._parseConditions.TAG; 322 return cursor; 323 } 324 case 35: 325 ++cursor; 326 { 327 if (this._isAttribute()) { 328 this.tokenType = null; 329 this._setAttributeValue(); 330 } else if (this._parseCondition === this._parseConditions.DOCTYPE) 331 this.tokenType = "html-doctype"; 332 else 333 this.tokenType = null; 334 return cursor; 335 } 336 case 37: 337 ++cursor; 338 { 339 if (this._parseCondition === this._parseConditions.SCRIPT) { 340 this.tokenType = null; 341 return cursor; 342 } 343 344 if (this._parseCondition === this._parseConditions.DOCTYPE) 345 this.tokenType = "html-doctype"; 346 else 347 this.tokenType = "html-tag"; 348 349 if (this._parseCondition === this._parseConditions.SCRIPT_ATTRIBUTE) 350 this._parseCondition = this._parseConditions.SCRIPT; 351 else 352 this._parseCondition = this._parseConditions.INITIAL; 353 return cursor; 354 } 355 case 39: 356 yyaccept = 1; 357 yych = this._charAt(YYMARKER = ++cursor); 358 if (yych == 'S') { gotoCase = 66; continue; }; 359 if (yych == 's') { gotoCase = 66; continue; }; 360 { gotoCase = 34; continue; }; 361 case 40: 362 yych = this._charAt(++cursor); 363 if (yych == 'C') { gotoCase = 60; continue; }; 364 if (yych == 'c') { gotoCase = 60; continue; }; 365 case 41: 375 366 cursor = YYMARKER; 376 367 if (yyaccept <= 0) { 377 368 { gotoCase = 28; continue; }; 378 369 } else { 379 { gotoCase = 32; continue; }; 380 } 370 { gotoCase = 34; continue; }; 371 } 372 case 42: 373 yych = this._charAt(++cursor); 374 if (yych <= 'C') { 375 if (yych != '-') { gotoCase = 41; continue; }; 376 } else { 377 if (yych <= 'D') { gotoCase = 44; continue; }; 378 if (yych == 'd') { gotoCase = 44; continue; }; 379 { gotoCase = 41; continue; }; 380 } 381 yych = this._charAt(++cursor); 382 if (yych == '-') { gotoCase = 52; continue; }; 383 { gotoCase = 41; continue; }; 381 384 case 44: 382 385 yych = this._charAt(++cursor); 383 if (yych <= 'C') { 384 if (yych != '-') { gotoCase = 43; continue; }; 385 } else { 386 if (yych <= 'D') { gotoCase = 46; continue; }; 387 if (yych == 'd') { gotoCase = 46; continue; }; 388 { gotoCase = 43; continue; }; 389 } 390 yych = this._charAt(++cursor); 391 if (yych == '-') { gotoCase = 54; continue; }; 392 { gotoCase = 43; continue; }; 386 if (yych == 'O') { gotoCase = 45; continue; }; 387 if (yych != 'o') { gotoCase = 41; continue; }; 388 case 45: 389 yych = this._charAt(++cursor); 390 if (yych == 'C') { gotoCase = 46; continue; }; 391 if (yych != 'c') { gotoCase = 41; continue; }; 393 392 case 46: 394 393 yych = this._charAt(++cursor); 395 if (yych == ' O') { gotoCase = 47; continue; };396 if (yych != ' o') { gotoCase = 43; continue; };394 if (yych == 'T') { gotoCase = 47; continue; }; 395 if (yych != 't') { gotoCase = 41; continue; }; 397 396 case 47: 398 397 yych = this._charAt(++cursor); 399 if (yych == ' C') { gotoCase = 48; continue; };400 if (yych != ' c') { gotoCase = 43; continue; };398 if (yych == 'Y') { gotoCase = 48; continue; }; 399 if (yych != 'y') { gotoCase = 41; continue; }; 401 400 case 48: 402 401 yych = this._charAt(++cursor); 403 if (yych == ' T') { gotoCase = 49; continue; };404 if (yych != ' t') { gotoCase = 43; continue; };402 if (yych == 'P') { gotoCase = 49; continue; }; 403 if (yych != 'p') { gotoCase = 41; continue; }; 405 404 case 49: 406 405 yych = this._charAt(++cursor); 407 if (yych == ' Y') { gotoCase = 50; continue; };408 if (yych != ' y') { gotoCase = 43; continue; };406 if (yych == 'E') { gotoCase = 50; continue; }; 407 if (yych != 'e') { gotoCase = 41; continue; }; 409 408 case 50: 410 yych = this._charAt(++cursor);411 if (yych == 'P') { gotoCase = 51; continue; };412 if (yych != 'p') { gotoCase = 43; continue; };413 case 51:414 yych = this._charAt(++cursor);415 if (yych == 'E') { gotoCase = 52; continue; };416 if (yych != 'e') { gotoCase = 43; continue; };417 case 52:418 409 ++cursor; 419 410 { … … 422 413 return cursor; 423 414 } 424 case 5 4:425 ++cursor; 426 yych = this._charAt(cursor); 427 if (yych <= '\f') { 428 if (yych == '\n') { gotoCase = 5 7; continue; };429 { gotoCase = 5 4; continue; };430 } else { 431 if (yych <= '\r') { gotoCase = 5 7; continue; };432 if (yych != '-') { gotoCase = 5 4; continue; };433 } 434 ++cursor; 435 yych = this._charAt(cursor); 436 if (yych == '-') { gotoCase = 5 9; continue; };437 { gotoCase = 4 3; continue; };438 case 5 7:415 case 52: 416 ++cursor; 417 yych = this._charAt(cursor); 418 if (yych <= '\f') { 419 if (yych == '\n') { gotoCase = 55; continue; }; 420 { gotoCase = 52; continue; }; 421 } else { 422 if (yych <= '\r') { gotoCase = 55; continue; }; 423 if (yych != '-') { gotoCase = 52; continue; }; 424 } 425 ++cursor; 426 yych = this._charAt(cursor); 427 if (yych == '-') { gotoCase = 57; continue; }; 428 { gotoCase = 41; continue; }; 429 case 55: 439 430 ++cursor; 440 431 this.setLexCondition(this._lexConditions.COMMENT); 441 432 { this.tokenType = "html-comment"; return cursor; } 442 case 5 9:443 ++cursor; 444 yych = this._charAt(cursor); 445 if (yych != '>') { gotoCase = 5 4; continue; };433 case 57: 434 ++cursor; 435 yych = this._charAt(cursor); 436 if (yych != '>') { gotoCase = 52; continue; }; 446 437 ++cursor; 447 438 { this.tokenType = "html-comment"; return cursor; } 439 case 60: 440 yych = this._charAt(++cursor); 441 if (yych == 'R') { gotoCase = 61; continue; }; 442 if (yych != 'r') { gotoCase = 41; continue; }; 443 case 61: 444 yych = this._charAt(++cursor); 445 if (yych == 'I') { gotoCase = 62; continue; }; 446 if (yych != 'i') { gotoCase = 41; continue; }; 448 447 case 62: 449 448 yych = this._charAt(++cursor); 450 if (yych == ' R') { gotoCase = 63; continue; };451 if (yych != ' r') { gotoCase = 43; continue; };449 if (yych == 'P') { gotoCase = 63; continue; }; 450 if (yych != 'p') { gotoCase = 41; continue; }; 452 451 case 63: 453 452 yych = this._charAt(++cursor); 454 if (yych == ' I') { gotoCase = 64; continue; };455 if (yych != ' i') { gotoCase = 43; continue; };453 if (yych == 'T') { gotoCase = 64; continue; }; 454 if (yych != 't') { gotoCase = 41; continue; }; 456 455 case 64: 457 yych = this._charAt(++cursor);458 if (yych == 'P') { gotoCase = 65; continue; };459 if (yych != 'p') { gotoCase = 43; continue; };460 case 65:461 yych = this._charAt(++cursor);462 if (yych == 'T') { gotoCase = 66; continue; };463 if (yych != 't') { gotoCase = 43; continue; };464 case 66:465 456 ++cursor; 466 457 { … … 469 460 return cursor; 470 461 } 462 case 66: 463 yych = this._charAt(++cursor); 464 if (yych == 'C') { gotoCase = 67; continue; }; 465 if (yych != 'c') { gotoCase = 41; continue; }; 466 case 67: 467 yych = this._charAt(++cursor); 468 if (yych == 'R') { gotoCase = 68; continue; }; 469 if (yych != 'r') { gotoCase = 41; continue; }; 471 470 case 68: 472 471 yych = this._charAt(++cursor); 473 if (yych == ' C') { gotoCase = 69; continue; };474 if (yych != ' c') { gotoCase = 43; continue; };472 if (yych == 'I') { gotoCase = 69; continue; }; 473 if (yych != 'i') { gotoCase = 41; continue; }; 475 474 case 69: 476 475 yych = this._charAt(++cursor); 477 if (yych == ' R') { gotoCase = 70; continue; };478 if (yych != ' r') { gotoCase = 43; continue; };476 if (yych == 'P') { gotoCase = 70; continue; }; 477 if (yych != 'p') { gotoCase = 41; continue; }; 479 478 case 70: 480 479 yych = this._charAt(++cursor); 481 if (yych == ' I') { gotoCase = 71; continue; };482 if (yych != ' i') { gotoCase = 43; continue; };480 if (yych == 'T') { gotoCase = 71; continue; }; 481 if (yych != 't') { gotoCase = 41; continue; }; 483 482 case 71: 484 yych = this._charAt(++cursor);485 if (yych == 'P') { gotoCase = 72; continue; };486 if (yych != 'p') { gotoCase = 43; continue; };487 case 72:488 yych = this._charAt(++cursor);489 if (yych == 'T') { gotoCase = 73; continue; };490 if (yych != 't') { gotoCase = 43; continue; };491 case 73:492 483 ++cursor; 493 484 { … … 496 487 return cursor; 497 488 } 489 case 73: 490 ++cursor; 491 yych = this._charAt(cursor); 492 case 74: 493 if (yych <= '^') { 494 if (yych <= '9') { 495 if (yych <= '/') { gotoCase = 32; continue; }; 496 { gotoCase = 73; continue; }; 497 } else { 498 if (yych <= '@') { gotoCase = 32; continue; }; 499 if (yych <= 'Z') { gotoCase = 73; continue; }; 500 { gotoCase = 32; continue; }; 501 } 502 } else { 503 if (yych <= '`') { 504 if (yych <= '_') { gotoCase = 73; continue; }; 505 { gotoCase = 32; continue; }; 506 } else { 507 if (yych <= 'z') { gotoCase = 73; continue; }; 508 if (yych <= 0x7F) { gotoCase = 32; continue; }; 509 { gotoCase = 73; continue; }; 510 } 511 } 498 512 case 75: 499 513 ++cursor; … … 574 588 } 575 589 576 WebInspector.SourceHTMLTokenizer.prototype.__proto__ = WebInspector. TextEditorHighlighter.Tokenizer.prototype;590 WebInspector.SourceHTMLTokenizer.prototype.__proto__ = WebInspector.SourceTokenizer.prototype; -
trunk/WebCore/inspector/front-end/SourceHTMLTokenizer.re2js
r53916 r54053 43 43 WebInspector.SourceHTMLTokenizer = function() 44 44 { 45 WebInspector. TextEditorHighlighter.Tokenizer.call(this);45 WebInspector.SourceTokenizer.call(this); 46 46 47 47 this._lexConditions = { … … 151 151 SingleStringEnd = SingleStringContent "'"; 152 152 153 Identifier = [_a-zA-Z \x80-\xFF]+;153 Identifier = [_a-zA-Z0-9\x80-\xFF]+; 154 154 155 155 <INITIAL> Comment { this.tokenType = "html-comment"; return cursor; } … … 256 256 } 257 257 258 WebInspector.SourceHTMLTokenizer.prototype.__proto__ = WebInspector. TextEditorHighlighter.Tokenizer.prototype;258 WebInspector.SourceHTMLTokenizer.prototype.__proto__ = WebInspector.SourceTokenizer.prototype; -
trunk/WebCore/inspector/front-end/SourceJavaScriptTokenizer.js
r53846 r54053 1 /* Generated by re2c 0.13.5 on T ue Jan 26 01:16:33 2010 */1 /* Generated by re2c 0.13.5 on Thu Jan 28 20:49:23 2010 */ 2 2 /* 3 3 * Copyright (C) 2009 Google Inc. All rights reserved. … … 44 44 WebInspector.SourceJavaScriptTokenizer = function() 45 45 { 46 WebInspector. TextEditorHighlighter.Tokenizer.call(this);46 WebInspector.SourceTokenizer.call(this); 47 47 48 48 this._keywords = [ … … 118 118 } 119 119 case 2: 120 { this.tokenType = "j s-comment"; return cursor; }120 { this.tokenType = "javascript-comment"; return cursor; } 121 121 case 3: 122 122 yyaccept = 0; … … 134 134 ++cursor; 135 135 this.setLexCondition(this._lexConditions.NODIV); 136 { this.tokenType = "j s-comment"; return cursor; }136 { this.tokenType = "javascript-comment"; return cursor; } 137 137 case 9: 138 138 ++cursor; … … 248 248 var token = this._line.substring(cursorOnEnter, cursor); 249 249 if (token in this._keywords) 250 this.tokenType = "j s-keyword";250 this.tokenType = "javascript-keyword"; 251 251 else 252 this.tokenType = null;252 this.tokenType = "javascript-ident"; 253 253 return cursor; 254 254 } … … 324 324 } 325 325 case 35: 326 { this.tokenType = "j s-number"; return cursor; }326 { this.tokenType = "javascript-number"; return cursor; } 327 327 case 36: 328 328 yyaccept = 3; … … 637 637 if (yych != '\r') { gotoCase = 80; continue; }; 638 638 case 82: 639 { this.tokenType = "j s-comment"; return cursor; }639 { this.tokenType = "javascript-comment"; return cursor; } 640 640 case 83: 641 641 ++cursor; … … 647 647 ++cursor; 648 648 this.setLexCondition(this._lexConditions.COMMENT); 649 { this.tokenType = "j s-comment"; return cursor; }649 { this.tokenType = "javascript-comment"; return cursor; } 650 650 case 87: 651 651 ++cursor; 652 { this.tokenType = "j s-comment"; return cursor; }652 { this.tokenType = "javascript-comment"; return cursor; } 653 653 case 89: 654 654 yyaccept = 3; … … 743 743 case 98: 744 744 ++cursor; 745 { this.tokenType = "j s-string"; return cursor; }745 { this.tokenType = "javascript-string"; return cursor; } 746 746 case 100: 747 747 ++cursor; … … 760 760 ++cursor; 761 761 this.setLexCondition(this._lexConditions.SSTRING); 762 { this.tokenType = "j s-string"; return cursor; }762 { this.tokenType = "javascript-string"; return cursor; } 763 763 case 103: 764 764 ++cursor; … … 870 870 ++cursor; 871 871 this.setLexCondition(this._lexConditions.DSTRING); 872 { this.tokenType = "j s-string"; return cursor; }872 { this.tokenType = "javascript-string"; return cursor; } 873 873 case 112: 874 874 ++cursor; … … 927 927 } 928 928 case 118: 929 { this.tokenType = "j s-string"; return cursor; }929 { this.tokenType = "javascript-string"; return cursor; } 930 930 case 119: 931 931 yyaccept = 0; … … 940 940 case 123: 941 941 this.setLexCondition(this._lexConditions.NODIV); 942 { this.tokenType = "j s-string"; return cursor; }942 { this.tokenType = "javascript-string"; return cursor; } 943 943 case 124: 944 944 yyaccept = 1; … … 1180 1180 var token = this._line.substring(cursorOnEnter, cursor); 1181 1181 if (token in this._keywords) 1182 this.tokenType = "j s-keyword";1182 this.tokenType = "javascript-keyword"; 1183 1183 else 1184 this.tokenType = null;1184 this.tokenType = "javascript-ident"; 1185 1185 return cursor; 1186 1186 } … … 1269 1269 case 155: 1270 1270 this.setLexCondition(this._lexConditions.DIV); 1271 { this.tokenType = "j s-number"; return cursor; }1271 { this.tokenType = "javascript-number"; return cursor; } 1272 1272 case 156: 1273 1273 yyaccept = 2; … … 1628 1628 if (yych != '\r') { gotoCase = 204; continue; }; 1629 1629 case 206: 1630 { this.tokenType = "j s-comment"; return cursor; }1630 { this.tokenType = "javascript-comment"; return cursor; } 1631 1631 case 207: 1632 1632 ++cursor; … … 1638 1638 ++cursor; 1639 1639 this.setLexCondition(this._lexConditions.COMMENT); 1640 { this.tokenType = "j s-comment"; return cursor; }1640 { this.tokenType = "javascript-comment"; return cursor; } 1641 1641 case 211: 1642 1642 ++cursor; 1643 { this.tokenType = "j s-comment"; return cursor; }1643 { this.tokenType = "javascript-comment"; return cursor; } 1644 1644 case 213: 1645 1645 ++cursor; … … 1678 1678 case 217: 1679 1679 this.setLexCondition(this._lexConditions.REGEX); 1680 { this.tokenType = "j s-regex"; return cursor; }1680 { this.tokenType = "javascript-regexp"; return cursor; } 1681 1681 case 218: 1682 1682 ++cursor; … … 1710 1710 if (yych == 'm') { gotoCase = 220; continue; }; 1711 1711 } 1712 { this.tokenType = "j s-regex"; return cursor; }1712 { this.tokenType = "javascript-regexp"; return cursor; } 1713 1713 case 223: 1714 1714 ++cursor; … … 1901 1901 case 243: 1902 1902 ++cursor; 1903 { this.tokenType = "j s-string"; return cursor; }1903 { this.tokenType = "javascript-string"; return cursor; } 1904 1904 case 245: 1905 1905 ++cursor; … … 1918 1918 ++cursor; 1919 1919 this.setLexCondition(this._lexConditions.SSTRING); 1920 { this.tokenType = "j s-string"; return cursor; }1920 { this.tokenType = "javascript-string"; return cursor; } 1921 1921 case 248: 1922 1922 ++cursor; … … 2028 2028 ++cursor; 2029 2029 this.setLexCondition(this._lexConditions.DSTRING); 2030 { this.tokenType = "j s-string"; return cursor; }2030 { this.tokenType = "javascript-string"; return cursor; } 2031 2031 case 257: 2032 2032 ++cursor; … … 2091 2091 } 2092 2092 case 263: 2093 { this.tokenType = "j s-regex"; return cursor; }2093 { this.tokenType = "javascript-regexp"; return cursor; } 2094 2094 case 264: 2095 2095 yyaccept = 0; … … 2106 2106 case 268: 2107 2107 this.setLexCondition(this._lexConditions.NODIV); 2108 { this.tokenType = "j s-regex"; return cursor; }2108 { this.tokenType = "javascript-regexp"; return cursor; } 2109 2109 case 269: 2110 2110 yyaccept = 1; … … 2250 2250 } 2251 2251 case 285: 2252 { this.tokenType = "j s-string"; return cursor; }2252 { this.tokenType = "javascript-string"; return cursor; } 2253 2253 case 286: 2254 2254 yyaccept = 0; … … 2263 2263 case 290: 2264 2264 this.setLexCondition(this._lexConditions.NODIV); 2265 { this.tokenType = "j s-string"; return cursor; }2265 { this.tokenType = "javascript-string"; return cursor; } 2266 2266 case 291: 2267 2267 yyaccept = 1; … … 2414 2414 } 2415 2415 2416 WebInspector.SourceJavaScriptTokenizer.prototype.__proto__ = WebInspector. TextEditorHighlighter.Tokenizer.prototype;2416 WebInspector.SourceJavaScriptTokenizer.prototype.__proto__ = WebInspector.SourceTokenizer.prototype; -
trunk/WebCore/inspector/front-end/SourceJavaScriptTokenizer.re2js
r53846 r54053 43 43 WebInspector.SourceJavaScriptTokenizer = function() 44 44 { 45 WebInspector. TextEditorHighlighter.Tokenizer.call(this);45 WebInspector.SourceTokenizer.call(this); 46 46 47 47 this._keywords = [ … … 137 137 RegexEnd = RegexContent "/" [igm]*; 138 138 139 <DIV,NODIV> LineComment { this.tokenType = "j s-comment"; return cursor; }140 <DIV,NODIV> Comment { this.tokenType = "j s-comment"; return cursor; }141 <DIV,NODIV> CommentStart => COMMENT { this.tokenType = "j s-comment"; return cursor; }142 <COMMENT> CommentContent => COMMENT { this.tokenType = "j s-comment"; return cursor; }143 <COMMENT> CommentEnd => NODIV { this.tokenType = "j s-comment"; return cursor; }139 <DIV,NODIV> LineComment { this.tokenType = "javascript-comment"; return cursor; } 140 <DIV,NODIV> Comment { this.tokenType = "javascript-comment"; return cursor; } 141 <DIV,NODIV> CommentStart => COMMENT { this.tokenType = "javascript-comment"; return cursor; } 142 <COMMENT> CommentContent => COMMENT { this.tokenType = "javascript-comment"; return cursor; } 143 <COMMENT> CommentEnd => NODIV { this.tokenType = "javascript-comment"; return cursor; } 144 144 145 <DIV,NODIV> StringLiteral { this.tokenType = "j s-string"; return cursor; }146 <DIV,NODIV> DoubleStringStart => DSTRING { this.tokenType = "j s-string"; return cursor; }147 <DSTRING> DoubleStringContent => DSTRING { this.tokenType = "j s-string"; return cursor; }148 <DSTRING> DoubleStringEnd => NODIV { this.tokenType = "j s-string"; return cursor; }149 <DIV,NODIV> SingleStringStart => SSTRING { this.tokenType = "j s-string"; return cursor; }150 <SSTRING> SingleStringContent => SSTRING { this.tokenType = "j s-string"; return cursor; }151 <SSTRING> SingleStringEnd => NODIV { this.tokenType = "j s-string"; return cursor; }145 <DIV,NODIV> StringLiteral { this.tokenType = "javascript-string"; return cursor; } 146 <DIV,NODIV> DoubleStringStart => DSTRING { this.tokenType = "javascript-string"; return cursor; } 147 <DSTRING> DoubleStringContent => DSTRING { this.tokenType = "javascript-string"; return cursor; } 148 <DSTRING> DoubleStringEnd => NODIV { this.tokenType = "javascript-string"; return cursor; } 149 <DIV,NODIV> SingleStringStart => SSTRING { this.tokenType = "javascript-string"; return cursor; } 150 <SSTRING> SingleStringContent => SSTRING { this.tokenType = "javascript-string"; return cursor; } 151 <SSTRING> SingleStringEnd => NODIV { this.tokenType = "javascript-string"; return cursor; } 152 152 153 <NODIV> Regex { this.tokenType = "j s-regex"; return cursor; }154 <NODIV> RegexStart => REGEX { this.tokenType = "j s-regex"; return cursor; }155 <REGEX> RegexContent => REGEX { this.tokenType = "j s-regex"; return cursor; }156 <REGEX> RegexEnd => NODIV { this.tokenType = "j s-regex"; return cursor; }153 <NODIV> Regex { this.tokenType = "javascript-regexp"; return cursor; } 154 <NODIV> RegexStart => REGEX { this.tokenType = "javascript-regexp"; return cursor; } 155 <REGEX> RegexContent => REGEX { this.tokenType = "javascript-regexp"; return cursor; } 156 <REGEX> RegexEnd => NODIV { this.tokenType = "javascript-regexp"; return cursor; } 157 157 158 <DIV,NODIV> NumericLiteral => DIV { this.tokenType = "j s-number"; return cursor; }158 <DIV,NODIV> NumericLiteral => DIV { this.tokenType = "javascript-number"; return cursor; } 159 159 <DIV,NODIV> Identifier => DIV 160 160 { 161 161 var token = this._line.substring(cursorOnEnter, cursor); 162 162 if (token in this._keywords) 163 this.tokenType = "j s-keyword";163 this.tokenType = "javascript-keyword"; 164 164 else 165 this.tokenType = null;165 this.tokenType = "javascript-ident"; 166 166 return cursor; 167 167 } … … 175 175 } 176 176 177 WebInspector.SourceJavaScriptTokenizer.prototype.__proto__ = WebInspector. TextEditorHighlighter.Tokenizer.prototype;177 WebInspector.SourceJavaScriptTokenizer.prototype.__proto__ = WebInspector.SourceTokenizer.prototype; -
trunk/WebCore/inspector/front-end/TextEditorHighlighter.js
r54052 r54053 53 53 this._styles["html-doctype"] = "rgb(192, 192, 192)"; 54 54 55 this._styles["js-comment"] = "rgb(0, 116, 0)"; 56 this._styles["js-string"] = "rgb(196, 26, 22)"; 57 this._styles["js-regex"] = "rgb(196, 26, 22)"; 58 this._styles["js-keyword"] = "rgb(170, 13, 145)"; 59 this._styles["js-number"] = "rgb(28, 0, 207)"; 60 61 this._tokenizers = {}; 62 this._tokenizerConstructors = { 63 "text/css": WebInspector.SourceCSSTokenizer, 64 "text/html": WebInspector.SourceHTMLTokenizer, 65 "text/javascript": WebInspector.SourceJavaScriptTokenizer, 66 "application/x-javascript": WebInspector.SourceJavaScriptTokenizer 67 }; 55 this._styles["javascript-comment"] = "rgb(0, 116, 0)"; 56 this._styles["javascript-string"] = "rgb(196, 26, 22)"; 57 this._styles["javascript-regexp"] = "rgb(196, 26, 22)"; 58 this._styles["javascript-keyword"] = "rgb(170, 13, 145)"; 59 this._styles["javascript-number"] = "rgb(28, 0, 207)"; 68 60 69 61 this.mimeType = "text/html"; … … 74 66 set mimeType(mimeType) 75 67 { 76 if (!this._tokenizerConstructors[mimeType]) 77 return; 78 this._tokenizer = this._tokenizers[mimeType]; 79 if (!this._tokenizer) { 80 this._tokenizer = new this._tokenizerConstructors[mimeType](); 81 this._tokenizers[mimeType] = this._tokenizer; 82 } 68 var tokenizer = WebInspector.SourceTokenizer.Registry.getInstance().getTokenizer(mimeType); 69 if (tokenizer) 70 this._tokenizer = tokenizer; 83 71 }, 84 72 … … 206 194 } 207 195 } 208 209 WebInspector.TextEditorHighlighter.Tokenizer = function()210 {211 }212 213 WebInspector.TextEditorHighlighter.Tokenizer.prototype = {214 set line(line) {215 this._line = line;216 },217 218 set condition(condition)219 {220 this._lexCondition = condition.lexCondition;221 this._parseCondition = condition.parseCondition;222 },223 224 get condition()225 {226 return { lexCondition: this._lexCondition, parseCondition: this._parseCondition };227 },228 229 hasCondition: function(condition)230 {231 return this._lexCondition === condition.lexCondition && this._parseCondition === condition.parseCondition;232 },233 234 getLexCondition: function()235 {236 return this._lexCondition;237 },238 239 setLexCondition: function(lexCondition)240 {241 this._lexCondition = lexCondition;242 },243 244 _charAt: function(cursor)245 {246 return cursor < this._line.length ? this._line.charAt(cursor) : "\n";247 }248 } -
trunk/WebCore/inspector/front-end/WebKit.qrc
r53941 r54053 17 17 <file>ContextMenu.js</file> 18 18 <file>CookieItemsView.js</file> 19 <file>CSSSourceSyntaxHighlighter.js</file>20 19 <file>Database.js</file> 21 20 <file>DatabaseQueryView.js</file> … … 25 24 <file>DOMStorage.js</file> 26 25 <file>DOMStorageItemsView.js</file> 26 <file>DOMSyntaxHighlighter.js</file> 27 27 <file>Drawer.js</file> 28 28 <file>ElementsPanel.js</file> … … 36 36 <file>InspectorBackendStub.js</file> 37 37 <file>InspectorFrontendHostStub.js</file> 38 <file>JavaScriptSourceSyntaxHighlighter.js</file>39 38 <file>KeyboardShortcut.js</file> 40 39 <file>MetricsSidebarPane.js</file> … … 67 66 <file>SourceHTMLTokenizer.js</file> 68 67 <file>SourceJavaScriptTokenizer.js</file> 69 <file>Source SyntaxHighlighter.js</file>68 <file>SourceTokenizer.js</file> 70 69 <file>SourceView.js</file> 71 70 <file>StatusBarButton.js</file> -
trunk/WebCore/inspector/front-end/inspector.html
r54001 r54053 94 94 <script type="text/javascript" src="ResourceView.js"></script> 95 95 <script type="text/javascript" src="SourceFrame.js"></script> 96 <script type="text/javascript" src="SourceSyntaxHighlighter.js"></script> 97 <script type="text/javascript" src="CSSSourceSyntaxHighlighter.js"></script> 98 <script type="text/javascript" src="JavaScriptSourceSyntaxHighlighter.js"></script> 96 <script type="text/javascript" src="DOMSyntaxHighlighter.js"></script> 99 97 <script type="text/javascript" src="TextEditorModel.js"></script> 100 98 <script type="text/javascript" src="TextEditor.js"></script> 101 99 <script type="text/javascript" src="TextEditorHighlighter.js"></script> 100 <script type="text/javascript" src="SourceTokenizer.js"></script> 102 101 <script type="text/javascript" src="SourceCSSTokenizer.js"></script> 103 102 <script type="text/javascript" src="SourceHTMLTokenizer.js"></script>
Note: See TracChangeset
for help on using the changeset viewer.