Branch Coverage

blib/lib/Syntax/Highlight/Engine/Kate/Bash.pm
Criterion Covered Total %
branch 255 358 71.2


line true false branch
659 4 46 if ($self->testDetectChar($text, "(", 0, 0, 0, undef, 0, "AssignArray", "Variable"))
664 10 36 if ($self->includeRules("FindStrings", $text))
669 4 32 if ($self->includeRules("FindSubstitutions", $text))
674 8 24 if ($self->includeRules("FindOthers", $text))
681 12 12 if ($self->testRegExpr($text, "[\\w:,+_./-]+", 0, 0, 0, undef, 0, "#stay", "Normal Text"))
693 4 42 if ($self->testDetectChar($text, ")", 0, 0, 0, undef, 0, "#pop", "Variable"))
700 4 38 if ($self->testDetectChar($text, "[", 0, 0, 0, undef, 0, "Subscript", "Variable"))
707 4 34 if ($self->testDetectChar($text, "=", 0, 0, 0, undef, 0, "Assign", "Variable"))
712 0 34 if ($self->includeRules("FindMost", $text))
724 2 2 if ($self->testDetectChar($text, "[", 0, 0, 0, undef, 0, "Subscript", "Variable"))
731 2 0 if ($self->testDetectChar($text, "=", 0, 0, 0, undef, 0, "Assign", "Variable"))
736 0 0 if ($self->includeRules("FindStrings", $text))
741 0 0 if ($self->includeRules("FindSubstitutions", $text))
746 0 0 if ($self->includeRules("FindOthers", $text))
758 2 4 if ($self->testRegExpr($text, "\\sin\\b", 0, 0, 0, undef, 0, "CaseIn", "Keyword"))
763 2 2 if ($self->includeRules("FindMost", $text))
777 4 60 if ($self->testDetect2Chars($text, ";", ";", 0, 0, 0, undef, 0, "#pop", "Keyword"))
782 4 56 if ($self->includeRules("FindAll", $text))
795 2 24 if ($self->testRegExpr($text, "\\besac(?=\$|[\\s;)])", 0, 0, 0, undef, 0, "#pop#pop", "Keyword"))
803 4 20 if ($self->testDetectChar($text, ")", 0, 0, 0, undef, 0, "CaseExpr", "Keyword"))
810 0 20 if ($self->testAnyChar($text, "(|", 0, 0, undef, 0, "#stay", "Keyword"))
815 0 20 if ($self->includeRules("FindMost", $text))
825 0 2470 if ($self->includePlugin("Alerts", $text))
837 0 0 if ($self->testRegExpr($text, "[^`](?=`)", 0, 0, 0, undef, 0, "#pop", "Comment"))
842 0 0 if ($self->includePlugin("Alerts", $text))
854 0 0 if ($self->testRegExpr($text, "[^)](?=\\))", 0, 0, 0, undef, 0, "#pop", "Comment"))
859 0 0 if ($self->includePlugin("Alerts", $text))
872 6 50 if ($self->testRegExpr($text, "\\s\\](?=(\$|[\\s;|&]))", 0, 0, 0, undef, 0, "#pop", "Builtin"))
881 0 50 if ($self->testRegExpr($text, "\\](?=(\$|[\\s;|&]))", 0, 0, 0, 0, 0, "#pop", "Builtin"))
888 0 50 if ($self->testDetectChar($text, "(", 0, 0, 0, undef, 0, "ExprSubParen", "Normal Text"))
893 10 40 if ($self->includeRules("FindMost", $text))
906 2 14 if ($self->testRegExpr($text, "\\s\\]\\](?=(\$|[\\s;|&]))", 0, 0, 0, undef, 0, "#pop", "Keyword"))
915 0 14 if ($self->testRegExpr($text, "\\]\\](?=(\$|[\\s;|&]))", 0, 0, 0, 0, 0, "#pop", "Keyword"))
922 0 14 if ($self->testDetectChar($text, "(", 0, 0, 0, undef, 0, "ExprSubParen", "Normal Text"))
927 2 12 if ($self->includeRules("FindMost", $text))
941 0 0 if ($self->testDetect2Chars($text, ")", ")", 0, 0, 0, undef, 0, "#pop", "Keyword"))
948 0 0 if ($self->testDetectChar($text, "(", 0, 0, 0, undef, 0, "ExprSubParen", "Normal Text"))
953 0 0 if ($self->includeRules("FindMost", $text))
967 4 42 if ($self->testDetect2Chars($text, ")", ")", 0, 0, 0, undef, 0, "#pop", "Variable"))
974 0 42 if ($self->testDetectChar($text, "(", 0, 0, 0, undef, 0, "ExprSubParen", "Normal Text"))
979 4 38 if ($self->includeRules("FindMost", $text))
991 0 0 if ($self->testDetectChar($text, ")", 0, 0, 0, undef, 0, "#pop", "Normal Text"))
998 0 0 if ($self->testDetectChar($text, "(", 0, 0, 0, undef, 0, "ExprSubParen", "Normal Text"))
1003 0 0 if ($self->includeRules("FindMost", $text))
1013 72 914 if ($self->includeRules("FindComments", $text))
1018 176 738 if ($self->includeRules("FindCommands", $text))
1023 22 716 if ($self->includeRules("FindStrings", $text))
1028 54 662 if ($self->includeRules("FindSubstitutions", $text))
1033 38 624 if ($self->includeRules("FindOthers", $text))
1047 0 1030 if ($self->testDetect2Chars($text, "(", "(", 0, 0, 0, undef, 0, "ExprDblParen", "Keyword"))
1056 0 1030 if ($self->testRegExpr($text, "\\[\\[(?=(\$|\\s))", 0, 0, 0, 0, 0, "ExprDblBracket", "Keyword"))
1064 2 1028 if ($self->testRegExpr($text, "\\s\\[\\[(?=(\$|\\s))", 0, 0, 0, undef, 0, "ExprDblBracket", "Keyword"))
1073 0 1028 if ($self->testRegExpr($text, "\\[(?=(\$|\\s))", 0, 0, 0, 0, 0, "ExprBracket", "Builtin"))
1081 6 1022 if ($self->testRegExpr($text, "\\s\\[(?=(\$|\\s))", 0, 0, 0, undef, 0, "ExprBracket", "Builtin"))
1089 4 1018 if ($self->testRegExpr($text, "\\{(?=(\$|\\s))", 0, 0, 0, undef, 0, "Group", "Keyword"))
1097 2 1016 if ($self->testDetectChar($text, "(", 0, 0, 0, undef, 0, "SubShell", "Keyword"))
1105 4 1012 if ($self->testRegExpr($text, "\\bdo(?![\\w\$+-])", 0, 0, 0, undef, 0, "#stay", "Keyword"))
1113 4 1008 if ($self->testRegExpr($text, "\\bdone(?![\\w\$+-])", 0, 0, 0, undef, 0, "#stay", "Keyword"))
1121 4 1004 if ($self->testRegExpr($text, "\\bif(?![\\w\$+-])", 0, 0, 0, undef, 0, "#stay", "Keyword"))
1129 4 1000 if ($self->testRegExpr($text, "\\bfi(?![\\w\$+-])", 0, 0, 0, undef, 0, "#stay", "Keyword"))
1137 2 998 if ($self->testRegExpr($text, "\\bcase(?![\\w\$+-])", 0, 0, 0, undef, 0, "Case", "Keyword"))
1144 12 986 if ($self->testRegExpr($text, "-[A-Za-z0-9]+", 0, 0, 0, undef, 0, "#stay", "Option"))
1151 2 984 if ($self->testRegExpr($text, "--[a-z][A-Za-z0-9_-]*", 0, 0, 0, undef, 0, "#stay", "Option"))
1158 18 966 if ($self->testRegExpr($text, "\\b[A-Za-z_][A-Za-z0-9_]*=", 0, 0, 0, undef, 0, "Assign", "Variable"))
1165 2 964 if ($self->testRegExpr($text, "\\b[A-Za-z_][A-Za-z0-9_]*(?=\\[[^]]+\\]=)", 0, 0, 0, undef, 0, "AssignSubscr", "Variable"))
1172 0 964 if ($self->testStringDetect($text, ":()", 0, 0, 0, undef, 0, "#stay", "Function"))
1179 0 964 if ($self->testRegExpr($text, "\\bfunction\\b", 0, 0, 0, undef, 0, "FunctionDef", "Keyword"))
1186 16 948 if ($self->testKeyword($text, "keywords", 0, undef, 0, "#stay", "Keyword"))
1193 26 922 if ($self->testKeyword($text, "builtins", 0, undef, 0, "#stay", "Builtin"))
1200 36 886 if ($self->testKeyword($text, "unixcommands", 0, undef, 0, "#stay", "Command"))
1207 14 872 if ($self->testKeyword($text, "builtins_var", 0, undef, 0, "VarName", "Builtin"))
1214 2 870 if ($self->testStringDetect($text, "<<<", 0, 0, 0, undef, 0, "#stay", "Redirection"))
1222 2 868 if ($self->testStringDetect($text, "<<", 0, 0, 1, undef, 0, "HereDoc", "Redirection"))
1229 2 866 if ($self->testRegExpr($text, "[<>]\\(", 0, 0, 0, undef, 0, "ProcessSubst", "Redirection"))
1236 10 856 if ($self->testRegExpr($text, "([0-9]*(>{1,2}|<)(&[0-9]+-?)?|&>|>&|[0-9]*<>)", 0, 0, 0, undef, 0, "#stay", "Redirection"))
1243 22 834 if ($self->testRegExpr($text, "([|&])\\1?", 0, 0, 0, undef, 0, "#stay", "Control"))
1250 2 832 if ($self->testRegExpr($text, "[A-Za-z_:][A-Za-z0-9_:#%\@-]*\\s*\\(\\)", 0, 0, 0, undef, 0, "#stay", "Function"))
1263 66 1140 if ($self->testDetectChar($text, "#", 0, 0, 0, undef, 1, "Comment", "Comment"))
1270 6 1134 if ($self->testRegExpr($text, "[\\s;](?=#)", 0, 0, 0, undef, 0, "Comment", "Normal Text"))
1283 0 44 if ($self->testDetectChar($text, "#", 0, 0, 0, undef, 1, "CommentBackq", "Comment"))
1290 0 44 if ($self->testRegExpr($text, "[\\s;](?=#)", 0, 0, 0, undef, 0, "CommentBackq", "Normal Text"))
1303 0 80 if ($self->testDetectChar($text, "#", 0, 0, 0, undef, 1, "CommentParen", "Comment"))
1310 0 80 if ($self->testRegExpr($text, "[\\s;](?=#)", 0, 0, 0, undef, 0, "CommentParen", "Normal Text"))
1320 0 220 if ($self->includeRules("FindComments", $text))
1325 4 216 if ($self->includeRules("FindStrings", $text))
1330 14 202 if ($self->includeRules("FindSubstitutions", $text))
1335 0 202 if ($self->includeRules("FindOthers", $text))
1347 18 990 if ($self->testRegExpr($text, "\\\\[][;\"\\\\'\$`{}()|&<>* ]", 0, 0, 0, undef, 0, "#stay", "Escape"))
1354 0 990 if ($self->testRegExpr($text, "\\\\\$", 0, 0, 0, undef, 0, "#stay", "Keyword"))
1361 2 988 if ($self->testRegExpr($text, "\\{(?!(\\s|\$))\\S*\\}", 0, 0, 0, undef, 0, "#stay", "Escape"))
1368 32 956 if ($self->testRegExpr($text, "\\.?/[\\w_\@.+-]+(?=([\\s/):]|\$))", 0, 0, 0, undef, 0, "#stay", "Path"))
1380 10 1146 if ($self->testDetectChar($text, "'", 0, 0, 0, undef, 0, "StringSQ", "String SingleQ"))
1387 28 1118 if ($self->testDetectChar($text, "\"", 0, 0, 0, undef, 0, "StringDQ", "String DoubleQ"))
1395 2 1116 if ($self->testDetect2Chars($text, "\$", "'", 0, 0, 0, undef, 0, "StringEsc", "String SingleQ"))
1403 2 1114 if ($self->testDetect2Chars($text, "\$", "\"", 0, 0, 0, undef, 0, "StringDQ", "String Transl."))
1415 8 2592 if ($self->testRegExpr($text, "\\\$[*\@#?\$!_0-9-]", 0, 0, 0, undef, 0, "#stay", "Variable"))
1422 0 2592 if ($self->testRegExpr($text, "\\\$[A-Za-z_][A-Za-z0-9_]*\\[", 0, 0, 0, undef, 0, "Subscript", "Variable"))
1429 58 2534 if ($self->testRegExpr($text, "\\\$[A-Za-z_][A-Za-z0-9_]*", 0, 0, 0, undef, 0, "#stay", "Variable"))
1436 2 2532 if ($self->testRegExpr($text, "\\\$\\{[*\@#?\$!_0-9-]\\}", 0, 0, 0, undef, 0, "#stay", "Variable"))
1443 0 2532 if ($self->testRegExpr($text, "\\\$\\{#[A-Za-z_][A-Za-z0-9_]*\\}", 0, 0, 0, undef, 0, "#stay", "Variable"))
1450 4 2528 if ($self->testRegExpr($text, "\\\$\\{![A-Za-z_][A-Za-z0-9_]*\\*?\\}", 0, 0, 0, undef, 0, "#stay", "Variable"))
1457 10 2518 if ($self->testRegExpr($text, "\\\$\\{[A-Za-z_][A-Za-z0-9_]*", 0, 0, 0, undef, 0, "VarBrace", "Variable"))
1464 2 2516 if ($self->testRegExpr($text, "\\\$\\{[*\@#?\$!_0-9-](?=[:#%/])", 0, 0, 0, undef, 0, "VarBrace", "Variable"))
1472 4 2512 if ($self->testStringDetect($text, "\$((", 0, 0, 0, undef, 0, "ExprDblParenSubst", "Variable"))
1479 4 2508 if ($self->testStringDetect($text, "\$(<", 0, 0, 0, undef, 0, "SubstFile", "Redirection"))
1486 4 2504 if ($self->testStringDetect($text, "\$(", 0, 0, 0, undef, 0, "SubstCommand", "Variable"))
1493 6 2498 if ($self->testDetectChar($text, "`", 0, 0, 0, undef, 0, "SubstBackq", "Backquote"))
1500 2 2496 if ($self->testRegExpr($text, "\\\\[`\$\\\\]", 0, 0, 0, undef, 0, "#stay", "Escape"))
1512 0 0 if ($self->testRegExpr($text, "\\s+[A-Za-z_:][A-Za-z0-9_:#%\@-]*(\\s*\\(\\))?", 0, 0, 0, undef, 0, "#pop", "Function"))
1525 4 136 if ($self->testDetectChar($text, "}", 0, 0, 0, undef, 0, "#pop", "Keyword"))
1530 36 100 if ($self->includeRules("FindAll", $text))
1543 0 2 if ($self->testRegExpr($text, "(<<\\s*\"([^|&;()<>\\s]+)\")", 0, 0, 1, undef, 0, "HereDocQ", "Redirection"))
1551 0 2 if ($self->testRegExpr($text, "(<<\\s*'([^|&;()<>\\s]+)')", 0, 0, 1, undef, 0, "HereDocQ", "Redirection"))
1559 0 2 if ($self->testRegExpr($text, "(<<\\s*\\\\([^|&;()<>\\s]+))", 0, 0, 1, undef, 0, "HereDocQ", "Redirection"))
1567 2 0 if ($self->testRegExpr($text, "(<<\\s*([^|&;()<>\\s]+))", 0, 0, 1, undef, 0, "HereDocNQ", "Redirection"))
1575 0 0 if ($self->testRegExpr($text, "(<<-\\s*\"([^|&;()<>\\s]+)\")", 0, 0, 1, undef, 0, "HereDocIQ", "Redirection"))
1583 0 0 if ($self->testRegExpr($text, "(<<-\\s*'([^|&;()<>\\s]+)')", 0, 0, 1, undef, 0, "HereDocIQ", "Redirection"))
1591 0 0 if ($self->testRegExpr($text, "(<<-\\s*\\\\([^|&;()<>\\s]+))", 0, 0, 1, undef, 0, "HereDocIQ", "Redirection"))
1599 0 0 if ($self->testRegExpr($text, "(<<-\\s*([^|&;()<>\\s]+))", 0, 0, 1, undef, 0, "HereDocINQ", "Redirection"))
1606 0 0 if ($self->testStringDetect($text, "<<", 0, 0, 0, undef, 0, "#pop", "Redirection"))
1619 0 0 if ($self->testRegExpr($text, "%1", 0, 1, 0, undef, 0, "HereDocRemainder", "Redirection"))
1628 0 0 if ($self->testRegExpr($text, "\\s*%2[\\s;]*\$", 0, 1, 0, 0, 0, "#pop#pop", "Redirection"))
1633 0 0 if ($self->includeRules("FindSubstitutions", $text))
1646 0 0 if ($self->testRegExpr($text, "%1", 0, 1, 0, undef, 0, "HereDocRemainder", "Redirection"))
1655 0 0 if ($self->testRegExpr($text, "\\s*%2[\\s;]*\$", 0, 1, 0, 0, 0, "#pop#pop", "Redirection"))
1668 2 962 if ($self->testRegExpr($text, "%1", 0, 1, 0, undef, 0, "HereDocRemainder", "Redirection"))
1677 0 962 if ($self->testRegExpr($text, "%2[\\s;]*\$", 0, 1, 0, 0, 0, "#pop#pop", "Redirection"))
1682 12 950 if ($self->includeRules("FindSubstitutions", $text))
1695 0 0 if ($self->testRegExpr($text, "%1", 0, 1, 0, undef, 0, "HereDocRemainder", "Redirection"))
1704 0 0 if ($self->testRegExpr($text, "%2[\\s;]*\$", 0, 1, 0, 0, 0, "#pop#pop", "Redirection"))
1714 0 0 if ($self->includeRules("FindAll", $text))
1726 2 22 if ($self->testDetectChar($text, ")", 0, 0, 0, undef, 0, "#pop", "Redirection"))
1731 0 22 if ($self->includeRules("FindCommentsParen", $text))
1736 0 22 if ($self->includeRules("FindCommands", $text))
1741 0 22 if ($self->includeRules("FindStrings", $text))
1746 0 22 if ($self->includeRules("FindSubstitutions", $text))
1751 0 22 if ($self->includeRules("FindOthers", $text))
1761 320 440 if ($self->includeRules("FindAll", $text))
1773 30 530 if ($self->testDetectChar($text, "\"", 0, 0, 0, undef, 0, "#pop", "String DoubleQ"))
1780 6 524 if ($self->testRegExpr($text, "\\\\[`\"\\\\\$\\n]", 0, 0, 0, undef, 0, "#stay", "String Escape"))
1785 14 510 if ($self->includeRules("FindSubstitutions", $text))
1797 2 50 if ($self->testDetectChar($text, "'", 0, 0, 0, undef, 0, "#pop", "String SingleQ"))
1804 2 48 if ($self->testRegExpr($text, "\\\\[abefnrtv\\\\']", 0, 0, 0, undef, 0, "#stay", "String Escape"))
1811 2 46 if ($self->testRegExpr($text, "\\\\([0-7]{1,3}|x[A-Fa-f0-9]{1,2}|c.)", 0, 0, 0, undef, 0, "#stay", "String Escape"))
1823 10 114 if ($self->testDetectChar($text, "'", 0, 0, 0, undef, 0, "#pop", "String SingleQ"))
1836 2 30 if ($self->testDetectChar($text, ")", 0, 0, 0, undef, 0, "#pop", "Keyword"))
1841 2 28 if ($self->includeRules("FindAll", $text))
1853 10 22 if ($self->testDetectChar($text, "]", 0, 0, 0, undef, 0, "#pop", "Variable"))
1858 2 20 if ($self->includeRules("FindStrings", $text))
1863 2 18 if ($self->includeRules("FindSubstitutions", $text))
1868 0 18 if ($self->includeRules("FindOthers", $text))
1880 6 44 if ($self->testDetectChar($text, "`", 0, 0, 0, undef, 0, "#pop", "Keyword"))
1885 0 44 if ($self->includeRules("FindCommentsBackq", $text))
1890 4 40 if ($self->includeRules("FindCommands", $text))
1895 0 40 if ($self->includeRules("FindStrings", $text))
1900 2 38 if ($self->includeRules("FindSubstitutions", $text))
1905 0 38 if ($self->includeRules("FindOthers", $text))
1917 4 50 if ($self->testDetectChar($text, ")", 0, 0, 0, undef, 0, "#pop", "Variable"))
1922 0 50 if ($self->includeRules("FindCommentsParen", $text))
1927 18 32 if ($self->includeRules("FindCommands", $text))
1932 4 28 if ($self->includeRules("FindStrings", $text))
1937 0 28 if ($self->includeRules("FindSubstitutions", $text))
1942 0 28 if ($self->includeRules("FindOthers", $text))
1954 4 8 if ($self->testDetectChar($text, ")", 0, 0, 0, undef, 0, "#pop", "Redirection"))
1959 0 8 if ($self->includeRules("FindCommentsParen", $text))
1964 0 8 if ($self->includeRules("FindStrings", $text))
1969 2 6 if ($self->includeRules("FindSubstitutions", $text))
1974 6 0 if ($self->includeRules("FindOthers", $text))
1986 12 32 if ($self->testDetectChar($text, "}", 0, 0, 0, undef, 0, "#pop", "Variable"))
1993 4 28 if ($self->testDetectChar($text, "[", 0, 0, 0, undef, 0, "Subscript", "Variable"))
1998 0 28 if ($self->includeRules("FindStrings", $text))
2003 0 28 if ($self->includeRules("FindSubstitutions", $text))
2015 2 102 if ($self->testRegExpr($text, "-[A-Za-z0-9]+", 0, 0, 0, undef, 0, "#stay", "Option"))
2022 0 102 if ($self->testRegExpr($text, "--[a-z][A-Za-z0-9_-]*", 0, 0, 0, undef, 0, "#stay", "Option"))
2029 40 62 if ($self->testRegExpr($text, "\\b[A-Za-z_][A-Za-z0-9_]*", 0, 0, 0, undef, 0, "#stay", "Variable"))
2036 0 62 if ($self->testDetectChar($text, "[", 0, 0, 0, undef, 0, "Subscript", "Variable"))
2043 6 56 if ($self->testDetectChar($text, "=", 0, 0, 0, undef, 0, "Assign", "Variable"))
2048 0 56 if ($self->includeRules("FindMost", $text))
2055 50 6 if ($self->testRegExpr($text, "[^]})|;`&><]", 0, 0, 0, undef, 0, "#stay", "Normal Text"))