1 # Copyright (c) 2005 - 2006 Hans Jeuken. All rights reserved.
2 # This program is free software; you can redistribute it and/or
3 # modify it under the same terms as Perl itself.
5 # This file was generated from the 'mup.xml' file of the syntax highlight
6 # engine of the kate text editor (http://www.kate-editor.org
10 #kate author Wilbert Berendsen (wilbert@kde.nl)
11 #generated: Sun Feb 3 22:02:05 2008, localtime
13 package Syntax::Highlight::Engine::Kate::Music_Publisher;
15 our $VERSION = '0.06';
19 use base('Syntax::Highlight::Engine::Kate::Template');
23 my $class = ref($proto) || $proto;
24 my $self = $class->SUPER::new(@_);
26 'Barline' => 'DecVal',
27 'Comment' => 'Comment',
28 'Context' => 'Keyword',
30 'Location' => 'Operator',
31 'Location Probably' => 'Reserved',
34 'Newscore' => 'BString',
35 'Normal Text' => 'Normal',
37 'Note Attribute' => 'Normal',
38 'Parameter' => 'Char',
39 'Print Command' => 'BaseN',
40 'Special Char' => 'Keyword',
42 'String Error' => 'Error',
43 'String Lyrics' => 'String',
44 'String Special' => 'IString',
45 'Tuplet' => 'RegionMarker',
46 'Unset Command' => 'Variable',
49 $self->listAdd('mupcontexts',
67 $self->listAdd('mupfontnames',
76 $self->listAdd('mupfontstyles',
82 $self->listAdd('mupgraphics',
103 $self->listAdd('muplocations',
109 $self->listAdd('mupmacrodirectives',
114 $self->listAdd('mupmacrodirectives_end',
118 $self->listAdd('mupmacrodirectives_start',
123 $self->listAdd('mupmusicchars',
273 $self->listAdd('mupparameters',
350 $self->listAdd('mupprintcommands',
359 $self->listAdd('mupprintspecifiers',
365 $self->listAdd('mupspecialchars',
528 $self->listAdd('mupvalues',
590 callback => \&parseBarRehearsal,
591 attribute => 'Barline',
592 lineending => '#pop',
593 fallthrough => '#pop',
596 callback => \&parseBarline,
597 attribute => 'Barline',
598 lineending => '#pop',
599 fallthrough => '#pop',
602 callback => \&parseBracket,
603 attribute => 'Note Attribute',
604 lineending => '#pop',
605 fallthrough => '#pop',
608 callback => \&parseBracketHs,
609 attribute => 'Note Attribute',
610 lineending => '#pop',
611 fallthrough => '#pop',
614 callback => \&parseBracketWith,
615 attribute => 'Note Attribute',
616 lineending => '#pop',
617 fallthrough => '#pop',
620 callback => \&parseComment,
621 attribute => 'Comment',
622 lineending => '#pop',
625 callback => \&parseFontName,
626 attribute => 'String Special',
627 fallthrough => '#pop',
630 callback => \&parseFontSize,
631 attribute => 'String Special',
632 fallthrough => '#pop',
635 callback => \&parseFontStyle,
636 attribute => 'String Special',
637 fallthrough => '#pop',
640 callback => \&parseLocation,
641 attribute => 'Normal Text',
642 lineending => '#pop',
643 fallthrough => '#pop',
645 'Location Probably' => {
646 callback => \&parseLocationProbably,
647 attribute => 'Location Problably',
648 lineending => '#pop',
649 fallthrough => '#pop',
652 callback => \&parseMacro,
653 attribute => 'Macro',
654 lineending => '#pop',
656 'Macro Location' => {
657 callback => \&parseMacroLocation,
658 attribute => 'Location',
659 lineending => '#pop',
660 fallthrough => '#pop',
663 callback => \&parseNormal,
664 attribute => 'Normal Text',
667 callback => \&parseNote,
669 lineending => '#pop',
670 fallthrough => '#pop',
673 callback => \&parseNoteProbably,
675 lineending => '#pop',
676 fallthrough => '#pop',
679 callback => \&parseParameter,
680 attribute => 'Parameter',
681 lineending => '#pop',
682 fallthrough => '#pop',
685 callback => \&parsePrintCommand,
686 attribute => 'Print Command',
687 lineending => '#pop',
688 fallthrough => '#pop',
691 callback => \&parseSpecialChar,
692 attribute => 'String Special',
693 fallthrough => '#pop',
696 callback => \&parseString,
697 attribute => 'String',
700 callback => \&parseTuplet,
701 attribute => 'Tuplet',
702 lineending => '#pop',
703 fallthrough => '#pop',
706 callback => \&parseUnset,
707 attribute => 'Parameter',
708 lineending => '#pop',
709 fallthrough => '#pop',
712 callback => \&parseValue,
713 attribute => 'Value',
714 lineending => '#pop',
715 fallthrough => '#pop',
718 $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\');
719 $self->basecontext('Normal');
720 $self->keywordscase(0);
722 bless ($self, $class);
727 return 'Music Publisher';
730 sub parseBarRehearsal {
731 my ($self, $text) = @_;
733 # attribute => 'Print Command'
736 if ($self->testRegExpr($text, '\\s+', 0, 0, 0, undef, 0, '#stay', 'Print Command')) {
739 # String => 'mupfontnames'
740 # attribute => 'Print Command'
741 # context => 'Print Command'
743 if ($self->testKeyword($text, 'mupfontnames', 0, undef, 0, 'Print Command', 'Print Command')) {
746 # String => 'mupfontstyles'
747 # attribute => 'Print Command'
748 # context => 'Print Command'
750 if ($self->testKeyword($text, 'mupfontstyles', 0, undef, 0, 'Print Command', 'Print Command')) {
753 # String => '\b(let|mnum|num)\b'
754 # attribute => 'Barline'
757 if ($self->testRegExpr($text, '\\b(let|mnum|num)\\b', 0, 0, 0, undef, 0, '#pop', 'Barline')) {
761 # type => 'IncludeRules'
762 if ($self->includeRules('Macro', $text)) {
769 my ($self, $text) = @_;
770 # type => 'DetectSpaces'
771 if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) {
774 # String => '\b(ending|endending|hidechanges)\b'
775 # attribute => 'Barline'
778 if ($self->testRegExpr($text, '\\b(ending|endending|hidechanges)\\b', 0, 0, 0, undef, 0, '#stay', 'Barline')) {
781 # String => '\breh(earsal)?\b'
782 # attribute => 'Barline'
783 # context => 'Bar Rehearsal'
785 if ($self->testRegExpr($text, '\\breh(earsal)?\\b', 0, 0, 0, undef, 0, 'Bar Rehearsal', 'Barline')) {
788 # String => '\bmnum\s*=\s*[0-9]+'
789 # attribute => 'Barline'
792 if ($self->testRegExpr($text, '\\bmnum\\s*=\\s*[0-9]+', 0, 0, 0, undef, 0, '#stay', 'Barline')) {
795 # String => '\bnum\s*=\s*[0-9]+'
796 # attribute => 'Barline'
799 if ($self->testRegExpr($text, '\\bnum\\s*=\\s*[0-9]+', 0, 0, 0, undef, 0, '#stay', 'Barline')) {
802 # String => '\blet\s*=\s*("[A-Z]{1,2}")?'
803 # attribute => 'Barline'
806 if ($self->testRegExpr($text, '\\blet\\s*=\\s*("[A-Z]{1,2}")?', 0, 0, 0, undef, 0, '#stay', 'Barline')) {
809 # String => '\bpad\s+[0-9]+'
810 # attribute => 'Barline'
813 if ($self->testRegExpr($text, '\\bpad\\s+[0-9]+', 0, 0, 0, undef, 0, '#stay', 'Barline')) {
816 # String => '=([a-z]|_[a-z][a-z_0-9]*)\b'
817 # attribute => 'Location'
820 if ($self->testRegExpr($text, '=([a-z]|_[a-z][a-z_0-9]*)\\b', 0, 0, 0, undef, 0, '#stay', 'Location')) {
824 # type => 'IncludeRules'
825 if ($self->includeRules('Macro', $text)) {
832 my ($self, $text) = @_;
833 # attribute => 'Special Char'
836 # type => 'DetectChar'
837 if ($self->testDetectChar($text, ']', 0, 0, 0, undef, 0, '#pop', 'Special Char')) {
840 # String => '[\s;,]+'
841 # attribute => 'Normal Text'
844 if ($self->testRegExpr($text, '[\\s;,]+', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) {
847 # String => '\b(grace|xnote|cue|diam|up|down)\b'
848 # attribute => 'Note Attribute'
851 if ($self->testRegExpr($text, '\\b(grace|xnote|cue|diam|up|down)\\b', 0, 0, 0, undef, 0, '#stay', 'Note Attribute')) {
854 # String => '\b(slash|len|pad|ho|dist)\s*[0-9.+-]*'
855 # attribute => 'Note Attribute'
858 if ($self->testRegExpr($text, '\\b(slash|len|pad|ho|dist)\\s*[0-9.+-]*', 0, 0, 0, undef, 0, '#stay', 'Note Attribute')) {
861 # String => '\bwith\s*(?=[A-Z"^>.-])'
862 # attribute => 'Note Attribute'
863 # context => 'Bracket With'
865 if ($self->testRegExpr($text, '\\bwith\\s*(?=[A-Z"^>.-])', 0, 0, 0, undef, 0, 'Bracket With', 'Note Attribute')) {
868 # String => '\bhs\s*(?=[A-Z"])'
869 # attribute => 'Note Attribute'
870 # context => 'Bracket Hs'
872 if ($self->testRegExpr($text, '\\bhs\\s*(?=[A-Z"])', 0, 0, 0, undef, 0, 'Bracket Hs', 'Note Attribute')) {
875 # String => '=([a-z]|_[a-z][a-z_0-9]*)\b'
876 # attribute => 'Location'
879 if ($self->testRegExpr($text, '=([a-z]|_[a-z][a-z_0-9]*)\\b', 0, 0, 0, undef, 0, '#stay', 'Location')) {
883 # attribute => 'Normal Text'
886 if ($self->testRegExpr($text, '\\bc\\b', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) {
890 # type => 'IncludeRules'
891 if ($self->includeRules('Macro', $text)) {
898 my ($self, $text) = @_;
899 # attribute => 'String'
901 # context => 'String'
902 # type => 'DetectChar'
903 if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String', 'String')) {
907 # type => 'IncludeRules'
908 if ($self->includeRules('Macro', $text)) {
914 sub parseBracketWith {
915 my ($self, $text) = @_;
916 # attribute => 'String'
918 # context => 'String'
919 # type => 'DetectChar'
920 if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String', 'String')) {
923 # String => '[>.^-]+'
924 # attribute => 'Note Attribute'
927 if ($self->testRegExpr($text, '[>.^-]+', 0, 0, 0, undef, 0, '#stay', 'Note Attribute')) {
931 # attribute => 'Normal Text'
934 if ($self->testRegExpr($text, '[\\s,]+', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) {
938 # type => 'IncludeRules'
939 if ($self->includeRules('Macro', $text)) {
946 my ($self, $text) = @_;
947 # context => '##Alerts'
948 # type => 'IncludeRules'
949 if ($self->includePlugin('Alerts', $text)) {
956 my ($self, $text) = @_;
957 # attribute => 'String Special'
960 # type => 'DetectChar'
961 if ($self->testDetectChar($text, ')', 0, 0, 0, undef, 0, '#pop', 'String Special')) {
964 # String => '[ABCHNPT][RBIX](?=\))'
965 # attribute => 'String Special'
968 if ($self->testRegExpr($text, '[ABCHNPT][RBIX](?=\\))', 0, 0, 0, undef, 0, '#stay', 'String Special')) {
971 # String => 'mupfontnames'
972 # attribute => 'String Special'
973 # context => 'Font Style'
975 if ($self->testKeyword($text, 'mupfontnames', 0, undef, 0, 'Font Style', 'String Special')) {
978 # String => '(PV|previous)(?=\))'
979 # attribute => 'String Special'
982 if ($self->testRegExpr($text, '(PV|previous)(?=\\))', 0, 0, 0, undef, 0, '#stay', 'String Special')) {
985 # String => '[^ )"]+'
986 # attribute => 'String Error'
989 if ($self->testRegExpr($text, '[^ )"]+', 0, 0, 0, undef, 0, '#stay', 'String Error')) {
996 my ($self, $text) = @_;
997 # attribute => 'String Special'
1000 # type => 'DetectChar'
1001 if ($self->testDetectChar($text, ')', 0, 0, 0, undef, 0, '#pop', 'String Special')) {
1004 # String => '[-+]?[0-9]+(?=\))'
1005 # attribute => 'String Special'
1006 # context => '#stay'
1008 if ($self->testRegExpr($text, '[-+]?[0-9]+(?=\\))', 0, 0, 0, undef, 0, '#stay', 'String Special')) {
1011 # String => '(PV|previous)(?=\))'
1012 # attribute => 'String Special'
1013 # context => '#stay'
1015 if ($self->testRegExpr($text, '(PV|previous)(?=\\))', 0, 0, 0, undef, 0, '#stay', 'String Special')) {
1018 # String => '[^ )"]+'
1019 # attribute => 'String Error'
1020 # context => '#stay'
1022 if ($self->testRegExpr($text, '[^ )"]+', 0, 0, 0, undef, 0, '#stay', 'String Error')) {
1028 sub parseFontStyle {
1029 my ($self, $text) = @_;
1031 # attribute => 'String Special'
1032 # context => '#stay'
1034 if ($self->testRegExpr($text, '\\s+', 0, 0, 0, undef, 0, '#stay', 'String Special')) {
1037 # String => 'mupfontstyles'
1038 # attribute => 'String Special'
1039 # context => '#stay'
1041 if ($self->testKeyword($text, 'mupfontstyles', 0, undef, 0, '#stay', 'String Special')) {
1044 # String => '[^ )"]+'
1045 # attribute => 'String Error'
1046 # context => '#stay'
1048 if ($self->testRegExpr($text, '[^ )"]+', 0, 0, 0, undef, 0, '#stay', 'String Error')) {
1055 my ($self, $text) = @_;
1056 # String => '[\+\-\s]+'
1057 # attribute => 'Normal Text'
1058 # context => '#stay'
1060 if ($self->testRegExpr($text, '[\\+\\-\\s]+', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) {
1063 # attribute => 'Normal Text'
1064 # context => '#stay'
1066 if ($self->testFloat($text, 0, undef, 0, '#stay', 'Normal Text')) {
1069 # String => '\btime\b'
1070 # attribute => 'Location'
1071 # context => '#stay'
1073 if ($self->testRegExpr($text, '\\btime\\b', 0, 0, 0, undef, 0, '#stay', 'Location')) {
1076 # context => 'Macro'
1077 # type => 'IncludeRules'
1078 if ($self->includeRules('Macro', $text)) {
1084 sub parseLocationProbably {
1085 my ($self, $text) = @_;
1086 # String => '[h-qt-z]|_[a-z][a-z_0-9]*'
1087 # attribute => 'Location Probably'
1090 if ($self->testRegExpr($text, '[h-qt-z]|_[a-z][a-z_0-9]*', 0, 0, 0, undef, 0, '#pop', 'Location Probably')) {
1097 my ($self, $text) = @_;
1098 # String => 'mupmacrodirectives_start'
1099 # attribute => 'Macro'
1100 # beginRegion => 'macro'
1101 # context => '#stay'
1103 if ($self->testKeyword($text, 'mupmacrodirectives_start', 0, undef, 0, '#stay', 'Macro')) {
1106 # String => 'mupmacrodirectives_end'
1107 # attribute => 'Macro'
1108 # context => '#stay'
1109 # endRegion => 'macro'
1111 if ($self->testKeyword($text, 'mupmacrodirectives_end', 0, undef, 0, '#stay', 'Macro')) {
1114 # String => 'mupmacrodirectives'
1115 # attribute => 'Macro'
1116 # context => '#stay'
1118 if ($self->testKeyword($text, 'mupmacrodirectives', 0, undef, 0, '#stay', 'Macro')) {
1121 # String => '[A-Z][A-Z0-9_]*(?=\.[xynews]\b)'
1122 # attribute => 'Macro'
1123 # context => 'Macro Location'
1125 if ($self->testRegExpr($text, '[A-Z][A-Z0-9_]*(?=\\.[xynews]\\b)', 0, 0, 0, undef, 0, 'Macro Location', 'Macro')) {
1128 # String => '[A-Z][A-Z0-9_]*'
1129 # attribute => 'Macro'
1130 # context => '#stay'
1132 if ($self->testRegExpr($text, '[A-Z][A-Z0-9_]*', 0, 0, 0, undef, 0, '#stay', 'Macro')) {
1135 # attribute => 'Macro'
1137 # context => '#stay'
1138 # endRegion => 'macro'
1139 # type => 'DetectChar'
1140 if ($self->testDetectChar($text, '@', 0, 0, 0, undef, 0, '#stay', 'Macro')) {
1146 sub parseMacroLocation {
1147 my ($self, $text) = @_;
1149 # attribute => 'Location Probably'
1152 if ($self->testRegExpr($text, '..', 0, 0, 0, undef, 0, '#pop', 'Location Probably')) {
1159 my ($self, $text) = @_;
1160 # String => 'mupcontexts'
1161 # attribute => 'Context'
1162 # context => '#stay'
1164 if ($self->testKeyword($text, 'mupcontexts', 0, undef, 0, '#stay', 'Context')) {
1167 # String => '\blyrics\b'
1168 # attribute => 'Lyrics'
1169 # context => '#stay'
1171 if ($self->testRegExpr($text, '\\blyrics\\b', 0, 0, 0, undef, 0, '#stay', 'Lyrics')) {
1174 # String => '\b((dashed|dotted)\s+)?(bar|endbar|dblbar|invisbar|repeatstart|repeatboth|repeatend|restart)\b'
1175 # attribute => 'Barline'
1176 # context => 'Barline'
1178 if ($self->testRegExpr($text, '\\b((dashed|dotted)\\s+)?(bar|endbar|dblbar|invisbar|repeatstart|repeatboth|repeatend|restart)\\b', 0, 0, 0, undef, 0, 'Barline', 'Barline')) {
1181 # String => '\bnew(score|page)\b'
1182 # attribute => 'Newscore'
1183 # context => '#stay'
1185 if ($self->testRegExpr($text, '\\bnew(score|page)\\b', 0, 0, 0, undef, 0, '#stay', 'Newscore')) {
1188 # String => '\bmultirest\s+[0-9]+\b'
1189 # attribute => 'Newscore'
1190 # context => '#stay'
1192 if ($self->testRegExpr($text, '\\bmultirest\\s+[0-9]+\\b', 0, 0, 0, undef, 0, '#stay', 'Newscore')) {
1195 # String => '\bunset\b'
1196 # attribute => 'Unset Command'
1197 # context => 'Unset'
1199 if ($self->testRegExpr($text, '\\bunset\\b', 0, 0, 0, undef, 0, 'Unset', 'Unset Command')) {
1202 # attribute => 'Comment'
1205 # context => 'Comment'
1206 # type => 'Detect2Chars'
1207 if ($self->testDetect2Chars($text, '/', '/', 0, 0, 0, undef, 0, 'Comment', 'Comment')) {
1210 # attribute => 'String'
1212 # context => 'String'
1213 # type => 'DetectChar'
1214 if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String', 'String')) {
1218 # attribute => 'Special Char'
1219 # context => '#stay'
1221 if ($self->testRegExpr($text, '\\\\$', 0, 0, 0, undef, 0, '#stay', 'Special Char')) {
1224 # String => 'mupprintcommands'
1225 # attribute => 'Print Command'
1226 # context => 'Print Command'
1228 if ($self->testKeyword($text, 'mupprintcommands', 0, undef, 0, 'Print Command', 'Print Command')) {
1231 # String => 'mupfontnames'
1232 # attribute => 'Print Command'
1233 # context => 'Print Command'
1235 if ($self->testKeyword($text, 'mupfontnames', 0, undef, 0, 'Print Command', 'Print Command')) {
1238 # String => 'mupfontstyles'
1239 # attribute => 'Print Command'
1240 # context => 'Print Command'
1242 if ($self->testKeyword($text, 'mupfontstyles', 0, undef, 0, 'Print Command', 'Print Command')) {
1245 # String => '\b((ragged|justified)\s+)?paragraph\b'
1246 # attribute => 'Print Command'
1247 # context => 'Print Command'
1249 if ($self->testRegExpr($text, '\\b((ragged|justified)\\s+)?paragraph\\b', 0, 0, 0, undef, 0, 'Print Command', 'Print Command')) {
1252 # String => 'mupprintspecifiers'
1253 # attribute => 'Print Command'
1254 # context => '#stay'
1256 if ($self->testKeyword($text, 'mupprintspecifiers', 0, undef, 0, '#stay', 'Print Command')) {
1259 # String => 'mupgraphics'
1260 # attribute => 'Print Command'
1261 # context => '#stay'
1263 if ($self->testKeyword($text, 'mupgraphics', 0, undef, 0, '#stay', 'Print Command')) {
1266 # String => 'muplocations'
1267 # attribute => 'Print Command'
1268 # context => '#stay'
1270 if ($self->testKeyword($text, 'muplocations', 0, undef, 0, '#stay', 'Print Command')) {
1273 # String => '\bdist(?=\s+[^=])'
1274 # attribute => 'Print Command'
1275 # context => '#stay'
1277 if ($self->testRegExpr($text, '\\bdist(?=\\s+[^=])', 0, 0, 0, undef, 0, '#stay', 'Print Command')) {
1280 # String => 'mupparameters'
1281 # attribute => 'Parameter'
1282 # context => 'Parameter'
1284 if ($self->testKeyword($text, 'mupparameters', 0, undef, 0, 'Parameter', 'Parameter')) {
1287 # String => '\[(?=(grace|xnote|cue|diam|with|slash|up|down|len|pad|ho|dist|hs|c\b|=))'
1288 # attribute => 'Special Char'
1289 # context => 'Bracket'
1291 if ($self->testRegExpr($text, '\\[(?=(grace|xnote|cue|diam|with|slash|up|down|len|pad|ho|dist|hs|c\\b|=))', 0, 0, 0, undef, 0, 'Bracket', 'Special Char')) {
1294 # attribute => 'Special Char'
1296 # context => 'Tuplet'
1297 # type => 'DetectChar'
1298 if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, 'Tuplet', 'Special Char')) {
1302 # attribute => 'Special Char'
1303 # context => '#stay'
1305 if ($self->testAnyChar($text, '[]{', 0, 0, undef, 0, '#stay', 'Special Char')) {
1308 # String => '(<<|>>)'
1309 # attribute => 'Special Char'
1310 # context => '#stay'
1312 if ($self->testRegExpr($text, '(<<|>>)', 0, 0, 0, undef, 0, '#stay', 'Special Char')) {
1315 # String => '(\(\s*)?((1/4|1/2|1|2|4|8|16|32|64|128|256)\.*\s*)?((\(\s*)?([a-grs]|us)(?!bm)([0-9'?\sxn]|[+-]+|[&#]{1,2}|\(\s*[&#]{1,2}\s*\)|\(\s*[xn]\s*\)|\(\s*[0-9]\s*\))*\)?\s*)*\s*(?=[;~="<A-Z@^]|\b(bm|es?bm|dashed|dotted|tie|slur|alt|hs|ifn?def|else|elseif|endif|with|above)\b)'
1316 # attribute => 'Note'
1319 if ($self->testRegExpr($text, '(\\(\\s*)?((1/4|1/2|1|2|4|8|16|32|64|128|256)\\.*\\s*)?((\\(\\s*)?([a-grs]|us)(?!bm)([0-9\'?\\sxn]|[+-]+|[&#]{1,2}|\\(\\s*[&#]{1,2}\\s*\\)|\\(\\s*[xn]\\s*\\)|\\(\\s*[0-9]\\s*\\))*\\)?\\s*)*\\s*(?=[;~="<A-Z@^]|\\b(bm|es?bm|dashed|dotted|tie|slur|alt|hs|ifn?def|else|elseif|endif|with|above)\\b)', 0, 0, 0, undef, 0, 'Note', 'Note')) {
1322 # String => ';\s*(?=[~=<]|\b(bm|es?bm|dashed|dotted|tie|slur|alt|hs|ifn?def|else|elseif|endif)\b)'
1323 # attribute => 'Normal Text'
1326 if ($self->testRegExpr($text, ';\\s*(?=[~=<]|\\b(bm|es?bm|dashed|dotted|tie|slur|alt|hs|ifn?def|else|elseif|endif)\\b)', 0, 0, 0, undef, 0, 'Note', 'Normal Text')) {
1329 # String => '(1/4|1/2|1|2|4|8|16|32|64|128|256)?mu?[rs]+\s*(?=;)'
1330 # attribute => 'Note'
1331 # context => '#stay'
1333 if ($self->testRegExpr($text, '(1/4|1/2|1|2|4|8|16|32|64|128|256)?mu?[rs]+\\s*(?=;)', 0, 0, 0, undef, 0, '#stay', 'Note')) {
1336 # String => 'm\s*rpt\s*(?=;)'
1337 # attribute => 'Note'
1338 # context => '#stay'
1340 if ($self->testRegExpr($text, 'm\\s*rpt\\s*(?=;)', 0, 0, 0, undef, 0, '#stay', 'Note')) {
1343 # String => '=([a-z]|_[a-z][a-z_0-9]*)\b'
1344 # attribute => 'Location'
1345 # context => '#stay'
1347 if ($self->testRegExpr($text, '=([a-z]|_[a-z][a-z_0-9]*)\\b', 0, 0, 0, undef, 0, '#stay', 'Location')) {
1350 # String => '([a-z]|_[a-z][a-z_0-9]*)\.[xynews]\b'
1351 # attribute => 'Location'
1352 # context => 'Location'
1354 if ($self->testRegExpr($text, '([a-z]|_[a-z][a-z_0-9]*)\\.[xynews]\\b', 0, 0, 0, undef, 0, 'Location', 'Location')) {
1357 # String => '([a-z]|_[a-z][a-z_0-9]*)\.(?=[A-Z])'
1358 # attribute => 'Location Probably'
1359 # context => '#stay'
1361 if ($self->testRegExpr($text, '([a-z]|_[a-z][a-z_0-9]*)\\.(?=[A-Z])', 0, 0, 0, undef, 0, '#stay', 'Location Probably')) {
1364 # String => '[(,]\s*(?=([h-qt-z]|_[a-z][a-z_0-9]*)\s*[,)])'
1365 # attribute => 'Normal Text'
1366 # context => 'Location Probably'
1368 if ($self->testRegExpr($text, '[(,]\\s*(?=([h-qt-z]|_[a-z][a-z_0-9]*)\\s*[,)])', 0, 0, 0, undef, 0, 'Location Probably', 'Normal Text')) {
1371 # String => '[(,]\s*(?=[a-grs]\s*[,)])'
1372 # attribute => 'Normal Text'
1373 # context => 'Note Probably'
1375 if ($self->testRegExpr($text, '[(,]\\s*(?=[a-grs]\\s*[,)])', 0, 0, 0, undef, 0, 'Note Probably', 'Normal Text')) {
1378 # context => 'Macro'
1379 # type => 'IncludeRules'
1380 if ($self->includeRules('Macro', $text)) {
1383 # String => '[0-9.]*\s*til\s*(([0-9]+m(\s*\+\s*[0-9.]+)?)|[0-9.]+)\s*;'
1384 # attribute => 'Normal Text'
1385 # context => '#stay'
1387 if ($self->testRegExpr($text, '[0-9.]*\\s*til\\s*(([0-9]+m(\\s*\\+\\s*[0-9.]+)?)|[0-9.]+)\\s*;', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) {
1390 # String => '[0-9]*[a-z_]+'
1391 # attribute => 'Error'
1392 # context => '#stay'
1394 if ($self->testRegExpr($text, '[0-9]*[a-z_]+', 0, 0, 0, undef, 0, '#stay', 'Error')) {
1401 my ($self, $text) = @_;
1402 # String => '(\bdashed\s+|\bdotted\s+)?(<(/n|\\n|n/|n\\|[a-g]([+-]*|[0-7]))?>|tie|slur|[~])'
1403 # attribute => 'Note Attribute'
1404 # context => '#stay'
1406 if ($self->testRegExpr($text, '(\\bdashed\\s+|\\bdotted\\s+)?(<(/n|\\\\n|n/|n\\\\|[a-g]([+-]*|[0-7]))?>|tie|slur|[~])', 0, 0, 0, undef, 0, '#stay', 'Note Attribute')) {
1409 # String => '^(/|[a-g]([+-]*|[0-7]))'
1410 # attribute => 'Note Attribute'
1411 # context => '#stay'
1413 if ($self->testRegExpr($text, '^(/|[a-g]([+-]*|[0-7]))', 0, 0, 0, undef, 0, '#stay', 'Note Attribute')) {
1416 # String => '\bbm\b(\s+with\s+staff\s+(below|above)\b)?'
1417 # attribute => 'Note Attribute'
1418 # context => '#stay'
1420 if ($self->testRegExpr($text, '\\bbm\\b(\\s+with\\s+staff\\s+(below|above)\\b)?', 0, 0, 0, undef, 0, '#stay', 'Note Attribute')) {
1423 # String => '\bes?bm\b'
1424 # attribute => 'Note Attribute'
1425 # context => '#stay'
1427 if ($self->testRegExpr($text, '\\bes?bm\\b', 0, 0, 0, undef, 0, '#stay', 'Note Attribute')) {
1430 # String => '\balt\s+[1-9]\b'
1431 # attribute => 'Note Attribute'
1432 # context => '#stay'
1434 if ($self->testRegExpr($text, '\\balt\\s+[1-9]\\b', 0, 0, 0, undef, 0, '#stay', 'Note Attribute')) {
1437 # String => '\bhs\s+'
1438 # attribute => 'Note Attribute'
1439 # context => '#stay'
1441 if ($self->testRegExpr($text, '\\bhs\\s+', 0, 0, 0, undef, 0, '#stay', 'Note Attribute')) {
1444 # attribute => 'String'
1446 # context => 'String'
1447 # type => 'DetectChar'
1448 if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String', 'String')) {
1451 # context => 'Macro'
1452 # type => 'IncludeRules'
1453 if ($self->includeRules('Macro', $text)) {
1459 sub parseNoteProbably {
1460 my ($self, $text) = @_;
1461 # String => '[a-grs]*'
1462 # attribute => 'Note'
1465 if ($self->testRegExpr($text, '[a-grs]*', 0, 0, 0, undef, 0, '#pop', 'Note')) {
1471 sub parseParameter {
1472 my ($self, $text) = @_;
1473 # attribute => 'Normal Text'
1475 # context => 'Value'
1476 # type => 'DetectChar'
1477 if ($self->testDetectChar($text, '=', 0, 0, 0, undef, 0, 'Value', 'Normal Text')) {
1481 # attribute => 'Parameter'
1482 # context => '#stay'
1484 if ($self->testRegExpr($text, '\\s+', 0, 0, 0, undef, 0, '#stay', 'Parameter')) {
1490 sub parsePrintCommand {
1491 my ($self, $text) = @_;
1492 # type => 'DetectSpaces'
1493 if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) {
1496 # String => 'mupfontstyles'
1497 # attribute => 'Print Command'
1498 # context => '#stay'
1500 if ($self->testKeyword($text, 'mupfontstyles', 0, undef, 0, '#stay', 'Print Command')) {
1503 # String => '\bnl\b'
1504 # attribute => 'Print Command'
1505 # context => '#stay'
1507 if ($self->testRegExpr($text, '\\bnl\\b', 0, 0, 0, undef, 0, '#stay', 'Print Command')) {
1510 # String => '\([0-9]+\)'
1511 # attribute => 'Print Command'
1514 if ($self->testRegExpr($text, '\\([0-9]+\\)', 0, 0, 0, undef, 0, '#pop', 'Print Command')) {
1520 sub parseSpecialChar {
1521 my ($self, $text) = @_;
1522 # attribute => 'String Special'
1525 # type => 'DetectChar'
1526 if ($self->testDetectChar($text, ')', 0, 0, 0, undef, 0, '#pop', 'String Special')) {
1529 # String => 'mupspecialchars'
1530 # attribute => 'String Special'
1531 # context => '#stay'
1533 if ($self->testKeyword($text, 'mupspecialchars', 0, undef, 0, '#stay', 'String Special')) {
1536 # String => 'mupmusicchars'
1537 # attribute => 'String Special'
1538 # context => '#stay'
1540 if ($self->testKeyword($text, 'mupmusicchars', 0, undef, 0, '#stay', 'String Special')) {
1543 # String => '[AaEeOo]['`:^~](?=\))'
1544 # attribute => 'String Special'
1545 # context => '#stay'
1547 if ($self->testRegExpr($text, '[AaEeOo][\'`:^~](?=\\))', 0, 0, 0, undef, 0, '#stay', 'String Special')) {
1550 # String => '[IiUu]['`:^](?=\))'
1551 # attribute => 'String Special'
1552 # context => '#stay'
1554 if ($self->testRegExpr($text, '[IiUu][\'`:^](?=\\))', 0, 0, 0, undef, 0, '#stay', 'String Special')) {
1557 # String => '[Nn]~(?=\))'
1558 # attribute => 'String Special'
1559 # context => '#stay'
1561 if ($self->testRegExpr($text, '[Nn]~(?=\\))', 0, 0, 0, undef, 0, '#stay', 'String Special')) {
1564 # String => '[Yy]:(?=\))'
1565 # attribute => 'String Special'
1566 # context => '#stay'
1568 if ($self->testRegExpr($text, '[Yy]:(?=\\))', 0, 0, 0, undef, 0, '#stay', 'String Special')) {
1571 # String => '[LlOo]/(?=\))'
1572 # attribute => 'String Special'
1573 # context => '#stay'
1575 if ($self->testRegExpr($text, '[LlOo]/(?=\\))', 0, 0, 0, undef, 0, '#stay', 'String Special')) {
1578 # String => '[Cc],(?=\))'
1579 # attribute => 'String Special'
1580 # context => '#stay'
1582 if ($self->testRegExpr($text, '[Cc],(?=\\))', 0, 0, 0, undef, 0, '#stay', 'String Special')) {
1585 # String => '(>>|<<|``|'')(?=\))'
1586 # attribute => 'String Special'
1587 # context => '#stay'
1589 if ($self->testRegExpr($text, '(>>|<<|``|\'\')(?=\\))', 0, 0, 0, undef, 0, '#stay', 'String Special')) {
1592 # String => '[^)"]+'
1593 # attribute => 'String Error'
1594 # context => '#stay'
1596 if ($self->testRegExpr($text, '[^)"]+', 0, 0, 0, undef, 0, '#stay', 'String Error')) {
1603 my ($self, $text) = @_;
1604 # attribute => 'String'
1607 # type => 'DetectChar'
1608 if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) {
1611 # String => '[\\][][{}%#"nb|^:,\\/ ]'
1612 # attribute => 'String Special'
1613 # context => '#stay'
1615 if ($self->testRegExpr($text, '[\\\\][][{}%#"nb|^:,\\\\/ ]', 0, 0, 0, undef, 0, '#stay', 'String Special')) {
1619 # attribute => 'String Special'
1620 # context => 'Special Char'
1621 # type => 'StringDetect'
1622 if ($self->testStringDetect($text, '\\(', 0, 0, 0, undef, 0, 'Special Char', 'String Special')) {
1626 # attribute => 'String Special'
1627 # context => 'Font Name'
1628 # type => 'StringDetect'
1629 if ($self->testStringDetect($text, '\\f(', 0, 0, 0, undef, 0, 'Font Name', 'String Special')) {
1633 # attribute => 'String Special'
1634 # context => 'Font Size'
1635 # type => 'StringDetect'
1636 if ($self->testStringDetect($text, '\\s(', 0, 0, 0, undef, 0, 'Font Size', 'String Special')) {
1639 # String => '\\v\(-?[0-9]{1,3}\)'
1640 # attribute => 'String Special'
1641 # context => '#stay'
1643 if ($self->testRegExpr($text, '\\\\v\\(-?[0-9]{1,3}\\)', 0, 0, 0, undef, 0, '#stay', 'String Special')) {
1646 # String => '[~<>|^]'
1647 # attribute => 'String Lyrics'
1648 # context => '#stay'
1650 if ($self->testRegExpr($text, '[~<>|^]', 0, 0, 0, undef, 0, '#stay', 'String Lyrics')) {
1653 # String => '[-+]?[0-9]+\|'
1654 # attribute => 'String Lyrics'
1655 # context => '#stay'
1657 if ($self->testRegExpr($text, '[-+]?[0-9]+\\|', 0, 0, 0, undef, 0, '#stay', 'String Lyrics')) {
1664 my ($self, $text) = @_;
1665 # String => '\s*(above|below)?\s*[0-9]{1,2}(y|n|num)?(\s*,\s*[0-9]{1,2}\.?([+][0-9]{1,2}\.?)*)?'
1666 # attribute => 'Tuplet'
1669 if ($self->testRegExpr($text, '\\s*(above|below)?\\s*[0-9]{1,2}(y|n|num)?(\\s*,\\s*[0-9]{1,2}\\.?([+][0-9]{1,2}\\.?)*)?', 0, 0, 0, undef, 0, '#pop', 'Tuplet')) {
1676 my ($self, $text) = @_;
1677 # String => 'mupparameters'
1678 # attribute => 'Parameter'
1679 # context => '#stay'
1681 if ($self->testKeyword($text, 'mupparameters', 0, undef, 0, '#stay', 'Parameter')) {
1684 # String => '[\s,]+'
1685 # attribute => 'Normal Text'
1686 # context => '#stay'
1688 if ($self->testRegExpr($text, '[\\s,]+', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) {
1692 # attribute => 'Error'
1695 if ($self->testRegExpr($text, '\\w+', 0, 0, 0, undef, 0, '#pop', 'Error')) {
1702 my ($self, $text) = @_;
1703 # attribute => 'Normal Text'
1706 # type => 'DetectChar'
1707 if ($self->testDetectChar($text, ';', 0, 0, 0, undef, 0, '#pop', 'Normal Text')) {
1710 # String => '[\s,&()-]+'
1711 # attribute => 'Normal Text'
1712 # context => '#stay'
1714 if ($self->testRegExpr($text, '[\\s,&()-]+', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) {
1717 # String => 'mupvalues'
1718 # attribute => 'Value'
1719 # context => '#stay'
1721 if ($self->testKeyword($text, 'mupvalues', 0, undef, 0, '#stay', 'Value')) {
1724 # String => 'mupfontnames'
1725 # attribute => 'Value'
1728 if ($self->testKeyword($text, 'mupfontnames', 0, undef, 0, '#pop', 'Value')) {
1731 # String => 'mupfontstyles'
1732 # attribute => 'Value'
1735 if ($self->testKeyword($text, 'mupfontstyles', 0, undef, 0, '#pop', 'Value')) {
1738 # String => '\b[1-9][0-9]*/(1|2|4|8|16|32|64|128)n?\b'
1739 # attribute => 'Value'
1740 # context => '#stay'
1742 if ($self->testRegExpr($text, '\\b[1-9][0-9]*/(1|2|4|8|16|32|64|128)n?\\b', 0, 0, 0, undef, 0, '#stay', 'Value')) {
1745 # String => '\b[a-g][#&]?'?([0-9]\b)?'
1746 # attribute => 'Value'
1747 # context => '#stay'
1749 if ($self->testRegExpr($text, '\\b[a-g][#&]?\'?([0-9]\\b)?', 0, 0, 0, undef, 0, '#stay', 'Value')) {
1752 # String => '[0-7][#&]'
1753 # attribute => 'Value'
1754 # context => '#stay'
1756 if ($self->testRegExpr($text, '[0-7][#&]', 0, 0, 0, undef, 0, '#stay', 'Value')) {
1760 # attribute => 'Value'
1761 # context => '#stay'
1763 if ($self->testRegExpr($text, 'r\\b', 0, 0, 0, undef, 0, '#stay', 'Value')) {
1766 # attribute => 'Value'
1767 # context => '#stay'
1769 if ($self->testFloat($text, 0, undef, 0, '#stay', 'Value')) {
1772 # attribute => 'Value'
1773 # context => '#stay'
1775 if ($self->testInt($text, 0, undef, 0, '#stay', 'Value')) {
1778 # attribute => 'String'
1780 # context => 'String'
1781 # type => 'DetectChar'
1782 if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String', 'String')) {
1785 # context => 'Macro'
1786 # type => 'IncludeRules'
1787 if ($self->includeRules('Macro', $text)) {
1790 # String => '[a-z][a-z0-9]*'
1791 # attribute => 'Error'
1792 # context => '#stay'
1794 if ($self->testRegExpr($text, '[a-z][a-z0-9]*', 0, 0, 0, undef, 0, '#stay', 'Error')) {
1807 Syntax::Highlight::Engine::Kate::Music_Publisher - a Plugin for Music Publisher syntax highlighting
1811 require Syntax::Highlight::Engine::Kate::Music_Publisher;
1812 my $sh = new Syntax::Highlight::Engine::Kate::Music_Publisher([
1817 Syntax::Highlight::Engine::Kate::Music_Publisher is a plugin module that provides syntax highlighting
1818 for Music Publisher to the Syntax::Haghlight::Engine::Kate highlighting engine.
1820 This code is generated from the syntax definition files used
1821 by the Kate project.
1822 It works quite fine, but can use refinement and optimization.
1824 It inherits Syntax::Higlight::Engine::Kate::Template. See also there.
1830 Hans Jeuken (haje <at> toneel <dot> demon <dot> nl)
1836 Unknown. If you find any, please contact the author