Add built local::lib
[catagits/Gitalist.git] / local-lib5 / lib / perl5 / Syntax / Highlight / Engine / Kate / Music_Publisher.pm
CommitLineData
3fea05b9 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.
4
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
7
8#kate xml version 1.06
9#kate version 2.4
10#kate author Wilbert Berendsen (wilbert@kde.nl)
11#generated: Sun Feb 3 22:02:05 2008, localtime
12
13package Syntax::Highlight::Engine::Kate::Music_Publisher;
14
15our $VERSION = '0.06';
16
17use strict;
18use warnings;
19use base('Syntax::Highlight::Engine::Kate::Template');
20
21sub new {
22 my $proto = shift;
23 my $class = ref($proto) || $proto;
24 my $self = $class->SUPER::new(@_);
25 $self->attributes({
26 'Barline' => 'DecVal',
27 'Comment' => 'Comment',
28 'Context' => 'Keyword',
29 'Error' => 'Error',
30 'Location' => 'Operator',
31 'Location Probably' => 'Reserved',
32 'Lyrics' => 'BaseN',
33 'Macro' => 'Others',
34 'Newscore' => 'BString',
35 'Normal Text' => 'Normal',
36 'Note' => 'Normal',
37 'Note Attribute' => 'Normal',
38 'Parameter' => 'Char',
39 'Print Command' => 'BaseN',
40 'Special Char' => 'Keyword',
41 'String' => 'String',
42 'String Error' => 'Error',
43 'String Lyrics' => 'String',
44 'String Special' => 'IString',
45 'Tuplet' => 'RegionMarker',
46 'Unset Command' => 'Variable',
47 'Value' => 'Float',
48 });
49 $self->listAdd('mupcontexts',
50 'block',
51 'bottom',
52 'bottom2',
53 'footer',
54 'footer2',
55 'grids',
56 'header',
57 'header2',
58 'headshapes',
59 'music',
60 'music',
61 'score',
62 'staff',
63 'top',
64 'top2',
65 'voice',
66 );
67 $self->listAdd('mupfontnames',
68 'avantgarde',
69 'bookman',
70 'courier',
71 'helvetica',
72 'newcentury',
73 'palatino',
74 'times',
75 );
76 $self->listAdd('mupfontstyles',
77 'bold',
78 'boldital',
79 'ital',
80 'rom',
81 );
82 $self->listAdd('mupgraphics',
83 'bulge',
84 'curve',
85 'dashed',
86 'dotted',
87 'down',
88 'line',
89 'medium',
90 'midi',
91 'mussym',
92 'octave',
93 'pedal',
94 'phrase',
95 'roll',
96 'to',
97 'to',
98 'up',
99 'wavy',
100 'wide',
101 'with',
102 );
103 $self->listAdd('muplocations',
104 'above',
105 'all',
106 'below',
107 'between',
108 );
109 $self->listAdd('mupmacrodirectives',
110 'else',
111 'include',
112 'undef',
113 );
114 $self->listAdd('mupmacrodirectives_end',
115 '@',
116 'endif',
117 );
118 $self->listAdd('mupmacrodirectives_start',
119 'define',
120 'ifdef',
121 'ifndef',
122 );
123 $self->listAdd('mupmusicchars',
124 '128rest',
125 '16rest',
126 '1n',
127 '1rest',
128 '256rest',
129 '2n',
130 '2rest',
131 '32rest',
132 '4n',
133 '4rest',
134 '64rest',
135 '8rest',
136 'acc_gt',
137 'acc_hat',
138 'acc_uhat',
139 'begped',
140 'cclef',
141 'coda',
142 'com',
143 'copyright',
144 'cut',
145 'dblflat',
146 'dblsharp',
147 'dblwhole',
148 'diamond',
149 'dim',
150 'dn128n',
151 'dn16n',
152 'dn256n',
153 'dn2n',
154 'dn32n',
155 'dn4n',
156 'dn64n',
157 'dn8n',
158 'dnbow',
159 'dnflag',
160 'dot',
161 'dwhdiamond',
162 'dwhrest',
163 'endped',
164 'fclef',
165 'ferm',
166 'filldiamond',
167 'flat',
168 'gclef',
169 'halfdim',
170 'invmor',
171 'invturn',
172 'leg',
173 'measrpt',
174 'mor',
175 'nat',
176 'pedal',
177 'qwhrest',
178 'rr',
179 'sharp',
180 'sign',
181 'sm128rest',
182 'sm16rest',
183 'sm1n',
184 'sm1rest',
185 'sm256rest',
186 'sm2n',
187 'sm2rest',
188 'sm32rest',
189 'sm4n',
190 'sm4rest',
191 'sm64rest',
192 'sm8rest',
193 'smacc_gt',
194 'smacc_hat',
195 'smacc_uhat',
196 'smbegped',
197 'smcclef',
198 'smcoda',
199 'smcom',
200 'smcopyright',
201 'smcut',
202 'smdblflat',
203 'smdblsharp',
204 'smdblwhole',
205 'smdiamond',
206 'smdim',
207 'smdn128n',
208 'smdn16n',
209 'smdn256n',
210 'smdn2n',
211 'smdn32n',
212 'smdn4n',
213 'smdn64n',
214 'smdn8n',
215 'smdnbow',
216 'smdnflag',
217 'smdot',
218 'smdwhdiamond',
219 'smdwhrest',
220 'smendped',
221 'smfclef',
222 'smferm',
223 'smfilldiamond',
224 'smflat',
225 'smgclef',
226 'smhalfdim',
227 'sminvmor',
228 'sminvturn',
229 'smleg',
230 'smmeasrpt',
231 'smmor',
232 'smnat',
233 'smpedal',
234 'smqwhrest',
235 'smrr',
236 'smsharp',
237 'smsign',
238 'smtr',
239 'smtriangle',
240 'smturn',
241 'smuferm',
242 'smup128n',
243 'smup16n',
244 'smup256n',
245 'smup2n',
246 'smup32n',
247 'smup4n',
248 'smup64n',
249 'smup8n',
250 'smupbow',
251 'smupflag',
252 'smuwedge',
253 'smwedge',
254 'smxnote',
255 'tr',
256 'triangle',
257 'turn',
258 'uferm',
259 'up128n',
260 'up16n',
261 'up256n',
262 'up2n',
263 'up32n',
264 'up4n',
265 'up64n',
266 'up8n',
267 'upbow',
268 'upflag',
269 'uwedge',
270 'wedge',
271 'xnote',
272 );
273 $self->listAdd('mupparameters',
274 'aboveorder',
275 'addtranspose',
276 'barstyle',
277 'beamslope',
278 'beamstyle',
279 'beloworder',
280 'betweenorder',
281 'bottommargin',
282 'brace',
283 'bracket',
284 'cancelkey',
285 'chorddist',
286 'clef',
287 'crescdist',
288 'defoct',
289 'dist',
290 'division',
291 'dyndist',
292 'endingstyle',
293 'firstpage',
294 'font',
295 'fontfamily',
296 'gridfret',
297 'gridsatend',
298 'gridscale',
299 'gridswhereused',
300 'key',
301 'label',
302 'label2',
303 'leftmargin',
304 'lyricsalign',
305 'lyricsfont',
306 'lyricsfontfamily',
307 'lyricssize',
308 'measnum',
309 'measnumfont',
310 'measnumfontfamily',
311 'measnumsize',
312 'noteheads',
313 'numbermrpt',
314 'ontheline',
315 'packexp',
316 'packfact',
317 'pad',
318 'pageheight',
319 'pagewidth',
320 'panelsperpage',
321 'pedstyle',
322 'printmultnum',
323 'rehstyle',
324 'release',
325 'restcombine',
326 'restsymmult',
327 'rightmargin',
328 'scale',
329 'scorepad',
330 'scoresep',
331 'size',
332 'stafflines',
333 'staffpad',
334 'staffs',
335 'staffscale',
336 'staffsep',
337 'stemlen',
338 'swingunit',
339 'sylposition',
340 'tabwhitebox',
341 'time',
342 'timeunit',
343 'topmargin',
344 'transpose',
345 'units',
346 'visible',
347 'vscheme',
348 'warn',
349 );
350 $self->listAdd('mupprintcommands',
351 'center',
352 'left',
353 'paragraph',
354 'postscript',
355 'print',
356 'right',
357 'title',
358 );
359 $self->listAdd('mupprintspecifiers',
360 'analysis',
361 'chord',
362 'dyn',
363 'figbass',
364 );
365 $self->listAdd('mupspecialchars',
366 '\\\'\\\'',
367 '<<',
368 '>>',
369 'A\\\'',
370 'A:',
371 'AE',
372 'A^',
373 'A`',
374 'Aacute',
375 'Acircumflex',
376 'Adieresis',
377 'Agrave',
378 'Ao',
379 'Aring',
380 'Atilde',
381 'A~',
382 'C,',
383 'Ccedilla',
384 'E\\\'',
385 'E:',
386 'E^',
387 'E`',
388 'Eacute',
389 'Ecircumflex',
390 'Edieresis',
391 'Egrave',
392 'I\\\'',
393 'I^',
394 'I`',
395 'Iacute',
396 'Icircumflex',
397 'Idieresis',
398 'Igrave',
399 'L/',
400 'Lslash',
401 'Ntilde',
402 'N~',
403 'O\\\'',
404 'O/',
405 'O:',
406 'OE',
407 'O^',
408 'O`',
409 'Oacute',
410 'Ocircumflex',
411 'Odieresis',
412 'Ograve',
413 'Oslash',
414 'Otilde',
415 'O~',
416 'Scaron',
417 'Sv',
418 'U\\\'',
419 'U:',
420 'U^',
421 'U`',
422 'Uacute',
423 'Ucircumflex',
424 'Udieresis',
425 'Ugrave',
426 'Y:',
427 'Ydieresis',
428 'Zcaron',
429 'Zv',
430 '``',
431 'a\\\'',
432 'a:',
433 'a^',
434 'a`',
435 'aacute',
436 'acircumflex',
437 'acute',
438 'adieresis',
439 'ae',
440 'agrave',
441 'ao',
442 'aring',
443 'atilde',
444 'a~',
445 'breve',
446 'bullet',
447 'c,',
448 'caron',
449 'ccedilla',
450 'cedilla',
451 'cent',
452 'dagger',
453 'daggerdbl',
454 'dieresis',
455 'dotaccent',
456 'dotlessi',
457 'e\\\'',
458 'e:',
459 'e^',
460 'e`',
461 'eacute',
462 'ecircumflex',
463 'edieresis',
464 'egrave',
465 'emdash',
466 'exclamdown',
467 'germandbls',
468 'grave',
469 'guildsinglleft',
470 'guillemotleft',
471 'guillemotright',
472 'guilsinglright',
473 'hungarumlaut',
474 'i\\\'',
475 'i:',
476 'i:',
477 'i^',
478 'i`',
479 'iacute',
480 'icircumflex',
481 'idieresis',
482 'igrave',
483 'l/',
484 'lslash',
485 'macron',
486 'ntilde',
487 'n~',
488 'o\\\'',
489 'o/',
490 'o:',
491 'o^',
492 'o`',
493 'oacute',
494 'ocircumflex',
495 'odieresis',
496 'oe',
497 'ogonek',
498 'ograve',
499 'ordfeminine',
500 'ordmasculine',
501 'oslash',
502 'otilde',
503 'o~',
504 'questiondown',
505 'quotedblbase',
506 'quotedblleft',
507 'quotedblright',
508 'ring',
509 'scaron',
510 'space',
511 'ss',
512 'sterling',
513 'sv',
514 'u\\\'',
515 'u:',
516 'u^',
517 'u`',
518 'uacute',
519 'ucircumflex',
520 'udieresis',
521 'ugrave',
522 'y:',
523 'ydieresis',
524 'yen',
525 'zcaron',
526 'zv',
527 );
528 $self->listAdd('mupvalues',
529 '1drum',
530 '1n',
531 '2f',
532 '2o',
533 '3f',
534 '3o',
535 '5drum',
536 '5n',
537 '8treble',
538 'alt',
539 'alto',
540 'aug',
541 'augmented',
542 'baritone',
543 'barred',
544 'bass',
545 'boxed',
546 'chord',
547 'circled',
548 'cm',
549 'common',
550 'cut',
551 'dim',
552 'diminished',
553 'down',
554 'drum',
555 'dyn',
556 'ending',
557 'frenchviolin',
558 'grouped',
559 'inches',
560 'line',
561 'lyrics',
562 'maj',
563 'major',
564 'mezzosoprano',
565 'min',
566 'minor',
567 'mussym',
568 'n',
569 'octave',
570 'othertext',
571 'pedal',
572 'pedstar',
573 'per',
574 'perfect',
575 'plain',
576 'reh',
577 'soprano',
578 'tab',
579 'tenor',
580 'times',
581 'top',
582 'treble',
583 'treble8',
584 'up',
585 'whereused',
586 'y',
587 );
588 $self->contextdata({
589 'Bar Rehearsal' => {
590 callback => \&parseBarRehearsal,
591 attribute => 'Barline',
592 lineending => '#pop',
593 fallthrough => '#pop',
594 },
595 'Barline' => {
596 callback => \&parseBarline,
597 attribute => 'Barline',
598 lineending => '#pop',
599 fallthrough => '#pop',
600 },
601 'Bracket' => {
602 callback => \&parseBracket,
603 attribute => 'Note Attribute',
604 lineending => '#pop',
605 fallthrough => '#pop',
606 },
607 'Bracket Hs' => {
608 callback => \&parseBracketHs,
609 attribute => 'Note Attribute',
610 lineending => '#pop',
611 fallthrough => '#pop',
612 },
613 'Bracket With' => {
614 callback => \&parseBracketWith,
615 attribute => 'Note Attribute',
616 lineending => '#pop',
617 fallthrough => '#pop',
618 },
619 'Comment' => {
620 callback => \&parseComment,
621 attribute => 'Comment',
622 lineending => '#pop',
623 },
624 'Font Name' => {
625 callback => \&parseFontName,
626 attribute => 'String Special',
627 fallthrough => '#pop',
628 },
629 'Font Size' => {
630 callback => \&parseFontSize,
631 attribute => 'String Special',
632 fallthrough => '#pop',
633 },
634 'Font Style' => {
635 callback => \&parseFontStyle,
636 attribute => 'String Special',
637 fallthrough => '#pop',
638 },
639 'Location' => {
640 callback => \&parseLocation,
641 attribute => 'Normal Text',
642 lineending => '#pop',
643 fallthrough => '#pop',
644 },
645 'Location Probably' => {
646 callback => \&parseLocationProbably,
647 attribute => 'Location Problably',
648 lineending => '#pop',
649 fallthrough => '#pop',
650 },
651 'Macro' => {
652 callback => \&parseMacro,
653 attribute => 'Macro',
654 lineending => '#pop',
655 },
656 'Macro Location' => {
657 callback => \&parseMacroLocation,
658 attribute => 'Location',
659 lineending => '#pop',
660 fallthrough => '#pop',
661 },
662 'Normal' => {
663 callback => \&parseNormal,
664 attribute => 'Normal Text',
665 },
666 'Note' => {
667 callback => \&parseNote,
668 attribute => 'Note',
669 lineending => '#pop',
670 fallthrough => '#pop',
671 },
672 'Note Probably' => {
673 callback => \&parseNoteProbably,
674 attribute => 'Note',
675 lineending => '#pop',
676 fallthrough => '#pop',
677 },
678 'Parameter' => {
679 callback => \&parseParameter,
680 attribute => 'Parameter',
681 lineending => '#pop',
682 fallthrough => '#pop',
683 },
684 'Print Command' => {
685 callback => \&parsePrintCommand,
686 attribute => 'Print Command',
687 lineending => '#pop',
688 fallthrough => '#pop',
689 },
690 'Special Char' => {
691 callback => \&parseSpecialChar,
692 attribute => 'String Special',
693 fallthrough => '#pop',
694 },
695 'String' => {
696 callback => \&parseString,
697 attribute => 'String',
698 },
699 'Tuplet' => {
700 callback => \&parseTuplet,
701 attribute => 'Tuplet',
702 lineending => '#pop',
703 fallthrough => '#pop',
704 },
705 'Unset' => {
706 callback => \&parseUnset,
707 attribute => 'Parameter',
708 lineending => '#pop',
709 fallthrough => '#pop',
710 },
711 'Value' => {
712 callback => \&parseValue,
713 attribute => 'Value',
714 lineending => '#pop',
715 fallthrough => '#pop',
716 },
717 });
718 $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\');
719 $self->basecontext('Normal');
720 $self->keywordscase(0);
721 $self->initialize;
722 bless ($self, $class);
723 return $self;
724}
725
726sub language {
727 return 'Music Publisher';
728}
729
730sub parseBarRehearsal {
731 my ($self, $text) = @_;
732 # String => '\s+'
733 # attribute => 'Print Command'
734 # context => '#stay'
735 # type => 'RegExpr'
736 if ($self->testRegExpr($text, '\\s+', 0, 0, 0, undef, 0, '#stay', 'Print Command')) {
737 return 1
738 }
739 # String => 'mupfontnames'
740 # attribute => 'Print Command'
741 # context => 'Print Command'
742 # type => 'keyword'
743 if ($self->testKeyword($text, 'mupfontnames', 0, undef, 0, 'Print Command', 'Print Command')) {
744 return 1
745 }
746 # String => 'mupfontstyles'
747 # attribute => 'Print Command'
748 # context => 'Print Command'
749 # type => 'keyword'
750 if ($self->testKeyword($text, 'mupfontstyles', 0, undef, 0, 'Print Command', 'Print Command')) {
751 return 1
752 }
753 # String => '\b(let|mnum|num)\b'
754 # attribute => 'Barline'
755 # context => '#pop'
756 # type => 'RegExpr'
757 if ($self->testRegExpr($text, '\\b(let|mnum|num)\\b', 0, 0, 0, undef, 0, '#pop', 'Barline')) {
758 return 1
759 }
760 # context => 'Macro'
761 # type => 'IncludeRules'
762 if ($self->includeRules('Macro', $text)) {
763 return 1
764 }
765 return 0;
766};
767
768sub parseBarline {
769 my ($self, $text) = @_;
770 # type => 'DetectSpaces'
771 if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) {
772 return 1
773 }
774 # String => '\b(ending|endending|hidechanges)\b'
775 # attribute => 'Barline'
776 # context => '#stay'
777 # type => 'RegExpr'
778 if ($self->testRegExpr($text, '\\b(ending|endending|hidechanges)\\b', 0, 0, 0, undef, 0, '#stay', 'Barline')) {
779 return 1
780 }
781 # String => '\breh(earsal)?\b'
782 # attribute => 'Barline'
783 # context => 'Bar Rehearsal'
784 # type => 'RegExpr'
785 if ($self->testRegExpr($text, '\\breh(earsal)?\\b', 0, 0, 0, undef, 0, 'Bar Rehearsal', 'Barline')) {
786 return 1
787 }
788 # String => '\bmnum\s*=\s*[0-9]+'
789 # attribute => 'Barline'
790 # context => '#stay'
791 # type => 'RegExpr'
792 if ($self->testRegExpr($text, '\\bmnum\\s*=\\s*[0-9]+', 0, 0, 0, undef, 0, '#stay', 'Barline')) {
793 return 1
794 }
795 # String => '\bnum\s*=\s*[0-9]+'
796 # attribute => 'Barline'
797 # context => '#stay'
798 # type => 'RegExpr'
799 if ($self->testRegExpr($text, '\\bnum\\s*=\\s*[0-9]+', 0, 0, 0, undef, 0, '#stay', 'Barline')) {
800 return 1
801 }
802 # String => '\blet\s*=\s*("[A-Z]{1,2}")?'
803 # attribute => 'Barline'
804 # context => '#stay'
805 # type => 'RegExpr'
806 if ($self->testRegExpr($text, '\\blet\\s*=\\s*("[A-Z]{1,2}")?', 0, 0, 0, undef, 0, '#stay', 'Barline')) {
807 return 1
808 }
809 # String => '\bpad\s+[0-9]+'
810 # attribute => 'Barline'
811 # context => '#stay'
812 # type => 'RegExpr'
813 if ($self->testRegExpr($text, '\\bpad\\s+[0-9]+', 0, 0, 0, undef, 0, '#stay', 'Barline')) {
814 return 1
815 }
816 # String => '=([a-z]|_[a-z][a-z_0-9]*)\b'
817 # attribute => 'Location'
818 # context => '#stay'
819 # type => 'RegExpr'
820 if ($self->testRegExpr($text, '=([a-z]|_[a-z][a-z_0-9]*)\\b', 0, 0, 0, undef, 0, '#stay', 'Location')) {
821 return 1
822 }
823 # context => 'Macro'
824 # type => 'IncludeRules'
825 if ($self->includeRules('Macro', $text)) {
826 return 1
827 }
828 return 0;
829};
830
831sub parseBracket {
832 my ($self, $text) = @_;
833 # attribute => 'Special Char'
834 # char => ']'
835 # context => '#pop'
836 # type => 'DetectChar'
837 if ($self->testDetectChar($text, ']', 0, 0, 0, undef, 0, '#pop', 'Special Char')) {
838 return 1
839 }
840 # String => '[\s;,]+'
841 # attribute => 'Normal Text'
842 # context => '#stay'
843 # type => 'RegExpr'
844 if ($self->testRegExpr($text, '[\\s;,]+', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) {
845 return 1
846 }
847 # String => '\b(grace|xnote|cue|diam|up|down)\b'
848 # attribute => 'Note Attribute'
849 # context => '#stay'
850 # type => 'RegExpr'
851 if ($self->testRegExpr($text, '\\b(grace|xnote|cue|diam|up|down)\\b', 0, 0, 0, undef, 0, '#stay', 'Note Attribute')) {
852 return 1
853 }
854 # String => '\b(slash|len|pad|ho|dist)\s*[0-9.+-]*'
855 # attribute => 'Note Attribute'
856 # context => '#stay'
857 # type => 'RegExpr'
858 if ($self->testRegExpr($text, '\\b(slash|len|pad|ho|dist)\\s*[0-9.+-]*', 0, 0, 0, undef, 0, '#stay', 'Note Attribute')) {
859 return 1
860 }
861 # String => '\bwith\s*(?=[A-Z"^>.-])'
862 # attribute => 'Note Attribute'
863 # context => 'Bracket With'
864 # type => 'RegExpr'
865 if ($self->testRegExpr($text, '\\bwith\\s*(?=[A-Z"^>.-])', 0, 0, 0, undef, 0, 'Bracket With', 'Note Attribute')) {
866 return 1
867 }
868 # String => '\bhs\s*(?=[A-Z"])'
869 # attribute => 'Note Attribute'
870 # context => 'Bracket Hs'
871 # type => 'RegExpr'
872 if ($self->testRegExpr($text, '\\bhs\\s*(?=[A-Z"])', 0, 0, 0, undef, 0, 'Bracket Hs', 'Note Attribute')) {
873 return 1
874 }
875 # String => '=([a-z]|_[a-z][a-z_0-9]*)\b'
876 # attribute => 'Location'
877 # context => '#stay'
878 # type => 'RegExpr'
879 if ($self->testRegExpr($text, '=([a-z]|_[a-z][a-z_0-9]*)\\b', 0, 0, 0, undef, 0, '#stay', 'Location')) {
880 return 1
881 }
882 # String => '\bc\b'
883 # attribute => 'Normal Text'
884 # context => '#stay'
885 # type => 'RegExpr'
886 if ($self->testRegExpr($text, '\\bc\\b', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) {
887 return 1
888 }
889 # context => 'Macro'
890 # type => 'IncludeRules'
891 if ($self->includeRules('Macro', $text)) {
892 return 1
893 }
894 return 0;
895};
896
897sub parseBracketHs {
898 my ($self, $text) = @_;
899 # attribute => 'String'
900 # char => '"'
901 # context => 'String'
902 # type => 'DetectChar'
903 if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String', 'String')) {
904 return 1
905 }
906 # context => 'Macro'
907 # type => 'IncludeRules'
908 if ($self->includeRules('Macro', $text)) {
909 return 1
910 }
911 return 0;
912};
913
914sub parseBracketWith {
915 my ($self, $text) = @_;
916 # attribute => 'String'
917 # char => '"'
918 # context => 'String'
919 # type => 'DetectChar'
920 if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String', 'String')) {
921 return 1
922 }
923 # String => '[>.^-]+'
924 # attribute => 'Note Attribute'
925 # context => '#stay'
926 # type => 'RegExpr'
927 if ($self->testRegExpr($text, '[>.^-]+', 0, 0, 0, undef, 0, '#stay', 'Note Attribute')) {
928 return 1
929 }
930 # String => '[\s,]+'
931 # attribute => 'Normal Text'
932 # context => '#stay'
933 # type => 'RegExpr'
934 if ($self->testRegExpr($text, '[\\s,]+', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) {
935 return 1
936 }
937 # context => 'Macro'
938 # type => 'IncludeRules'
939 if ($self->includeRules('Macro', $text)) {
940 return 1
941 }
942 return 0;
943};
944
945sub parseComment {
946 my ($self, $text) = @_;
947 # context => '##Alerts'
948 # type => 'IncludeRules'
949 if ($self->includePlugin('Alerts', $text)) {
950 return 1
951 }
952 return 0;
953};
954
955sub parseFontName {
956 my ($self, $text) = @_;
957 # attribute => 'String Special'
958 # char => ')'
959 # context => '#pop'
960 # type => 'DetectChar'
961 if ($self->testDetectChar($text, ')', 0, 0, 0, undef, 0, '#pop', 'String Special')) {
962 return 1
963 }
964 # String => '[ABCHNPT][RBIX](?=\))'
965 # attribute => 'String Special'
966 # context => '#stay'
967 # type => 'RegExpr'
968 if ($self->testRegExpr($text, '[ABCHNPT][RBIX](?=\\))', 0, 0, 0, undef, 0, '#stay', 'String Special')) {
969 return 1
970 }
971 # String => 'mupfontnames'
972 # attribute => 'String Special'
973 # context => 'Font Style'
974 # type => 'keyword'
975 if ($self->testKeyword($text, 'mupfontnames', 0, undef, 0, 'Font Style', 'String Special')) {
976 return 1
977 }
978 # String => '(PV|previous)(?=\))'
979 # attribute => 'String Special'
980 # context => '#stay'
981 # type => 'RegExpr'
982 if ($self->testRegExpr($text, '(PV|previous)(?=\\))', 0, 0, 0, undef, 0, '#stay', 'String Special')) {
983 return 1
984 }
985 # String => '[^ )"]+'
986 # attribute => 'String Error'
987 # context => '#stay'
988 # type => 'RegExpr'
989 if ($self->testRegExpr($text, '[^ )"]+', 0, 0, 0, undef, 0, '#stay', 'String Error')) {
990 return 1
991 }
992 return 0;
993};
994
995sub parseFontSize {
996 my ($self, $text) = @_;
997 # attribute => 'String Special'
998 # char => ')'
999 # context => '#pop'
1000 # type => 'DetectChar'
1001 if ($self->testDetectChar($text, ')', 0, 0, 0, undef, 0, '#pop', 'String Special')) {
1002 return 1
1003 }
1004 # String => '[-+]?[0-9]+(?=\))'
1005 # attribute => 'String Special'
1006 # context => '#stay'
1007 # type => 'RegExpr'
1008 if ($self->testRegExpr($text, '[-+]?[0-9]+(?=\\))', 0, 0, 0, undef, 0, '#stay', 'String Special')) {
1009 return 1
1010 }
1011 # String => '(PV|previous)(?=\))'
1012 # attribute => 'String Special'
1013 # context => '#stay'
1014 # type => 'RegExpr'
1015 if ($self->testRegExpr($text, '(PV|previous)(?=\\))', 0, 0, 0, undef, 0, '#stay', 'String Special')) {
1016 return 1
1017 }
1018 # String => '[^ )"]+'
1019 # attribute => 'String Error'
1020 # context => '#stay'
1021 # type => 'RegExpr'
1022 if ($self->testRegExpr($text, '[^ )"]+', 0, 0, 0, undef, 0, '#stay', 'String Error')) {
1023 return 1
1024 }
1025 return 0;
1026};
1027
1028sub parseFontStyle {
1029 my ($self, $text) = @_;
1030 # String => '\s+'
1031 # attribute => 'String Special'
1032 # context => '#stay'
1033 # type => 'RegExpr'
1034 if ($self->testRegExpr($text, '\\s+', 0, 0, 0, undef, 0, '#stay', 'String Special')) {
1035 return 1
1036 }
1037 # String => 'mupfontstyles'
1038 # attribute => 'String Special'
1039 # context => '#stay'
1040 # type => 'keyword'
1041 if ($self->testKeyword($text, 'mupfontstyles', 0, undef, 0, '#stay', 'String Special')) {
1042 return 1
1043 }
1044 # String => '[^ )"]+'
1045 # attribute => 'String Error'
1046 # context => '#stay'
1047 # type => 'RegExpr'
1048 if ($self->testRegExpr($text, '[^ )"]+', 0, 0, 0, undef, 0, '#stay', 'String Error')) {
1049 return 1
1050 }
1051 return 0;
1052};
1053
1054sub parseLocation {
1055 my ($self, $text) = @_;
1056 # String => '[\+\-\s]+'
1057 # attribute => 'Normal Text'
1058 # context => '#stay'
1059 # type => 'RegExpr'
1060 if ($self->testRegExpr($text, '[\\+\\-\\s]+', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) {
1061 return 1
1062 }
1063 # attribute => 'Normal Text'
1064 # context => '#stay'
1065 # type => 'Float'
1066 if ($self->testFloat($text, 0, undef, 0, '#stay', 'Normal Text')) {
1067 return 1
1068 }
1069 # String => '\btime\b'
1070 # attribute => 'Location'
1071 # context => '#stay'
1072 # type => 'RegExpr'
1073 if ($self->testRegExpr($text, '\\btime\\b', 0, 0, 0, undef, 0, '#stay', 'Location')) {
1074 return 1
1075 }
1076 # context => 'Macro'
1077 # type => 'IncludeRules'
1078 if ($self->includeRules('Macro', $text)) {
1079 return 1
1080 }
1081 return 0;
1082};
1083
1084sub parseLocationProbably {
1085 my ($self, $text) = @_;
1086 # String => '[h-qt-z]|_[a-z][a-z_0-9]*'
1087 # attribute => 'Location Probably'
1088 # context => '#pop'
1089 # type => 'RegExpr'
1090 if ($self->testRegExpr($text, '[h-qt-z]|_[a-z][a-z_0-9]*', 0, 0, 0, undef, 0, '#pop', 'Location Probably')) {
1091 return 1
1092 }
1093 return 0;
1094};
1095
1096sub parseMacro {
1097 my ($self, $text) = @_;
1098 # String => 'mupmacrodirectives_start'
1099 # attribute => 'Macro'
1100 # beginRegion => 'macro'
1101 # context => '#stay'
1102 # type => 'keyword'
1103 if ($self->testKeyword($text, 'mupmacrodirectives_start', 0, undef, 0, '#stay', 'Macro')) {
1104 return 1
1105 }
1106 # String => 'mupmacrodirectives_end'
1107 # attribute => 'Macro'
1108 # context => '#stay'
1109 # endRegion => 'macro'
1110 # type => 'keyword'
1111 if ($self->testKeyword($text, 'mupmacrodirectives_end', 0, undef, 0, '#stay', 'Macro')) {
1112 return 1
1113 }
1114 # String => 'mupmacrodirectives'
1115 # attribute => 'Macro'
1116 # context => '#stay'
1117 # type => 'keyword'
1118 if ($self->testKeyword($text, 'mupmacrodirectives', 0, undef, 0, '#stay', 'Macro')) {
1119 return 1
1120 }
1121 # String => '[A-Z][A-Z0-9_]*(?=\.[xynews]\b)'
1122 # attribute => 'Macro'
1123 # context => 'Macro Location'
1124 # type => 'RegExpr'
1125 if ($self->testRegExpr($text, '[A-Z][A-Z0-9_]*(?=\\.[xynews]\\b)', 0, 0, 0, undef, 0, 'Macro Location', 'Macro')) {
1126 return 1
1127 }
1128 # String => '[A-Z][A-Z0-9_]*'
1129 # attribute => 'Macro'
1130 # context => '#stay'
1131 # type => 'RegExpr'
1132 if ($self->testRegExpr($text, '[A-Z][A-Z0-9_]*', 0, 0, 0, undef, 0, '#stay', 'Macro')) {
1133 return 1
1134 }
1135 # attribute => 'Macro'
1136 # char => '@'
1137 # context => '#stay'
1138 # endRegion => 'macro'
1139 # type => 'DetectChar'
1140 if ($self->testDetectChar($text, '@', 0, 0, 0, undef, 0, '#stay', 'Macro')) {
1141 return 1
1142 }
1143 return 0;
1144};
1145
1146sub parseMacroLocation {
1147 my ($self, $text) = @_;
1148 # String => '..'
1149 # attribute => 'Location Probably'
1150 # context => '#pop'
1151 # type => 'RegExpr'
1152 if ($self->testRegExpr($text, '..', 0, 0, 0, undef, 0, '#pop', 'Location Probably')) {
1153 return 1
1154 }
1155 return 0;
1156};
1157
1158sub parseNormal {
1159 my ($self, $text) = @_;
1160 # String => 'mupcontexts'
1161 # attribute => 'Context'
1162 # context => '#stay'
1163 # type => 'keyword'
1164 if ($self->testKeyword($text, 'mupcontexts', 0, undef, 0, '#stay', 'Context')) {
1165 return 1
1166 }
1167 # String => '\blyrics\b'
1168 # attribute => 'Lyrics'
1169 # context => '#stay'
1170 # type => 'RegExpr'
1171 if ($self->testRegExpr($text, '\\blyrics\\b', 0, 0, 0, undef, 0, '#stay', 'Lyrics')) {
1172 return 1
1173 }
1174 # String => '\b((dashed|dotted)\s+)?(bar|endbar|dblbar|invisbar|repeatstart|repeatboth|repeatend|restart)\b'
1175 # attribute => 'Barline'
1176 # context => 'Barline'
1177 # type => 'RegExpr'
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')) {
1179 return 1
1180 }
1181 # String => '\bnew(score|page)\b'
1182 # attribute => 'Newscore'
1183 # context => '#stay'
1184 # type => 'RegExpr'
1185 if ($self->testRegExpr($text, '\\bnew(score|page)\\b', 0, 0, 0, undef, 0, '#stay', 'Newscore')) {
1186 return 1
1187 }
1188 # String => '\bmultirest\s+[0-9]+\b'
1189 # attribute => 'Newscore'
1190 # context => '#stay'
1191 # type => 'RegExpr'
1192 if ($self->testRegExpr($text, '\\bmultirest\\s+[0-9]+\\b', 0, 0, 0, undef, 0, '#stay', 'Newscore')) {
1193 return 1
1194 }
1195 # String => '\bunset\b'
1196 # attribute => 'Unset Command'
1197 # context => 'Unset'
1198 # type => 'RegExpr'
1199 if ($self->testRegExpr($text, '\\bunset\\b', 0, 0, 0, undef, 0, 'Unset', 'Unset Command')) {
1200 return 1
1201 }
1202 # attribute => 'Comment'
1203 # char => '/'
1204 # char1 => '/'
1205 # context => 'Comment'
1206 # type => 'Detect2Chars'
1207 if ($self->testDetect2Chars($text, '/', '/', 0, 0, 0, undef, 0, 'Comment', 'Comment')) {
1208 return 1
1209 }
1210 # attribute => 'String'
1211 # char => '"'
1212 # context => 'String'
1213 # type => 'DetectChar'
1214 if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String', 'String')) {
1215 return 1
1216 }
1217 # String => '\\$'
1218 # attribute => 'Special Char'
1219 # context => '#stay'
1220 # type => 'RegExpr'
1221 if ($self->testRegExpr($text, '\\\\$', 0, 0, 0, undef, 0, '#stay', 'Special Char')) {
1222 return 1
1223 }
1224 # String => 'mupprintcommands'
1225 # attribute => 'Print Command'
1226 # context => 'Print Command'
1227 # type => 'keyword'
1228 if ($self->testKeyword($text, 'mupprintcommands', 0, undef, 0, 'Print Command', 'Print Command')) {
1229 return 1
1230 }
1231 # String => 'mupfontnames'
1232 # attribute => 'Print Command'
1233 # context => 'Print Command'
1234 # type => 'keyword'
1235 if ($self->testKeyword($text, 'mupfontnames', 0, undef, 0, 'Print Command', 'Print Command')) {
1236 return 1
1237 }
1238 # String => 'mupfontstyles'
1239 # attribute => 'Print Command'
1240 # context => 'Print Command'
1241 # type => 'keyword'
1242 if ($self->testKeyword($text, 'mupfontstyles', 0, undef, 0, 'Print Command', 'Print Command')) {
1243 return 1
1244 }
1245 # String => '\b((ragged|justified)\s+)?paragraph\b'
1246 # attribute => 'Print Command'
1247 # context => 'Print Command'
1248 # type => 'RegExpr'
1249 if ($self->testRegExpr($text, '\\b((ragged|justified)\\s+)?paragraph\\b', 0, 0, 0, undef, 0, 'Print Command', 'Print Command')) {
1250 return 1
1251 }
1252 # String => 'mupprintspecifiers'
1253 # attribute => 'Print Command'
1254 # context => '#stay'
1255 # type => 'keyword'
1256 if ($self->testKeyword($text, 'mupprintspecifiers', 0, undef, 0, '#stay', 'Print Command')) {
1257 return 1
1258 }
1259 # String => 'mupgraphics'
1260 # attribute => 'Print Command'
1261 # context => '#stay'
1262 # type => 'keyword'
1263 if ($self->testKeyword($text, 'mupgraphics', 0, undef, 0, '#stay', 'Print Command')) {
1264 return 1
1265 }
1266 # String => 'muplocations'
1267 # attribute => 'Print Command'
1268 # context => '#stay'
1269 # type => 'keyword'
1270 if ($self->testKeyword($text, 'muplocations', 0, undef, 0, '#stay', 'Print Command')) {
1271 return 1
1272 }
1273 # String => '\bdist(?=\s+[^=])'
1274 # attribute => 'Print Command'
1275 # context => '#stay'
1276 # type => 'RegExpr'
1277 if ($self->testRegExpr($text, '\\bdist(?=\\s+[^=])', 0, 0, 0, undef, 0, '#stay', 'Print Command')) {
1278 return 1
1279 }
1280 # String => 'mupparameters'
1281 # attribute => 'Parameter'
1282 # context => 'Parameter'
1283 # type => 'keyword'
1284 if ($self->testKeyword($text, 'mupparameters', 0, undef, 0, 'Parameter', 'Parameter')) {
1285 return 1
1286 }
1287 # String => '\[(?=(grace|xnote|cue|diam|with|slash|up|down|len|pad|ho|dist|hs|c\b|=))'
1288 # attribute => 'Special Char'
1289 # context => 'Bracket'
1290 # type => 'RegExpr'
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')) {
1292 return 1
1293 }
1294 # attribute => 'Special Char'
1295 # char => '}'
1296 # context => 'Tuplet'
1297 # type => 'DetectChar'
1298 if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, 'Tuplet', 'Special Char')) {
1299 return 1
1300 }
1301 # String => '[]{'
1302 # attribute => 'Special Char'
1303 # context => '#stay'
1304 # type => 'AnyChar'
1305 if ($self->testAnyChar($text, '[]{', 0, 0, undef, 0, '#stay', 'Special Char')) {
1306 return 1
1307 }
1308 # String => '(<<|>>)'
1309 # attribute => 'Special Char'
1310 # context => '#stay'
1311 # type => 'RegExpr'
1312 if ($self->testRegExpr($text, '(<<|>>)', 0, 0, 0, undef, 0, '#stay', 'Special Char')) {
1313 return 1
1314 }
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'
1317 # context => 'Note'
1318 # type => 'RegExpr'
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')) {
1320 return 1
1321 }
1322 # String => ';\s*(?=[~=<]|\b(bm|es?bm|dashed|dotted|tie|slur|alt|hs|ifn?def|else|elseif|endif)\b)'
1323 # attribute => 'Normal Text'
1324 # context => 'Note'
1325 # type => 'RegExpr'
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')) {
1327 return 1
1328 }
1329 # String => '(1/4|1/2|1|2|4|8|16|32|64|128|256)?mu?[rs]+\s*(?=;)'
1330 # attribute => 'Note'
1331 # context => '#stay'
1332 # type => 'RegExpr'
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')) {
1334 return 1
1335 }
1336 # String => 'm\s*rpt\s*(?=;)'
1337 # attribute => 'Note'
1338 # context => '#stay'
1339 # type => 'RegExpr'
1340 if ($self->testRegExpr($text, 'm\\s*rpt\\s*(?=;)', 0, 0, 0, undef, 0, '#stay', 'Note')) {
1341 return 1
1342 }
1343 # String => '=([a-z]|_[a-z][a-z_0-9]*)\b'
1344 # attribute => 'Location'
1345 # context => '#stay'
1346 # type => 'RegExpr'
1347 if ($self->testRegExpr($text, '=([a-z]|_[a-z][a-z_0-9]*)\\b', 0, 0, 0, undef, 0, '#stay', 'Location')) {
1348 return 1
1349 }
1350 # String => '([a-z]|_[a-z][a-z_0-9]*)\.[xynews]\b'
1351 # attribute => 'Location'
1352 # context => 'Location'
1353 # type => 'RegExpr'
1354 if ($self->testRegExpr($text, '([a-z]|_[a-z][a-z_0-9]*)\\.[xynews]\\b', 0, 0, 0, undef, 0, 'Location', 'Location')) {
1355 return 1
1356 }
1357 # String => '([a-z]|_[a-z][a-z_0-9]*)\.(?=[A-Z])'
1358 # attribute => 'Location Probably'
1359 # context => '#stay'
1360 # type => 'RegExpr'
1361 if ($self->testRegExpr($text, '([a-z]|_[a-z][a-z_0-9]*)\\.(?=[A-Z])', 0, 0, 0, undef, 0, '#stay', 'Location Probably')) {
1362 return 1
1363 }
1364 # String => '[(,]\s*(?=([h-qt-z]|_[a-z][a-z_0-9]*)\s*[,)])'
1365 # attribute => 'Normal Text'
1366 # context => 'Location Probably'
1367 # type => 'RegExpr'
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')) {
1369 return 1
1370 }
1371 # String => '[(,]\s*(?=[a-grs]\s*[,)])'
1372 # attribute => 'Normal Text'
1373 # context => 'Note Probably'
1374 # type => 'RegExpr'
1375 if ($self->testRegExpr($text, '[(,]\\s*(?=[a-grs]\\s*[,)])', 0, 0, 0, undef, 0, 'Note Probably', 'Normal Text')) {
1376 return 1
1377 }
1378 # context => 'Macro'
1379 # type => 'IncludeRules'
1380 if ($self->includeRules('Macro', $text)) {
1381 return 1
1382 }
1383 # String => '[0-9.]*\s*til\s*(([0-9]+m(\s*\+\s*[0-9.]+)?)|[0-9.]+)\s*;'
1384 # attribute => 'Normal Text'
1385 # context => '#stay'
1386 # type => 'RegExpr'
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')) {
1388 return 1
1389 }
1390 # String => '[0-9]*[a-z_]+'
1391 # attribute => 'Error'
1392 # context => '#stay'
1393 # type => 'RegExpr'
1394 if ($self->testRegExpr($text, '[0-9]*[a-z_]+', 0, 0, 0, undef, 0, '#stay', 'Error')) {
1395 return 1
1396 }
1397 return 0;
1398};
1399
1400sub parseNote {
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'
1405 # type => 'RegExpr'
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')) {
1407 return 1
1408 }
1409 # String => '^(/|[a-g]([+-]*|[0-7]))'
1410 # attribute => 'Note Attribute'
1411 # context => '#stay'
1412 # type => 'RegExpr'
1413 if ($self->testRegExpr($text, '^(/|[a-g]([+-]*|[0-7]))', 0, 0, 0, undef, 0, '#stay', 'Note Attribute')) {
1414 return 1
1415 }
1416 # String => '\bbm\b(\s+with\s+staff\s+(below|above)\b)?'
1417 # attribute => 'Note Attribute'
1418 # context => '#stay'
1419 # type => 'RegExpr'
1420 if ($self->testRegExpr($text, '\\bbm\\b(\\s+with\\s+staff\\s+(below|above)\\b)?', 0, 0, 0, undef, 0, '#stay', 'Note Attribute')) {
1421 return 1
1422 }
1423 # String => '\bes?bm\b'
1424 # attribute => 'Note Attribute'
1425 # context => '#stay'
1426 # type => 'RegExpr'
1427 if ($self->testRegExpr($text, '\\bes?bm\\b', 0, 0, 0, undef, 0, '#stay', 'Note Attribute')) {
1428 return 1
1429 }
1430 # String => '\balt\s+[1-9]\b'
1431 # attribute => 'Note Attribute'
1432 # context => '#stay'
1433 # type => 'RegExpr'
1434 if ($self->testRegExpr($text, '\\balt\\s+[1-9]\\b', 0, 0, 0, undef, 0, '#stay', 'Note Attribute')) {
1435 return 1
1436 }
1437 # String => '\bhs\s+'
1438 # attribute => 'Note Attribute'
1439 # context => '#stay'
1440 # type => 'RegExpr'
1441 if ($self->testRegExpr($text, '\\bhs\\s+', 0, 0, 0, undef, 0, '#stay', 'Note Attribute')) {
1442 return 1
1443 }
1444 # attribute => 'String'
1445 # char => '"'
1446 # context => 'String'
1447 # type => 'DetectChar'
1448 if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String', 'String')) {
1449 return 1
1450 }
1451 # context => 'Macro'
1452 # type => 'IncludeRules'
1453 if ($self->includeRules('Macro', $text)) {
1454 return 1
1455 }
1456 return 0;
1457};
1458
1459sub parseNoteProbably {
1460 my ($self, $text) = @_;
1461 # String => '[a-grs]*'
1462 # attribute => 'Note'
1463 # context => '#pop'
1464 # type => 'RegExpr'
1465 if ($self->testRegExpr($text, '[a-grs]*', 0, 0, 0, undef, 0, '#pop', 'Note')) {
1466 return 1
1467 }
1468 return 0;
1469};
1470
1471sub parseParameter {
1472 my ($self, $text) = @_;
1473 # attribute => 'Normal Text'
1474 # char => '='
1475 # context => 'Value'
1476 # type => 'DetectChar'
1477 if ($self->testDetectChar($text, '=', 0, 0, 0, undef, 0, 'Value', 'Normal Text')) {
1478 return 1
1479 }
1480 # String => '\s+'
1481 # attribute => 'Parameter'
1482 # context => '#stay'
1483 # type => 'RegExpr'
1484 if ($self->testRegExpr($text, '\\s+', 0, 0, 0, undef, 0, '#stay', 'Parameter')) {
1485 return 1
1486 }
1487 return 0;
1488};
1489
1490sub parsePrintCommand {
1491 my ($self, $text) = @_;
1492 # type => 'DetectSpaces'
1493 if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) {
1494 return 1
1495 }
1496 # String => 'mupfontstyles'
1497 # attribute => 'Print Command'
1498 # context => '#stay'
1499 # type => 'keyword'
1500 if ($self->testKeyword($text, 'mupfontstyles', 0, undef, 0, '#stay', 'Print Command')) {
1501 return 1
1502 }
1503 # String => '\bnl\b'
1504 # attribute => 'Print Command'
1505 # context => '#stay'
1506 # type => 'RegExpr'
1507 if ($self->testRegExpr($text, '\\bnl\\b', 0, 0, 0, undef, 0, '#stay', 'Print Command')) {
1508 return 1
1509 }
1510 # String => '\([0-9]+\)'
1511 # attribute => 'Print Command'
1512 # context => '#pop'
1513 # type => 'RegExpr'
1514 if ($self->testRegExpr($text, '\\([0-9]+\\)', 0, 0, 0, undef, 0, '#pop', 'Print Command')) {
1515 return 1
1516 }
1517 return 0;
1518};
1519
1520sub parseSpecialChar {
1521 my ($self, $text) = @_;
1522 # attribute => 'String Special'
1523 # char => ')'
1524 # context => '#pop'
1525 # type => 'DetectChar'
1526 if ($self->testDetectChar($text, ')', 0, 0, 0, undef, 0, '#pop', 'String Special')) {
1527 return 1
1528 }
1529 # String => 'mupspecialchars'
1530 # attribute => 'String Special'
1531 # context => '#stay'
1532 # type => 'keyword'
1533 if ($self->testKeyword($text, 'mupspecialchars', 0, undef, 0, '#stay', 'String Special')) {
1534 return 1
1535 }
1536 # String => 'mupmusicchars'
1537 # attribute => 'String Special'
1538 # context => '#stay'
1539 # type => 'keyword'
1540 if ($self->testKeyword($text, 'mupmusicchars', 0, undef, 0, '#stay', 'String Special')) {
1541 return 1
1542 }
1543 # String => '[AaEeOo]['`:^~](?=\))'
1544 # attribute => 'String Special'
1545 # context => '#stay'
1546 # type => 'RegExpr'
1547 if ($self->testRegExpr($text, '[AaEeOo][\'`:^~](?=\\))', 0, 0, 0, undef, 0, '#stay', 'String Special')) {
1548 return 1
1549 }
1550 # String => '[IiUu]['`:^](?=\))'
1551 # attribute => 'String Special'
1552 # context => '#stay'
1553 # type => 'RegExpr'
1554 if ($self->testRegExpr($text, '[IiUu][\'`:^](?=\\))', 0, 0, 0, undef, 0, '#stay', 'String Special')) {
1555 return 1
1556 }
1557 # String => '[Nn]~(?=\))'
1558 # attribute => 'String Special'
1559 # context => '#stay'
1560 # type => 'RegExpr'
1561 if ($self->testRegExpr($text, '[Nn]~(?=\\))', 0, 0, 0, undef, 0, '#stay', 'String Special')) {
1562 return 1
1563 }
1564 # String => '[Yy]:(?=\))'
1565 # attribute => 'String Special'
1566 # context => '#stay'
1567 # type => 'RegExpr'
1568 if ($self->testRegExpr($text, '[Yy]:(?=\\))', 0, 0, 0, undef, 0, '#stay', 'String Special')) {
1569 return 1
1570 }
1571 # String => '[LlOo]/(?=\))'
1572 # attribute => 'String Special'
1573 # context => '#stay'
1574 # type => 'RegExpr'
1575 if ($self->testRegExpr($text, '[LlOo]/(?=\\))', 0, 0, 0, undef, 0, '#stay', 'String Special')) {
1576 return 1
1577 }
1578 # String => '[Cc],(?=\))'
1579 # attribute => 'String Special'
1580 # context => '#stay'
1581 # type => 'RegExpr'
1582 if ($self->testRegExpr($text, '[Cc],(?=\\))', 0, 0, 0, undef, 0, '#stay', 'String Special')) {
1583 return 1
1584 }
1585 # String => '(>>|<<|``|'')(?=\))'
1586 # attribute => 'String Special'
1587 # context => '#stay'
1588 # type => 'RegExpr'
1589 if ($self->testRegExpr($text, '(>>|<<|``|\'\')(?=\\))', 0, 0, 0, undef, 0, '#stay', 'String Special')) {
1590 return 1
1591 }
1592 # String => '[^)"]+'
1593 # attribute => 'String Error'
1594 # context => '#stay'
1595 # type => 'RegExpr'
1596 if ($self->testRegExpr($text, '[^)"]+', 0, 0, 0, undef, 0, '#stay', 'String Error')) {
1597 return 1
1598 }
1599 return 0;
1600};
1601
1602sub parseString {
1603 my ($self, $text) = @_;
1604 # attribute => 'String'
1605 # char => '"'
1606 # context => '#pop'
1607 # type => 'DetectChar'
1608 if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) {
1609 return 1
1610 }
1611 # String => '[\\][][{}%#"nb|^:,\\/ ]'
1612 # attribute => 'String Special'
1613 # context => '#stay'
1614 # type => 'RegExpr'
1615 if ($self->testRegExpr($text, '[\\\\][][{}%#"nb|^:,\\\\/ ]', 0, 0, 0, undef, 0, '#stay', 'String Special')) {
1616 return 1
1617 }
1618 # String => '\('
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')) {
1623 return 1
1624 }
1625 # String => '\f('
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')) {
1630 return 1
1631 }
1632 # String => '\s('
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')) {
1637 return 1
1638 }
1639 # String => '\\v\(-?[0-9]{1,3}\)'
1640 # attribute => 'String Special'
1641 # context => '#stay'
1642 # type => 'RegExpr'
1643 if ($self->testRegExpr($text, '\\\\v\\(-?[0-9]{1,3}\\)', 0, 0, 0, undef, 0, '#stay', 'String Special')) {
1644 return 1
1645 }
1646 # String => '[~<>|^]'
1647 # attribute => 'String Lyrics'
1648 # context => '#stay'
1649 # type => 'RegExpr'
1650 if ($self->testRegExpr($text, '[~<>|^]', 0, 0, 0, undef, 0, '#stay', 'String Lyrics')) {
1651 return 1
1652 }
1653 # String => '[-+]?[0-9]+\|'
1654 # attribute => 'String Lyrics'
1655 # context => '#stay'
1656 # type => 'RegExpr'
1657 if ($self->testRegExpr($text, '[-+]?[0-9]+\\|', 0, 0, 0, undef, 0, '#stay', 'String Lyrics')) {
1658 return 1
1659 }
1660 return 0;
1661};
1662
1663sub parseTuplet {
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'
1667 # context => '#pop'
1668 # type => 'RegExpr'
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')) {
1670 return 1
1671 }
1672 return 0;
1673};
1674
1675sub parseUnset {
1676 my ($self, $text) = @_;
1677 # String => 'mupparameters'
1678 # attribute => 'Parameter'
1679 # context => '#stay'
1680 # type => 'keyword'
1681 if ($self->testKeyword($text, 'mupparameters', 0, undef, 0, '#stay', 'Parameter')) {
1682 return 1
1683 }
1684 # String => '[\s,]+'
1685 # attribute => 'Normal Text'
1686 # context => '#stay'
1687 # type => 'RegExpr'
1688 if ($self->testRegExpr($text, '[\\s,]+', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) {
1689 return 1
1690 }
1691 # String => '\w+'
1692 # attribute => 'Error'
1693 # context => '#pop'
1694 # type => 'RegExpr'
1695 if ($self->testRegExpr($text, '\\w+', 0, 0, 0, undef, 0, '#pop', 'Error')) {
1696 return 1
1697 }
1698 return 0;
1699};
1700
1701sub parseValue {
1702 my ($self, $text) = @_;
1703 # attribute => 'Normal Text'
1704 # char => ';'
1705 # context => '#pop'
1706 # type => 'DetectChar'
1707 if ($self->testDetectChar($text, ';', 0, 0, 0, undef, 0, '#pop', 'Normal Text')) {
1708 return 1
1709 }
1710 # String => '[\s,&()-]+'
1711 # attribute => 'Normal Text'
1712 # context => '#stay'
1713 # type => 'RegExpr'
1714 if ($self->testRegExpr($text, '[\\s,&()-]+', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) {
1715 return 1
1716 }
1717 # String => 'mupvalues'
1718 # attribute => 'Value'
1719 # context => '#stay'
1720 # type => 'keyword'
1721 if ($self->testKeyword($text, 'mupvalues', 0, undef, 0, '#stay', 'Value')) {
1722 return 1
1723 }
1724 # String => 'mupfontnames'
1725 # attribute => 'Value'
1726 # context => '#pop'
1727 # type => 'keyword'
1728 if ($self->testKeyword($text, 'mupfontnames', 0, undef, 0, '#pop', 'Value')) {
1729 return 1
1730 }
1731 # String => 'mupfontstyles'
1732 # attribute => 'Value'
1733 # context => '#pop'
1734 # type => 'keyword'
1735 if ($self->testKeyword($text, 'mupfontstyles', 0, undef, 0, '#pop', 'Value')) {
1736 return 1
1737 }
1738 # String => '\b[1-9][0-9]*/(1|2|4|8|16|32|64|128)n?\b'
1739 # attribute => 'Value'
1740 # context => '#stay'
1741 # type => 'RegExpr'
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')) {
1743 return 1
1744 }
1745 # String => '\b[a-g][#&]?'?([0-9]\b)?'
1746 # attribute => 'Value'
1747 # context => '#stay'
1748 # type => 'RegExpr'
1749 if ($self->testRegExpr($text, '\\b[a-g][#&]?\'?([0-9]\\b)?', 0, 0, 0, undef, 0, '#stay', 'Value')) {
1750 return 1
1751 }
1752 # String => '[0-7][#&]'
1753 # attribute => 'Value'
1754 # context => '#stay'
1755 # type => 'RegExpr'
1756 if ($self->testRegExpr($text, '[0-7][#&]', 0, 0, 0, undef, 0, '#stay', 'Value')) {
1757 return 1
1758 }
1759 # String => 'r\b'
1760 # attribute => 'Value'
1761 # context => '#stay'
1762 # type => 'RegExpr'
1763 if ($self->testRegExpr($text, 'r\\b', 0, 0, 0, undef, 0, '#stay', 'Value')) {
1764 return 1
1765 }
1766 # attribute => 'Value'
1767 # context => '#stay'
1768 # type => 'Float'
1769 if ($self->testFloat($text, 0, undef, 0, '#stay', 'Value')) {
1770 return 1
1771 }
1772 # attribute => 'Value'
1773 # context => '#stay'
1774 # type => 'Int'
1775 if ($self->testInt($text, 0, undef, 0, '#stay', 'Value')) {
1776 return 1
1777 }
1778 # attribute => 'String'
1779 # char => '"'
1780 # context => 'String'
1781 # type => 'DetectChar'
1782 if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String', 'String')) {
1783 return 1
1784 }
1785 # context => 'Macro'
1786 # type => 'IncludeRules'
1787 if ($self->includeRules('Macro', $text)) {
1788 return 1
1789 }
1790 # String => '[a-z][a-z0-9]*'
1791 # attribute => 'Error'
1792 # context => '#stay'
1793 # type => 'RegExpr'
1794 if ($self->testRegExpr($text, '[a-z][a-z0-9]*', 0, 0, 0, undef, 0, '#stay', 'Error')) {
1795 return 1
1796 }
1797 return 0;
1798};
1799
1800
18011;
1802
1803__END__
1804
1805=head1 NAME
1806
1807Syntax::Highlight::Engine::Kate::Music_Publisher - a Plugin for Music Publisher syntax highlighting
1808
1809=head1 SYNOPSIS
1810
1811 require Syntax::Highlight::Engine::Kate::Music_Publisher;
1812 my $sh = new Syntax::Highlight::Engine::Kate::Music_Publisher([
1813 ]);
1814
1815=head1 DESCRIPTION
1816
1817Syntax::Highlight::Engine::Kate::Music_Publisher is a plugin module that provides syntax highlighting
1818for Music Publisher to the Syntax::Haghlight::Engine::Kate highlighting engine.
1819
1820This code is generated from the syntax definition files used
1821by the Kate project.
1822It works quite fine, but can use refinement and optimization.
1823
1824It inherits Syntax::Higlight::Engine::Kate::Template. See also there.
1825
1826=cut
1827
1828=head1 AUTHOR
1829
1830Hans Jeuken (haje <at> toneel <dot> demon <dot> nl)
1831
1832=cut
1833
1834=head1 BUGS
1835
1836Unknown. If you find any, please contact the author
1837
1838=cut
1839