File Coverage

blib/lib/Syntax/Highlight/Engine/Kate/Bash.pm
Criterion Covered Total %
statement 347 469 73.9
branch 255 358 71.2
condition 1 3 33.3
subroutine 38 48 79.1
pod 0 45 0.0
total 641 923 69.4


line stmt bran cond sub pod time code
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 'bash.xml' file of the syntax highlight
6             # engine of the kate text editor (http://www.kate-editor.org
7              
8             #kate xml version 2.05
9             #kate version 2.4
10             #kate author Wilbert Berendsen (wilbert@kde.nl)
11             #generated: Sun Feb 3 22:02:04 2008, localtime
12              
13             package Syntax::Highlight::Engine::Kate::Bash;
14              
15             our $VERSION = '0.16';
16              
17 1     1   1175 use strict;
  1         2  
  1         38  
18 1     1   5 use warnings;
  1         3  
  1         79  
19 1     1   8 use base('Syntax::Highlight::Engine::Kate::Template');
  1         2  
  1         4724  
20              
21             sub new {
22 2     2 0 1564 my $proto = shift;
23 2   33     22 my $class = ref($proto) || $proto;
24 2         56 my $self = $class->SUPER::new(@_);
25 2         71 $self->attributes({
26             'Backquote' => 'Keyword',
27             'Builtin' => 'Reserved',
28             'Command' => 'BString',
29             'Comment' => 'Comment',
30             'Control' => 'Keyword',
31             'Escape' => 'DataType',
32             'Expression' => 'Others',
33             'Function' => 'Char',
34             'Keyword' => 'Keyword',
35             'Normal Text' => 'Normal',
36             'Option' => 'Normal',
37             'Path' => 'Normal',
38             'Redirection' => 'Operator',
39             'String DoubleQ' => 'String',
40             'String Escape' => 'DataType',
41             'String SingleQ' => 'String',
42             'String Transl.' => 'String',
43             'Variable' => 'Others',
44             });
45 2         21 $self->listAdd('builtins',
46             '.',
47             ':',
48             'alias',
49             'bg',
50             'bind',
51             'break',
52             'builtin',
53             'cd',
54             'command',
55             'compgen',
56             'complete',
57             'continue',
58             'dirs',
59             'disown',
60             'echo',
61             'enable',
62             'eval',
63             'exec',
64             'exit',
65             'fc',
66             'fg',
67             'getopts',
68             'hash',
69             'help',
70             'history',
71             'jobs',
72             'kill',
73             'let',
74             'logout',
75             'popd',
76             'printf',
77             'pushd',
78             'pwd',
79             'return',
80             'set',
81             'shift',
82             'shopt',
83             'source',
84             'suspend',
85             'test',
86             'times',
87             'trap',
88             'type',
89             'ulimit',
90             'umask',
91             'unalias',
92             'wait',
93             );
94 2         11 $self->listAdd('builtins_var',
95             'declare',
96             'export',
97             'local',
98             'read',
99             'readonly',
100             'typeset',
101             'unset',
102             );
103 2         11 $self->listAdd('keywords',
104             '.',
105             'elif',
106             'else',
107             'for',
108             'function',
109             'in',
110             'select',
111             'set',
112             'then',
113             'until',
114             'while',
115             );
116 2         37 $self->listAdd('unixcommands',
117             'aclocal',
118             'aconnect',
119             'aplay',
120             'apm',
121             'apmsleep',
122             'apropos',
123             'ar',
124             'arch',
125             'arecord',
126             'as',
127             'as86',
128             'autoconf',
129             'autoheader',
130             'automake',
131             'awk',
132             'awk',
133             'basename',
134             'bash',
135             'bc',
136             'bison',
137             'bunzip2',
138             'bzcat',
139             'bzcmp',
140             'bzdiff',
141             'bzegrep',
142             'bzfgrep',
143             'bzgrep',
144             'bzip2',
145             'bzip2recover',
146             'bzless',
147             'bzmore',
148             'c++',
149             'cal',
150             'cat',
151             'cat',
152             'cc',
153             'cd-read',
154             'cdda2wav',
155             'cdparanoia',
156             'cdrdao',
157             'cdrecord',
158             'chattr',
159             'chfn',
160             'chgrp',
161             'chgrp',
162             'chmod',
163             'chmod',
164             'chown',
165             'chown',
166             'chroot',
167             'chsh',
168             'chvt',
169             'clear',
170             'cmp',
171             'co',
172             'col',
173             'comm',
174             'cp',
175             'cp',
176             'cpio',
177             'cpp',
178             'cut',
179             'date',
180             'dc',
181             'dcop',
182             'dd',
183             'dd',
184             'deallocvt',
185             'df',
186             'df',
187             'diff',
188             'diff3',
189             'dir',
190             'dir',
191             'dircolors',
192             'dircolors',
193             'directomatic',
194             'dirname',
195             'dmesg',
196             'dnsdomainname',
197             'domainname',
198             'du',
199             'du',
200             'dumpkeys',
201             'echo',
202             'ed',
203             'egrep',
204             'env',
205             'expr',
206             'false',
207             'fbset',
208             'fgconsole',
209             'fgrep',
210             'file',
211             'find',
212             'flex',
213             'flex++',
214             'fmt',
215             'free',
216             'ftp',
217             'funzip',
218             'fuser',
219             'fuser',
220             'g++',
221             'gawk',
222             'gawk',
223             'gc',
224             'gcc',
225             'gdb',
226             'getent',
227             'getkeycodes',
228             'getopt',
229             'gettext',
230             'gettextize',
231             'gimp',
232             'gimp-remote',
233             'gimptool',
234             'gmake',
235             'gocr',
236             'grep',
237             'groups',
238             'gs',
239             'gunzip',
240             'gzexe',
241             'gzip',
242             'head',
243             'hexdump',
244             'hostname',
245             'id',
246             'igawk',
247             'install',
248             'install',
249             'join',
250             'kbd_mode',
251             'kbdrate',
252             'kdialog',
253             'kfile',
254             'kill',
255             'killall',
256             'killall',
257             'last',
258             'lastb',
259             'ld',
260             'ld86',
261             'ldd',
262             'less',
263             'lex',
264             'link',
265             'ln',
266             'ln',
267             'loadkeys',
268             'loadunimap',
269             'locate',
270             'lockfile',
271             'login',
272             'logname',
273             'lp',
274             'lpr',
275             'ls',
276             'ls',
277             'lsattr',
278             'lsmod',
279             'lsmod.old',
280             'lynx',
281             'm4',
282             'make',
283             'man',
284             'mapscrn',
285             'mesg',
286             'mkdir',
287             'mkdir',
288             'mkfifo',
289             'mknod',
290             'mknod',
291             'mktemp',
292             'more',
293             'mount',
294             'msgfmt',
295             'mv',
296             'mv',
297             'namei',
298             'nano',
299             'nasm',
300             'nawk',
301             'netstat',
302             'nice',
303             'nisdomainname',
304             'nl',
305             'nm',
306             'nm86',
307             'nmap',
308             'nohup',
309             'nop',
310             'od',
311             'openvt',
312             'passwd',
313             'patch',
314             'pcregrep',
315             'pcretest',
316             'perl',
317             'perror',
318             'pgawk',
319             'pidof',
320             'pidof',
321             'ping',
322             'pr',
323             'printf',
324             'procmail',
325             'prune',
326             'ps',
327             'ps2ascii',
328             'ps2epsi',
329             'ps2frag',
330             'ps2pdf',
331             'ps2ps',
332             'psbook',
333             'psmerge',
334             'psnup',
335             'psresize',
336             'psselect',
337             'pstops',
338             'pstree',
339             'pwd',
340             'rbash',
341             'rcs',
342             'readlink',
343             'red',
344             'resizecons',
345             'rev',
346             'rm',
347             'rm',
348             'rmdir',
349             'run-parts',
350             'sash',
351             'scp',
352             'sed',
353             'sed',
354             'seq',
355             'setfont',
356             'setkeycodes',
357             'setleds',
358             'setmetamode',
359             'setserial',
360             'setterm',
361             'sh',
362             'showkey',
363             'shred',
364             'shred',
365             'size',
366             'size86',
367             'skill',
368             'sleep',
369             'slogin',
370             'snice',
371             'sort',
372             'sox',
373             'split',
374             'ssed',
375             'ssh',
376             'ssh-add',
377             'ssh-agent',
378             'ssh-keygen',
379             'ssh-keyscan',
380             'stat',
381             'stat',
382             'strings',
383             'strip',
384             'stty',
385             'su',
386             'sudo',
387             'suidperl',
388             'sum',
389             'sync',
390             'tac',
391             'tail',
392             'tar',
393             'tee',
394             'tempfile',
395             'test',
396             'touch',
397             'tr',
398             'true',
399             'umount',
400             'uname',
401             'unicode_start',
402             'unicode_stop',
403             'uniq',
404             'unlink',
405             'unlink',
406             'unzip',
407             'updatedb',
408             'updmap',
409             'uptime',
410             'users',
411             'utmpdump',
412             'uuidgen',
413             'vdir',
414             'vmstat',
415             'w',
416             'wall',
417             'wc',
418             'wc',
419             'wget',
420             'whatis',
421             'whereis',
422             'which',
423             'who',
424             'whoami',
425             'write',
426             'xargs',
427             'xhost',
428             'xmodmap',
429             'xset',
430             'yacc',
431             'yes',
432             'ypdomainname',
433             'zcat',
434             'zcmp',
435             'zdiff',
436             'zegrep',
437             'zfgrep',
438             'zforce',
439             'zgrep',
440             'zip',
441             'zless',
442             'zmore',
443             'znew',
444             'zsh',
445             'zsoelim',
446             );
447 2         331 $self->contextdata({
448             'Assign' => {
449             callback => \&parseAssign,
450             attribute => 'Normal Text',
451             lineending => '#pop',
452             fallthrough => '#pop',
453             },
454             'AssignArray' => {
455             callback => \&parseAssignArray,
456             attribute => 'Normal Text',
457             lineending => '#pop',
458             },
459             'AssignSubscr' => {
460             callback => \&parseAssignSubscr,
461             attribute => 'Normal Text',
462             lineending => '#pop',
463             fallthrough => '#pop',
464             },
465             'Case' => {
466             callback => \&parseCase,
467             attribute => 'Normal Text',
468             },
469             'CaseExpr' => {
470             callback => \&parseCaseExpr,
471             attribute => 'Normal Text',
472             },
473             'CaseIn' => {
474             callback => \&parseCaseIn,
475             attribute => 'Normal Text',
476             },
477             'Comment' => {
478             callback => \&parseComment,
479             attribute => 'Comment',
480             lineending => '#pop',
481             },
482             'CommentBackq' => {
483             callback => \&parseCommentBackq,
484             attribute => 'Comment',
485             lineending => '#pop',
486             },
487             'CommentParen' => {
488             callback => \&parseCommentParen,
489             attribute => 'Comment',
490             lineending => '#pop',
491             },
492             'ExprBracket' => {
493             callback => \&parseExprBracket,
494             attribute => 'Normal Text',
495             },
496             'ExprDblBracket' => {
497             callback => \&parseExprDblBracket,
498             attribute => 'Normal Text',
499             },
500             'ExprDblParen' => {
501             callback => \&parseExprDblParen,
502             attribute => 'Normal Text',
503             },
504             'ExprDblParenSubst' => {
505             callback => \&parseExprDblParenSubst,
506             attribute => 'Normal Text',
507             },
508             'ExprSubParen' => {
509             callback => \&parseExprSubParen,
510             attribute => 'Normal Text',
511             },
512             'FindAll' => {
513             callback => \&parseFindAll,
514             attribute => 'Normal Text',
515             },
516             'FindCommands' => {
517             callback => \&parseFindCommands,
518             attribute => 'Normal Text',
519             },
520             'FindComments' => {
521             callback => \&parseFindComments,
522             attribute => 'Normal Text',
523             lineending => '#pop',
524             },
525             'FindCommentsBackq' => {
526             callback => \&parseFindCommentsBackq,
527             attribute => 'Normal Text',
528             lineending => '#pop',
529             },
530             'FindCommentsParen' => {
531             callback => \&parseFindCommentsParen,
532             attribute => 'Normal Text',
533             lineending => '#pop',
534             },
535             'FindMost' => {
536             callback => \&parseFindMost,
537             attribute => 'Normal Text',
538             },
539             'FindOthers' => {
540             callback => \&parseFindOthers,
541             attribute => 'Normal Text',
542             },
543             'FindStrings' => {
544             callback => \&parseFindStrings,
545             attribute => 'Normal Text',
546             },
547             'FindSubstitutions' => {
548             callback => \&parseFindSubstitutions,
549             attribute => 'Normal Text',
550             },
551             'FunctionDef' => {
552             callback => \&parseFunctionDef,
553             attribute => 'Function',
554             lineending => '#pop',
555             fallthrough => '#pop',
556             },
557             'Group' => {
558             callback => \&parseGroup,
559             attribute => 'Normal Text',
560             },
561             'HereDoc' => {
562             callback => \&parseHereDoc,
563             attribute => 'Normal Text',
564             },
565             'HereDocINQ' => {
566             callback => \&parseHereDocINQ,
567             attribute => 'Normal Text',
568             dynamic => 1,
569             },
570             'HereDocIQ' => {
571             callback => \&parseHereDocIQ,
572             attribute => 'Normal Text',
573             dynamic => 1,
574             },
575             'HereDocNQ' => {
576             callback => \&parseHereDocNQ,
577             attribute => 'Normal Text',
578             dynamic => 1,
579             },
580             'HereDocQ' => {
581             callback => \&parseHereDocQ,
582             attribute => 'Normal Text',
583             dynamic => 1,
584             },
585             'HereDocRemainder' => {
586             callback => \&parseHereDocRemainder,
587             attribute => 'Normal Text',
588             lineending => '#pop',
589             },
590             'ProcessSubst' => {
591             callback => \&parseProcessSubst,
592             attribute => 'Normal Text',
593             },
594             'Start' => {
595             callback => \&parseStart,
596             attribute => 'Normal Text',
597             },
598             'StringDQ' => {
599             callback => \&parseStringDQ,
600             attribute => 'String DoubleQ',
601             },
602             'StringEsc' => {
603             callback => \&parseStringEsc,
604             attribute => 'String SingleQ',
605             },
606             'StringSQ' => {
607             callback => \&parseStringSQ,
608             attribute => 'String SingleQ',
609             },
610             'SubShell' => {
611             callback => \&parseSubShell,
612             attribute => 'Normal Text',
613             },
614             'Subscript' => {
615             callback => \&parseSubscript,
616             attribute => 'Variable',
617             },
618             'SubstBackq' => {
619             callback => \&parseSubstBackq,
620             attribute => 'Normal Text',
621             },
622             'SubstCommand' => {
623             callback => \&parseSubstCommand,
624             attribute => 'Normal Text',
625             },
626             'SubstFile' => {
627             callback => \&parseSubstFile,
628             attribute => 'Normal Text',
629             },
630             'VarBrace' => {
631             callback => \&parseVarBrace,
632             attribute => 'Variable',
633             },
634             'VarName' => {
635             callback => \&parseVarName,
636             attribute => 'Normal Text',
637             lineending => '#pop',
638             fallthrough => '#pop',
639             },
640             });
641 2         21 $self->deliminators('\\s||\\(|\\)|\\!|\\+|,|<|=|>|\\&|\\*|\\/|;|\\?|\\||\\~|\\\\|\\^|\\%|#|\\[|\\]|\\$|\\.|_|\\{|\\}|:|-');
642 2         12 $self->basecontext('Start');
643 2         27 $self->keywordscase(0);
644 2         8 $self->initialize;
645 2         4 bless ($self, $class);
646 2         15 return $self;
647             }
648              
649             sub language {
650 0     0 0 0 return 'Bash';
651             }
652              
653             sub parseAssign {
654 50     50 0 139 my ($self, $text) = @_;
655             # attribute => 'Variable'
656             # char => '('
657             # context => 'AssignArray'
658             # type => 'DetectChar'
659 50 100       250 if ($self->testDetectChar($text, '(', 0, 0, 0, undef, 0, 'AssignArray', 'Variable')) {
660 4         34 return 1
661             }
662             # context => 'FindStrings'
663             # type => 'IncludeRules'
664 46 100       208 if ($self->includeRules('FindStrings', $text)) {
665 10         31 return 1
666             }
667             # context => 'FindSubstitutions'
668             # type => 'IncludeRules'
669 36 100       124 if ($self->includeRules('FindSubstitutions', $text)) {
670 4         15 return 1
671             }
672             # context => 'FindOthers'
673             # type => 'IncludeRules'
674 32 100       140 if ($self->includeRules('FindOthers', $text)) {
675 8         32 return 1
676             }
677             # String => '[\w:,+_./-]+'
678             # attribute => 'Normal Text'
679             # context => '#stay'
680             # type => 'RegExpr'
681 24 100       123 if ($self->testRegExpr($text, '[\\w:,+_./-]+', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) {
682 12         51 return 1
683             }
684 12         43 return 0;
685             };
686              
687             sub parseAssignArray {
688 46     46 0 115 my ($self, $text) = @_;
689             # attribute => 'Variable'
690             # char => ')'
691             # context => '#pop'
692             # type => 'DetectChar'
693 46 100       182 if ($self->testDetectChar($text, ')', 0, 0, 0, undef, 0, '#pop', 'Variable')) {
694 4         15 return 1
695             }
696             # attribute => 'Variable'
697             # char => '['
698             # context => 'Subscript'
699             # type => 'DetectChar'
700 42 100       191 if ($self->testDetectChar($text, '[', 0, 0, 0, undef, 0, 'Subscript', 'Variable')) {
701 4         14 return 1
702             }
703             # attribute => 'Variable'
704             # char => '='
705             # context => 'Assign'
706             # type => 'DetectChar'
707 38 100       116 if ($self->testDetectChar($text, '=', 0, 0, 0, undef, 0, 'Assign', 'Variable')) {
708 4         14 return 1
709             }
710             # context => 'FindMost'
711             # type => 'IncludeRules'
712 34 50       125 if ($self->includeRules('FindMost', $text)) {
713 0         0 return 1
714             }
715 34         103 return 0;
716             };
717              
718             sub parseAssignSubscr {
719 4     4 0 14 my ($self, $text) = @_;
720             # attribute => 'Variable'
721             # char => '['
722             # context => 'Subscript'
723             # type => 'DetectChar'
724 4 100       19 if ($self->testDetectChar($text, '[', 0, 0, 0, undef, 0, 'Subscript', 'Variable')) {
725 2         8 return 1
726             }
727             # attribute => 'Variable'
728             # char => '='
729             # context => 'Assign'
730             # type => 'DetectChar'
731 2 50       12 if ($self->testDetectChar($text, '=', 0, 0, 0, undef, 0, 'Assign', 'Variable')) {
732 2         9 return 1
733             }
734             # context => 'FindStrings'
735             # type => 'IncludeRules'
736 0 0       0 if ($self->includeRules('FindStrings', $text)) {
737 0         0 return 1
738             }
739             # context => 'FindSubstitutions'
740             # type => 'IncludeRules'
741 0 0       0 if ($self->includeRules('FindSubstitutions', $text)) {
742 0         0 return 1
743             }
744             # context => 'FindOthers'
745             # type => 'IncludeRules'
746 0 0       0 if ($self->includeRules('FindOthers', $text)) {
747 0         0 return 1
748             }
749 0         0 return 0;
750             };
751              
752             sub parseCase {
753 6     6 0 18 my ($self, $text) = @_;
754             # String => '\sin\b'
755             # attribute => 'Keyword'
756             # context => 'CaseIn'
757             # type => 'RegExpr'
758 6 100       25 if ($self->testRegExpr($text, '\\sin\\b', 0, 0, 0, undef, 0, 'CaseIn', 'Keyword')) {
759 2         8 return 1
760             }
761             # context => 'FindMost'
762             # type => 'IncludeRules'
763 4 100       20 if ($self->includeRules('FindMost', $text)) {
764 2         7 return 1
765             }
766 2         7 return 0;
767             };
768              
769             sub parseCaseExpr {
770 64     64 0 158 my ($self, $text) = @_;
771             # attribute => 'Keyword'
772             # char => ';'
773             # char1 => ';'
774             # context => '#pop'
775             # endRegion => 'caseexpr'
776             # type => 'Detect2Chars'
777 64 100       296 if ($self->testDetect2Chars($text, ';', ';', 0, 0, 0, undef, 0, '#pop', 'Keyword')) {
778 4         16 return 1
779             }
780             # context => 'FindAll'
781             # type => 'IncludeRules'
782 60 100       240 if ($self->includeRules('FindAll', $text)) {
783 4         32 return 1
784             }
785 56         197 return 0;
786             };
787              
788             sub parseCaseIn {
789 26     26 0 92 my ($self, $text) = @_;
790             # String => '\besac(?=$|[\s;)])'
791             # attribute => 'Keyword'
792             # context => '#pop#pop'
793             # endRegion => 'case'
794             # type => 'RegExpr'
795 26 100       107 if ($self->testRegExpr($text, '\\besac(?=$|[\\s;)])', 0, 0, 0, undef, 0, '#pop#pop', 'Keyword')) {
796 2         9 return 1
797             }
798             # attribute => 'Keyword'
799             # beginRegion => 'caseexpr'
800             # char => ')'
801             # context => 'CaseExpr'
802             # type => 'DetectChar'
803 24 100       110 if ($self->testDetectChar($text, ')', 0, 0, 0, undef, 0, 'CaseExpr', 'Keyword')) {
804 4         14 return 1
805             }
806             # String => '(|'
807             # attribute => 'Keyword'
808             # context => '#stay'
809             # type => 'AnyChar'
810 20 50       106 if ($self->testAnyChar($text, '(|', 0, 0, undef, 0, '#stay', 'Keyword')) {
811 0         0 return 1
812             }
813             # context => 'FindMost'
814             # type => 'IncludeRules'
815 20 50       79 if ($self->includeRules('FindMost', $text)) {
816 0         0 return 1
817             }
818 20         63 return 0;
819             };
820              
821             sub parseComment {
822 2470     2470 0 5701 my ($self, $text) = @_;
823             # context => '##Alerts'
824             # type => 'IncludeRules'
825 2470 50       7214 if ($self->includePlugin('Alerts', $text)) {
826 0         0 return 1
827             }
828 2470         6320 return 0;
829             };
830              
831             sub parseCommentBackq {
832 0     0 0 0 my ($self, $text) = @_;
833             # String => '[^`](?=`)'
834             # attribute => 'Comment'
835             # context => '#pop'
836             # type => 'RegExpr'
837 0 0       0 if ($self->testRegExpr($text, '[^`](?=`)', 0, 0, 0, undef, 0, '#pop', 'Comment')) {
838 0         0 return 1
839             }
840             # context => '##Alerts'
841             # type => 'IncludeRules'
842 0 0       0 if ($self->includePlugin('Alerts', $text)) {
843 0         0 return 1
844             }
845 0         0 return 0;
846             };
847              
848             sub parseCommentParen {
849 0     0 0 0 my ($self, $text) = @_;
850             # String => '[^)](?=\))'
851             # attribute => 'Comment'
852             # context => '#pop'
853             # type => 'RegExpr'
854 0 0       0 if ($self->testRegExpr($text, '[^)](?=\\))', 0, 0, 0, undef, 0, '#pop', 'Comment')) {
855 0         0 return 1
856             }
857             # context => '##Alerts'
858             # type => 'IncludeRules'
859 0 0       0 if ($self->includePlugin('Alerts', $text)) {
860 0         0 return 1
861             }
862 0         0 return 0;
863             };
864              
865             sub parseExprBracket {
866 56     56 0 127 my ($self, $text) = @_;
867             # String => '\s\](?=($|[\s;|&]))'
868             # attribute => 'Builtin'
869             # context => '#pop'
870             # endRegion => 'expression'
871             # type => 'RegExpr'
872 56 100       210 if ($self->testRegExpr($text, '\\s\\](?=($|[\\s;|&]))', 0, 0, 0, undef, 0, '#pop', 'Builtin')) {
873 6         24 return 1
874             }
875             # String => '\](?=($|[\s;|&]))'
876             # attribute => 'Builtin'
877             # column => '0'
878             # context => '#pop'
879             # endRegion => 'expression'
880             # type => 'RegExpr'
881 50 50       219 if ($self->testRegExpr($text, '\\](?=($|[\\s;|&]))', 0, 0, 0, 0, 0, '#pop', 'Builtin')) {
882 0         0 return 1
883             }
884             # attribute => 'Normal Text'
885             # char => '('
886             # context => 'ExprSubParen'
887             # type => 'DetectChar'
888 50 50       201 if ($self->testDetectChar($text, '(', 0, 0, 0, undef, 0, 'ExprSubParen', 'Normal Text')) {
889 0         0 return 1
890             }
891             # context => 'FindMost'
892             # type => 'IncludeRules'
893 50 100       179 if ($self->includeRules('FindMost', $text)) {
894 10         35 return 1
895             }
896 40         109 return 0;
897             };
898              
899             sub parseExprDblBracket {
900 16     16 0 37 my ($self, $text) = @_;
901             # String => '\s\]\](?=($|[\s;|&]))'
902             # attribute => 'Keyword'
903             # context => '#pop'
904             # endRegion => 'expression'
905             # type => 'RegExpr'
906 16 100       87 if ($self->testRegExpr($text, '\\s\\]\\](?=($|[\\s;|&]))', 0, 0, 0, undef, 0, '#pop', 'Keyword')) {
907 2         8 return 1
908             }
909             # String => '\]\](?=($|[\s;|&]))'
910             # attribute => 'Keyword'
911             # column => '0'
912             # context => '#pop'
913             # endRegion => 'expression'
914             # type => 'RegExpr'
915 14 50       59 if ($self->testRegExpr($text, '\\]\\](?=($|[\\s;|&]))', 0, 0, 0, 0, 0, '#pop', 'Keyword')) {
916 0         0 return 1
917             }
918             # attribute => 'Normal Text'
919             # char => '('
920             # context => 'ExprSubParen'
921             # type => 'DetectChar'
922 14 50       82 if ($self->testDetectChar($text, '(', 0, 0, 0, undef, 0, 'ExprSubParen', 'Normal Text')) {
923 0         0 return 1
924             }
925             # context => 'FindMost'
926             # type => 'IncludeRules'
927 14 100       59 if ($self->includeRules('FindMost', $text)) {
928 2         18 return 1
929             }
930 12         37 return 0;
931             };
932              
933             sub parseExprDblParen {
934 0     0 0 0 my ($self, $text) = @_;
935             # attribute => 'Keyword'
936             # char => ')'
937             # char1 => ')'
938             # context => '#pop'
939             # endRegion => 'expression'
940             # type => 'Detect2Chars'
941 0 0       0 if ($self->testDetect2Chars($text, ')', ')', 0, 0, 0, undef, 0, '#pop', 'Keyword')) {
942 0         0 return 1
943             }
944             # attribute => 'Normal Text'
945             # char => '('
946             # context => 'ExprSubParen'
947             # type => 'DetectChar'
948 0 0       0 if ($self->testDetectChar($text, '(', 0, 0, 0, undef, 0, 'ExprSubParen', 'Normal Text')) {
949 0         0 return 1
950             }
951             # context => 'FindMost'
952             # type => 'IncludeRules'
953 0 0       0 if ($self->includeRules('FindMost', $text)) {
954 0         0 return 1
955             }
956 0         0 return 0;
957             };
958              
959             sub parseExprDblParenSubst {
960 46     46 0 113 my ($self, $text) = @_;
961             # attribute => 'Variable'
962             # char => ')'
963             # char1 => ')'
964             # context => '#pop'
965             # endRegion => 'expression'
966             # type => 'Detect2Chars'
967 46 100       196 if ($self->testDetect2Chars($text, ')', ')', 0, 0, 0, undef, 0, '#pop', 'Variable')) {
968 4         17 return 1
969             }
970             # attribute => 'Normal Text'
971             # char => '('
972             # context => 'ExprSubParen'
973             # type => 'DetectChar'
974 42 50       207 if ($self->testDetectChar($text, '(', 0, 0, 0, undef, 0, 'ExprSubParen', 'Normal Text')) {
975 0         0 return 1
976             }
977             # context => 'FindMost'
978             # type => 'IncludeRules'
979 42 100       170 if ($self->includeRules('FindMost', $text)) {
980 4         13 return 1
981             }
982 38         133 return 0;
983             };
984              
985             sub parseExprSubParen {
986 0     0 0 0 my ($self, $text) = @_;
987             # attribute => 'Normal Text'
988             # char => ')'
989             # context => '#pop'
990             # type => 'DetectChar'
991 0 0       0 if ($self->testDetectChar($text, ')', 0, 0, 0, undef, 0, '#pop', 'Normal Text')) {
992 0         0 return 1
993             }
994             # attribute => 'Normal Text'
995             # char => '('
996             # context => 'ExprSubParen'
997             # type => 'DetectChar'
998 0 0       0 if ($self->testDetectChar($text, '(', 0, 0, 0, undef, 0, 'ExprSubParen', 'Normal Text')) {
999 0         0 return 1
1000             }
1001             # context => 'FindMost'
1002             # type => 'IncludeRules'
1003 0 0       0 if ($self->includeRules('FindMost', $text)) {
1004 0         0 return 1
1005             }
1006 0         0 return 0;
1007             };
1008              
1009             sub parseFindAll {
1010 986     986 0 2424 my ($self, $text) = @_;
1011             # context => 'FindComments'
1012             # type => 'IncludeRules'
1013 986 100       3216 if ($self->includeRules('FindComments', $text)) {
1014 72         270 return 1
1015             }
1016             # context => 'FindCommands'
1017             # type => 'IncludeRules'
1018 914 100       3790 if ($self->includeRules('FindCommands', $text)) {
1019 176         836 return 1
1020             }
1021             # context => 'FindStrings'
1022             # type => 'IncludeRules'
1023 738 100       3387 if ($self->includeRules('FindStrings', $text)) {
1024 22         101 return 1
1025             }
1026             # context => 'FindSubstitutions'
1027             # type => 'IncludeRules'
1028 716 100       2462 if ($self->includeRules('FindSubstitutions', $text)) {
1029 54         262 return 1
1030             }
1031             # context => 'FindOthers'
1032             # type => 'IncludeRules'
1033 662 100       3108 if ($self->includeRules('FindOthers', $text)) {
1034 38         265 return 1
1035             }
1036 624         2912 return 0;
1037             };
1038              
1039             sub parseFindCommands {
1040 1030     1030 0 2613 my ($self, $text) = @_;
1041             # attribute => 'Keyword'
1042             # beginRegion => 'expression'
1043             # char => '('
1044             # char1 => '('
1045             # context => 'ExprDblParen'
1046             # type => 'Detect2Chars'
1047 1030 50       4525 if ($self->testDetect2Chars($text, '(', '(', 0, 0, 0, undef, 0, 'ExprDblParen', 'Keyword')) {
1048 0         0 return 1
1049             }
1050             # String => '\[\[(?=($|\s))'
1051             # attribute => 'Keyword'
1052             # beginRegion => 'expression'
1053             # column => '0'
1054             # context => 'ExprDblBracket'
1055             # type => 'RegExpr'
1056 1030 50       4293 if ($self->testRegExpr($text, '\\[\\[(?=($|\\s))', 0, 0, 0, 0, 0, 'ExprDblBracket', 'Keyword')) {
1057 0         0 return 1
1058             }
1059             # String => '\s\[\[(?=($|\s))'
1060             # attribute => 'Keyword'
1061             # beginRegion => 'expression'
1062             # context => 'ExprDblBracket'
1063             # type => 'RegExpr'
1064 1030 100       4085 if ($self->testRegExpr($text, '\\s\\[\\[(?=($|\\s))', 0, 0, 0, undef, 0, 'ExprDblBracket', 'Keyword')) {
1065 2         12 return 1
1066             }
1067             # String => '\[(?=($|\s))'
1068             # attribute => 'Builtin'
1069             # beginRegion => 'expression'
1070             # column => '0'
1071             # context => 'ExprBracket'
1072             # type => 'RegExpr'
1073 1028 50       5602 if ($self->testRegExpr($text, '\\[(?=($|\\s))', 0, 0, 0, 0, 0, 'ExprBracket', 'Builtin')) {
1074 0         0 return 1
1075             }
1076             # String => '\s\[(?=($|\s))'
1077             # attribute => 'Builtin'
1078             # beginRegion => 'expression'
1079             # context => 'ExprBracket'
1080             # type => 'RegExpr'
1081 1028 100       3975 if ($self->testRegExpr($text, '\\s\\[(?=($|\\s))', 0, 0, 0, undef, 0, 'ExprBracket', 'Builtin')) {
1082 6         28 return 1
1083             }
1084             # String => '\{(?=($|\s))'
1085             # attribute => 'Keyword'
1086             # beginRegion => 'group'
1087             # context => 'Group'
1088             # type => 'RegExpr'
1089 1022 100       4109 if ($self->testRegExpr($text, '\\{(?=($|\\s))', 0, 0, 0, undef, 0, 'Group', 'Keyword')) {
1090 4         17 return 1
1091             }
1092             # attribute => 'Keyword'
1093             # beginRegion => 'subshell'
1094             # char => '('
1095             # context => 'SubShell'
1096             # type => 'DetectChar'
1097 1018 100       4459 if ($self->testDetectChar($text, '(', 0, 0, 0, undef, 0, 'SubShell', 'Keyword')) {
1098 2         11 return 1
1099             }
1100             # String => '\bdo(?![\w$+-])'
1101             # attribute => 'Keyword'
1102             # beginRegion => 'do'
1103             # context => '#stay'
1104             # type => 'RegExpr'
1105 1016 100       4007 if ($self->testRegExpr($text, '\\bdo(?![\\w$+-])', 0, 0, 0, undef, 0, '#stay', 'Keyword')) {
1106 4         22 return 1
1107             }
1108             # String => '\bdone(?![\w$+-])'
1109             # attribute => 'Keyword'
1110             # context => '#stay'
1111             # endRegion => 'do'
1112             # type => 'RegExpr'
1113 1012 100       4130 if ($self->testRegExpr($text, '\\bdone(?![\\w$+-])', 0, 0, 0, undef, 0, '#stay', 'Keyword')) {
1114 4         20 return 1
1115             }
1116             # String => '\bif(?![\w$+-])'
1117             # attribute => 'Keyword'
1118             # beginRegion => 'if'
1119             # context => '#stay'
1120             # type => 'RegExpr'
1121 1008 100       3773 if ($self->testRegExpr($text, '\\bif(?![\\w$+-])', 0, 0, 0, undef, 0, '#stay', 'Keyword')) {
1122 4         22 return 1
1123             }
1124             # String => '\bfi(?![\w$+-])'
1125             # attribute => 'Keyword'
1126             # context => '#stay'
1127             # endRegion => 'if'
1128             # type => 'RegExpr'
1129 1004 100       3779 if ($self->testRegExpr($text, '\\bfi(?![\\w$+-])', 0, 0, 0, undef, 0, '#stay', 'Keyword')) {
1130 4         19 return 1
1131             }
1132             # String => '\bcase(?![\w$+-])'
1133             # attribute => 'Keyword'
1134             # beginRegion => 'case'
1135             # context => 'Case'
1136             # type => 'RegExpr'
1137 1000 100       5988 if ($self->testRegExpr($text, '\\bcase(?![\\w$+-])', 0, 0, 0, undef, 0, 'Case', 'Keyword')) {
1138 2         16 return 1
1139             }
1140             # String => '-[A-Za-z0-9]+'
1141             # attribute => 'Option'
1142             # context => '#stay'
1143             # type => 'RegExpr'
1144 998 100       3887 if ($self->testRegExpr($text, '-[A-Za-z0-9]+', 0, 0, 0, undef, 0, '#stay', 'Option')) {
1145 12         90 return 1
1146             }
1147             # String => '--[a-z][A-Za-z0-9_-]*'
1148             # attribute => 'Option'
1149             # context => '#stay'
1150             # type => 'RegExpr'
1151 986 100       4485 if ($self->testRegExpr($text, '--[a-z][A-Za-z0-9_-]*', 0, 0, 0, undef, 0, '#stay', 'Option')) {
1152 2         81 return 1
1153             }
1154             # String => '\b[A-Za-z_][A-Za-z0-9_]*='
1155             # attribute => 'Variable'
1156             # context => 'Assign'
1157             # type => 'RegExpr'
1158 984 100       6916 if ($self->testRegExpr($text, '\\b[A-Za-z_][A-Za-z0-9_]*=', 0, 0, 0, undef, 0, 'Assign', 'Variable')) {
1159 18         102 return 1
1160             }
1161             # String => '\b[A-Za-z_][A-Za-z0-9_]*(?=\[[^]]+\]=)'
1162             # attribute => 'Variable'
1163             # context => 'AssignSubscr'
1164             # type => 'RegExpr'
1165 966 100       3979 if ($self->testRegExpr($text, '\\b[A-Za-z_][A-Za-z0-9_]*(?=\\[[^]]+\\]=)', 0, 0, 0, undef, 0, 'AssignSubscr', 'Variable')) {
1166 2         11 return 1
1167             }
1168             # String => ':()'
1169             # attribute => 'Function'
1170             # context => '#stay'
1171             # type => 'StringDetect'
1172 964 50       4343 if ($self->testStringDetect($text, ':()', 0, 0, 0, undef, 0, '#stay', 'Function')) {
1173 0         0 return 1
1174             }
1175             # String => '\bfunction\b'
1176             # attribute => 'Keyword'
1177             # context => 'FunctionDef'
1178             # type => 'RegExpr'
1179 964 50       3750 if ($self->testRegExpr($text, '\\bfunction\\b', 0, 0, 0, undef, 0, 'FunctionDef', 'Keyword')) {
1180 0         0 return 1
1181             }
1182             # String => 'keywords'
1183             # attribute => 'Keyword'
1184             # context => '#stay'
1185             # type => 'keyword'
1186 964 100       5822 if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) {
1187 16         104 return 1
1188             }
1189             # String => 'builtins'
1190             # attribute => 'Builtin'
1191             # context => '#stay'
1192             # type => 'keyword'
1193 948 100       3846 if ($self->testKeyword($text, 'builtins', 0, undef, 0, '#stay', 'Builtin')) {
1194 26         148 return 1
1195             }
1196             # String => 'unixcommands'
1197             # attribute => 'Command'
1198             # context => '#stay'
1199             # type => 'keyword'
1200 922 100       3386 if ($self->testKeyword($text, 'unixcommands', 0, undef, 0, '#stay', 'Command')) {
1201 36         205 return 1
1202             }
1203             # String => 'builtins_var'
1204             # attribute => 'Builtin'
1205             # context => 'VarName'
1206             # type => 'keyword'
1207 886 100       3440 if ($self->testKeyword($text, 'builtins_var', 0, undef, 0, 'VarName', 'Builtin')) {
1208 14         82 return 1
1209             }
1210             # String => '<<<'
1211             # attribute => 'Redirection'
1212             # context => '#stay'
1213             # type => 'StringDetect'
1214 872 100       3485 if ($self->testStringDetect($text, '<<<', 0, 0, 0, undef, 0, '#stay', 'Redirection')) {
1215 2         13 return 1
1216             }
1217             # String => '<<'
1218             # attribute => 'Redirection'
1219             # context => 'HereDoc'
1220             # lookAhead => 'true'
1221             # type => 'StringDetect'
1222 870 100       3050 if ($self->testStringDetect($text, '<<', 0, 0, 1, undef, 0, 'HereDoc', 'Redirection')) {
1223 2         14 return 1
1224             }
1225             # String => '[<>]\('
1226             # attribute => 'Redirection'
1227             # context => 'ProcessSubst'
1228             # type => 'RegExpr'
1229 868 100       3412 if ($self->testRegExpr($text, '[<>]\\(', 0, 0, 0, undef, 0, 'ProcessSubst', 'Redirection')) {
1230 2         11 return 1
1231             }
1232             # String => '([0-9]*(>{1,2}|<)(&[0-9]+-?)?|&>|>&|[0-9]*<>)'
1233             # attribute => 'Redirection'
1234             # context => '#stay'
1235             # type => 'RegExpr'
1236 866 100       3609 if ($self->testRegExpr($text, '([0-9]*(>{1,2}|<)(&[0-9]+-?)?|&>|>&|[0-9]*<>)', 0, 0, 0, undef, 0, '#stay', 'Redirection')) {
1237 10         52 return 1
1238             }
1239             # String => '([|&])\1?'
1240             # attribute => 'Control'
1241             # context => '#stay'
1242             # type => 'RegExpr'
1243 856 100       3393 if ($self->testRegExpr($text, '([|&])\\1?', 0, 0, 0, undef, 0, '#stay', 'Control')) {
1244 22         115 return 1
1245             }
1246             # String => '[A-Za-z_:][A-Za-z0-9_:#%@-]*\s*\(\)'
1247             # attribute => 'Function'
1248             # context => '#stay'
1249             # type => 'RegExpr'
1250 834 100       3160 if ($self->testRegExpr($text, '[A-Za-z_:][A-Za-z0-9_:#%@-]*\\s*\\(\\)', 0, 0, 0, undef, 0, '#stay', 'Function')) {
1251 2         9 return 1
1252             }
1253 832         4865 return 0;
1254             };
1255              
1256             sub parseFindComments {
1257 1206     1206 0 2877 my ($self, $text) = @_;
1258             # attribute => 'Comment'
1259             # char => '#'
1260             # context => 'Comment'
1261             # firstNonSpace => 'true'
1262             # type => 'DetectChar'
1263 1206 100       4672 if ($self->testDetectChar($text, '#', 0, 0, 0, undef, 1, 'Comment', 'Comment')) {
1264 66         340 return 1
1265             }
1266             # String => '[\s;](?=#)'
1267             # attribute => 'Normal Text'
1268             # context => 'Comment'
1269             # type => 'RegExpr'
1270 1140 100       4725 if ($self->testRegExpr($text, '[\\s;](?=#)', 0, 0, 0, undef, 0, 'Comment', 'Normal Text')) {
1271 6         37 return 1
1272             }
1273 1134         5860 return 0;
1274             };
1275              
1276             sub parseFindCommentsBackq {
1277 44     44 0 135 my ($self, $text) = @_;
1278             # attribute => 'Comment'
1279             # char => '#'
1280             # context => 'CommentBackq'
1281             # firstNonSpace => 'true'
1282             # type => 'DetectChar'
1283 44 50       147 if ($self->testDetectChar($text, '#', 0, 0, 0, undef, 1, 'CommentBackq', 'Comment')) {
1284 0         0 return 1
1285             }
1286             # String => '[\s;](?=#)'
1287             # attribute => 'Normal Text'
1288             # context => 'CommentBackq'
1289             # type => 'RegExpr'
1290 44 50       187 if ($self->testRegExpr($text, '[\\s;](?=#)', 0, 0, 0, undef, 0, 'CommentBackq', 'Normal Text')) {
1291 0         0 return 1
1292             }
1293 44         273 return 0;
1294             };
1295              
1296             sub parseFindCommentsParen {
1297 80     80 0 195 my ($self, $text) = @_;
1298             # attribute => 'Comment'
1299             # char => '#'
1300             # context => 'CommentParen'
1301             # firstNonSpace => 'true'
1302             # type => 'DetectChar'
1303 80 50       247 if ($self->testDetectChar($text, '#', 0, 0, 0, undef, 1, 'CommentParen', 'Comment')) {
1304 0         0 return 1
1305             }
1306             # String => '[\s;](?=#)'
1307             # attribute => 'Normal Text'
1308             # context => 'CommentParen'
1309             # type => 'RegExpr'
1310 80 50       329 if ($self->testRegExpr($text, '[\\s;](?=#)', 0, 0, 0, undef, 0, 'CommentParen', 'Normal Text')) {
1311 0         0 return 1
1312             }
1313 80         372 return 0;
1314             };
1315              
1316             sub parseFindMost {
1317 220     220 0 841 my ($self, $text) = @_;
1318             # context => 'FindComments'
1319             # type => 'IncludeRules'
1320 220 50       710 if ($self->includeRules('FindComments', $text)) {
1321 0         0 return 1
1322             }
1323             # context => 'FindStrings'
1324             # type => 'IncludeRules'
1325 220 100       997 if ($self->includeRules('FindStrings', $text)) {
1326 4         18 return 1
1327             }
1328             # context => 'FindSubstitutions'
1329             # type => 'IncludeRules'
1330 216 100       754 if ($self->includeRules('FindSubstitutions', $text)) {
1331 14         58 return 1
1332             }
1333             # context => 'FindOthers'
1334             # type => 'IncludeRules'
1335 202 50       855 if ($self->includeRules('FindOthers', $text)) {
1336 0         0 return 1
1337             }
1338 202         789 return 0;
1339             };
1340              
1341             sub parseFindOthers {
1342 1008     1008 0 2608 my ($self, $text) = @_;
1343             # String => '\\[][;"\\'$`{}()|&<>* ]'
1344             # attribute => 'Escape'
1345             # context => '#stay'
1346             # type => 'RegExpr'
1347 1008 100       3864 if ($self->testRegExpr($text, '\\\\[][;"\\\\\'$`{}()|&<>* ]', 0, 0, 0, undef, 0, '#stay', 'Escape')) {
1348 18         103 return 1
1349             }
1350             # String => '\\$'
1351             # attribute => 'Keyword'
1352             # context => '#stay'
1353             # type => 'RegExpr'
1354 990 50       4455 if ($self->testRegExpr($text, '\\\\$', 0, 0, 0, undef, 0, '#stay', 'Keyword')) {
1355 0         0 return 1
1356             }
1357             # String => '\{(?!(\s|$))\S*\}'
1358             # attribute => 'Escape'
1359             # context => '#stay'
1360             # type => 'RegExpr'
1361 990 100       3949 if ($self->testRegExpr($text, '\\{(?!(\\s|$))\\S*\\}', 0, 0, 0, undef, 0, '#stay', 'Escape')) {
1362 2         11 return 1
1363             }
1364             # String => '\.?/[\w_@.+-]+(?=([\s/):]|$))'
1365             # attribute => 'Path'
1366             # context => '#stay'
1367             # type => 'RegExpr'
1368 988 100       4057 if ($self->testRegExpr($text, '\\.?/[\\w_@.+-]+(?=([\\s/):]|$))', 0, 0, 0, undef, 0, '#stay', 'Path')) {
1369 32         159 return 1
1370             }
1371 956         5187 return 0;
1372             };
1373              
1374             sub parseFindStrings {
1375 1156     1156 0 3153 my ($self, $text) = @_;
1376             # attribute => 'String SingleQ'
1377             # char => '''
1378             # context => 'StringSQ'
1379             # type => 'DetectChar'
1380 1156 100       5237 if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, 'StringSQ', 'String SingleQ')) {
1381 10         45 return 1
1382             }
1383             # attribute => 'String DoubleQ'
1384             # char => '"'
1385             # context => 'StringDQ'
1386             # type => 'DetectChar'
1387 1146 100       4076 if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'StringDQ', 'String DoubleQ')) {
1388 28         130 return 1
1389             }
1390             # attribute => 'String SingleQ'
1391             # char => '$'
1392             # char1 => '''
1393             # context => 'StringEsc'
1394             # type => 'Detect2Chars'
1395 1118 100       5212 if ($self->testDetect2Chars($text, '$', '\'', 0, 0, 0, undef, 0, 'StringEsc', 'String SingleQ')) {
1396 2         11 return 1
1397             }
1398             # attribute => 'String Transl.'
1399             # char => '$'
1400             # char1 => '"'
1401             # context => 'StringDQ'
1402             # type => 'Detect2Chars'
1403 1116 100       6456 if ($self->testDetect2Chars($text, '$', '"', 0, 0, 0, undef, 0, 'StringDQ', 'String Transl.')) {
1404 2         13 return 1
1405             }
1406 1114         5799 return 0;
1407             };
1408              
1409             sub parseFindSubstitutions {
1410 2600     2600 0 8399 my ($self, $text) = @_;
1411             # String => '\$[*@#?$!_0-9-]'
1412             # attribute => 'Variable'
1413             # context => '#stay'
1414             # type => 'RegExpr'
1415 2600 100       10356 if ($self->testRegExpr($text, '\\$[*@#?$!_0-9-]', 0, 0, 0, undef, 0, '#stay', 'Variable')) {
1416 8         61 return 1
1417             }
1418             # String => '\$[A-Za-z_][A-Za-z0-9_]*\['
1419             # attribute => 'Variable'
1420             # context => 'Subscript'
1421             # type => 'RegExpr'
1422 2592 50       13230 if ($self->testRegExpr($text, '\\$[A-Za-z_][A-Za-z0-9_]*\\[', 0, 0, 0, undef, 0, 'Subscript', 'Variable')) {
1423 0         0 return 1
1424             }
1425             # String => '\$[A-Za-z_][A-Za-z0-9_]*'
1426             # attribute => 'Variable'
1427             # context => '#stay'
1428             # type => 'RegExpr'
1429 2592 100       10740 if ($self->testRegExpr($text, '\\$[A-Za-z_][A-Za-z0-9_]*', 0, 0, 0, undef, 0, '#stay', 'Variable')) {
1430 58         292 return 1
1431             }
1432             # String => '\$\{[*@#?$!_0-9-]\}'
1433             # attribute => 'Variable'
1434             # context => '#stay'
1435             # type => 'RegExpr'
1436 2534 100       10325 if ($self->testRegExpr($text, '\\$\\{[*@#?$!_0-9-]\\}', 0, 0, 0, undef, 0, '#stay', 'Variable')) {
1437 2         10 return 1
1438             }
1439             # String => '\$\{#[A-Za-z_][A-Za-z0-9_]*\}'
1440             # attribute => 'Variable'
1441             # context => '#stay'
1442             # type => 'RegExpr'
1443 2532 50       9909 if ($self->testRegExpr($text, '\\$\\{#[A-Za-z_][A-Za-z0-9_]*\\}', 0, 0, 0, undef, 0, '#stay', 'Variable')) {
1444 0         0 return 1
1445             }
1446             # String => '\$\{![A-Za-z_][A-Za-z0-9_]*\*?\}'
1447             # attribute => 'Variable'
1448             # context => '#stay'
1449             # type => 'RegExpr'
1450 2532 100       10194 if ($self->testRegExpr($text, '\\$\\{![A-Za-z_][A-Za-z0-9_]*\\*?\\}', 0, 0, 0, undef, 0, '#stay', 'Variable')) {
1451 4         18 return 1
1452             }
1453             # String => '\$\{[A-Za-z_][A-Za-z0-9_]*'
1454             # attribute => 'Variable'
1455             # context => 'VarBrace'
1456             # type => 'RegExpr'
1457 2528 100       9938 if ($self->testRegExpr($text, '\\$\\{[A-Za-z_][A-Za-z0-9_]*', 0, 0, 0, undef, 0, 'VarBrace', 'Variable')) {
1458 10         51 return 1
1459             }
1460             # String => '\$\{[*@#?$!_0-9-](?=[:#%/])'
1461             # attribute => 'Variable'
1462             # context => 'VarBrace'
1463             # type => 'RegExpr'
1464 2518 100       10399 if ($self->testRegExpr($text, '\\$\\{[*@#?$!_0-9-](?=[:#%/])', 0, 0, 0, undef, 0, 'VarBrace', 'Variable')) {
1465 2         15 return 1
1466             }
1467             # String => '$(('
1468             # attribute => 'Variable'
1469             # beginRegion => 'expression'
1470             # context => 'ExprDblParenSubst'
1471             # type => 'StringDetect'
1472 2516 100       10493 if ($self->testStringDetect($text, '$((', 0, 0, 0, undef, 0, 'ExprDblParenSubst', 'Variable')) {
1473 4         41 return 1
1474             }
1475             # String => '$(<'
1476             # attribute => 'Redirection'
1477             # context => 'SubstFile'
1478             # type => 'StringDetect'
1479 2512 100       8105 if ($self->testStringDetect($text, '$(<', 0, 0, 0, undef, 0, 'SubstFile', 'Redirection')) {
1480 4         194 return 1
1481             }
1482             # String => '$('
1483             # attribute => 'Variable'
1484             # context => 'SubstCommand'
1485             # type => 'StringDetect'
1486 2508 100       7751 if ($self->testStringDetect($text, '$(', 0, 0, 0, undef, 0, 'SubstCommand', 'Variable')) {
1487 4         22 return 1
1488             }
1489             # attribute => 'Backquote'
1490             # char => '`'
1491             # context => 'SubstBackq'
1492             # type => 'DetectChar'
1493 2504 100       9578 if ($self->testDetectChar($text, '`', 0, 0, 0, undef, 0, 'SubstBackq', 'Backquote')) {
1494 6         34 return 1
1495             }
1496             # String => '\\[`$\\]'
1497             # attribute => 'Escape'
1498             # context => '#stay'
1499             # type => 'RegExpr'
1500 2498 100       9807 if ($self->testRegExpr($text, '\\\\[`$\\\\]', 0, 0, 0, undef, 0, '#stay', 'Escape')) {
1501 2         11 return 1
1502             }
1503 2496         25543 return 0;
1504             };
1505              
1506             sub parseFunctionDef {
1507 0     0 0 0 my ($self, $text) = @_;
1508             # String => '\s+[A-Za-z_:][A-Za-z0-9_:#%@-]*(\s*\(\))?'
1509             # attribute => 'Function'
1510             # context => '#pop'
1511             # type => 'RegExpr'
1512 0 0       0 if ($self->testRegExpr($text, '\\s+[A-Za-z_:][A-Za-z0-9_:#%@-]*(\\s*\\(\\))?', 0, 0, 0, undef, 0, '#pop', 'Function')) {
1513 0         0 return 1
1514             }
1515 0         0 return 0;
1516             };
1517              
1518             sub parseGroup {
1519 140     140 0 355 my ($self, $text) = @_;
1520             # attribute => 'Keyword'
1521             # char => '}'
1522             # context => '#pop'
1523             # endRegion => 'group'
1524             # type => 'DetectChar'
1525 140 100       519 if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#pop', 'Keyword')) {
1526 4         44 return 1
1527             }
1528             # context => 'FindAll'
1529             # type => 'IncludeRules'
1530 136 100       409 if ($self->includeRules('FindAll', $text)) {
1531 36         126 return 1
1532             }
1533 100         265 return 0;
1534             };
1535              
1536             sub parseHereDoc {
1537 2     2 0 8 my ($self, $text) = @_;
1538             # String => '(<<\s*"([^|&;()<>\s]+)")'
1539             # attribute => 'Redirection'
1540             # context => 'HereDocQ'
1541             # lookAhead => 'true'
1542             # type => 'RegExpr'
1543 2 50       10 if ($self->testRegExpr($text, '(<<\\s*"([^|&;()<>\\s]+)")', 0, 0, 1, undef, 0, 'HereDocQ', 'Redirection')) {
1544 0         0 return 1
1545             }
1546             # String => '(<<\s*'([^|&;()<>\s]+)')'
1547             # attribute => 'Redirection'
1548             # context => 'HereDocQ'
1549             # lookAhead => 'true'
1550             # type => 'RegExpr'
1551 2 50       11 if ($self->testRegExpr($text, '(<<\\s*\'([^|&;()<>\\s]+)\')', 0, 0, 1, undef, 0, 'HereDocQ', 'Redirection')) {
1552 0         0 return 1
1553             }
1554             # String => '(<<\s*\\([^|&;()<>\s]+))'
1555             # attribute => 'Redirection'
1556             # context => 'HereDocQ'
1557             # lookAhead => 'true'
1558             # type => 'RegExpr'
1559 2 50       39 if ($self->testRegExpr($text, '(<<\\s*\\\\([^|&;()<>\\s]+))', 0, 0, 1, undef, 0, 'HereDocQ', 'Redirection')) {
1560 0         0 return 1
1561             }
1562             # String => '(<<\s*([^|&;()<>\s]+))'
1563             # attribute => 'Redirection'
1564             # context => 'HereDocNQ'
1565             # lookAhead => 'true'
1566             # type => 'RegExpr'
1567 2 50       13 if ($self->testRegExpr($text, '(<<\\s*([^|&;()<>\\s]+))', 0, 0, 1, undef, 0, 'HereDocNQ', 'Redirection')) {
1568 2         9 return 1
1569             }
1570             # String => '(<<-\s*"([^|&;()<>\s]+)")'
1571             # attribute => 'Redirection'
1572             # context => 'HereDocIQ'
1573             # lookAhead => 'true'
1574             # type => 'RegExpr'
1575 0 0       0 if ($self->testRegExpr($text, '(<<-\\s*"([^|&;()<>\\s]+)")', 0, 0, 1, undef, 0, 'HereDocIQ', 'Redirection')) {
1576 0         0 return 1
1577             }
1578             # String => '(<<-\s*'([^|&;()<>\s]+)')'
1579             # attribute => 'Redirection'
1580             # context => 'HereDocIQ'
1581             # lookAhead => 'true'
1582             # type => 'RegExpr'
1583 0 0       0 if ($self->testRegExpr($text, '(<<-\\s*\'([^|&;()<>\\s]+)\')', 0, 0, 1, undef, 0, 'HereDocIQ', 'Redirection')) {
1584 0         0 return 1
1585             }
1586             # String => '(<<-\s*\\([^|&;()<>\s]+))'
1587             # attribute => 'Redirection'
1588             # context => 'HereDocIQ'
1589             # lookAhead => 'true'
1590             # type => 'RegExpr'
1591 0 0       0 if ($self->testRegExpr($text, '(<<-\\s*\\\\([^|&;()<>\\s]+))', 0, 0, 1, undef, 0, 'HereDocIQ', 'Redirection')) {
1592 0         0 return 1
1593             }
1594             # String => '(<<-\s*([^|&;()<>\s]+))'
1595             # attribute => 'Redirection'
1596             # context => 'HereDocINQ'
1597             # lookAhead => 'true'
1598             # type => 'RegExpr'
1599 0 0       0 if ($self->testRegExpr($text, '(<<-\\s*([^|&;()<>\\s]+))', 0, 0, 1, undef, 0, 'HereDocINQ', 'Redirection')) {
1600 0         0 return 1
1601             }
1602             # String => '<<'
1603             # attribute => 'Redirection'
1604             # context => '#pop'
1605             # type => 'StringDetect'
1606 0 0       0 if ($self->testStringDetect($text, '<<', 0, 0, 0, undef, 0, '#pop', 'Redirection')) {
1607 0         0 return 1
1608             }
1609 0         0 return 0;
1610             };
1611              
1612             sub parseHereDocINQ {
1613 0     0 0 0 my ($self, $text) = @_;
1614             # String => '%1'
1615             # attribute => 'Redirection'
1616             # context => 'HereDocRemainder'
1617             # dynamic => 'true'
1618             # type => 'RegExpr'
1619 0 0       0 if ($self->testRegExpr($text, '%1', 0, 1, 0, undef, 0, 'HereDocRemainder', 'Redirection')) {
1620 0         0 return 1
1621             }
1622             # String => '\s*%2[\s;]*$'
1623             # attribute => 'Redirection'
1624             # column => '0'
1625             # context => '#pop#pop'
1626             # dynamic => 'true'
1627             # type => 'RegExpr'
1628 0 0       0 if ($self->testRegExpr($text, '\\s*%2[\\s;]*$', 0, 1, 0, 0, 0, '#pop#pop', 'Redirection')) {
1629 0         0 return 1
1630             }
1631             # context => 'FindSubstitutions'
1632             # type => 'IncludeRules'
1633 0 0       0 if ($self->includeRules('FindSubstitutions', $text)) {
1634 0         0 return 1
1635             }
1636 0         0 return 0;
1637             };
1638              
1639             sub parseHereDocIQ {
1640 0     0 0 0 my ($self, $text) = @_;
1641             # String => '%1'
1642             # attribute => 'Redirection'
1643             # context => 'HereDocRemainder'
1644             # dynamic => 'true'
1645             # type => 'RegExpr'
1646 0 0       0 if ($self->testRegExpr($text, '%1', 0, 1, 0, undef, 0, 'HereDocRemainder', 'Redirection')) {
1647 0         0 return 1
1648             }
1649             # String => '\s*%2[\s;]*$'
1650             # attribute => 'Redirection'
1651             # column => '0'
1652             # context => '#pop#pop'
1653             # dynamic => 'true'
1654             # type => 'RegExpr'
1655 0 0       0 if ($self->testRegExpr($text, '\\s*%2[\\s;]*$', 0, 1, 0, 0, 0, '#pop#pop', 'Redirection')) {
1656 0         0 return 1
1657             }
1658 0         0 return 0;
1659             };
1660              
1661             sub parseHereDocNQ {
1662 964     964 0 2422 my ($self, $text) = @_;
1663             # String => '%1'
1664             # attribute => 'Redirection'
1665             # context => 'HereDocRemainder'
1666             # dynamic => 'true'
1667             # type => 'RegExpr'
1668 964 100       3653 if ($self->testRegExpr($text, '%1', 0, 1, 0, undef, 0, 'HereDocRemainder', 'Redirection')) {
1669 2         9 return 1
1670             }
1671             # String => '%2[\s;]*$'
1672             # attribute => 'Redirection'
1673             # column => '0'
1674             # context => '#pop#pop'
1675             # dynamic => 'true'
1676             # type => 'RegExpr'
1677 962 50       4328 if ($self->testRegExpr($text, '%2[\\s;]*$', 0, 1, 0, 0, 0, '#pop#pop', 'Redirection')) {
1678 0         0 return 1
1679             }
1680             # context => 'FindSubstitutions'
1681             # type => 'IncludeRules'
1682 962 100       4801 if ($self->includeRules('FindSubstitutions', $text)) {
1683 12         48 return 1
1684             }
1685 950         3290 return 0;
1686             };
1687              
1688             sub parseHereDocQ {
1689 0     0 0 0 my ($self, $text) = @_;
1690             # String => '%1'
1691             # attribute => 'Redirection'
1692             # context => 'HereDocRemainder'
1693             # dynamic => 'true'
1694             # type => 'RegExpr'
1695 0 0       0 if ($self->testRegExpr($text, '%1', 0, 1, 0, undef, 0, 'HereDocRemainder', 'Redirection')) {
1696 0         0 return 1
1697             }
1698             # String => '%2[\s;]*$'
1699             # attribute => 'Redirection'
1700             # column => '0'
1701             # context => '#pop#pop'
1702             # dynamic => 'true'
1703             # type => 'RegExpr'
1704 0 0       0 if ($self->testRegExpr($text, '%2[\\s;]*$', 0, 1, 0, 0, 0, '#pop#pop', 'Redirection')) {
1705 0         0 return 1
1706             }
1707 0         0 return 0;
1708             };
1709              
1710             sub parseHereDocRemainder {
1711 0     0 0 0 my ($self, $text) = @_;
1712             # context => 'FindAll'
1713             # type => 'IncludeRules'
1714 0 0       0 if ($self->includeRules('FindAll', $text)) {
1715 0         0 return 1
1716             }
1717 0         0 return 0;
1718             };
1719              
1720             sub parseProcessSubst {
1721 24     24 0 84 my ($self, $text) = @_;
1722             # attribute => 'Redirection'
1723             # char => ')'
1724             # context => '#pop'
1725             # type => 'DetectChar'
1726 24 100       89 if ($self->testDetectChar($text, ')', 0, 0, 0, undef, 0, '#pop', 'Redirection')) {
1727 2         7 return 1
1728             }
1729             # context => 'FindCommentsParen'
1730             # type => 'IncludeRules'
1731 22 50       72 if ($self->includeRules('FindCommentsParen', $text)) {
1732 0         0 return 1
1733             }
1734             # context => 'FindCommands'
1735             # type => 'IncludeRules'
1736 22 50       70 if ($self->includeRules('FindCommands', $text)) {
1737 0         0 return 1
1738             }
1739             # context => 'FindStrings'
1740             # type => 'IncludeRules'
1741 22 50       81 if ($self->includeRules('FindStrings', $text)) {
1742 0         0 return 1
1743             }
1744             # context => 'FindSubstitutions'
1745             # type => 'IncludeRules'
1746 22 50       70 if ($self->includeRules('FindSubstitutions', $text)) {
1747 0         0 return 1
1748             }
1749             # context => 'FindOthers'
1750             # type => 'IncludeRules'
1751 22 50       89 if ($self->includeRules('FindOthers', $text)) {
1752 0         0 return 1
1753             }
1754 22         121 return 0;
1755             };
1756              
1757             sub parseStart {
1758 760     760 0 3886 my ($self, $text) = @_;
1759             # context => 'FindAll'
1760             # type => 'IncludeRules'
1761 760 100       2898 if ($self->includeRules('FindAll', $text)) {
1762 320         1125 return 1
1763             }
1764 440         1440 return 0;
1765             };
1766              
1767             sub parseStringDQ {
1768 560     560 0 1470 my ($self, $text) = @_;
1769             # attribute => 'String DoubleQ'
1770             # char => '"'
1771             # context => '#pop'
1772             # type => 'DetectChar'
1773 560 100       2757 if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String DoubleQ')) {
1774 30         113 return 1
1775             }
1776             # String => '\\[`"\\$\n]'
1777             # attribute => 'String Escape'
1778             # context => '#stay'
1779             # type => 'RegExpr'
1780 530 100       2029 if ($self->testRegExpr($text, '\\\\[`"\\\\$\\n]', 0, 0, 0, undef, 0, '#stay', 'String Escape')) {
1781 6         21 return 1
1782             }
1783             # context => 'FindSubstitutions'
1784             # type => 'IncludeRules'
1785 524 100       2428 if ($self->includeRules('FindSubstitutions', $text)) {
1786 14         51 return 1
1787             }
1788 510         1573 return 0;
1789             };
1790              
1791             sub parseStringEsc {
1792 52     52 0 107 my ($self, $text) = @_;
1793             # attribute => 'String SingleQ'
1794             # char => '''
1795             # context => '#pop'
1796             # type => 'DetectChar'
1797 52 100       157 if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '#pop', 'String SingleQ')) {
1798 2         9 return 1
1799             }
1800             # String => '\\[abefnrtv\\']'
1801             # attribute => 'String Escape'
1802             # context => '#stay'
1803             # type => 'RegExpr'
1804 50 100       152 if ($self->testRegExpr($text, '\\\\[abefnrtv\\\\\']', 0, 0, 0, undef, 0, '#stay', 'String Escape')) {
1805 2         9 return 1
1806             }
1807             # String => '\\([0-7]{1,3}|x[A-Fa-f0-9]{1,2}|c.)'
1808             # attribute => 'String Escape'
1809             # context => '#stay'
1810             # type => 'RegExpr'
1811 48 100       155 if ($self->testRegExpr($text, '\\\\([0-7]{1,3}|x[A-Fa-f0-9]{1,2}|c.)', 0, 0, 0, undef, 0, '#stay', 'String Escape')) {
1812 2         8 return 1
1813             }
1814 46         117 return 0;
1815             };
1816              
1817             sub parseStringSQ {
1818 124     124 0 284 my ($self, $text) = @_;
1819             # attribute => 'String SingleQ'
1820             # char => '''
1821             # context => '#pop'
1822             # type => 'DetectChar'
1823 124 100       390 if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '#pop', 'String SingleQ')) {
1824 10         39 return 1
1825             }
1826 114         278 return 0;
1827             };
1828              
1829             sub parseSubShell {
1830 32     32 0 178 my ($self, $text) = @_;
1831             # attribute => 'Keyword'
1832             # char => ')'
1833             # context => '#pop'
1834             # endRegion => 'subshell'
1835             # type => 'DetectChar'
1836 32 100       137 if ($self->testDetectChar($text, ')', 0, 0, 0, undef, 0, '#pop', 'Keyword')) {
1837 2         8 return 1
1838             }
1839             # context => 'FindAll'
1840             # type => 'IncludeRules'
1841 30 100       144 if ($self->includeRules('FindAll', $text)) {
1842 2         9 return 1
1843             }
1844 28         103 return 0;
1845             };
1846              
1847             sub parseSubscript {
1848 32     32 0 84 my ($self, $text) = @_;
1849             # attribute => 'Variable'
1850             # char => ']'
1851             # context => '#pop'
1852             # type => 'DetectChar'
1853 32 100       119 if ($self->testDetectChar($text, ']', 0, 0, 0, undef, 0, '#pop', 'Variable')) {
1854 10         39 return 1
1855             }
1856             # context => 'FindStrings'
1857             # type => 'IncludeRules'
1858 22 100       108 if ($self->includeRules('FindStrings', $text)) {
1859 2         7 return 1
1860             }
1861             # context => 'FindSubstitutions'
1862             # type => 'IncludeRules'
1863 20 100       65 if ($self->includeRules('FindSubstitutions', $text)) {
1864 2         8 return 1
1865             }
1866             # context => 'FindOthers'
1867             # type => 'IncludeRules'
1868 18 50       78 if ($self->includeRules('FindOthers', $text)) {
1869 0         0 return 1
1870             }
1871 18         57 return 0;
1872             };
1873              
1874             sub parseSubstBackq {
1875 50     50 0 133 my ($self, $text) = @_;
1876             # attribute => 'Keyword'
1877             # char => '`'
1878             # context => '#pop'
1879             # type => 'DetectChar'
1880 50 100       262 if ($self->testDetectChar($text, '`', 0, 0, 0, undef, 0, '#pop', 'Keyword')) {
1881 6         23 return 1
1882             }
1883             # context => 'FindCommentsBackq'
1884             # type => 'IncludeRules'
1885 44 50       169 if ($self->includeRules('FindCommentsBackq', $text)) {
1886 0         0 return 1
1887             }
1888             # context => 'FindCommands'
1889             # type => 'IncludeRules'
1890 44 100       161 if ($self->includeRules('FindCommands', $text)) {
1891 4         14 return 1
1892             }
1893             # context => 'FindStrings'
1894             # type => 'IncludeRules'
1895 40 50       167 if ($self->includeRules('FindStrings', $text)) {
1896 0         0 return 1
1897             }
1898             # context => 'FindSubstitutions'
1899             # type => 'IncludeRules'
1900 40 100       168 if ($self->includeRules('FindSubstitutions', $text)) {
1901 2         9 return 1
1902             }
1903             # context => 'FindOthers'
1904             # type => 'IncludeRules'
1905 38 50       162 if ($self->includeRules('FindOthers', $text)) {
1906 0         0 return 1
1907             }
1908 38         152 return 0;
1909             };
1910              
1911             sub parseSubstCommand {
1912 54     54 0 135 my ($self, $text) = @_;
1913             # attribute => 'Variable'
1914             # char => ')'
1915             # context => '#pop'
1916             # type => 'DetectChar'
1917 54 100       215 if ($self->testDetectChar($text, ')', 0, 0, 0, undef, 0, '#pop', 'Variable')) {
1918 4         15 return 1
1919             }
1920             # context => 'FindCommentsParen'
1921             # type => 'IncludeRules'
1922 50 50       195 if ($self->includeRules('FindCommentsParen', $text)) {
1923 0         0 return 1
1924             }
1925             # context => 'FindCommands'
1926             # type => 'IncludeRules'
1927 50 100       199 if ($self->includeRules('FindCommands', $text)) {
1928 18         79 return 1
1929             }
1930             # context => 'FindStrings'
1931             # type => 'IncludeRules'
1932 32 100       132 if ($self->includeRules('FindStrings', $text)) {
1933 4         15 return 1
1934             }
1935             # context => 'FindSubstitutions'
1936             # type => 'IncludeRules'
1937 28 50       93 if ($self->includeRules('FindSubstitutions', $text)) {
1938 0         0 return 1
1939             }
1940             # context => 'FindOthers'
1941             # type => 'IncludeRules'
1942 28 50       120 if ($self->includeRules('FindOthers', $text)) {
1943 0         0 return 1
1944             }
1945 28         91 return 0;
1946             };
1947              
1948             sub parseSubstFile {
1949 12     12 0 31 my ($self, $text) = @_;
1950             # attribute => 'Redirection'
1951             # char => ')'
1952             # context => '#pop'
1953             # type => 'DetectChar'
1954 12 100       49 if ($self->testDetectChar($text, ')', 0, 0, 0, undef, 0, '#pop', 'Redirection')) {
1955 4         14 return 1
1956             }
1957             # context => 'FindCommentsParen'
1958             # type => 'IncludeRules'
1959 8 50       29 if ($self->includeRules('FindCommentsParen', $text)) {
1960 0         0 return 1
1961             }
1962             # context => 'FindStrings'
1963             # type => 'IncludeRules'
1964 8 50       2788 if ($self->includeRules('FindStrings', $text)) {
1965 0         0 return 1
1966             }
1967             # context => 'FindSubstitutions'
1968             # type => 'IncludeRules'
1969 8 100       32 if ($self->includeRules('FindSubstitutions', $text)) {
1970 2         8 return 1
1971             }
1972             # context => 'FindOthers'
1973             # type => 'IncludeRules'
1974 6 50       24 if ($self->includeRules('FindOthers', $text)) {
1975 6         19 return 1
1976             }
1977 0         0 return 0;
1978             };
1979              
1980             sub parseVarBrace {
1981 44     44 0 157 my ($self, $text) = @_;
1982             # attribute => 'Variable'
1983             # char => '}'
1984             # context => '#pop'
1985             # type => 'DetectChar'
1986 44 100       180 if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#pop', 'Variable')) {
1987 12         47 return 1
1988             }
1989             # attribute => 'Variable'
1990             # char => '['
1991             # context => 'Subscript'
1992             # type => 'DetectChar'
1993 32 100       173 if ($self->testDetectChar($text, '[', 0, 0, 0, undef, 0, 'Subscript', 'Variable')) {
1994 4         13 return 1
1995             }
1996             # context => 'FindStrings'
1997             # type => 'IncludeRules'
1998 28 50       109 if ($self->includeRules('FindStrings', $text)) {
1999 0         0 return 1
2000             }
2001             # context => 'FindSubstitutions'
2002             # type => 'IncludeRules'
2003 28 50       108 if ($self->includeRules('FindSubstitutions', $text)) {
2004 0         0 return 1
2005             }
2006 28         92 return 0;
2007             };
2008              
2009             sub parseVarName {
2010 104     104 0 277 my ($self, $text) = @_;
2011             # String => '-[A-Za-z0-9]+'
2012             # attribute => 'Option'
2013             # context => '#stay'
2014             # type => 'RegExpr'
2015 104 100       427 if ($self->testRegExpr($text, '-[A-Za-z0-9]+', 0, 0, 0, undef, 0, '#stay', 'Option')) {
2016 2         9 return 1
2017             }
2018             # String => '--[a-z][A-Za-z0-9_-]*'
2019             # attribute => 'Option'
2020             # context => '#stay'
2021             # type => 'RegExpr'
2022 102 50       445 if ($self->testRegExpr($text, '--[a-z][A-Za-z0-9_-]*', 0, 0, 0, undef, 0, '#stay', 'Option')) {
2023 0         0 return 1
2024             }
2025             # String => '\b[A-Za-z_][A-Za-z0-9_]*'
2026             # attribute => 'Variable'
2027             # context => '#stay'
2028             # type => 'RegExpr'
2029 102 100       418 if ($self->testRegExpr($text, '\\b[A-Za-z_][A-Za-z0-9_]*', 0, 0, 0, undef, 0, '#stay', 'Variable')) {
2030 40         150 return 1
2031             }
2032             # attribute => 'Variable'
2033             # char => '['
2034             # context => 'Subscript'
2035             # type => 'DetectChar'
2036 62 50       360 if ($self->testDetectChar($text, '[', 0, 0, 0, undef, 0, 'Subscript', 'Variable')) {
2037 0         0 return 1
2038             }
2039             # attribute => 'Variable'
2040             # char => '='
2041             # context => 'Assign'
2042             # type => 'DetectChar'
2043 62 100       202 if ($self->testDetectChar($text, '=', 0, 0, 0, undef, 0, 'Assign', 'Variable')) {
2044 6         21 return 1
2045             }
2046             # context => 'FindMost'
2047             # type => 'IncludeRules'
2048 56 50       223 if ($self->includeRules('FindMost', $text)) {
2049 0         0 return 1
2050             }
2051             # String => '[^]})|;`&><]'
2052             # attribute => 'Normal Text'
2053             # context => '#stay'
2054             # type => 'RegExpr'
2055 56 100       270 if ($self->testRegExpr($text, '[^]})|;`&><]', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) {
2056 50         190 return 1
2057             }
2058 6         25 return 0;
2059             };
2060              
2061              
2062             1;
2063              
2064             __END__