1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041
|
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language [
<!ENTITY a_valid_char_in_macro_names "A-Za-z0-9_">
<!ENTITY command_section_name "(prep|build|pre|preun|install|post|postun|clean|files|trigger|triggerin|triggerun|triggerpostun|verifyscript|check|pretrans|posttrans|filetriggerin|filetriggerun|filetriggerpostun|transfiletriggerin|transfiletriggerun|transfiletriggerpostun|generate_buildrequires)">
<!ENTITY arch "(aarch64|alpha|alphaev5|alphaev56|alphaev6|alphaev67|alphapca56|amd64|armv3l|armv4b|armv4l|armv4tl|armv5tejl|armv5tel|armv5tl|armv6hl|armv6l|armv7hl|armv7hnl|armv7l|atariclone|atarist|atariste|ataritt|athlon|em64t|falcon|fat|geode|hades|hppa1\.0|hppa1\.1|hppa1\.2|hppa2\.0|i370|i386|i486|i586|i686|ia32e|ia64|IP|m68k|m68kmint|milan|mips|mips64|mips64el|mips64r6|mips64r6el|mipsel|mipsr6|mipsr6el|noarch|osfmach3_i386|osfmach3_i486|osfmach3_i586|osfmach3_i686|osfmach3_ppc|parisc|pentium3|pentium4|powerpc|powerppc|ppc|ppc32dy4|ppc64|ppc64iseries|ppc64le|ppc64p7|ppc64pseries|ppc8260|ppc8560|ppciseries|ppcpseries|riscv|riscv64|rs6000|s390|s390x|sh|sh3|sh4|sh4a|sparc|sparc64|sparc64v|sparcv8|sparcv9|sparcv9v|sun4|sun4c|sun4d|sun4m|sun4u|x86_64|xtensa)">
<!ENTITY os "(AIX|AmigaOS|bsdi|bsdi4\.0|BSD_OS|cygwin32|CYGWIN32_95|CYGWIN32_NT|darwin|Darwin|FreeBSD|FreeMiNT|HP-UX|hpux10|hpux10\.00|hpux10\.01|hpux10\.10|hpux10\.20|hpux10\.30|hpux11\.00|hpux9\.04|hpux9\.05|hpux9\.07|Irix|IRIX|Irix64|IRIX64|Linux|Linux\/390|Linux\/ESA|machten|macosx|MacOSX|mint|MiNT|MP_RAS|ncr-sysv4\.2|ncr-sysv4\.3|NextStep|NEXTSTEP|OS\/390|osf1|OSF1|osf3\.2|osf4\.0|SCO_SV|SCO_SV3\.2v5\.0\.2|solaris|solaris2\.3|solaris2\.4|solaris2\.5|solaris2\.6|solaris2\.7|SunOS|SunOS4|SunOS5|TOS|UNIX_SV|VM\/ESA)">
<!ENTITY arch_conditionals_names "(ifarch|ifnarch)">
<!ENTITY os_conditionals_names "(ifos|ifnos)">
<!ENTITY predefined_commands "(if|&arch_conditionals_names;|&os_conditionals_names;|else|endif|define|undefine|package|description|&command_section_name;|changelog)($|[^&a_valid_char_in_macro_names;])">
<!ENTITY lookahead_whitespace_eol "(?=($| |\t))">
]>
<language name="RPM Spec" version="13" kateversion="5.79" section="Other" extensions="*.spec" mimetype="text/x-rpm-spec" license="Public Domain">
<!-- The entities "arch" and "os" are based on /usr/lib/rpm/rpmrc (in the version coming with openSUSE 11.4). -->
<highlighting>
<list name="weekdays">
<item>Mon</item>
<item>Tue</item>
<item>Wed</item>
<item>Thu</item>
<item>Fri</item>
<item>Sat</item>
<item>Sun</item>
</list>
<list name="month names">
<item>Jan</item>
<item>Feb</item>
<item>Mar</item>
<item>Apr</item>
<item>May</item>
<item>Jun</item>
<item>Jul</item>
<item>Aug</item>
<item>Sep</item>
<item>Oct</item>
<item>Nov</item>
<item>Dec</item>
</list>
<list name="days">
<item>1</item>
<item>2</item>
<item>3</item>
<item>4</item>
<item>5</item>
<item>6</item>
<item>7</item>
<item>8</item>
<item>9</item>
<item>01</item>
<item>02</item>
<item>03</item>
<item>04</item>
<item>05</item>
<item>06</item>
<item>07</item>
<item>08</item>
<item>09</item>
<item>10</item>
<item>11</item>
<item>12</item>
<item>13</item>
<item>14</item>
<item>15</item>
<item>16</item>
<item>17</item>
<item>18</item>
<item>19</item>
<item>20</item>
<item>21</item>
<item>22</item>
<item>23</item>
<item>24</item>
<item>25</item>
<item>26</item>
<item>27</item>
<item>28</item>
<item>29</item>
<item>30</item>
<item>31</item>
</list>
<list name="bash_keyword">
<item>break</item>
<item>case</item>
<item>continue</item>
<item>do</item>
<item>done</item>
<item>elif</item>
<item>else</item>
<item>esac</item>
<item>fi</item>
<item>for</item>
<item>function</item>
<item>if</item>
<item>in</item>
<item>return</item>
<item>select</item>
<item>then</item>
<item>until</item>
<item>while</item>
</list>
<contexts>
<!-- "package section" is the context for the package definition. As it is the first context
in this file, it is also the context with which the interpreter starts. -->
<context attribute="Error" lineEndContext="#stay" name="package section">
<!-- Handle % -->
<DetectChar context="macro entry in package section" char="%" lookAhead="true" />
<!-- Handle tags: -->
<RegExpr attribute="Tag" context="tag_line_package" String="^(Conflicts|Obsoletes|Provides|Requires|Requires\([^)]*\)|Enhances|Suggests|BuildConflicts|BuildRequires|Recommends|PreReq|BuildPreReq|Supplements|OrderWithRequires|RemovePathPostfixes)[ \t]*:[ \t]*" column="0"/>
<RegExpr attribute="Tag" context="tag_line_string" String="^(Copyright|License|Summary|Summary\([^)]*\)|Distribution|Vendor|Packager|Group|Source\d*|Patch\d*|BuildRoot|Prefix)[ \t]*:[ \t]*" column="0"/>
<RegExpr attribute="Tag" context="tag_line_string_only_one_word" String="^(Name|Version|Release|Url|URL)[ \t]*:[ \t]*" column="0"/>
<RegExpr attribute="Tag" context="tag_line_os" String="^(ExclusiveOs|ExcludeOs)[ \t]*:[ \t]*" column="0"/>
<RegExpr attribute="Tag" context="tag_line_arch" String="^(BuildArch|BuildArchitectures|ExclusiveArch|ExcludeArch)[ \t]*:[ \t]*" column="0"/>
<RegExpr attribute="Tag" context="tag_line_integer" String="^(Epoch|Serial|Nosource|Nopatch)[ \t]*:[ \t]*" column="0"/>
<RegExpr attribute="Tag" context="tag_line_switch" String="^(AutoReq|AutoProv|AutoReqProv)[ \t]*:[ \t]*" column="0"/>
<RegExpr attribute="Tag" context="tag_line_value" String="^(Icon)[ \t]*:[ \t]*" column="0"/>
<!-- Handle comments. "# norootforbuild" is displayed like a tag. -->
<RegExpr context="Comment" String="^[ \t]*#" column="0" lookAhead="true" />
<!-- Spaces are okay -->
<DetectSpaces attribute="Fallback for separator spaces" />
<DetectIdentifier/>
<!-- Fallback value for every non-space -->
<!--RegExpr attribute="Error" context="#stay" String="[^\s]" /-->
</context>
<!-- "macro entry in package section" is used for lines in the package section that start
with a macro. It recognizes macros. Everything else is treated as normal text. This context
is used to prevent to highlight syntax errors after macros. With the next line break, this
context will switch back ("#pop"). -->
<context attribute="Shell commands" lineEndContext="#pop" name="macro entry in package section">
<!-- Handle % -->
<DetectChar context="handle_percent" char="%" lookAhead="true" />
<IncludeRules context="find_spaces_and_ident"/>
</context>
<!-- "package section start line" simply is used for the parameters after the
"%package" macro. With the next line break, it will switch to the
"package section" context which will handle everything else. -->
<context attribute="Shell commands" lineEndContext="package section" name="package section start line">
<!-- Handle % -->
<DetectChar context="handle_percent" char="%" lookAhead="true" />
</context>
<!-- "command section" is a generic context for all sections (like %prep, %build, %install...)
where you can enter shell commands. -->
<context attribute="Shell commands" lineEndContext="#stay" name="command section" fallthroughContext="#pop!shell in section">
<RegExpr attribute="Shell commands" String="\s+(?=.*-p\s+<lua>)" context="#pop!command section lua"/>
</context>
<context attribute="Shell commands" lineEndContext="#pop!section lua" name="command section lua">
<DetectChar context="handle_percent" char="%" lookAhead="true" />
<IncludeRules context="find_spaces_and_ident"/>
</context>
<context attribute="Shell commands" lineEndContext="#stay" name="section lua">
<DetectChar context="handle_percent" char="%" lookAhead="1" column="0"/>
<IncludeRules context="##Lua"/>
</context>
<!-- "changelog section" is the context for the changelog. By default, everything that is
not recognized especially, is interpretated as changelog text. -->
<context attribute="String" lineEndContext="#stay" name="changelog section">
<!-- Handle calender date -->
<DetectChar attribute="Tag" context="changelog_weekday" char="*" column="0" />
<IncludeRules context="description section"/>
</context>
<!-- "description section start line" simply is used for the parameters after the
"%description" macro. With the next line break, it will switch to the
"description section" context which will handle the content of the description. -->
<context attribute="Shell commands" lineEndContext="#pop!description section" name="description section start line">
<!-- Handle % -->
<DetectChar context="handle_percent" char="%" lookAhead="true" />
</context>
<!-- "description section" is a follow-up context of "description section start line". See
there for further details. -->
<context attribute="String" lineEndContext="#stay" name="description section">
<!-- Handle % -->
<DetectChar context="handle_percent" char="%" lookAhead="true" />
<DetectIdentifier attribute="String"/>
<!-- Handle comments. "# norootforbuild" is displayed like a tag. -->
<RegExpr context="Comment" String="^[ \t]*#" column="0" lookAhead="true" />
<DetectSpaces attribute="String"/>
</context>
<!-- This is a convenience context that is handling comments automatically. Furthermore it
handles "# norootforbuild" because it looks like a comment. If a context supports comments,
simple use "<RegExpr context="Comment" String="^[ \t]*#" column="0" lookAhead="true" />".
(This context relies on the asumption that # is the first non-whitespace. We have to
guarantee this when calling this context! -->
<context attribute="Comment" lineEndContext="#pop" name="Comment">
<!-- While indeeted comments are not allowed by the standard (see section "Comments" at
http://docs.fedoraproject.org/en-US/Fedora_Draft_Documentation/0.1/html/RPM_Guide/ch-specfile-syntax.html#id1961462),
rpmbuild accepts them nevertheless. We highlight them as comments, but we mark the
indeet. -->
<!-- Handle "# norootforbuild" and some of its miss-spellings. -->
<StringDetect attribute="Tag" context="every_non_whitespace_is_warning" String="# norootforbuild" column="0" />
<RegExpr attribute="Warning" context="#stay" String="#[ \t]*norootforbuild" firstNonSpace="1"/>
<RegExpr attribute="Hint" context="#stay" String="^[ \t]+(?=#)" column="0" />
<!-- Warning on single percent ("%"), but not on double percent ("%%"): -->
<Detect2Chars attribute="Comment" char="%" char1="%"/>
<DetectChar attribute="Warning" char="%"/>
<DetectSpaces />
<IncludeRules context="##Comments"/> <!-- Alert -->
<DetectIdentifier />
</context>
<!-- "every_non_whitespace_is_error" is a simple helper context. It switchs back to the
previous context at the end of the line. -->
<context attribute="Fallback for separator spaces" lineEndContext="#pop" name="every_non_whitespace_is_error">
<DetectSpaces attribute="Fallback for separator spaces"/>
<RegExpr attribute="Error" context="#stay" String="[^\s]+"/>
</context>
<!-- "every_non_whitespace_is_warning" is a simple helper context. It switchs back to the
previous context at the end of the line. -->
<context attribute="Fallback for separator spaces" lineEndContext="#pop" name="every_non_whitespace_is_warning">
<RegExpr attribute="Warning" context="#stay" String="[^\s]" />
</context>
<!-- "tag_line_value" is a context for enumeration values. It makes no further syntax
check. -->
<context attribute="Enumeration" lineEndContext="#pop" name="tag_line_value">
<!-- Handle % -->
<DetectChar context="handle_percent" char="%" lookAhead="1"/>
</context>
<!-- "tag_line_string" is a context for string values. It makes no further syntax
check. -->
<context attribute="String" lineEndContext="#pop" name="tag_line_string">
<!-- Handle \ -->
<RegExpr attribute="Escaped character" String="\\[^%]|\\(?=(\%))" />
<!-- Handle % -->
<DetectChar context="handle_percent" char="%" lookAhead="1"/>
</context>
<!-- "tag_line_string_only_one_word" is a context for string values. The first word is
highlighted as string, but after the first space (normal space, tab...), all other
words are highlighted as error. WARNING: This context requieres that there is no space at
the begin! -->
<context attribute="String" lineEndContext="#pop" name="tag_line_string_only_one_word">
<!-- Handle \ -->
<RegExpr attribute="Escaped character" String="\\[^%]|\\(?=(\%))" />
<!-- Handle % -->
<AnyChar context="tag_line_string" String="%$" lookAhead="true" />
<!-- Handle spaces -->
<DetectSpaces context="every_non_whitespace_is_error" />
</context>
<!-- "tag_line_integer" is a context for integer values. Non-integer context is marked as
error. -->
<context attribute="Error" lineEndContext="#pop" name="tag_line_integer" fallthroughContext="every_non_whitespace_is_error">
<Int attribute="Integer" context="every_non_whitespace_is_error" />
<!-- Handle % -->
<AnyChar context="tag_line_integer_without_syntax_check" String="%$" lookAhead="true" />
</context>
<!-- "tag_line_os" is a context for values that define the operation system. Unknown values
are marked as error. -->
<context attribute="Warning" lineEndContext="#pop" name="tag_line_os">
<!-- Spaces are okay -->
<DetectSpaces attribute="Fallback for separator spaces" />
<!-- Recognize valid values -->
<RegExpr attribute="Enumeration" String="&os;&lookahead_whitespace_eol;" />
<!-- Handle % -->
<AnyChar context="tag_line_value" String="%$" lookAhead="true" />
</context>
<!-- "tag_line_integer_without_syntax_check" is a context that is used internally by
"tag_line_integer" after macros. -->
<context attribute="Integer" lineEndContext="#pop" name="tag_line_integer_without_syntax_check">
<!-- Handle % -->
<DetectChar context="handle_percent" char="%" lookAhead="1"/>
</context>
<!-- "tag_line_arch" is a context for values that define the computer type. Unknown values
are marked as error. -->
<context attribute="Warning" lineEndContext="#pop" name="tag_line_arch">
<!-- Spaces are okay -->
<DetectSpaces attribute="Fallback for separator spaces" />
<!-- Recognize valid values -->
<RegExpr attribute="Enumeration" String="&arch;&lookahead_whitespace_eol;" />
<!-- Handle % -->
<AnyChar context="tag_line_value" String="%$" lookAhead="true" />
</context>
<!-- "tag_line_package" is a context for dependency handling. The keywords <= >= == < > are
recognized and highlighted as keywords. Thee rest is simply highlighted as enumeration. See
http://docs.fedoraproject.org/drafts/rpm-guide-en/ch-specfile-syntax.html#id3045258 and
http://docs.fedoraproject.org/drafts/rpm-guide-en/ch-advanced-packaging.html#id2979270 for
details -->
<context attribute="Enumeration" lineEndContext="#pop" name="tag_line_package">
<AnyChar attribute="Keyword" context="#stay" String="()" /> <!-- See http://rpm5.org/docs/api/dependencies.html about the parentheses -->
<Detect2Chars attribute="Keyword" context="#stay" char="<" char1="="/>
<Detect2Chars attribute="Keyword" context="#stay" char=">" char1="="/>
<Detect2Chars attribute="Keyword" context="#stay" char="=" char1="="/>
<AnyChar attribute="Keyword" context="#stay" String="=<>," />
<!-- Handle % -->
<DetectChar context="handle_percent" char="%" lookAhead="1"/>
</context>
<!-- "tag_line_switch" is a context that accepts "0", "1", "yes" and "no" as value.
Everything else is an error. See http://www.rpm.org/max-rpm-snapshot/s1-rpm-depend-auto-depend.html
and http://www.rpm.org/max-rpm/s1-rpm-inside-tags.html#S3-RPM-INSIDE-AUTOREQPROV-TAG -->
<context attribute="Error" lineEndContext="#pop" name="tag_line_switch" fallthroughContext="every_non_whitespace_is_error">
<AnyChar attribute="Enumeration" context="every_non_whitespace_is_error" String="01" />
<Detect2Chars attribute="Enumeration" context="every_non_whitespace_is_error" char="n" char1="o"/>
<StringDetect attribute="Enumeration" context="every_non_whitespace_is_error" String="yes" />
<!-- Handle % -->
<AnyChar context="tag_line_value" String="%$" lookAhead="true" />
</context>
<!-- A context that doesn't test for format errors in the changelog date anymore. Necessary
if macros are used. -->
<context attribute="Tag" lineEndContext="#pop" name="changelog_generic">
<!-- Handle % -->
<DetectChar context="handle_percent" char="%" lookAhead="1"/>
</context>
<!-- A context that handles the weekday in the changelog date. -->
<context attribute="Tag" lineEndContext="#pop" name="changelog_weekday">
<DetectSpaces/>
<keyword context="changelog_month" attribute="Tag" String="weekdays" />
<!-- % handling without format errors in the date of the changelog -->
<AnyChar context="changelog_generic" String="%$" lookAhead="true" />
<RegExpr context="changelog_month" attribute="Error" String="\S*" />
</context>
<!-- A context that handles the month in the changelog date. -->
<context attribute="Tag" lineEndContext="#pop" name="changelog_month">
<DetectSpaces/>
<keyword context="changelog_day" attribute="Tag" String="month names" />
<!-- % handling without format errors in the date of the changelog -->
<AnyChar context="changelog_generic" String="%$" lookAhead="true" />
<RegExpr context="changelog_day" attribute="Error" String="\S*" />
</context>
<!-- A context that handles the day in the changelog date. -->
<context attribute="Tag" lineEndContext="#pop" name="changelog_day">
<DetectSpaces/>
<keyword context="changelog_year" attribute="Tag" String="days" />
<!-- % handling without format errors in the date of the changelog -->
<AnyChar context="changelog_generic" String="%$" lookAhead="true" />
<RegExpr context="changelog_year" attribute="Error" String="\S*" />
</context>
<!-- A context that handles the year in the changelog date. -->
<context attribute="Tag" lineEndContext="#pop" name="changelog_year">
<DetectSpaces/>
<RegExpr context="changelog_header" attribute="Tag" String="(\d{4})&lookahead_whitespace_eol;" />
<!-- % handling without format errors in the date of the changelog -->
<AnyChar context="changelog_generic" String="%$" lookAhead="true" />
<RegExpr context="changelog_header" attribute="Error" String="\S*" />
</context>
<!-- A context that handles the text after the date in a changelog (name, e-mail...). -->
<context attribute="Tag" lineEndContext="#pop" name="changelog_header">
<!-- Handle % -->
<DetectChar context="handle_percent" char="%" lookAhead="1"/>
</context>
<!-- Handles everything that comes after %ifos etc... -->
<context attribute="Warning" lineEndContext="#pop" name="parameters after ifos">
<!-- Spaces are okay -->
<DetectSpaces attribute="Fallback for separator spaces" />
<!-- Recognize valid values -->
<RegExpr attribute="Enumeration" String="&os;&lookahead_whitespace_eol;" />
<!-- Handle % -->
<DetectChar context="handle_percent" char="%" lookAhead="1"/>
</context>
<!-- Handles everything that comes after %ifarch etc... -->
<context attribute="Warning" lineEndContext="#pop" name="parameters after ifarch">
<!-- Spaces are okay -->
<DetectSpaces attribute="Fallback for separator spaces" />
<!-- Recognize valid values -->
<RegExpr attribute="Enumeration" String="&arch;&lookahead_whitespace_eol;" />
<!-- Handle % -->
<DetectChar context="handle_percent" char="%" lookAhead="1"/>
</context>
<!-- Handles expressions after conditionals. -->
<context attribute="Error" lineEndContext="#pop" name="expression after _if_ statement">
<!-- spaces should not be "Error" (which is the default for unrecognized entities) -->
<DetectSpaces attribute="Fallback for separator spaces" context="#stay" />
<!-- %if recognizes && || > < >= <= == != ! and () -->
<AnyChar attribute="Keyword" context="#stay" String="()" />
<Detect2Chars attribute="Keyword" context="#stay" char="&" char1="&"/>
<Detect2Chars attribute="Keyword" context="#stay" char="<" char1="="/>
<Detect2Chars attribute="Keyword" context="#stay" char=">" char1="="/>
<Detect2Chars attribute="Keyword" context="#stay" char="=" char1="="/>
<Detect2Chars attribute="Keyword" context="#stay" char="!" char1="="/>
<AnyChar attribute="Keyword" context="#stay" String="!<>" />
<Detect2Chars attribute="Keyword" context="#stay" char="|" char1="|"/>
<!-- %if interpretates values either as integer or as string -->
<Int attribute="Integer" context="#stay" additionalDeliminator="!("/>
<DetectIdentifier attribute="String" context="#stay" />
<DetectChar attribute="String" context="quoted strings in if statements" char=""" />
<!-- Handle % -->
<DetectChar context="handle_percent" char="%" lookAhead="1"/>
</context>
<!-- This context handles quoted strings in %if statements. WARNING: Make sure that you
switch to this context _after_ parsing the starting ", because at the first occurrence
of " this context switches back. -->
<context attribute="String" lineEndContext="#pop" name="quoted strings in if statements">
<!-- Handle \ -->
<RegExpr attribute="Escaped character" String="\\[^"]" />
<!-- Handle % -->
<DetectChar context="handle_percent" char="%" lookAhead="1"/>
<!-- Switch back at the end of the quoted string -->
<DetectChar attribute="String" context="#pop" char=""" />
</context>
<!-- Context for %define -->
<context attribute="Fallback for separator spaces" lineEndContext="#pop" name="macro definition">
<DetectSpaces />
<RegExpr attribute="Enumeration" context="macro definition content" String="[&a_valid_char_in_macro_names;]*(([(][)])|&lookahead_whitespace_eol;)" />
<RegExpr attribute="Error" context="macro definition content" String="[^ \t]*" />
</context>
<!-- Context for the content of a macro definition. -->
<context attribute="String" lineEndContext="#pop" name="macro definition content">
<IncludeRules context="find_spaces_and_ident"/>
<!-- Handle % -->
<DetectChar context="handle_percent" char="%" lookAhead="1"/>
<LineContinue attribute="Line break" context="#stay"/>
<DetectChar attribute="Warning" char="\" />
</context>
<!-- Context for %undefine -->
<context attribute="Fallback for separator spaces" lineEndContext="#pop" name="undefine macro">
<DetectSpaces />
<RegExpr attribute="Enumeration" context="every_non_whitespace_is_error" String="[&a_valid_char_in_macro_names;]*&lookahead_whitespace_eol;" />
<RegExpr attribute="Error" context="every_non_whitespace_is_error" String="." />
</context>
<!-- This context handles automatically all type of macros, keywords and so on that start with % or $.
It expects a string starting with % or $ (otherwise, this context will fail!). -->
<context attribute="Fallback for separator spaces" lineEndContext="#pop" name="handle_percent">
<Detect2Chars attribute="Escaped character" context="#pop" char="%" char1="%"/>
<!-- Handle normal macros -->
<Detect2Chars attribute="Macro call" context="#pop!macro content in braces" char="%" char1="{" />
<Detect2Chars attribute="Macro call" context="#pop!macro content in parenthesis" char="%" char1="(" />
<!-- Keywords: -->
<RegExpr attribute="Control Flow" context="expression after _if_ statement" String="%(if!?)&lookahead_whitespace_eol;" firstNonSpace="true" beginRegion="if_block" />
<RegExpr attribute="Control Flow" context="parameters after ifarch" String="%&arch_conditionals_names;&lookahead_whitespace_eol;" firstNonSpace="true" beginRegion="if_block" />
<RegExpr attribute="Control Flow" context="parameters after ifos" String="%&os_conditionals_names;&lookahead_whitespace_eol;" firstNonSpace="true" beginRegion="if_block" />
<RegExpr attribute="Control Flow" context="every_non_whitespace_is_error" String="%else&lookahead_whitespace_eol;" firstNonSpace="true" endRegion="if_block" beginRegion="if_block" />
<RegExpr attribute="Control Flow" context="every_non_whitespace_is_error" String="%endif&lookahead_whitespace_eol;" firstNonSpace="true" endRegion="if_block" />
<RegExpr attribute="Keyword" context="macro definition" String="%(define|global)&lookahead_whitespace_eol;" firstNonSpace="true" />
<RegExpr attribute="Keyword" context="undefine macro" String="%undefine&lookahead_whitespace_eol;" firstNonSpace="true" />
<!-- If a command section starts (=section macro at begin of the line), we switch
to the corresponding context. There will never be a return to THIS context...: -->
<RegExpr attribute="Section" context="#pop#pop!package section start line" String="^%package&lookahead_whitespace_eol;" column="0" />
<RegExpr attribute="Section" context="#pop#pop!description section start line" String="^%description&lookahead_whitespace_eol;" column="0" />
<RegExpr attribute="Section" context="#pop#pop!command section" String="^%&command_section_name;&lookahead_whitespace_eol;" column="0" />
<RegExpr attribute="Section" context="#pop#pop!changelog section" String="^%changelog&lookahead_whitespace_eol;" column="0" />
<!-- Handle normal macros -->
<RegExpr attribute="Macro call" context="macro call in parenthesis" String="%(?!&predefined_commands;)[&a_valid_char_in_macro_names;]*\(" />
<RegExpr attribute="Macro call" context="#pop" String="%(?!&predefined_commands;)([&a_valid_char_in_macro_names;]+|[*#])(?=($|[^&a_valid_char_in_macro_names;]))" /> <!-- ')' and '}' are only allowed as macro terminator in the lookahead because when you do something like %__make %{?jobs:-j %jobs}, then the "%jobs" is a valid macro. However, the disadvantage is that a line like "%abc} isn't marked as error. But it is to complicate to distinguish this properly. -->
<RegExpr attribute="Error" context="#pop" String="%([&a_valid_char_in_macro_names;]+|[*#])?" /> <!-- a single % or $ is also an error -->
</context>
<!-- Used internally by "handle_percent" -->
<context attribute="Macro call" lineEndContext="#pop" name="normal macro content in braces">
<DetectChar attribute="Macro call" context="#pop" char="}" />
<DetectIdentifier attribute="Macro call"/>
<AnyChar attribute="Error" context="#stay" String="({)" />
<!--(This seems to be confusing instead of helping)AnyChar attribute="Keyword" context="#stay" String="!?:" /-->
<!-- Handle % -->
<DetectChar context="handle_percent" char="%" lookAhead="1"/>
<DetectSpaces attribute="Macro call"/>
</context>
<context attribute="Shell commands" lineEndContext="#stay" name="macro_lua">
<DetectChar attribute="Macro call" context="#pop" char="}" />
<!-- Should exit on the first } found, even if this one is in a string,
but this is currently not possible -->
<IncludeRules context="##Lua"/>
</context>
<!-- Used internally by "handle_percent"
Context for %{ -->
<context attribute="Macro call" lineEndContext="#pop" name="macro content in braces" fallthroughContext="#pop!normal macro content in braces">
<StringDetect attribute="Macro call" context="#pop!macro_expand" String="expand:"/>
<StringDetect attribute="Macro call" context="#pop!macro_lua" String="lua:"/>
</context>
<!-- Used internally by "handle_percent"
Context for %xxx( -->
<context attribute="Macro call" lineEndContext="#pop#pop" name="macro call in parenthesis">
<DetectChar attribute="Macro call" context="#pop#pop" char=")" />
<DetectChar context="handle_percent" char="%" lookAhead="1"/>
<DetectIdentifier attribute="Macro call"/>
</context>
<!-- Used internally by "handle_percent"
Context for %( -->
<context attribute="Shell commands" lineEndContext="#stay" name="macro content in parenthesis" fallthroughContext="shell_in_parenthesis_parameters">
<DetectChar attribute="Macro call" context="#pop" char=")"/>
<keyword attribute="Shell keyword" String="bash_keyword" additionalDeliminator="&|);"/>
<DetectIdentifier attribute="Shell commands" context="shell_in_parenthesis_parameters"/>
<DetectSpaces attribute="Shell commands"/>
<AnyChar attribute="Shell symbol" String="&|;!"/>
<DetectChar char="`" context="shell_in_parenthesis_bq" attribute="Shell symbol"/>
<Detect2Chars attribute="Shell variable" char="(" char1="(" context="shell_in_parenthesis_expr"/>
<DetectChar attribute="Shell symbol" char="(" context="shell_in_parenthesis_subcommand"/>
<DetectChar attribute="Comment" char="#" context="shell_in_parenthesis_comment"/>
<StringDetect attribute="Shell commands" String="[[ " context="shell_in_parenthesis_cond2"/>
<DetectChar attribute="Shell keyword" char="{" context="shell_in_parenthesis_brace"/>
<IncludeRules context="shell_find_redirections"/>
<RegExpr attribute="Shell commands" context="shell_in_parenthesis_parameters" String="[^ \t<>|&;()${}'"`\\%#]++"/>
</context>
<context attribute="Shell commands" lineEndContext="#pop" name="find_spaces_and_ident">
<DetectSpaces/>
<DetectIdentifier/>
</context>
<context attribute="Shell commands" lineEndContext="#pop" name="shell_in_parenthesis_find_blank_and_ident" fallthroughContext="#pop">
<RegExpr attribute="Comment" String="^#|\s+#" context="shell_in_parenthesis_comment"/>
<RegExpr attribute="Shell keyword" String="(^|\s+)\{&lookahead_whitespace_eol;" context="shell_in_parenthesis_brace"/>
<IncludeRules context="find_spaces_and_ident"/>
</context>
<!-- %( with { -->
<context attribute="Shell commands" lineEndContext="#stay" name="shell_in_parenthesis_brace">
<DetectChar attribute="Shell keyword" context="#pop" char="}"/>
<DetectChar context="#pop" char=")" lookAhead="1"/>
<IncludeRules context="macro content in parenthesis"/>
</context>
<!-- %( with # -->
<context attribute="Comment" lineEndContext="#pop" name="shell_in_parenthesis_comment">
<DetectChar attribute="Comment" char="(" context="shell_in_parenthesis_comment_brace"/>
<DetectChar char=")" context="#pop" lookAhead="1"/>
<IncludeRules context="shell_in_section_comment"/>
</context>
<context attribute="Comment" lineEndContext="#pop" name="shell_in_parenthesis_comment_brace">
<DetectChar attribute="Comment" char=")" context="#pop"/>
<IncludeRules context="shell_in_parenthesis_comment"/>
</context>
<!-- %( with ` -->
<context attribute="Shell commands" lineEndContext="#pop" name="shell_in_parenthesis_bq" fallthroughContext="shell_in_parenthesis_parameters">
<DetectChar char="`" context="#pop" attribute="Shell symbol"/>
<DetectChar char=")" context="#pop" lookAhead="1"/>
<IncludeRules context="macro content in parenthesis"/>
</context>
<!-- %( with cmd ... -->
<context attribute="Shell commands" lineEndContext="#pop" name="shell_in_parenthesis_parameters">
<IncludeRules context="shell_in_parenthesis_find_blank_and_ident"/>
<AnyChar context="#pop" String=")`" lookAhead="1"/>
<AnyChar attribute="Shell symbol" String="&|;" context="#pop"/>
<AnyChar attribute="Shell symbol" String="*?"/>
<DetectChar attribute="Shell commands" context="shell_in_parenthesis_parameters_brace" char="("/>
<IncludeRules context="shell_in_parenthesis_find_word"/>
<IncludeRules context="shell_find_redirections"/>
</context>
<context attribute="Shell commands" lineEndContext="#pop" name="shell_in_parenthesis_parameters_brace">
<DetectChar attribute="Shell commands" context="#pop" char=")"/>
<AnyChar String="&|;" context="#pop" lookAhead="1"/>
<IncludeRules context="shell_in_parenthesis_parameters"/>
</context>
<!-- %( with [[ -->
<context attribute="Shell commands" lineEndContext="#pop" name="shell_in_parenthesis_cond2">
<Detect2Chars attribute="Shell commands" char="]" char1="]" context="#pop"/>
<AnyChar attribute="Shell symbol" String="&|;"/>
<DetectChar attribute="Shell symbol" char="(" context="shell_in_parenthesis_sub_cond2"/>
<IncludeRules context="shell_in_parenthesis_parameters"/>
</context>
<context attribute="Shell commands" lineEndContext="#pop" name="shell_in_parenthesis_sub_cond2">
<DetectChar attribute="Shell symbol" char=")" context="#pop"/>
<AnyChar attribute="Shell symbol" String="&|;"/>
<DetectChar attribute="Shell symbol" char="(" context="shell_in_parenthesis_sub_cond2"/>
<Detect2Chars char="]" char1="]" context="#pop" lookAhead="1"/>
<IncludeRules context="shell_in_parenthesis_parameters"/>
</context>
<context attribute="Shell commands" lineEndContext="#pop" name="shell_in_parenthesis_find_word" fallthroughContext="#pop">
<IncludeRules context="shell_in_parenthesis_find_variable"/>
<DetectChar attribute="Shell string" char="'" context="shell_in_parenthesis_sq_string"/>
<DetectChar attribute="Shell string" char=""" context="shell_in_parenthesis_dq_string"/>
<IncludeRules context="shell_find_escape"/>
<DetectChar char="`" context="#pop" lookAhead="1"/>
</context>
<context attribute="Shell commands" lineEndContext="#pop" name="shell_in_parenthesis_find_variable">
<!-- Handle % -->
<DetectChar context="handle_percent" char="%" lookAhead="1"/>
<Detect2Chars attribute="Shell string" char="$" char1="'" context="shell_in_parenthesis_variable_sq"/>
<StringDetect attribute="Shell variable" String="$((" context="shell_in_parenthesis_expr"/>
<Detect2Chars attribute="Shell symbol" char="$" char1="(" context="shell_in_parenthesis_subcommand"/>
<Detect2Chars attribute="Shell variable" char="$" char1="{" context="shell_in_parenthesis_variable_brace"/>
<DetectChar attribute="Shell variable" char="$" context="shell_single_variable"/>
</context>
<!-- %( with $' -->
<context attribute="Shell string" lineEndContext="#pop" name="shell_in_parenthesis_variable_sq">
<IncludeRules context="find_spaces_and_ident"/>
<DetectChar char="'" context="#pop" attribute="Shell string"/>
<DetectChar char=")" context="#pop" lookAhead="1"/>
<DetectChar char="(" context="shell_in_parenthesis_variable_sq_brace" attribute="Shell string"/>
<IncludeRules context="shell_find_escape"/>
<DetectChar context="handle_percent" char="%" lookAhead="1"/>
</context>
<context attribute="Shell string" lineEndContext="#pop" name="shell_in_parenthesis_variable_sq_brace">
<DetectChar char="'" context="#pop" lookAhead="1"/>
<DetectChar char=")" context="#pop" attribute="Shell string"/>
<IncludeRules context="shell_in_parenthesis_variable_sq"/>
</context>
<!-- %( with $(( -->
<context attribute="Shell variable" lineEndContext="#pop" name="shell_in_parenthesis_expr">
<IncludeRules context="shell_in_parenthesis_find_blank_and_ident"/>
<Detect2Chars char=")" char1=")" context="#pop" attribute="Shell variable"/>
<DetectChar char=")" context="#pop!shell_in_parenthesis_subcommand" attribute="Shell variable"/>
<DetectChar char="(" context="shell_in_parenthesis_subexpr" attribute="Shell symbol"/>
<IncludeRules context="shell_in_parenthesis_find_word"/>
</context>
<context attribute="Shell variable" lineEndContext="#pop" name="shell_in_parenthesis_subexpr">
<IncludeRules context="shell_in_parenthesis_find_blank_and_ident"/>
<DetectChar char=")" context="#pop" attribute="Shell symbol"/>
<DetectChar char="(" context="shell_in_parenthesis_subexpr" attribute="Shell symbol"/>
<IncludeRules context="shell_in_parenthesis_find_word"/>
</context>
<!-- %( with $( -->
<context attribute="Shell string" lineEndContext="#pop" name="shell_in_parenthesis_subcommand">
<DetectChar char=")" context="#pop" attribute="Shell symbol"/>
<IncludeRules context="macro content in parenthesis"/>
</context>
<!-- %( with ${ -->
<context attribute="Shell variable" lineEndContext="#pop" name="shell_in_parenthesis_variable_brace">
<DetectChar char=")" context="#pop" lookAhead="1"/>
<DetectChar char="(" context="shell_in_parenthesis_variable_brace_parenthesis" attribute="Shell variable"/>
<DetectChar attribute="Shell variable" char="}" context="#pop"/>
<DetectChar attribute="Shell variable" char="{" context="shell_in_parenthesis_variable_brace"/>
<DetectIdentifier attribute="Shell variable"/>
<IncludeRules context="shell_in_parenthesis_find_word"/>
</context>
<context attribute="Shell variable" lineEndContext="#pop" name="shell_in_parenthesis_variable_brace_parenthesis">
<DetectChar char=")" context="#pop" attribute="Shell variable"/>
<IncludeRules context="shell_in_parenthesis_variable_brace"/>
</context>
<!-- %( with ' -->
<context attribute="Shell string" lineEndContext="#pop" name="shell_in_parenthesis_sq_string">
<IncludeRules context="find_spaces_and_ident"/>
<DetectChar char=")" context="#pop" lookAhead="1"/>
<DetectChar char="'" context="#pop" attribute="Shell string"/>
<DetectChar char="(" context="shell_in_parenthesis_sq_string_brace" attribute="Shell string"/>
<Detect2Chars char="\" char1=")" attribute="Escaped character"/>
<DetectChar context="handle_percent" char="%" lookAhead="1"/>
</context>
<context attribute="Shell string" lineEndContext="#pop" name="shell_in_parenthesis_sq_string_brace">
<DetectChar char=")" context="#pop" attribute="Shell string"/>
<DetectChar char="'" context="#pop" lookAhead="1"/>
<IncludeRules context="shell_in_parenthesis_sq_string"/>
</context>
<!-- %( with " -->
<context attribute="Shell string" lineEndContext="#pop" name="shell_in_parenthesis_dq_string">
<IncludeRules context="find_spaces_and_ident"/>
<DetectChar char=""" context="#pop" attribute="Shell string"/>
<DetectChar char=")" context="#pop" lookAhead="1"/>
<DetectChar char="(" context="shell_in_parenthesis_dq_string_brace" attribute="Shell string"/>
<IncludeRules context="shell_find_escape"/>
<IncludeRules context="shell_in_parenthesis_find_variable"/>
<DetectChar char="`" context="shell_in_parenthesis_bq" attribute="Shell symbol"/>
</context>
<context attribute="Shell string" lineEndContext="#pop" name="shell_in_parenthesis_dq_string_brace">
<DetectChar char=""" context="#pop" lookAhead="1"/>
<DetectChar char=")" context="#pop" attribute="Shell string"/>
<IncludeRules context="shell_in_parenthesis_dq_string"/>
</context>
<!-- Used internally by "handle_percent"
Context for %{expand: -->
<context attribute="Shell commands" lineEndContext="#stay" name="macro_expand" fallthroughContext="shell_in_brace_parameters">
<DetectChar attribute="Macro call" context="#pop" char="}"/>
<WordDetect attribute="Shell keyword" String="function" context="shell_in_brace_function"/>
<keyword attribute="Shell keyword" String="bash_keyword" additionalDeliminator="&|});"/>
<DetectIdentifier attribute="Shell commands" context="shell_in_brace_parameters"/>
<DetectSpaces attribute="Shell commands"/>
<AnyChar attribute="Shell symbol" String="&|;!"/>
<DetectChar char="`" context="shell_in_brace_bq" attribute="Shell symbol"/>
<Detect2Chars attribute="Shell variable" char="(" char1="(" context="shell_in_brace_expr"/>
<DetectChar attribute="Shell symbol" char="(" context="shell_in_brace_subcommand"/>
<DetectChar attribute="Comment" char="#" context="shell_in_brace_comment"/>
<StringDetect attribute="Shell commands" String="[[ " context="shell_in_brace_cond2"/>
<DetectChar attribute="Shell keyword" char="{" context="shell_in_brace_brace"/>
<IncludeRules context="shell_find_redirections"/>
<RegExpr attribute="Shell commands" context="shell_in_brace_parameters" String="[^ \t<>|&;()${}'"`\\%#]++"/>
</context>
<context attribute="Shell commands" lineEndContext="#pop" name="shell_in_brace_find_blank_and_ident" fallthroughContext="#pop">
<RegExpr attribute="Comment" String="^#|\s+#" context="shell_in_brace_comment"/>
<RegExpr attribute="Shell keyword" String="(^|\s+)\{&lookahead_whitespace_eol;" context="shell_in_brace_brace"/>
<IncludeRules context="find_spaces_and_ident"/>
</context>
<!-- %{expand with function -->
<context attribute="Shell commands" lineEndContext="#stay" name="shell_in_brace_function" fallthroughContext="#pop">
<DetectChar attribute="Shell keyword" context="#pop!shell_in_brace_brace" char="{"/>
<DetectChar context="#pop" char="}" lookAhead="1"/>
<Detect2Chars char="(" char1=")"/>
<IncludeRules context="find_spaces_and_ident"/>
</context>
<!-- %{expand with { -->
<context attribute="Shell commands" lineEndContext="#stay" name="shell_in_brace_brace">
<DetectChar attribute="Shell keyword" context="#pop" char="}"/>
<IncludeRules context="macro_expand"/>
</context>
<!-- %{expand with # -->
<context attribute="Comment" lineEndContext="#pop" name="shell_in_brace_comment">
<DetectChar attribute="Comment" char="{" context="shell_in_brace_comment_brace"/>
<DetectChar char="}" context="#pop" lookAhead="1"/>
<IncludeRules context="shell_in_section_comment"/>
</context>
<context attribute="Comment" lineEndContext="#pop" name="shell_in_brace_comment_brace">
<DetectChar attribute="Comment" char="}" context="#pop"/>
<IncludeRules context="shell_in_brace_comment"/>
</context>
<!-- %{expand with ` -->
<context attribute="Shell commands" lineEndContext="#pop" name="shell_in_brace_bq" fallthroughContext="shell_in_brace_parameters">
<DetectChar char="`" context="#pop" attribute="Shell symbol"/>
<DetectChar char="}" context="#pop" lookAhead="1"/>
<IncludeRules context="macro_expand"/>
</context>
<!-- %{expand with cmd ... -->
<context attribute="Shell commands" lineEndContext="#pop" name="shell_in_brace_parameters">
<IncludeRules context="shell_in_brace_find_blank_and_ident"/>
<AnyChar context="#pop" String="})`" lookAhead="1"/>
<AnyChar attribute="Shell symbol" String="&|;" context="#pop"/>
<AnyChar attribute="Shell symbol" String="*?"/>
<DetectChar attribute="Shell commands" context="shell_in_brace_parameters_brace" char="{"/>
<IncludeRules context="shell_in_brace_find_word"/>
<IncludeRules context="shell_find_redirections"/>
</context>
<context attribute="Shell commands" lineEndContext="#pop" name="shell_in_brace_parameters_brace">
<DetectChar attribute="Shell commands" context="#pop" char="}"/>
<AnyChar String="&|;" context="#pop" lookAhead="1"/>
<IncludeRules context="shell_in_brace_parameters"/>
</context>
<!-- %{expand with [[ -->
<context attribute="Shell commands" lineEndContext="#pop" name="shell_in_brace_cond2">
<Detect2Chars attribute="Shell commands" char="]" char1="]" context="#pop"/>
<AnyChar attribute="Shell symbol" String="&|;"/>
<DetectChar attribute="Shell symbol" char="(" context="shell_in_brace_sub_cond2"/>
<IncludeRules context="shell_in_brace_parameters"/>
</context>
<context attribute="Shell commands" lineEndContext="#pop" name="shell_in_brace_sub_cond2">
<DetectChar attribute="Shell symbol" char=")" context="#pop"/>
<AnyChar attribute="Shell symbol" String="&|;"/>
<DetectChar attribute="Shell symbol" char="(" context="shell_in_brace_sub_cond2"/>
<Detect2Chars char="]" char1="]" context="#pop" lookAhead="1"/>
<IncludeRules context="shell_in_brace_parameters"/>
</context>
<context attribute="Shell commands" lineEndContext="#pop" name="shell_find_redirections">
<RegExpr attribute="Shell redirection" context="shell_in_brace_find_word" String="([0-9]*>[>|&]?|&>>?|<<<|<[&>]?)(&[0-9]+|\s*[^\s{}()%$&;|`]+)?"/>
</context>
<context attribute="Shell commands" lineEndContext="#pop" name="shell_in_brace_find_word" fallthroughContext="#pop">
<IncludeRules context="shell_in_brace_find_variable"/>
<DetectChar attribute="Shell string" char="'" context="shell_in_brace_sq_string"/>
<DetectChar attribute="Shell string" char=""" context="shell_in_brace_dq_string"/>
<IncludeRules context="shell_find_escape"/>
<DetectChar char="`" context="#pop" lookAhead="1"/>
</context>
<context attribute="Shell commands" lineEndContext="#pop" name="shell_in_brace_find_variable">
<!-- Handle % -->
<DetectChar context="handle_percent" char="%" lookAhead="1"/>
<Detect2Chars attribute="Shell string" char="$" char1="'" context="shell_in_brace_variable_sq"/>
<StringDetect attribute="Shell variable" String="$((" context="shell_in_brace_expr"/>
<Detect2Chars attribute="Shell symbol" char="$" char1="(" context="shell_in_brace_subcommand"/>
<Detect2Chars attribute="Shell variable" char="$" char1="{" context="shell_in_brace_variable_brace"/>
<DetectChar attribute="Shell variable" char="$" context="shell_single_variable"/>
</context>
<context attribute="Shell commands" lineEndContext="#pop" name="shell_find_escape">
<DetectChar attribute="Shell symbol" char="\" context="shell_in_brace_escape" lookAhead="1"/>
</context>
<context attribute="Shell commands" lineEndContext="#pop" name="shell_in_brace_escape">
<RegExpr attribute="Escaped character" context="#pop" String="\\."/>
<LineContinue attribute="Line break" context="#pop"/>
</context>
<!-- %{expand with $' -->
<context attribute="Shell string" lineEndContext="#pop" name="shell_in_brace_variable_sq">
<IncludeRules context="find_spaces_and_ident"/>
<DetectChar char="'" context="#pop" attribute="Shell string"/>
<DetectChar char="}" context="#pop" lookAhead="1"/>
<DetectChar char="{" context="shell_in_brace_variable_sq_brace" attribute="Shell string"/>
<IncludeRules context="shell_find_escape"/>
<DetectChar context="handle_percent" char="%" lookAhead="1"/>
</context>
<context attribute="Shell string" lineEndContext="#pop" name="shell_in_brace_variable_sq_brace">
<DetectChar char="'" context="#pop" lookAhead="1"/>
<DetectChar char="}" context="#pop" attribute="Shell string"/>
<IncludeRules context="shell_in_brace_variable_sq"/>
</context>
<!-- %{expand with $(( -->
<context attribute="Shell variable" lineEndContext="#pop" name="shell_in_brace_expr">
<IncludeRules context="shell_in_brace_find_blank_and_ident"/>
<DetectChar char="}" context="#pop" lookAhead="1"/>
<Detect2Chars char=")" char1=")" context="#pop" attribute="Shell variable"/>
<DetectChar char=")" context="#pop!shell_in_brace_subcommand" attribute="Shell variable"/>
<DetectChar char="(" context="shell_in_brace_subexpr" attribute="Shell symbol"/>
<IncludeRules context="shell_in_brace_find_word"/>
</context>
<context attribute="Shell variable" lineEndContext="#pop" name="shell_in_brace_subexpr">
<IncludeRules context="shell_in_brace_find_blank_and_ident"/>
<DetectChar char="}" context="#pop" lookAhead="1"/>
<DetectChar char=")" context="#pop" attribute="Shell symbol"/>
<DetectChar char="(" context="shell_in_brace_subexpr" attribute="Shell symbol"/>
<IncludeRules context="shell_in_brace_find_word"/>
</context>
<!-- %{expand with $( -->
<context attribute="Shell string" lineEndContext="#pop" name="shell_in_brace_subcommand">
<DetectChar char="}" context="#pop" lookAhead="1"/>
<DetectChar char=")" context="#pop" attribute="Shell symbol"/>
<IncludeRules context="macro_expand"/>
</context>
<!-- %{expand with ${ -->
<context attribute="Shell variable" lineEndContext="#pop" name="shell_in_brace_variable_brace">
<DetectChar attribute="Shell variable" char="}" context="#pop"/>
<DetectChar attribute="Shell variable" char="{" context="shell_in_brace_variable_brace"/>
<DetectIdentifier attribute="Shell variable"/>
<IncludeRules context="shell_in_brace_find_word"/>
</context>
<!-- %{expand with $ -->
<context attribute="Shell variable" lineEndContext="#pop" name="shell_single_variable" fallthroughContext="#pop">
<DetectIdentifier attribute="Shell variable" context="#pop"/>
<AnyChar attribute="Shell variable" context="#pop" String="*@#?$!0123456789-"/>
</context>
<!-- %{expand with ' -->
<context attribute="Shell string" lineEndContext="#pop" name="shell_in_brace_sq_string">
<IncludeRules context="find_spaces_and_ident"/>
<DetectChar char="}" context="#pop" lookAhead="1"/>
<DetectChar char="'" context="#pop" attribute="Shell string"/>
<DetectChar char="{" context="shell_in_brace_sq_string_brace" attribute="Shell string"/>
<Detect2Chars char="\" char1="}" attribute="Escaped character"/>
<DetectChar context="handle_percent" char="%" lookAhead="1"/>
</context>
<context attribute="Shell string" lineEndContext="#pop" name="shell_in_brace_sq_string_brace">
<DetectChar char="}" context="#pop" attribute="Shell string"/>
<DetectChar char="'" context="#pop" lookAhead="1"/>
<IncludeRules context="shell_in_brace_sq_string"/>
</context>
<!-- %{expand with " -->
<context attribute="Shell string" lineEndContext="#pop" name="shell_in_brace_dq_string">
<IncludeRules context="find_spaces_and_ident"/>
<DetectChar char=""" context="#pop" attribute="Shell string"/>
<DetectChar char="}" context="#pop" lookAhead="1"/>
<DetectChar char="{" context="shell_in_brace_dq_string_brace" attribute="Shell string"/>
<IncludeRules context="shell_find_escape"/>
<IncludeRules context="shell_in_brace_find_variable"/>
<DetectChar char="`" context="shell_in_brace_bq" attribute="Shell symbol"/>
</context>
<context attribute="Shell string" lineEndContext="#pop" name="shell_in_brace_dq_string_brace">
<DetectChar char=""" context="#pop" lookAhead="1"/>
<DetectChar char="}" context="#pop" attribute="Shell string"/>
<IncludeRules context="shell_in_brace_dq_string"/>
</context>
<!-- Used internally by "command section" -->
<context attribute="Shell commands" lineEndContext="#stay" name="shell in section" fallthroughContext="shell_in_section_parameters">
<keyword attribute="Shell keyword" String="bash_keyword" additionalDeliminator="&|;"/>
<DetectIdentifier attribute="Shell commands" context="shell_in_section_parameters"/>
<DetectSpaces attribute="Shell commands"/>
<AnyChar attribute="Shell symbol" String="&|;!"/>
<DetectChar char="`" context="shell_in_section_bq" attribute="Shell symbol"/>
<Detect2Chars attribute="Shell variable" char="(" char1="(" context="shell_in_parenthesis_expr"/>
<DetectChar attribute="Shell symbol" char="(" context="shell_in_parenthesis_subcommand"/>
<DetectChar attribute="Comment" char="#" context="shell_in_section_comment"/>
<StringDetect attribute="Shell commands" String="[[ " context="shell_in_section_cond2"/>
<DetectChar attribute="Shell keyword" char="{" context="shell_in_section_brace"/>
<IncludeRules context="shell_find_redirections"/>
<RegExpr attribute="Shell commands" context="shell_in_section_parameters" String="[^ \t<>|&;()${}'"`\\%#]++"/>
<DetectChar context="handle_percent" char="%" lookAhead="1"/>
</context>
<context attribute="Shell commands" lineEndContext="#pop" name="shell_in_section_blank_and_ident" fallthroughContext="#pop">
<RegExpr attribute="Comment" String="^#|\s+#" context="shell_in_section_comment"/>
<RegExpr attribute="Shell keyword" String="(^|\s+)\{&lookahead_whitespace_eol;" context="shell_in_section_brace"/>
<IncludeRules context="find_spaces_and_ident"/>
</context>
<!-- sections with { -->
<context attribute="Shell commands" lineEndContext="#stay" name="shell_in_section_brace">
<DetectChar attribute="Shell keyword" context="#pop" char="}"/>
<IncludeRules context="shell in section"/>
</context>
<!-- section with # -->
<context attribute="Comment" lineEndContext="#pop" name="shell_in_section_comment">
<!-- Warning on single percent ("%"), but not on double percent ("%%"): -->
<Detect2Chars attribute="Comment" char="%" char1="%"/>
<DetectChar attribute="Warning" char="%"/>
<DetectSpaces />
<IncludeRules context="##Comments"/> <!-- Alert -->
<DetectIdentifier />
</context>
<!-- section with ` -->
<context attribute="Shell commands" lineEndContext="#pop" name="shell_in_section_bq" fallthroughContext="shell_in_section_parameters">
<DetectChar char="`" context="#pop" attribute="Shell symbol"/>
<IncludeRules context="shell in section"/>
</context>
<!-- section with cmd ... -->
<context attribute="Shell commands" lineEndContext="#pop" name="shell_in_section_parameters">
<IncludeRules context="shell_in_section_blank_and_ident"/>
<AnyChar attribute="Shell symbol" String="&|;" context="#pop"/>
<AnyChar attribute="Shell symbol" String="*?"/>
<IncludeRules context="shell_in_section_find_variable"/>
<DetectChar attribute="Shell string" char="'" context="shell_in_section_sq_string"/>
<DetectChar attribute="Shell string" char=""" context="shell_in_section_dq_string"/>
<IncludeRules context="shell_find_escape"/>
<DetectChar char="`" context="#pop" lookAhead="1"/>
<IncludeRules context="shell_find_redirections"/>
</context>
<!-- section with [[ -->
<context attribute="Shell commands" lineEndContext="#pop" name="shell_in_section_cond2">
<Detect2Chars attribute="Shell commands" char="]" char1="]" context="#pop"/>
<AnyChar attribute="Shell symbol" String="&|;"/>
<IncludeRules context="shell_in_section_parameters"/>
</context>
<context attribute="Shell commands" lineEndContext="#pop" name="shell_in_section_find_variable">
<!-- Handle % -->
<DetectChar context="handle_percent" char="%" lookAhead="1"/>
<Detect2Chars attribute="Shell string" char="$" char1="'" context="shell_in_section_variable_sq"/>
<StringDetect attribute="Shell variable" String="$((" context="shell_in_parenthesis_expr"/>
<Detect2Chars attribute="Shell symbol" char="$" char1="(" context="shell_in_parenthesis_subcommand"/>
<Detect2Chars attribute="Shell variable" char="$" char1="{" context="shell_in_brace_variable_brace"/>
<DetectChar attribute="Shell variable" char="$" context="shell_single_variable"/>
</context>
<!-- section with $' -->
<context attribute="Shell string" lineEndContext="#pop" name="shell_in_section_variable_sq">
<IncludeRules context="find_spaces_and_ident"/>
<DetectChar char="'" context="#pop" attribute="Shell string"/>
<IncludeRules context="shell_find_escape"/>
<DetectChar context="handle_percent" char="%" lookAhead="1"/>
</context>
<!-- section with ' -->
<context attribute="Shell string" lineEndContext="#pop" name="shell_in_section_sq_string">
<IncludeRules context="find_spaces_and_ident"/>
<DetectChar char="'" context="#pop" attribute="Shell string"/>
<DetectChar context="handle_percent" char="%" lookAhead="1"/>
</context>
<!-- section with " -->
<context attribute="Shell string" lineEndContext="#pop" name="shell_in_section_dq_string">
<IncludeRules context="find_spaces_and_ident"/>
<DetectChar char=""" context="#pop" attribute="Shell string"/>
<IncludeRules context="shell_find_escape"/>
<IncludeRules context="shell_in_section_find_variable"/>
<DetectChar char="`" context="shell_in_section_bq" attribute="Shell symbol"/>
</context>
</contexts>
<itemDatas>
<!-- "Shell commands" is used for the sections like %prep, %build or %install, where you write
shell commands. -->
<itemData name="Shell commands" defStyleNum="dsNormal"/>
<itemData name="Shell keyword" defStyleNum="dsKeyword"/>
<itemData name="Shell string" defStyleNum="dsString"/>
<itemData name="Shell variable" defStyleNum="dsVariable"/>
<itemData name="Shell symbol" defStyleNum="dsOperator"/>
<itemData name="Shell redirection" defStyleNum="dsAttribute"/>
<!-- "Fallback for separator spaces" is used as a fallback context for spaces between
different contexts. For example: "%if 1 <= %number" has the contexts Keyword,
Integer, Keyword and Macro call. But the spaces between? They are using THIS
context. -->
<itemData name="Fallback for separator spaces" defStyleNum="dsNormal"/>
<itemData name="Keyword" defStyleNum="dsKeyword"/>
<itemData name="Control Flow" defStyleNum="dsControlFlow"/>
<itemData name="Comment" defStyleNum="dsComment"/>
<itemData name="Tag" defStyleNum="dsDataType"/>
<!-- "Enumeration" is used for data types where you can't use arbitrary strings but have
to use predefined values (like in "Provides:" or "%undefine"). -->
<itemData name="Enumeration" defStyleNum="dsOthers"/>
<itemData name="String" defStyleNum="dsString"/>
<itemData name="Integer" defStyleNum="dsDecVal"/>
<!-- "Error" is used for problems that will always produce an error in the interpretation
process. -->
<itemData name="Error" defStyleNum="dsError"/>
<!-- "Warning" is used for problems that will maybe produce an error in the interpretation
process or will lead to unexpected results. -->
<itemData name="Warning" defStyleNum="dsError"/>
<!-- "Hint" is used for problems that will never produce an error in the interpretation
process and will always work like expected (the interpreter has error tolerance),
but that are claimed as bad or invalid .spec following the documentation. -->
<itemData name="Hint" defStyleNum="dsError"/>
<itemData name="Macro call" defStyleNum="dsFunction"/>
<itemData name="Section" defStyleNum="dsRegionMarker"/>
<itemData name="Escaped character" defStyleNum="dsChar"/>
<itemData name="Line break" defStyleNum="dsKeyword"/>
</itemDatas>
</highlighting>
<general>
<!-- defining all word deliminators except space and tab as weak -->
<keywords casesensitive="1" weakDeliminator=".():!+,-<=>%&*/;?[]^{|}~\," />
<comments>
<comment name="singleLine" start="#"/>
</comments>
</general>
</language>
<!-- kate: replace-tabs on; tab-width 2; indent-width 2; -->
|