Warning, /frameworks/syntax-highlighting/autotests/folding/highlight.awk.fold is written in an unsupported language. File is not indexed.

0001 #!/usr
0002 # AWK hl test
0003 
0004 # <beginfold id='1'>BEGIN</beginfold id='1'> and <endfold id='1'>END</endfold id='1'> are also matched as patterns
0005 BEGIN <beginfold id='2'>{</beginfold id='2'>
0006         p = 0;
0007 <endfold id='2'>}</endfold id='2'>
0008 
0009 /some pattern/ <beginfold id='2'>{</beginfold id='2'>
0010         p++;
0011 <endfold id='2'>}</endfold id='2'>
0012 
0013 # / inside brackets is not considered end of expression
0014 # a loose division operator (/) is not mismatched as a pattern.
0015 $1 =~ /[^abc/]def/ || b == 3 / 5 <beginfold id='2'>{</beginfold id='2'>
0016 
0017         gsub ( FILENAME );
0018 
0019 <endfold id='2'>}</endfold id='2'>
0020 
0021 # TODO and FIXME also work in comments in Awk.
0022 
0023 # Also backslash in patterns works.
0024 /\/usr\/bin\/awk/ <beginfold id='2'>{</beginfold id='2'> print "This is me"; <endfold id='2'>}</endfold id='2'>
0025 
0026 END <beginfold id='2'>{</beginfold id='2'>
0027         print p;
0028 <endfold id='2'>}</endfold id='2'>
0029 
0030 function myfunc()
0031 <beginfold id='2'>{</beginfold id='2'>
0032     print 42
0033 <endfold id='2'>}</endfold id='2'>
0034 
0035 /abc/,/a[b]c/<beginfold id='2'>{</beginfold id='2'>
0036         # parameter with a regex
0037         if (match($0, /a/)) <beginfold id='2'>{</beginfold id='2'><endfold id='2'>}</endfold id='2'>
0038 
0039         "x\ax\nx\ex\zx\023x\2x\xffx\xFf\xax\12x"
0040 
0041         a =~ /[[:alpha:]]/
0042         a =~ /[xx[:alpha:]xx]/
0043         a =~ /[a-z[:alpha:]xx-]/
0044         a =~ /[]a]/
0045         a =~ /[-a]/
0046         a =~ /[^]a]/
0047         a =~ /[^-a]/
0048         a =~ /[a]a\/\n/
0049         # incomplete regex
0050         a =~ /[xx[:alph
0051         a = 23.2
0052 <endfold id='2'>}</endfold id='2'>