awk.syntax 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. # AWK syntax by
  2. # Olegarch <olegarch@mail.ru>
  3. # Andres Farfan, <nafraf@linuxmail.org>
  4. # Ilia Maslakov <il.smind gmail com>
  5. #
  6. # (c) 2003, 2004, 2009
  7. # This program is free software: you can redistribute it and/or modify
  8. # it under the terms of the GNU General Public License as published by
  9. # the Free Software Foundation, either version 3 of the License, or
  10. # (at your option) any later version.
  11. #
  12. # This program is distributed in the hope that it will be useful,
  13. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. # GNU General Public License for more details.
  16. #
  17. # You should have received a copy of the GNU General Public License
  18. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  19. context default
  20. keyword whole linestart #!\[\s\]/bin/\[msg\]awk yellow magenta
  21. keyword whole linestart #!\[\s\]/usr/bin/\[msg\]awk yellow magenta
  22. # Keywords
  23. keyword whole AMNOISE white
  24. keyword whole BEGIN white
  25. keyword whole END white
  26. keyword whole func white
  27. keyword whole function white
  28. keyword whole nextfile white
  29. keyword whole return white/26
  30. keyword whole print white/26
  31. keyword whole printf white/26
  32. keyword whole if white/26
  33. keyword whole else white/26
  34. keyword whole while white/26
  35. keyword whole for white/26
  36. keyword whole in white/26
  37. keyword whole do white/26
  38. keyword whole break white/26
  39. keyword whole continue white/26
  40. keyword whole next white/26
  41. keyword whole exit white/26
  42. keyword whole close white/26
  43. keyword whole system white/26
  44. keyword whole getline white/26
  45. # Builtin functions:
  46. keyword whole atan2 white black
  47. keyword whole cos white black
  48. keyword whole exp white black
  49. keyword whole int white black
  50. keyword whole log white black
  51. keyword whole rand white black
  52. keyword whole sin white black
  53. keyword whole sqrt white black
  54. keyword whole srand white black
  55. keyword whole gsub white black
  56. keyword whole index white black
  57. keyword whole length white black
  58. keyword whole match white black
  59. keyword whole split white black
  60. keyword whole sprintf white black
  61. keyword whole sub white black
  62. keyword whole substr white black
  63. keyword whole asort white black
  64. keyword whole asorti white black
  65. keyword whole xor white
  66. keyword whole and white
  67. keyword whole or white
  68. # Gawk builtin functions:
  69. keyword whole fflush white black
  70. keyword whole gensub white black
  71. keyword whole tolower white black
  72. keyword whole toupper white black
  73. keyword whole systime white black
  74. keyword whole strftime white black
  75. keyword whole strtonum white
  76. keyword whole bindtextdomain white
  77. keyword whole dcgettext white
  78. keyword whole dcngettext white
  79. keyword whole compl white
  80. keyword whole delete white
  81. keyword whole extension white
  82. keyword whole mktime white
  83. keyword whole lshift white
  84. keyword whole rshift white
  85. # Builtin variables:
  86. keyword whole ARGIND brightblue
  87. keyword whole BINMODE brightblue
  88. keyword whole CONVFMT brightblue
  89. keyword whole ENVIRON brightblue
  90. keyword whole LINT brightblue
  91. keyword whole TEXTDOMAIN brightblue
  92. keyword whole ARGC brightblue
  93. keyword whole ARGV brightblue
  94. keyword whole FILENAME brightblue
  95. keyword whole FNR brightblue
  96. keyword whole FS brightblue
  97. keyword whole NF brightblue
  98. keyword whole NR brightblue
  99. keyword whole OFMT brightblue
  100. keyword whole OFS brightblue
  101. keyword whole ORS brightblue
  102. keyword whole RLENGTH brightblue
  103. keyword whole RS brightblue
  104. keyword whole RSTART brightblue
  105. keyword whole SUBSEP brightblue
  106. # Gawk builtin variables:
  107. keyword whole ARGIND brightblue
  108. keyword whole ERRNO brightblue
  109. keyword whole RT brightblue
  110. keyword whole IGNORECASE brightblue
  111. keyword whole FIELDWIDTHS brightblue
  112. keyword '\s' brightgreen/16
  113. keyword '+' brightgreen/16
  114. keyword > yellow/24
  115. keyword < yellow/24
  116. keyword \+ yellow/24
  117. keyword - yellow/24
  118. keyword \* yellow/24
  119. keyword % yellow/24
  120. keyword = yellow/24
  121. keyword != yellow/24
  122. keyword == yellow/24
  123. keyword { white/25
  124. keyword } white/25
  125. keyword ( white/25
  126. keyword ) white/25
  127. keyword [*] magenta
  128. keyword , white/25
  129. keyword : white/25
  130. keyword ; lightgray/19
  131. keyword $\[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\] brightred/18
  132. # Begin/End:
  133. keyword whole BEGIN red
  134. keyword whole END red
  135. # Function keyword:
  136. keyword whole function brightmagenta
  137. # Hex constant:
  138. keyword 0\{xX\}\[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\] magenta/6
  139. # Tab: \t
  140. # keyword linestart \t lightgray/13 blue/6
  141. # Sed:
  142. keyword linestart /^ red
  143. keyword linestart /^# red
  144. context /^#*/ red
  145. # Comments:
  146. context linestart # \n brown
  147. context linestart $ \n brown
  148. # String:
  149. context " " green/6
  150. keyword \\" brightgreen/16
  151. keyword \\\n brightgreen/16
  152. keyword %% brightgreen/16
  153. keyword %\[#0\s-\+,\]\[0123456789\]\[.\]\[0123456789\]\[L\]\{eEfgGoxX\} brightgreen/16
  154. keyword %\[0\s-\+,\]\[0123456789\]\[.\]\[0123456789\]\[hl\]\{diu\} brightgreen/16
  155. keyword %\[hl\]n brightgreen/16
  156. keyword %\[.\]\[0123456789\]s brightgreen/16
  157. keyword %[*] brightgreen/16
  158. keyword %c brightgreen/16
  159. keyword \\\{0123\}\{01234567\}\{01234567\} brightgreen/16
  160. keyword \\\\ brightgreen/16
  161. keyword \\' brightgreen/16
  162. keyword \\\{abtnvfr\} brightgreen/16