Changeset View
Changeset View
Standalone View
Standalone View
data/syntax/rhtml.xml
Show All 38 Lines | 36 | <!-- | |||
---|---|---|---|---|---|
39 | * "Nested" HERE documents aren't recognized. | 39 | * "Nested" HERE documents aren't recognized. | ||
40 | * Division is detected correctly only, if whitespace | 40 | * Division is detected correctly only, if whitespace | ||
41 | is around the "/" operator. | 41 | is around the "/" operator. | ||
42 | E.g.: detected correctly: 1 / 2 | 42 | E.g.: detected correctly: 1 / 2 | ||
43 | "/" interpreted as regex start: 1/2 | 43 | "/" interpreted as regex start: 1/2 | ||
44 | --> | 44 | --> | ||
45 | 45 | | |||
46 | <!-- Hold the "language" opening tag on a single line, as mentioned in "language.dtd". --> | 46 | <!-- Hold the "language" opening tag on a single line, as mentioned in "language.dtd". --> | ||
47 | <language name="Ruby/Rails/RHTML" version="8" kateversion="5.0" section="Markup" extensions="*.rhtml;*.RHTML;*.html.erb" mimetype="" author="Richard Dale rdale@foton.es" license="LGPLv2+"> | 47 | <language name="Ruby/Rails/RHTML" version="9" kateversion="5.0" section="Markup" extensions="*.rhtml;*.RHTML;*.html.erb" mimetype="" author="Richard Dale rdale@foton.es" license="LGPLv2+"> | ||
48 | 48 | | |||
49 | <highlighting> | 49 | <highlighting> | ||
50 | 50 | | |||
51 | <list name="keywords"> | 51 | <list name="keywords"> | ||
52 | <item>BEGIN</item> | 52 | <item>BEGIN</item> | ||
53 | <item>END</item> | 53 | <item>END</item> | ||
54 | <item>and</item> | 54 | <item>and</item> | ||
55 | <item>begin</item> | 55 | <item>begin</item> | ||
▲ Show 20 Lines • Show All 272 Lines • ▼ Show 20 Line(s) | 327 | <context name="Start" attribute="Normal Text" lineEndContext="#stay"> | |||
328 | <IncludeRules context="FindHTML" /> | 328 | <IncludeRules context="FindHTML" /> | ||
329 | </context> | 329 | </context> | ||
330 | 330 | | |||
331 | <context name="FindHTML" attribute="Normal Text" lineEndContext="#stay"> | 331 | <context name="FindHTML" attribute="Normal Text" lineEndContext="#stay"> | ||
332 | <DetectSpaces/> | 332 | <DetectSpaces/> | ||
333 | <DetectIdentifier/> | 333 | <DetectIdentifier/> | ||
334 | 334 | | |||
335 | <RegExpr attribute="Keyword" context="rubysource" String="<%=?" /> | 335 | <RegExpr attribute="Keyword" context="rubysource" String="<%=?" /> | ||
336 | <StringDetect attribute="Keyword" context="rubysourceline" String="%" /> | 336 | <DetectChar attribute="Keyword" context="rubysourceline" char="%" /> | ||
337 | 337 | | |||
338 | <StringDetect attribute="Comment" context="Comment" String="<!--" beginRegion="comment" /> | 338 | <StringDetect attribute="Comment" context="Comment" String="<!--" beginRegion="comment" /> | ||
339 | <StringDetect attribute="CDATA" context="CDATA" String="<![CDATA[" beginRegion="cdata" /> | 339 | <StringDetect attribute="CDATA" context="CDATA" String="<![CDATA[" beginRegion="cdata" /> | ||
340 | <RegExpr attribute="Doctype" context="Doctype" String="<!DOCTYPE\s+" beginRegion="doctype" /> | 340 | <RegExpr attribute="Doctype" context="Doctype" String="<!DOCTYPE\s+" beginRegion="doctype" /> | ||
341 | <RegExpr attribute="Processing Instruction" context="PI" String="<\?[\w:-]*" beginRegion="pi" /> | 341 | <RegExpr attribute="Processing Instruction" context="PI" String="<\?[\w:-]*" beginRegion="pi" /> | ||
342 | <RegExpr attribute="Element" context="CSS" String="<style\b" insensitive="true" beginRegion="style" /> | 342 | <RegExpr attribute="Element" context="CSS" String="<style\b" insensitive="true" beginRegion="style" /> | ||
343 | <RegExpr attribute="Element" context="JS" String="<script\b" insensitive="true" beginRegion="script" /> | 343 | <RegExpr attribute="Element" context="JS" String="<script\b" insensitive="true" beginRegion="script" /> | ||
344 | <RegExpr attribute="Element" context="El Open" String="<pre\b" insensitive="true" beginRegion="pre" /> | 344 | <RegExpr attribute="Element" context="El Open" String="<pre\b" insensitive="true" beginRegion="pre" /> | ||
▲ Show 20 Lines • Show All 200 Lines • ▼ Show 20 Line(s) | 536 | <context name="rubysource" attribute="RUBY RAILS ERB Text" lineEndContext="#stay"> | |||
545 | <!-- "shebang" line --> | 545 | <!-- "shebang" line --> | ||
546 | <RegExpr attribute="Keyword" String="#!\/.*" context="#stay" column="0"/> | 546 | <RegExpr attribute="Keyword" String="#!\/.*" context="#stay" column="0"/> | ||
547 | 547 | | |||
548 | <!-- "def" - "end" blocks --> | 548 | <!-- "def" - "end" blocks --> | ||
549 | <!-- check for statement modifiers with regexes --> | 549 | <!-- check for statement modifiers with regexes --> | ||
550 | <RegExpr attribute="Keyword" String="(\=|\(|\[|\{)\s*(if|unless|while|until)\b" context="#stay" beginRegion="def block"/> | 550 | <RegExpr attribute="Keyword" String="(\=|\(|\[|\{)\s*(if|unless|while|until)\b" context="#stay" beginRegion="def block"/> | ||
551 | <RegExpr attribute="Keyword" String="(while|until)\b(?!.*\bdo\b)" context="#stay" beginRegion="def block" firstNonSpace="true"/> | 551 | <RegExpr attribute="Keyword" String="(while|until)\b(?!.*\bdo\b)" context="#stay" beginRegion="def block" firstNonSpace="true"/> | ||
552 | <RegExpr attribute="Keyword" String="\;\s*(while|until)\b(?!.*\bdo\b)" context="#stay" beginRegion="def block"/> | 552 | <RegExpr attribute="Keyword" String="\;\s*(while|until)\b(?!.*\bdo\b)" context="#stay" beginRegion="def block"/> | ||
553 | <RegExpr attribute="Keyword" String="(if|unless)\b" context="#stay" beginRegion="def block" firstNonSpace="true"/> | 553 | <WordDetect attribute="Keyword" String="if" context="#stay" beginRegion="def block" firstNonSpace="true"/> | ||
554 | <WordDetect attribute="Keyword" String="unless" context="#stay" beginRegion="def block" firstNonSpace="true"/> | ||||
554 | <RegExpr attribute="Keyword" String="\;\s*(if|unless)\b" context="#stay" beginRegion="def block"/> | 555 | <RegExpr attribute="Keyword" String="\;\s*(if|unless)\b" context="#stay" beginRegion="def block"/> | ||
555 | <RegExpr attribute="Keyword" String="\bclass\b" context="#stay" beginRegion="def block"/> | 556 | <WordDetect attribute="Keyword" String="class" context="#stay" beginRegion="def block"/> | ||
556 | <RegExpr attribute="Keyword" String="\bmodule\b" context="#stay" beginRegion="def block"/> | 557 | <WordDetect attribute="Keyword" String="module" context="#stay" beginRegion="def block"/> | ||
557 | <RegExpr attribute="Keyword" String="\bbegin\b" context="#stay" beginRegion="def block"/> | 558 | <WordDetect attribute="Keyword" String="begin" context="#stay" beginRegion="def block"/> | ||
558 | <RegExpr attribute="Keyword" String="\bfor\b(?!.*\bdo\b)" context="#stay" beginRegion="def block"/> | 559 | <RegExpr attribute="Keyword" String="\bfor\b(?!.*\bdo\b)" context="#stay" beginRegion="def block"/> | ||
559 | <RegExpr attribute="Keyword" String="\bcase\b" context="#stay" beginRegion="def block"/> | 560 | <WordDetect attribute="Keyword" String="case" context="#stay" beginRegion="def block"/> | ||
560 | <RegExpr attribute="Keyword" String="\bdo\b" context="#stay" beginRegion="def block"/> | 561 | <WordDetect attribute="Keyword" String="do" context="#stay" beginRegion="def block"/> | ||
561 | <RegExpr attribute="Keyword" String="\bdef\b" context="#stay" beginRegion="def block"/> | 562 | <WordDetect attribute="Keyword" String="def" context="#stay" beginRegion="def block"/> | ||
562 | <RegExpr attribute="Keyword" String="\bend\b" context="#stay" endRegion="def block"/> | 563 | <WordDetect attribute="Keyword" String="end" context="#stay" endRegion="def block"/> | ||
563 | <!-- elsif/else close the current block and start a new one --> | 564 | <!-- elsif/else close the current block and start a new one --> | ||
564 | <RegExpr attribute="Keyword" String="(\b|^\s*)(else|elsif|rescue|ensure)(\s+|$)" context="#stay" endRegion="def block" beginRegion="def block"/> | 565 | <RegExpr attribute="Keyword" String="(\b|^\s*)(else|elsif|rescue|ensure)(\s+|$)" context="#stay" endRegion="def block" beginRegion="def block"/> | ||
565 | 566 | | |||
566 | <StringDetect attribute="Operator" String="..." context="#stay"/> | 567 | <StringDetect attribute="Operator" String="..." context="#stay"/> | ||
567 | <Detect2Chars attribute="Operator" char="." char1="." context="#stay"/> | 568 | <Detect2Chars attribute="Operator" char="." char1="." context="#stay"/> | ||
568 | 569 | | |||
569 | <!-- marks a message (being sent, not defined) --> | 570 | <!-- marks a message (being sent, not defined) --> | ||
570 | <RegExpr attribute="Message" String="\.[_a-z][_a-zA-Z0-9]*(\?|\!|\b)" context="#stay"/> | 571 | <RegExpr attribute="Message" String="\.[_a-z][_a-zA-Z0-9]*(\?|\!|\b)" context="#stay"/> | ||
571 | 572 | | |||
572 | <!-- Check for "ASCII code operator". e.g.: ?a --> | 573 | <!-- Check for "ASCII code operator". e.g.: ?a --> | ||
573 | <RegExpr attribute="Dec" String="\s\?(\\M\-)?(\\C\-)?\\?\S" context="#stay"/> | 574 | <RegExpr attribute="Dec" String="\s\?(\\M\-)?(\\C\-)?\\?\S" context="#stay"/> | ||
574 | 575 | | |||
575 | <keyword attribute="Keyword" String="keywords" context="#stay"/> | 576 | <keyword attribute="Keyword" String="keywords" context="#stay"/> | ||
576 | <keyword attribute="Attribute Definition" String="attribute-definitions" context="#stay"/> | 577 | <keyword attribute="Attribute Definition" String="attribute-definitions" context="#stay"/> | ||
577 | <keyword attribute="Access Control" String="access-control" context="#stay"/> | 578 | <keyword attribute="Access Control" String="access-control" context="#stay"/> | ||
578 | <keyword attribute="Definition" String="definitions" context="#stay" /> | 579 | <keyword attribute="Definition" String="definitions" context="#stay" /> | ||
579 | <keyword attribute="Pseudo variable" String="pseudo-variables" context="#stay"/> | 580 | <keyword attribute="Pseudo variable" String="pseudo-variables" context="#stay"/> | ||
580 | <keyword attribute="Default globals" String="default-globals" context="#stay"/> | 581 | <keyword attribute="Default globals" String="default-globals" context="#stay"/> | ||
581 | <keyword attribute="Kernel methods" String="kernel-methods" context="#stay"/> | 582 | <keyword attribute="Kernel methods" String="kernel-methods" context="#stay"/> | ||
582 | 583 | | |||
583 | <!-- (global) vars starting with $ | 584 | <!-- (global) vars starting with $ | ||
584 | Match them before $_. | 585 | Match them before $_. | ||
585 | --> | 586 | --> | ||
586 | <RegExpr attribute="Global Variable" String="\$[a-zA-Z_0-9]+" context="#stay"/> | 587 | <RegExpr attribute="Global Variable" String="\$(\w+|\-[a-zA-Z_]\b)" context="#stay"/> | ||
587 | <RegExpr attribute="Global Variable" String="\$\-[a-zA-Z_]\b" context="#stay"/> | | |||
588 | <!-- special-character globals --> | 588 | <!-- special-character globals --> | ||
589 | <RegExpr attribute="Default globals" String="\$[\d_*`\!:?'/\\\-\&]" context="#stay"/> | 589 | <RegExpr attribute="Default globals" String="\$[\d_*`\!:?'/\\\-\&]" context="#stay"/> | ||
590 | <RegExpr attribute="Global Constant" String="\b[_A-Z]+[A-Z_0-9]+\b" context="#stay"/> | 590 | <RegExpr attribute="Global Constant" String="\b[_A-Z]+[A-Z_0-9]+\b" context="#stay"/> | ||
591 | <!-- Generally a module or class name like "File", "MyModule_1", .. --> | 591 | <!-- Generally a module or class name like "File", "MyModule_1", .. --> | ||
592 | <RegExpr attribute="Constant" String="\b[A-Z]+_*([0-9]|[a-z])[_a-zA-Z0-9]*\b" context="#stay"/> | 592 | <RegExpr attribute="Constant" String="\b[A-Z]+_*([0-9]|[a-z])[_a-zA-Z0-9]*\b" context="#stay"/> | ||
593 | 593 | | |||
594 | <RegExpr attribute="Hex" String="\b\-?0[xX][_0-9a-fA-F]+" context="#stay"/> | 594 | <RegExpr attribute="Hex" String="\b\-?0[xX][_0-9a-fA-F]+" context="#stay"/> | ||
595 | <RegExpr attribute="Bin" String="\b\-?0[bB][_01]+" context="#stay"/> | 595 | <RegExpr attribute="Bin" String="\b\-?0[bB][_01]+" context="#stay"/> | ||
Show All 19 Lines | |||||
615 | <DetectChar attribute="Operator" char="." context="#stay"/> | 615 | <DetectChar attribute="Operator" char="." context="#stay"/> | ||
616 | <Detect2Chars attribute="Operator" char="&" char1="&" context="#stay"/> | 616 | <Detect2Chars attribute="Operator" char="&" char1="&" context="#stay"/> | ||
617 | <Detect2Chars attribute="Operator" char="|" char1="|" context="#stay"/> | 617 | <Detect2Chars attribute="Operator" char="|" char1="|" context="#stay"/> | ||
618 | <RegExpr attribute="Operator" String="\s[\?\:\%/]\s" context="#stay"/> | 618 | <RegExpr attribute="Operator" String="\s[\?\:\%/]\s" context="#stay"/> | ||
619 | <RegExpr attribute="Operator" String="[|&<>\^\+*~\-=]+" context="#stay"/> | 619 | <RegExpr attribute="Operator" String="[|&<>\^\+*~\-=]+" context="#stay"/> | ||
620 | <!-- regexp hack --> | 620 | <!-- regexp hack --> | ||
621 | <RegExpr attribute="Operator" String="\s!" context="#stay"/> | 621 | <RegExpr attribute="Operator" String="\s!" context="#stay"/> | ||
622 | <RegExpr attribute="Operator" String="/=\s" context="#stay" insensitive="0"/> | 622 | <RegExpr attribute="Operator" String="/=\s" context="#stay" insensitive="0"/> | ||
623 | <StringDetect attribute="Operator" String="%=" context="#stay" insensitive="0"/> | 623 | <Detect2Chars attribute="Operator" char="%" char1="=" context="#stay"/> | ||
624 | <Detect2Chars attribute="Operator" char=":" char1=":" context="Member Access"/> | 624 | <Detect2Chars attribute="Operator" char=":" char1=":" context="Member Access"/> | ||
625 | 625 | | |||
626 | <RegExpr attribute="Symbol" String=":[a-zA-Z_][a-zA-Z0-9_]*" context="#stay"/> | 626 | <RegExpr attribute="Symbol" String=":[a-zA-Z_][a-zA-Z0-9_]*" context="#stay"/> | ||
627 | 627 | | |||
628 | <DetectChar attribute="String" char=""" context="Quoted String"/> | 628 | <DetectChar attribute="String" char=""" context="Quoted String"/> | ||
629 | <DetectChar attribute="Raw String" char="'" context="Apostrophed String"/> | 629 | <DetectChar attribute="Raw String" char="'" context="Apostrophed String"/> | ||
630 | <DetectChar attribute="Command" char="`" context="Command String"/> | 630 | <DetectChar attribute="Command" char="`" context="Command String"/> | ||
631 | 631 | | |||
632 | <StringDetect attribute="Normal Text" String="?#" context="#stay"/> | 632 | <Detect2Chars attribute="Normal Text" char="?" char1="#" context="#stay"/> | ||
633 | 633 | | |||
634 | <RegExpr attribute="Comment" String="#\s*BEGIN.*$" context="#stay" beginRegion="marker" column="0"/> | 634 | <RegExpr attribute="Comment" String="#\s*BEGIN.*$" context="#stay" beginRegion="marker" column="0"/> | ||
635 | <RegExpr attribute="Comment" String="#\s*END.*$" context="#stay" endRegion="marker" column="0"/> | 635 | <RegExpr attribute="Comment" String="#\s*END.*$" context="#stay" endRegion="marker" column="0"/> | ||
636 | <RegExpr attribute="Comment" String="#" context="Comment Line" firstNonSpace="true"/> | 636 | <DetectChar attribute="Comment" char="#" context="Comment Line" firstNonSpace="true"/> | ||
637 | <RegExpr attribute="Comment" String="\s#" context="General Comment"/> | 637 | <RegExpr attribute="Comment" String="\s#" context="General Comment"/> | ||
638 | 638 | | |||
639 | <RegExpr attribute="Delimiter" String="[\[\]]+" context="#stay"/> | 639 | <RegExpr attribute="Delimiter" String="[\[\]]+" context="#stay"/> | ||
640 | <DetectChar attribute="Delimiter" char="{" context="#stay" beginRegion="def block"/> | 640 | <DetectChar attribute="Delimiter" char="{" context="#stay" beginRegion="def block"/> | ||
641 | <DetectChar attribute="Delimiter" char="}" context="#stay" endRegion="def block"/> | 641 | <DetectChar attribute="Delimiter" char="}" context="#stay" endRegion="def block"/> | ||
642 | 642 | | |||
643 | <RegExpr attribute="Instance Variable" String="@[a-zA-Z_0-9]+" context="#stay"/> | 643 | <RegExpr attribute="Instance Variable" String="@[a-zA-Z_0-9]+" context="#stay"/> | ||
644 | <RegExpr attribute="Class Variable" String="@@[a-zA-Z_0-9]+" context="#stay"/> | 644 | <RegExpr attribute="Class Variable" String="@@[a-zA-Z_0-9]+" context="#stay"/> | ||
645 | 645 | | |||
646 | <!-- handle the different regular expression formats --> | 646 | <!-- handle the different regular expression formats --> | ||
647 | <DetectChar attribute="Regular Expression" char="/" context="RegEx 1"/> | 647 | <DetectChar attribute="Regular Expression" char="/" context="RegEx 1"/> | ||
648 | 648 | | |||
649 | <!-- recognize the beginning of a general delimited input format --> | 649 | <!-- recognize the beginning of a general delimited input format --> | ||
650 | <!-- this moves to the next context to separate out the exact nature of the GDL input --> | 650 | <!-- this moves to the next context to separate out the exact nature of the GDL input --> | ||
651 | <RegExpr attribute="GDL input" context="find_gdl_input" String="\s*[%](?=[Qqxw]?[^\s>])" beginRegion="GdlInput" /> | 651 | <RegExpr attribute="GDL input" context="find_gdl_input" String="\s*[%](?=[Qqxw]?[^\s>])" beginRegion="GdlInput" /> | ||
652 | </context> | 652 | </context> | ||
653 | 653 | | |||
654 | <context name="Line Continue" attribute="Ruby Normal Text" lineEndContext="#pop"> | 654 | <context name="Line Continue" attribute="Ruby Normal Text" lineEndContext="#pop"> | ||
655 | <RegExpr attribute="Keyword" String="(while|until)\b(?!.*\bdo\b)" context="#stay" firstNonSpace="true"/> | 655 | <RegExpr attribute="Keyword" String="(while|until)\b(?!.*\bdo\b)" context="#stay" firstNonSpace="true"/> | ||
656 | <RegExpr attribute="Keyword" String="(if|unless)\b" context="#stay" firstNonSpace="true"/> | 656 | <WordDetect attribute="Keyword" String="if" context="#stay" firstNonSpace="true"/> | ||
657 | <WordDetect attribute="Keyword" String="unless" context="#stay" firstNonSpace="true"/> | ||||
657 | <IncludeRules context="rubysource"/> | 658 | <IncludeRules context="rubysource"/> | ||
658 | </context> | 659 | </context> | ||
659 | 660 | | |||
660 | <context name="Quoted String" attribute="String" lineEndContext="#stay"> | 661 | <context name="Quoted String" attribute="String" lineEndContext="#stay"> | ||
661 | <StringDetect attribute="String" String="\\" context="#stay"/> | 662 | <Detect2Chars attribute="String" char="\" char1="\" context="#stay"/> | ||
662 | <RegExpr attribute="String" String="\\\"" context="#stay"/> | 663 | <Detect2Chars attribute="String" char="\" char1=""" context="#stay"/> | ||
663 | <RegExpr attribute="Substitution" String="#@{1,2}" context="Short Subst"/> | 664 | <RegExpr attribute="Substitution" String="#@{1,2}" context="Short Subst"/> | ||
664 | <Detect2Chars attribute="Substitution" char="#" char1="{" context="Subst"/> | 665 | <Detect2Chars attribute="Substitution" char="#" char1="{" context="Subst"/> | ||
665 | <!--HlCChar attribute="Char" context="#pop"/--> | 666 | <!--HlCChar attribute="Char" context="#pop"/--> | ||
666 | <DetectChar char=""" attribute="String" context="#pop"/> | 667 | <DetectChar char=""" attribute="String" context="#pop"/> | ||
667 | </context> | 668 | </context> | ||
668 | 669 | | |||
669 | <context name="Apostrophed String" attribute="Raw String" lineEndContext="#stay"> | 670 | <context name="Apostrophed String" attribute="Raw String" lineEndContext="#stay"> | ||
670 | <!-- <HlCChar attribute="Char" context="#pop"/> --> | 671 | <!-- <HlCChar attribute="Char" context="#pop"/> --> | ||
671 | <StringDetect attribute="String" String="\\" context="#stay"/> | 672 | <Detect2Chars attribute="String" char="\" char1="\" context="#stay"/> | ||
672 | <RegExpr attribute="String" String="\\\'" context="#stay"/> | 673 | <Detect2Chars attribute="String" char="\" char1="'" context="#stay"/> | ||
673 | <DetectChar char="'" attribute="Raw String" context="#pop"/> | 674 | <DetectChar char="'" attribute="Raw String" context="#pop"/> | ||
674 | </context> | 675 | </context> | ||
675 | 676 | | |||
676 | <context name="Command String" attribute="Command" lineEndContext="#stay"> | 677 | <context name="Command String" attribute="Command" lineEndContext="#stay"> | ||
677 | <StringDetect attribute="String" String="\\" context="#stay"/> | 678 | <Detect2Chars attribute="String" char="\" char1="\" context="#stay"/> | ||
678 | <RegExpr attribute="String" String="\\\`" context="#stay"/> | 679 | <Detect2Chars attribute="String" char="\" char1="`" context="#stay"/> | ||
679 | <RegExpr attribute="Substitution" String="#@{1,2}" context="Short Subst"/> | 680 | <RegExpr attribute="Substitution" String="#@{1,2}" context="Short Subst"/> | ||
680 | <Detect2Chars attribute="Substitution" char="#" char1="{" context="Subst"/> | 681 | <Detect2Chars attribute="Substitution" char="#" char1="{" context="Subst"/> | ||
681 | <HlCChar attribute="Char" context="#pop"/> | 682 | <HlCChar attribute="Char" context="#pop"/> | ||
682 | <DetectChar char="`" attribute="Command" context="#pop"/> | 683 | <DetectChar char="`" attribute="Command" context="#pop"/> | ||
683 | </context> | 684 | </context> | ||
684 | 685 | | |||
685 | <context name="Embedded documentation" attribute="Ruby Comment" lineEndContext="#stay"> | 686 | <context name="Embedded documentation" attribute="Ruby Comment" lineEndContext="#stay"> | ||
686 | <StringDetect attribute="Ruby Comment" String="=end" context="#pop" endRegion="comment block" column="0"/> | 687 | <StringDetect attribute="Ruby Comment" String="=end" context="#pop" endRegion="comment block" column="0"/> | ||
687 | </context> | 688 | </context> | ||
688 | 689 | | |||
689 | <context name="RegEx 1" attribute="Regular Expression" lineEndContext="#stay"> | 690 | <context name="RegEx 1" attribute="Regular Expression" lineEndContext="#stay"> | ||
690 | <RegExpr attribute="Regular Expression" String="\\\/" context="#stay"/> | 691 | <Detect2Chars attribute="Regular Expression" char="\" char1="/" context="#stay"/> | ||
691 | <RegExpr attribute="Regular Expression" String="[^\\]$" context="#pop"/> | 692 | <RegExpr attribute="Regular Expression" String="[^\\]$" context="#pop"/> | ||
692 | <RegExpr attribute="Substitution" String="#@{1,2}" context="Short Subst"/> | 693 | <RegExpr attribute="Substitution" String="#@{1,2}" context="Short Subst"/> | ||
693 | <Detect2Chars attribute="Substitution" char="#" char1="{" context="Subst"/> | 694 | <Detect2Chars attribute="Substitution" char="#" char1="{" context="Subst"/> | ||
694 | <RegExpr attribute="Regular Expression" String="/[uiomxn]*" context="#pop"/> | 695 | <RegExpr attribute="Regular Expression" String="/[uiomxn]*" context="#pop"/> | ||
695 | </context> | 696 | </context> | ||
696 | 697 | | |||
697 | <!-- Substitutions can be nested --> | 698 | <!-- Substitutions can be nested --> | ||
698 | <context name="Subst" attribute="Ruby Normal Text" lineEndContext="#stay"> | 699 | <context name="Subst" attribute="Ruby Normal Text" lineEndContext="#stay"> | ||
▲ Show 20 Lines • Show All 78 Lines • ▼ Show 20 Line(s) | |||||
777 | </context> | 778 | </context> | ||
778 | 779 | | |||
779 | <!-- General delimited input support | 780 | <!-- General delimited input support | ||
780 | The contexts below handle the various gdl formats | 781 | The contexts below handle the various gdl formats | ||
781 | --> | 782 | --> | ||
782 | <context name="find_gdl_input" attribute="Ruby Normal Text" lineEndContext="#pop"> | 783 | <context name="find_gdl_input" attribute="Ruby Normal Text" lineEndContext="#pop"> | ||
783 | 784 | | |||
784 | <!-- handle token arrays --> | 785 | <!-- handle token arrays --> | ||
785 | <RegExpr attribute="GDL input" context="gdl_token_array_1" String="w\(" /> | 786 | <Detect2Chars attribute="GDL input" context="gdl_token_array_1" char="w" char1="(" /> | ||
786 | <RegExpr attribute="GDL input" context="gdl_token_array_2" String="w\{" /> | 787 | <Detect2Chars attribute="GDL input" context="gdl_token_array_2" char="w" char1="{" /> | ||
787 | <RegExpr attribute="GDL input" context="gdl_token_array_3" String="w\[" /> | 788 | <Detect2Chars attribute="GDL input" context="gdl_token_array_3" char="w" char1="[" /> | ||
788 | <RegExpr attribute="GDL input" context="gdl_token_array_4" String="w<" /> | 789 | <Detect2Chars attribute="GDL input" context="gdl_token_array_4" char="w" char1="<" /> | ||
789 | <!-- then we handle the 'any char' format --> | 790 | <!-- then we handle the 'any char' format --> | ||
790 | <RegExpr attribute="GDL input" context="gdl_token_array_5" String="w([^\s\w])" /> | 791 | <RegExpr attribute="GDL input" context="gdl_token_array_5" String="w([^\s\w])" /> | ||
791 | 792 | | |||
792 | <!-- handle apostrophed strings --> | 793 | <!-- handle apostrophed strings --> | ||
793 | <RegExpr attribute="GDL input" context="gdl_apostrophed_1" String="q\(" /> | 794 | <Detect2Chars attribute="GDL input" context="gdl_apostrophed_1" char="q" char1="(" /> | ||
794 | <RegExpr attribute="GDL input" context="gdl_apostrophed_2" String="q\{" /> | 795 | <Detect2Chars attribute="GDL input" context="gdl_apostrophed_2" char="q" char1="{" /> | ||
795 | <RegExpr attribute="GDL input" context="gdl_apostrophed_3" String="q\[" /> | 796 | <Detect2Chars attribute="GDL input" context="gdl_apostrophed_3" char="q" char1="[" /> | ||
796 | <RegExpr attribute="GDL input" context="gdl_apostrophed_4" String="q<" /> | 797 | <Detect2Chars attribute="GDL input" context="gdl_apostrophed_4" char="q" char1="<" /> | ||
797 | <!-- then we handle the 'any char' format --> | 798 | <!-- then we handle the 'any char' format --> | ||
798 | <RegExpr attribute="GDL input" context="gdl_apostrophed_5" String="q([^\s\w])" /> | 799 | <RegExpr attribute="GDL input" context="gdl_apostrophed_5" String="q([^\s\w])" /> | ||
799 | 800 | | |||
800 | <!-- handle shell commands --> | 801 | <!-- handle shell commands --> | ||
801 | <RegExpr attribute="GDL input" context="gdl_shell_command_1" String="x\(" /> | 802 | <Detect2Chars attribute="GDL input" context="gdl_shell_command_1" char="x" char1="(" /> | ||
802 | <RegExpr attribute="GDL input" context="gdl_shell_command_2" String="x\{" /> | 803 | <Detect2Chars attribute="GDL input" context="gdl_shell_command_2" char="x" char1="{" /> | ||
803 | <RegExpr attribute="GDL input" context="gdl_shell_command_3" String="x\[" /> | 804 | <Detect2Chars attribute="GDL input" context="gdl_shell_command_3" char="x" char1="[" /> | ||
804 | <RegExpr attribute="GDL input" context="gdl_shell_command_4" String="x<" /> | 805 | <Detect2Chars attribute="GDL input" context="gdl_shell_command_4" char="x" char1="<" /> | ||
805 | <!-- then we handle the 'any char' format --> | 806 | <!-- then we handle the 'any char' format --> | ||
806 | <RegExpr attribute="GDL input" context="gdl_shell_command_5" String="x([^\s\w])" /> | 807 | <RegExpr attribute="GDL input" context="gdl_shell_command_5" String="x([^\s\w])" /> | ||
807 | 808 | | |||
808 | <!-- handle regular expressions --> | 809 | <!-- handle regular expressions --> | ||
809 | <RegExpr attribute="GDL input" context="gdl_regexpr_1" String="r\(" /> | 810 | <Detect2Chars attribute="GDL input" context="gdl_regexpr_1" char="r" char1="(" /> | ||
810 | <RegExpr attribute="GDL input" context="gdl_regexpr_2" String="r\{" /> | 811 | <Detect2Chars attribute="GDL input" context="gdl_regexpr_2" char="r" char1="{" /> | ||
811 | <RegExpr attribute="GDL input" context="gdl_regexpr_3" String="r\[" /> | 812 | <Detect2Chars attribute="GDL input" context="gdl_regexpr_3" char="r" char1="[" /> | ||
812 | <RegExpr attribute="GDL input" context="gdl_regexpr_4" String="r<" /> | 813 | <Detect2Chars attribute="GDL input" context="gdl_regexpr_4" char="r" char1="<" /> | ||
813 | <!-- then we handle the 'any char' format --> | 814 | <!-- then we handle the 'any char' format --> | ||
814 | <RegExpr attribute="GDL input" context="gdl_regexpr_5" String="r([^\s\w])" /> | 815 | <RegExpr attribute="GDL input" context="gdl_regexpr_5" String="r([^\s\w])" /> | ||
815 | 816 | | |||
816 | <!-- handle double-quoted strings --> | 817 | <!-- handle double-quoted strings --> | ||
817 | <!-- | 818 | <!-- | ||
818 | be careful to make this the last GDL ruleset, because the rule for | 819 | be careful to make this the last GDL ruleset, because the rule for | ||
819 | the short form %?foo? will otherwise catch any of the other formats | 820 | the short form %?foo? will otherwise catch any of the other formats | ||
820 | --> | 821 | --> | ||
821 | <RegExpr attribute="GDL input" context="gdl_dq_string_1" String="Q?\(" /> | 822 | <Detect2Chars attribute="GDL input" context="gdl_dq_string_1" char="Q" char1="(" /> | ||
822 | <RegExpr attribute="GDL input" context="gdl_dq_string_2" String="Q?\{" /> | 823 | <Detect2Chars attribute="GDL input" context="gdl_dq_string_2" char="Q" char1="{" /> | ||
823 | <RegExpr attribute="GDL input" context="gdl_dq_string_3" String="Q?\[" /> | 824 | <Detect2Chars attribute="GDL input" context="gdl_dq_string_3" char="Q" char1="[" /> | ||
824 | <RegExpr attribute="GDL input" context="gdl_dq_string_4" String="Q?<" /> | 825 | <Detect2Chars attribute="GDL input" context="gdl_dq_string_4" char="Q" char1="<" /> | ||
826 | <DetectChar attribute="GDL input" context="gdl_dq_string_1" char="(" /> | ||||
827 | <DetectChar attribute="GDL input" context="gdl_dq_string_2" char="{" /> | ||||
828 | <DetectChar attribute="GDL input" context="gdl_dq_string_3" char="[" /> | ||||
829 | <DetectChar attribute="GDL input" context="gdl_dq_string_4" char="<" /> | ||||
825 | <!-- then we handle the 'any char' format --> | 830 | <!-- then we handle the 'any char' format --> | ||
826 | <RegExpr attribute="GDL input" context="gdl_dq_string_5" String="Q?([^\s\w])" /> | 831 | <RegExpr attribute="GDL input" context="gdl_dq_string_5" String="Q?([^\s\w])" /> | ||
827 | 832 | | |||
828 | </context> | 833 | </context> | ||
829 | <!-- double-quoted string specific contexts follow --> | 834 | <!-- double-quoted string specific contexts follow --> | ||
830 | <context name="gdl_dq_string_1" attribute="String" lineEndContext="#stay" > | 835 | <context name="gdl_dq_string_1" attribute="String" lineEndContext="#stay" > | ||
831 | <IncludeRules context="dq_string_rules" /> | 836 | <IncludeRules context="dq_string_rules" /> | ||
832 | <Detect2Chars attribute="String" char="\" char1=")" context="#stay"/> | 837 | <Detect2Chars attribute="String" char="\" char1=")" context="#stay"/> | ||
▲ Show 20 Lines • Show All 400 Lines • Show Last 20 Lines |