gtksourceview4 3.2.9-x64-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (379) hide show
  1. checksums.yaml +7 -0
  2. data/COPYING.LIB +502 -0
  3. data/README.md +24 -0
  4. data/Rakefile +61 -0
  5. data/dependency-check/Rakefile +43 -0
  6. data/gtksourceview4.gemspec +45 -0
  7. data/lib/gtksourceview4.rb +56 -0
  8. data/lib/gtksourceview4/deprecated.rb +49 -0
  9. data/lib/gtksourceview4/loader.rb +49 -0
  10. data/lib/gtksourceview4/mark-attributes.rb +29 -0
  11. data/test/run-test.rb +62 -0
  12. data/test/test-mark-attributes.rb +26 -0
  13. data/test/test-source-gutter-renderer.rb +33 -0
  14. data/test/test-source-language-manager.rb +46 -0
  15. data/test/test-source-view.rb +55 -0
  16. data/vendor/local/bin/libgtksourceview-4-0.dll +0 -0
  17. data/vendor/local/include/gtksourceview-4/gtksourceview/completion-providers/words/gtksourcecompletionwords.h +72 -0
  18. data/vendor/local/include/gtksourceview-4/gtksourceview/gtksource-enumtypes.h +107 -0
  19. data/vendor/local/include/gtksourceview-4/gtksourceview/gtksource.h +67 -0
  20. data/vendor/local/include/gtksourceview-4/gtksourceview/gtksourceautocleanups.h +63 -0
  21. data/vendor/local/include/gtksourceview-4/gtksourceview/gtksourcebuffer.h +279 -0
  22. data/vendor/local/include/gtksourceview-4/gtksourceview/gtksourcecompletion.h +156 -0
  23. data/vendor/local/include/gtksourceview-4/gtksourceview/gtksourcecompletioncontext.h +102 -0
  24. data/vendor/local/include/gtksourceview-4/gtksourceview/gtksourcecompletioninfo.h +77 -0
  25. data/vendor/local/include/gtksourceview-4/gtksourceview/gtksourcecompletionitem.h +92 -0
  26. data/vendor/local/include/gtksourceview-4/gtksourceview/gtksourcecompletionproposal.h +126 -0
  27. data/vendor/local/include/gtksourceview-4/gtksourceview/gtksourcecompletionprovider.h +166 -0
  28. data/vendor/local/include/gtksourceview-4/gtksourceview/gtksourceencoding.h +74 -0
  29. data/vendor/local/include/gtksourceview-4/gtksourceview/gtksourcefile.h +195 -0
  30. data/vendor/local/include/gtksourceview-4/gtksourceview/gtksourcefileloader.h +140 -0
  31. data/vendor/local/include/gtksourceview-4/gtksourceview/gtksourcefilesaver.h +168 -0
  32. data/vendor/local/include/gtksourceview-4/gtksourceview/gtksourcegutter.h +93 -0
  33. data/vendor/local/include/gtksourceview-4/gtksourceview/gtksourcegutterrenderer.h +272 -0
  34. data/vendor/local/include/gtksourceview-4/gtksourceview/gtksourcegutterrendererpixbuf.h +91 -0
  35. data/vendor/local/include/gtksourceview-4/gtksourceview/gtksourcegutterrenderertext.h +92 -0
  36. data/vendor/local/include/gtksourceview-4/gtksourceview/gtksourceinit.h +40 -0
  37. data/vendor/local/include/gtksourceview-4/gtksourceview/gtksourcelanguage.h +98 -0
  38. data/vendor/local/include/gtksourceview-4/gtksourceview/gtksourcelanguagemanager.h +92 -0
  39. data/vendor/local/include/gtksourceview-4/gtksourceview/gtksourcemap.h +70 -0
  40. data/vendor/local/include/gtksourceview-4/gtksourceview/gtksourcemark.h +79 -0
  41. data/vendor/local/include/gtksourceview-4/gtksourceview/gtksourcemarkattributes.h +112 -0
  42. data/vendor/local/include/gtksourceview-4/gtksourceview/gtksourceprintcompositor.h +223 -0
  43. data/vendor/local/include/gtksourceview-4/gtksourceview/gtksourceregion.h +127 -0
  44. data/vendor/local/include/gtksourceview-4/gtksourceview/gtksourcesearchcontext.h +161 -0
  45. data/vendor/local/include/gtksourceview-4/gtksourceview/gtksourcesearchsettings.h +100 -0
  46. data/vendor/local/include/gtksourceview-4/gtksourceview/gtksourcespacedrawer.h +144 -0
  47. data/vendor/local/include/gtksourceview-4/gtksourceview/gtksourcestyle.h +54 -0
  48. data/vendor/local/include/gtksourceview-4/gtksourceview/gtksourcestylescheme.h +119 -0
  49. data/vendor/local/include/gtksourceview-4/gtksourceview/gtksourcestyleschemechooser.h +66 -0
  50. data/vendor/local/include/gtksourceview-4/gtksourceview/gtksourcestyleschemechooserbutton.h +64 -0
  51. data/vendor/local/include/gtksourceview-4/gtksourceview/gtksourcestyleschemechooserwidget.h +64 -0
  52. data/vendor/local/include/gtksourceview-4/gtksourceview/gtksourcestyleschememanager.h +100 -0
  53. data/vendor/local/include/gtksourceview-4/gtksourceview/gtksourcetag.h +54 -0
  54. data/vendor/local/include/gtksourceview-4/gtksourceview/gtksourcetypes.h +73 -0
  55. data/vendor/local/include/gtksourceview-4/gtksourceview/gtksourceundomanager.h +90 -0
  56. data/vendor/local/include/gtksourceview-4/gtksourceview/gtksourceutils.h +41 -0
  57. data/vendor/local/include/gtksourceview-4/gtksourceview/gtksourceversion.h +578 -0
  58. data/vendor/local/include/gtksourceview-4/gtksourceview/gtksourceview.h +266 -0
  59. data/vendor/local/lib/girepository-1.0/GtkSource-4.typelib +0 -0
  60. data/vendor/local/lib/libgtksourceview-4.dll.a +0 -0
  61. data/vendor/local/lib/libgtksourceview-4.la +41 -0
  62. data/vendor/local/lib/pkgconfig/gtksourceview-4.pc +12 -0
  63. data/vendor/local/share/gir-1.0/GtkSource-4.gir +12999 -0
  64. data/vendor/local/share/gtk-doc/html/gtksourceview-4.0/GtkSourceBuffer.html +2421 -0
  65. data/vendor/local/share/gtk-doc/html/gtksourceview-4.0/GtkSourceCompletion.html +1087 -0
  66. data/vendor/local/share/gtk-doc/html/gtksourceview-4.0/GtkSourceCompletionContext.html +402 -0
  67. data/vendor/local/share/gtk-doc/html/gtksourceview-4.0/GtkSourceCompletionInfo.html +207 -0
  68. data/vendor/local/share/gtk-doc/html/gtksourceview-4.0/GtkSourceCompletionItem.html +497 -0
  69. data/vendor/local/share/gtk-doc/html/gtksourceview-4.0/GtkSourceCompletionProposal.html +668 -0
  70. data/vendor/local/share/gtk-doc/html/gtksourceview-4.0/GtkSourceCompletionProvider.html +837 -0
  71. data/vendor/local/share/gtk-doc/html/gtksourceview-4.0/GtkSourceCompletionWords.html +343 -0
  72. data/vendor/local/share/gtk-doc/html/gtksourceview-4.0/GtkSourceEncoding.html +391 -0
  73. data/vendor/local/share/gtk-doc/html/gtksourceview-4.0/GtkSourceFile.html +769 -0
  74. data/vendor/local/share/gtk-doc/html/gtksourceview-4.0/GtkSourceFileLoader.html +780 -0
  75. data/vendor/local/share/gtk-doc/html/gtksourceview-4.0/GtkSourceFileSaver.html +965 -0
  76. data/vendor/local/share/gtk-doc/html/gtksourceview-4.0/GtkSourceGutter.html +438 -0
  77. data/vendor/local/share/gtk-doc/html/gtksourceview-4.0/GtkSourceGutterRenderer.html +1708 -0
  78. data/vendor/local/share/gtk-doc/html/gtksourceview-4.0/GtkSourceGutterRendererPixbuf.html +369 -0
  79. data/vendor/local/share/gtk-doc/html/gtksourceview-4.0/GtkSourceGutterRendererText.html +299 -0
  80. data/vendor/local/share/gtk-doc/html/gtksourceview-4.0/GtkSourceLanguage.html +579 -0
  81. data/vendor/local/share/gtk-doc/html/gtksourceview-4.0/GtkSourceLanguageManager.html +473 -0
  82. data/vendor/local/share/gtk-doc/html/gtksourceview-4.0/GtkSourceMap.html +254 -0
  83. data/vendor/local/share/gtk-doc/html/gtksourceview-4.0/GtkSourceMark.html +307 -0
  84. data/vendor/local/share/gtk-doc/html/gtksourceview-4.0/GtkSourceMarkAttributes.html +788 -0
  85. data/vendor/local/share/gtk-doc/html/gtksourceview-4.0/GtkSourcePrintCompositor.html +2121 -0
  86. data/vendor/local/share/gtk-doc/html/gtksourceview-4.0/GtkSourceRegion.html +870 -0
  87. data/vendor/local/share/gtk-doc/html/gtksourceview-4.0/GtkSourceSearchContext.html +1216 -0
  88. data/vendor/local/share/gtk-doc/html/gtksourceview-4.0/GtkSourceSearchSettings.html +603 -0
  89. data/vendor/local/share/gtk-doc/html/gtksourceview-4.0/GtkSourceSpaceDrawer.html +671 -0
  90. data/vendor/local/share/gtk-doc/html/gtksourceview-4.0/GtkSourceStyle.html +433 -0
  91. data/vendor/local/share/gtk-doc/html/gtksourceview-4.0/GtkSourceStyleScheme.html +396 -0
  92. data/vendor/local/share/gtk-doc/html/gtksourceview-4.0/GtkSourceStyleSchemeChooser.html +214 -0
  93. data/vendor/local/share/gtk-doc/html/gtksourceview-4.0/GtkSourceStyleSchemeChooserButton.html +127 -0
  94. data/vendor/local/share/gtk-doc/html/gtksourceview-4.0/GtkSourceStyleSchemeChooserWidget.html +127 -0
  95. data/vendor/local/share/gtk-doc/html/gtksourceview-4.0/GtkSourceStyleSchemeManager.html +460 -0
  96. data/vendor/local/share/gtk-doc/html/gtksourceview-4.0/GtkSourceTag.html +179 -0
  97. data/vendor/local/share/gtk-doc/html/gtksourceview-4.0/GtkSourceUndoManager.html +460 -0
  98. data/vendor/local/share/gtk-doc/html/gtksourceview-4.0/GtkSourceView.html +2369 -0
  99. data/vendor/local/share/gtk-doc/html/gtksourceview-4.0/annexes.html +55 -0
  100. data/vendor/local/share/gtk-doc/html/gtksourceview-4.0/annotation-glossary.html +74 -0
  101. data/vendor/local/share/gtk-doc/html/gtksourceview-4.0/api-index-2-0.html +62 -0
  102. data/vendor/local/share/gtk-doc/html/gtksourceview-4.0/api-index-2-10.html +86 -0
  103. data/vendor/local/share/gtk-doc/html/gtksourceview-4.0/api-index-2-12.html +34 -0
  104. data/vendor/local/share/gtk-doc/html/gtksourceview-4.0/api-index-2-2.html +270 -0
  105. data/vendor/local/share/gtk-doc/html/gtksourceview-4.0/api-index-2-4.html +34 -0
  106. data/vendor/local/share/gtk-doc/html/gtksourceview-4.0/api-index-2-8.html +46 -0
  107. data/vendor/local/share/gtk-doc/html/gtksourceview-4.0/api-index-3-0.html +42 -0
  108. data/vendor/local/share/gtk-doc/html/gtksourceview-4.0/api-index-3-10.html +170 -0
  109. data/vendor/local/share/gtk-doc/html/gtksourceview-4.0/api-index-3-12.html +38 -0
  110. data/vendor/local/share/gtk-doc/html/gtksourceview-4.0/api-index-3-14.html +298 -0
  111. data/vendor/local/share/gtk-doc/html/gtksourceview-4.0/api-index-3-16.html +106 -0
  112. data/vendor/local/share/gtk-doc/html/gtksourceview-4.0/api-index-3-18.html +114 -0
  113. data/vendor/local/share/gtk-doc/html/gtksourceview-4.0/api-index-3-20.html +130 -0
  114. data/vendor/local/share/gtk-doc/html/gtksourceview-4.0/api-index-3-22.html +106 -0
  115. data/vendor/local/share/gtk-doc/html/gtksourceview-4.0/api-index-3-24.html +126 -0
  116. data/vendor/local/share/gtk-doc/html/gtksourceview-4.0/api-index-3-4.html +34 -0
  117. data/vendor/local/share/gtk-doc/html/gtksourceview-4.0/api-index-4-0.html +65 -0
  118. data/vendor/local/share/gtk-doc/html/gtksourceview-4.0/api-index-deprecated.html +30 -0
  119. data/vendor/local/share/gtk-doc/html/gtksourceview-4.0/api-index-full.html +2586 -0
  120. data/vendor/local/share/gtk-doc/html/gtksourceview-4.0/api-reference.html +174 -0
  121. data/vendor/local/share/gtk-doc/html/gtksourceview-4.0/completion.html +52 -0
  122. data/vendor/local/share/gtk-doc/html/gtksourceview-4.0/file-loading-and-saving.html +43 -0
  123. data/vendor/local/share/gtk-doc/html/gtksourceview-4.0/general.html +32 -0
  124. data/vendor/local/share/gtk-doc/html/gtksourceview-4.0/gtksourceview-4.0-GtkSourceUtils.html +151 -0
  125. data/vendor/local/share/gtk-doc/html/gtksourceview-4.0/gtksourceview-4.0-GtkSourceView-Initialization-and-Finalization.html +100 -0
  126. data/vendor/local/share/gtk-doc/html/gtksourceview-4.0/gtksourceview-4.0-Version-Information.html +511 -0
  127. data/vendor/local/share/gtk-doc/html/gtksourceview-4.0/gtksourceview-4.0.devhelp2 +819 -0
  128. data/vendor/local/share/gtk-doc/html/gtksourceview-4.0/gutter.html +49 -0
  129. data/vendor/local/share/gtk-doc/html/gtksourceview-4.0/home.png +0 -0
  130. data/vendor/local/share/gtk-doc/html/gtksourceview-4.0/index.html +215 -0
  131. data/vendor/local/share/gtk-doc/html/gtksourceview-4.0/intro.html +56 -0
  132. data/vendor/local/share/gtk-doc/html/gtksourceview-4.0/lang-reference.html +946 -0
  133. data/vendor/local/share/gtk-doc/html/gtksourceview-4.0/lang-tutorial.html +652 -0
  134. data/vendor/local/share/gtk-doc/html/gtksourceview-4.0/left-insensitive.png +0 -0
  135. data/vendor/local/share/gtk-doc/html/gtksourceview-4.0/left.png +0 -0
  136. data/vendor/local/share/gtk-doc/html/gtksourceview-4.0/main-classes.html +37 -0
  137. data/vendor/local/share/gtk-doc/html/gtksourceview-4.0/misc.html +52 -0
  138. data/vendor/local/share/gtk-doc/html/gtksourceview-4.0/object-tree.html +98 -0
  139. data/vendor/local/share/gtk-doc/html/gtksourceview-4.0/porting-guide-3-to-4.html +152 -0
  140. data/vendor/local/share/gtk-doc/html/gtksourceview-4.0/porting-guide.html +33 -0
  141. data/vendor/local/share/gtk-doc/html/gtksourceview-4.0/printing.html +32 -0
  142. data/vendor/local/share/gtk-doc/html/gtksourceview-4.0/right-insensitive.png +0 -0
  143. data/vendor/local/share/gtk-doc/html/gtksourceview-4.0/right.png +0 -0
  144. data/vendor/local/share/gtk-doc/html/gtksourceview-4.0/search-and-replace.html +37 -0
  145. data/vendor/local/share/gtk-doc/html/gtksourceview-4.0/style-reference.html +305 -0
  146. data/vendor/local/share/gtk-doc/html/gtksourceview-4.0/style.css +483 -0
  147. data/vendor/local/share/gtk-doc/html/gtksourceview-4.0/styling.html +49 -0
  148. data/vendor/local/share/gtk-doc/html/gtksourceview-4.0/syntax-highlighting-reference.html +49 -0
  149. data/vendor/local/share/gtk-doc/html/gtksourceview-4.0/syntax-highlighting.html +37 -0
  150. data/vendor/local/share/gtk-doc/html/gtksourceview-4.0/up-insensitive.png +0 -0
  151. data/vendor/local/share/gtk-doc/html/gtksourceview-4.0/up.png +0 -0
  152. data/vendor/local/share/gtksourceview-4/language-specs/R.lang +2198 -0
  153. data/vendor/local/share/gtksourceview-4/language-specs/abnf.lang +109 -0
  154. data/vendor/local/share/gtksourceview-4/language-specs/actionscript.lang +267 -0
  155. data/vendor/local/share/gtksourceview-4/language-specs/ada.lang +220 -0
  156. data/vendor/local/share/gtksourceview-4/language-specs/ansforth94.lang +728 -0
  157. data/vendor/local/share/gtksourceview-4/language-specs/asp.lang +1096 -0
  158. data/vendor/local/share/gtksourceview-4/language-specs/automake.lang +329 -0
  159. data/vendor/local/share/gtksourceview-4/language-specs/awk.lang +137 -0
  160. data/vendor/local/share/gtksourceview-4/language-specs/bennugd.lang +266 -0
  161. data/vendor/local/share/gtksourceview-4/language-specs/bibtex.lang +120 -0
  162. data/vendor/local/share/gtksourceview-4/language-specs/bluespec.lang +187 -0
  163. data/vendor/local/share/gtksourceview-4/language-specs/boo.lang +256 -0
  164. data/vendor/local/share/gtksourceview-4/language-specs/c.lang +343 -0
  165. data/vendor/local/share/gtksourceview-4/language-specs/cg.lang +231 -0
  166. data/vendor/local/share/gtksourceview-4/language-specs/changelog.lang +91 -0
  167. data/vendor/local/share/gtksourceview-4/language-specs/chdr.lang +50 -0
  168. data/vendor/local/share/gtksourceview-4/language-specs/cmake.lang +817 -0
  169. data/vendor/local/share/gtksourceview-4/language-specs/cobol.lang +646 -0
  170. data/vendor/local/share/gtksourceview-4/language-specs/cpp.lang +119 -0
  171. data/vendor/local/share/gtksourceview-4/language-specs/cpphdr.lang +41 -0
  172. data/vendor/local/share/gtksourceview-4/language-specs/csharp.lang +285 -0
  173. data/vendor/local/share/gtksourceview-4/language-specs/css.lang +2411 -0
  174. data/vendor/local/share/gtksourceview-4/language-specs/csv.lang +73 -0
  175. data/vendor/local/share/gtksourceview-4/language-specs/cuda.lang +281 -0
  176. data/vendor/local/share/gtksourceview-4/language-specs/d.lang +317 -0
  177. data/vendor/local/share/gtksourceview-4/language-specs/def.lang +261 -0
  178. data/vendor/local/share/gtksourceview-4/language-specs/desktop.lang +297 -0
  179. data/vendor/local/share/gtksourceview-4/language-specs/diff.lang +84 -0
  180. data/vendor/local/share/gtksourceview-4/language-specs/docbook.lang +475 -0
  181. data/vendor/local/share/gtksourceview-4/language-specs/dosbatch.lang +166 -0
  182. data/vendor/local/share/gtksourceview-4/language-specs/dot.lang +139 -0
  183. data/vendor/local/share/gtksourceview-4/language-specs/dpatch.lang +47 -0
  184. data/vendor/local/share/gtksourceview-4/language-specs/dtd.lang +139 -0
  185. data/vendor/local/share/gtksourceview-4/language-specs/dtl.lang +297 -0
  186. data/vendor/local/share/gtksourceview-4/language-specs/eiffel.lang +238 -0
  187. data/vendor/local/share/gtksourceview-4/language-specs/erlang.lang +262 -0
  188. data/vendor/local/share/gtksourceview-4/language-specs/fcl.lang +113 -0
  189. data/vendor/local/share/gtksourceview-4/language-specs/forth.lang +234 -0
  190. data/vendor/local/share/gtksourceview-4/language-specs/fortran.lang +710 -0
  191. data/vendor/local/share/gtksourceview-4/language-specs/fsharp.lang +324 -0
  192. data/vendor/local/share/gtksourceview-4/language-specs/gap.lang +84 -0
  193. data/vendor/local/share/gtksourceview-4/language-specs/gdb-log.lang +151 -0
  194. data/vendor/local/share/gtksourceview-4/language-specs/genie.lang +237 -0
  195. data/vendor/local/share/gtksourceview-4/language-specs/glsl.lang +482 -0
  196. data/vendor/local/share/gtksourceview-4/language-specs/go.lang +274 -0
  197. data/vendor/local/share/gtksourceview-4/language-specs/groovy.lang +330 -0
  198. data/vendor/local/share/gtksourceview-4/language-specs/gtk-doc.lang +90 -0
  199. data/vendor/local/share/gtksourceview-4/language-specs/gtkrc.lang +115 -0
  200. data/vendor/local/share/gtksourceview-4/language-specs/haddock.lang +161 -0
  201. data/vendor/local/share/gtksourceview-4/language-specs/haskell-literate.lang +58 -0
  202. data/vendor/local/share/gtksourceview-4/language-specs/haskell.lang +227 -0
  203. data/vendor/local/share/gtksourceview-4/language-specs/haxe.lang +237 -0
  204. data/vendor/local/share/gtksourceview-4/language-specs/html.lang +286 -0
  205. data/vendor/local/share/gtksourceview-4/language-specs/idl-exelis.lang +619 -0
  206. data/vendor/local/share/gtksourceview-4/language-specs/idl.lang +153 -0
  207. data/vendor/local/share/gtksourceview-4/language-specs/imagej.lang +783 -0
  208. data/vendor/local/share/gtksourceview-4/language-specs/ini.lang +94 -0
  209. data/vendor/local/share/gtksourceview-4/language-specs/j.lang +239 -0
  210. data/vendor/local/share/gtksourceview-4/language-specs/jade.lang +248 -0
  211. data/vendor/local/share/gtksourceview-4/language-specs/java.lang +188 -0
  212. data/vendor/local/share/gtksourceview-4/language-specs/javascript.lang +354 -0
  213. data/vendor/local/share/gtksourceview-4/language-specs/json.lang +124 -0
  214. data/vendor/local/share/gtksourceview-4/language-specs/julia.lang +376 -0
  215. data/vendor/local/share/gtksourceview-4/language-specs/kotlin.lang +389 -0
  216. data/vendor/local/share/gtksourceview-4/language-specs/language.dtd +72 -0
  217. data/vendor/local/share/gtksourceview-4/language-specs/language.rng +372 -0
  218. data/vendor/local/share/gtksourceview-4/language-specs/language2.rng +481 -0
  219. data/vendor/local/share/gtksourceview-4/language-specs/latex.lang +636 -0
  220. data/vendor/local/share/gtksourceview-4/language-specs/less.lang +793 -0
  221. data/vendor/local/share/gtksourceview-4/language-specs/lex.lang +208 -0
  222. data/vendor/local/share/gtksourceview-4/language-specs/libtool.lang +55 -0
  223. data/vendor/local/share/gtksourceview-4/language-specs/llvm.lang +314 -0
  224. data/vendor/local/share/gtksourceview-4/language-specs/logcat.lang +107 -0
  225. data/vendor/local/share/gtksourceview-4/language-specs/lua.lang +301 -0
  226. data/vendor/local/share/gtksourceview-4/language-specs/m4.lang +1374 -0
  227. data/vendor/local/share/gtksourceview-4/language-specs/makefile.lang +190 -0
  228. data/vendor/local/share/gtksourceview-4/language-specs/mallard.lang +123 -0
  229. data/vendor/local/share/gtksourceview-4/language-specs/markdown.lang +401 -0
  230. data/vendor/local/share/gtksourceview-4/language-specs/matlab.lang +148 -0
  231. data/vendor/local/share/gtksourceview-4/language-specs/maxima.lang +1864 -0
  232. data/vendor/local/share/gtksourceview-4/language-specs/mediawiki.lang +326 -0
  233. data/vendor/local/share/gtksourceview-4/language-specs/meson.lang +132 -0
  234. data/vendor/local/share/gtksourceview-4/language-specs/modelica.lang +261 -0
  235. data/vendor/local/share/gtksourceview-4/language-specs/mxml.lang +64 -0
  236. data/vendor/local/share/gtksourceview-4/language-specs/nemerle.lang +262 -0
  237. data/vendor/local/share/gtksourceview-4/language-specs/netrexx.lang +318 -0
  238. data/vendor/local/share/gtksourceview-4/language-specs/nsis.lang +87 -0
  239. data/vendor/local/share/gtksourceview-4/language-specs/objc.lang +119 -0
  240. data/vendor/local/share/gtksourceview-4/language-specs/objj.lang +127 -0
  241. data/vendor/local/share/gtksourceview-4/language-specs/ocaml.lang +301 -0
  242. data/vendor/local/share/gtksourceview-4/language-specs/ocl.lang +138 -0
  243. data/vendor/local/share/gtksourceview-4/language-specs/octave.lang +1757 -0
  244. data/vendor/local/share/gtksourceview-4/language-specs/ooc.lang +264 -0
  245. data/vendor/local/share/gtksourceview-4/language-specs/opal.lang +342 -0
  246. data/vendor/local/share/gtksourceview-4/language-specs/opencl.lang +599 -0
  247. data/vendor/local/share/gtksourceview-4/language-specs/pascal.lang +267 -0
  248. data/vendor/local/share/gtksourceview-4/language-specs/perl.lang +1044 -0
  249. data/vendor/local/share/gtksourceview-4/language-specs/php.lang +362 -0
  250. data/vendor/local/share/gtksourceview-4/language-specs/pig.lang +292 -0
  251. data/vendor/local/share/gtksourceview-4/language-specs/pkgconfig.lang +61 -0
  252. data/vendor/local/share/gtksourceview-4/language-specs/po.lang +93 -0
  253. data/vendor/local/share/gtksourceview-4/language-specs/prolog.lang +248 -0
  254. data/vendor/local/share/gtksourceview-4/language-specs/protobuf.lang +134 -0
  255. data/vendor/local/share/gtksourceview-4/language-specs/puppet.lang +696 -0
  256. data/vendor/local/share/gtksourceview-4/language-specs/python.lang +475 -0
  257. data/vendor/local/share/gtksourceview-4/language-specs/python3.lang +198 -0
  258. data/vendor/local/share/gtksourceview-4/language-specs/rpmspec.lang +215 -0
  259. data/vendor/local/share/gtksourceview-4/language-specs/rst.lang +141 -0
  260. data/vendor/local/share/gtksourceview-4/language-specs/ruby.lang +748 -0
  261. data/vendor/local/share/gtksourceview-4/language-specs/rust.lang +334 -0
  262. data/vendor/local/share/gtksourceview-4/language-specs/scala.lang +383 -0
  263. data/vendor/local/share/gtksourceview-4/language-specs/scheme.lang +301 -0
  264. data/vendor/local/share/gtksourceview-4/language-specs/scilab.lang +208 -0
  265. data/vendor/local/share/gtksourceview-4/language-specs/scss.lang +878 -0
  266. data/vendor/local/share/gtksourceview-4/language-specs/sh.lang +516 -0
  267. data/vendor/local/share/gtksourceview-4/language-specs/sml.lang +200 -0
  268. data/vendor/local/share/gtksourceview-4/language-specs/sparql.lang +451 -0
  269. data/vendor/local/share/gtksourceview-4/language-specs/sql.lang +617 -0
  270. data/vendor/local/share/gtksourceview-4/language-specs/sweave.lang +66 -0
  271. data/vendor/local/share/gtksourceview-4/language-specs/swift.lang +440 -0
  272. data/vendor/local/share/gtksourceview-4/language-specs/systemverilog.lang +262 -0
  273. data/vendor/local/share/gtksourceview-4/language-specs/t2t.lang +149 -0
  274. data/vendor/local/share/gtksourceview-4/language-specs/tcl.lang +145 -0
  275. data/vendor/local/share/gtksourceview-4/language-specs/tera.lang +142 -0
  276. data/vendor/local/share/gtksourceview-4/language-specs/texinfo.lang +447 -0
  277. data/vendor/local/share/gtksourceview-4/language-specs/thrift.lang +266 -0
  278. data/vendor/local/share/gtksourceview-4/language-specs/toml.lang +282 -0
  279. data/vendor/local/share/gtksourceview-4/language-specs/vala.lang +411 -0
  280. data/vendor/local/share/gtksourceview-4/language-specs/vbnet.lang +247 -0
  281. data/vendor/local/share/gtksourceview-4/language-specs/verilog.lang +475 -0
  282. data/vendor/local/share/gtksourceview-4/language-specs/vhdl.lang +247 -0
  283. data/vendor/local/share/gtksourceview-4/language-specs/xml.lang +219 -0
  284. data/vendor/local/share/gtksourceview-4/language-specs/xslt.lang +120 -0
  285. data/vendor/local/share/gtksourceview-4/language-specs/yacc.lang +176 -0
  286. data/vendor/local/share/gtksourceview-4/language-specs/yaml.lang +213 -0
  287. data/vendor/local/share/gtksourceview-4/styles/classic.xml +122 -0
  288. data/vendor/local/share/gtksourceview-4/styles/cobalt.xml +150 -0
  289. data/vendor/local/share/gtksourceview-4/styles/kate.xml +171 -0
  290. data/vendor/local/share/gtksourceview-4/styles/oblivion.xml +133 -0
  291. data/vendor/local/share/gtksourceview-4/styles/solarized-dark.xml +103 -0
  292. data/vendor/local/share/gtksourceview-4/styles/solarized-light.xml +102 -0
  293. data/vendor/local/share/gtksourceview-4/styles/styles.rng +139 -0
  294. data/vendor/local/share/gtksourceview-4/styles/tango.xml +130 -0
  295. data/vendor/local/share/license/gtksourceview/AUTHORS +15 -0
  296. data/vendor/local/share/license/gtksourceview/COPYING +504 -0
  297. data/vendor/local/share/locale/ar/LC_MESSAGES/gtksourceview-4.mo +0 -0
  298. data/vendor/local/share/locale/as/LC_MESSAGES/gtksourceview-4.mo +0 -0
  299. data/vendor/local/share/locale/ast/LC_MESSAGES/gtksourceview-4.mo +0 -0
  300. data/vendor/local/share/locale/az/LC_MESSAGES/gtksourceview-4.mo +0 -0
  301. data/vendor/local/share/locale/be/LC_MESSAGES/gtksourceview-4.mo +0 -0
  302. data/vendor/local/share/locale/bg/LC_MESSAGES/gtksourceview-4.mo +0 -0
  303. data/vendor/local/share/locale/bn/LC_MESSAGES/gtksourceview-4.mo +0 -0
  304. data/vendor/local/share/locale/bn_IN/LC_MESSAGES/gtksourceview-4.mo +0 -0
  305. data/vendor/local/share/locale/bs/LC_MESSAGES/gtksourceview-4.mo +0 -0
  306. data/vendor/local/share/locale/ca/LC_MESSAGES/gtksourceview-4.mo +0 -0
  307. data/vendor/local/share/locale/ca@valencia/LC_MESSAGES/gtksourceview-4.mo +0 -0
  308. data/vendor/local/share/locale/cs/LC_MESSAGES/gtksourceview-4.mo +0 -0
  309. data/vendor/local/share/locale/cy/LC_MESSAGES/gtksourceview-4.mo +0 -0
  310. data/vendor/local/share/locale/da/LC_MESSAGES/gtksourceview-4.mo +0 -0
  311. data/vendor/local/share/locale/de/LC_MESSAGES/gtksourceview-4.mo +0 -0
  312. data/vendor/local/share/locale/dz/LC_MESSAGES/gtksourceview-4.mo +0 -0
  313. data/vendor/local/share/locale/el/LC_MESSAGES/gtksourceview-4.mo +0 -0
  314. data/vendor/local/share/locale/en@shaw/LC_MESSAGES/gtksourceview-4.mo +0 -0
  315. data/vendor/local/share/locale/en_CA/LC_MESSAGES/gtksourceview-4.mo +0 -0
  316. data/vendor/local/share/locale/en_GB/LC_MESSAGES/gtksourceview-4.mo +0 -0
  317. data/vendor/local/share/locale/eo/LC_MESSAGES/gtksourceview-4.mo +0 -0
  318. data/vendor/local/share/locale/es/LC_MESSAGES/gtksourceview-4.mo +0 -0
  319. data/vendor/local/share/locale/et/LC_MESSAGES/gtksourceview-4.mo +0 -0
  320. data/vendor/local/share/locale/eu/LC_MESSAGES/gtksourceview-4.mo +0 -0
  321. data/vendor/local/share/locale/fa/LC_MESSAGES/gtksourceview-4.mo +0 -0
  322. data/vendor/local/share/locale/fi/LC_MESSAGES/gtksourceview-4.mo +0 -0
  323. data/vendor/local/share/locale/fr/LC_MESSAGES/gtksourceview-4.mo +0 -0
  324. data/vendor/local/share/locale/fur/LC_MESSAGES/gtksourceview-4.mo +0 -0
  325. data/vendor/local/share/locale/ga/LC_MESSAGES/gtksourceview-4.mo +0 -0
  326. data/vendor/local/share/locale/gl/LC_MESSAGES/gtksourceview-4.mo +0 -0
  327. data/vendor/local/share/locale/gu/LC_MESSAGES/gtksourceview-4.mo +0 -0
  328. data/vendor/local/share/locale/he/LC_MESSAGES/gtksourceview-4.mo +0 -0
  329. data/vendor/local/share/locale/hi/LC_MESSAGES/gtksourceview-4.mo +0 -0
  330. data/vendor/local/share/locale/hr/LC_MESSAGES/gtksourceview-4.mo +0 -0
  331. data/vendor/local/share/locale/hu/LC_MESSAGES/gtksourceview-4.mo +0 -0
  332. data/vendor/local/share/locale/id/LC_MESSAGES/gtksourceview-4.mo +0 -0
  333. data/vendor/local/share/locale/it/LC_MESSAGES/gtksourceview-4.mo +0 -0
  334. data/vendor/local/share/locale/ja/LC_MESSAGES/gtksourceview-4.mo +0 -0
  335. data/vendor/local/share/locale/kk/LC_MESSAGES/gtksourceview-4.mo +0 -0
  336. data/vendor/local/share/locale/kn/LC_MESSAGES/gtksourceview-4.mo +0 -0
  337. data/vendor/local/share/locale/ko/LC_MESSAGES/gtksourceview-4.mo +0 -0
  338. data/vendor/local/share/locale/lt/LC_MESSAGES/gtksourceview-4.mo +0 -0
  339. data/vendor/local/share/locale/lv/LC_MESSAGES/gtksourceview-4.mo +0 -0
  340. data/vendor/local/share/locale/mai/LC_MESSAGES/gtksourceview-4.mo +0 -0
  341. data/vendor/local/share/locale/mg/LC_MESSAGES/gtksourceview-4.mo +0 -0
  342. data/vendor/local/share/locale/mk/LC_MESSAGES/gtksourceview-4.mo +0 -0
  343. data/vendor/local/share/locale/ml/LC_MESSAGES/gtksourceview-4.mo +0 -0
  344. data/vendor/local/share/locale/mn/LC_MESSAGES/gtksourceview-4.mo +0 -0
  345. data/vendor/local/share/locale/mr/LC_MESSAGES/gtksourceview-4.mo +0 -0
  346. data/vendor/local/share/locale/ms/LC_MESSAGES/gtksourceview-4.mo +0 -0
  347. data/vendor/local/share/locale/nb/LC_MESSAGES/gtksourceview-4.mo +0 -0
  348. data/vendor/local/share/locale/ne/LC_MESSAGES/gtksourceview-4.mo +0 -0
  349. data/vendor/local/share/locale/nl/LC_MESSAGES/gtksourceview-4.mo +0 -0
  350. data/vendor/local/share/locale/nn/LC_MESSAGES/gtksourceview-4.mo +0 -0
  351. data/vendor/local/share/locale/oc/LC_MESSAGES/gtksourceview-4.mo +0 -0
  352. data/vendor/local/share/locale/or/LC_MESSAGES/gtksourceview-4.mo +0 -0
  353. data/vendor/local/share/locale/pa/LC_MESSAGES/gtksourceview-4.mo +0 -0
  354. data/vendor/local/share/locale/pl/LC_MESSAGES/gtksourceview-4.mo +0 -0
  355. data/vendor/local/share/locale/pt/LC_MESSAGES/gtksourceview-4.mo +0 -0
  356. data/vendor/local/share/locale/pt_BR/LC_MESSAGES/gtksourceview-4.mo +0 -0
  357. data/vendor/local/share/locale/ro/LC_MESSAGES/gtksourceview-4.mo +0 -0
  358. data/vendor/local/share/locale/ru/LC_MESSAGES/gtksourceview-4.mo +0 -0
  359. data/vendor/local/share/locale/rw/LC_MESSAGES/gtksourceview-4.mo +0 -0
  360. data/vendor/local/share/locale/si/LC_MESSAGES/gtksourceview-4.mo +0 -0
  361. data/vendor/local/share/locale/sk/LC_MESSAGES/gtksourceview-4.mo +0 -0
  362. data/vendor/local/share/locale/sl/LC_MESSAGES/gtksourceview-4.mo +0 -0
  363. data/vendor/local/share/locale/sq/LC_MESSAGES/gtksourceview-4.mo +0 -0
  364. data/vendor/local/share/locale/sr/LC_MESSAGES/gtksourceview-4.mo +0 -0
  365. data/vendor/local/share/locale/sr@latin/LC_MESSAGES/gtksourceview-4.mo +0 -0
  366. data/vendor/local/share/locale/sv/LC_MESSAGES/gtksourceview-4.mo +0 -0
  367. data/vendor/local/share/locale/ta/LC_MESSAGES/gtksourceview-4.mo +0 -0
  368. data/vendor/local/share/locale/te/LC_MESSAGES/gtksourceview-4.mo +0 -0
  369. data/vendor/local/share/locale/tg/LC_MESSAGES/gtksourceview-4.mo +0 -0
  370. data/vendor/local/share/locale/th/LC_MESSAGES/gtksourceview-4.mo +0 -0
  371. data/vendor/local/share/locale/tr/LC_MESSAGES/gtksourceview-4.mo +0 -0
  372. data/vendor/local/share/locale/ug/LC_MESSAGES/gtksourceview-4.mo +0 -0
  373. data/vendor/local/share/locale/uk/LC_MESSAGES/gtksourceview-4.mo +0 -0
  374. data/vendor/local/share/locale/vi/LC_MESSAGES/gtksourceview-4.mo +0 -0
  375. data/vendor/local/share/locale/xh/LC_MESSAGES/gtksourceview-4.mo +0 -0
  376. data/vendor/local/share/locale/zh_CN/LC_MESSAGES/gtksourceview-4.mo +0 -0
  377. data/vendor/local/share/locale/zh_HK/LC_MESSAGES/gtksourceview-4.mo +0 -0
  378. data/vendor/local/share/locale/zh_TW/LC_MESSAGES/gtksourceview-4.mo +0 -0
  379. metadata +437 -0
@@ -0,0 +1,652 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2
+ <html>
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5
+ <title>Language Definition v2.0 Tutorial: GtkSourceView 4 Reference Manual</title>
6
+ <meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
7
+ <link rel="home" href="index.html" title="GtkSourceView 4 Reference Manual">
8
+ <link rel="up" href="syntax-highlighting-reference.html" title="Part III. Syntax highlighting reference">
9
+ <link rel="prev" href="syntax-highlighting-reference.html" title="Part III. Syntax highlighting reference">
10
+ <link rel="next" href="lang-reference.html" title="Language Definition v2.0 Reference">
11
+ <meta name="generator" content="GTK-Doc V1.28.1 (XML mode)">
12
+ <link rel="stylesheet" href="style.css" type="text/css">
13
+ </head>
14
+ <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
15
+ <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
16
+ <td width="100%" align="left" class="shortcuts"></td>
17
+ <td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
18
+ <td><a accesskey="u" href="syntax-highlighting-reference.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
19
+ <td><a accesskey="p" href="syntax-highlighting-reference.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
20
+ <td><a accesskey="n" href="lang-reference.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
21
+ </tr></table>
22
+ <div class="refentry">
23
+ <a name="lang-tutorial"></a><div class="titlepage"></div>
24
+ <div class="refnamediv"><table width="100%"><tr>
25
+ <td valign="top">
26
+ <h2><span class="refentrytitle">Language Definition v2.0 Tutorial</span></h2>
27
+ <p>Language Definition v2.0 Tutorial —
28
+ Guide to the GtkSourceView language definition file format
29
+ </p>
30
+ </td>
31
+ <td class="gallery_image" valign="top" align="right"></td>
32
+ </tr></table></div>
33
+ <div class="refsect1">
34
+ <a name="tutorial"></a><h2>A language definition for the C language</h2>
35
+ <div class="note"><p>
36
+ The version 2 here refers to the language definition file format,
37
+ not to the version of GtkSourceView. This tutorial is suitable
38
+ for GtkSourceView 2, 3 and 4.
39
+ </p></div>
40
+ <p>
41
+ To describe the syntax of a language GtkSourceView uses an XML format which
42
+ defines nested context to be highlighted. Each context roughly corresponds
43
+ to a portion of the syntax which has to be highlighted (e.g. keywords,
44
+ strings, comments), and can contain nested contexts (e.g. escaped
45
+ characters.)
46
+ </p>
47
+ <p>
48
+ In this tutorial we will analyze a simple example to highlight a subset of
49
+ C, based on the full C language definition.
50
+ </p>
51
+ <p>
52
+ Like every well formed XML document, the language description starts with a
53
+ XML declaration:
54
+ </p>
55
+ <pre class="programlisting">
56
+ &lt;?xml version="1.0" encoding="UTF-8"?&gt;
57
+ </pre>
58
+ <p>
59
+ After the usual preamble, the main tag is the <code class="code">&lt;language&gt;</code> element:
60
+ </p>
61
+ <pre class="programlisting">
62
+ &lt;language id="c" name="C" version="2.0" _section="Source"&gt;
63
+ </pre>
64
+ <p>
65
+ The attribute <code class="code">id</code> is used in external references and defines a standard
66
+ way to refer to this language definition, while the <code class="code">name</code> attribute is
67
+ the name presented to the user.
68
+ </p>
69
+ <p>
70
+ The attribute <code class="code">section</code> (it is translatable using gettext prepending
71
+ a <code class="code">_</code>), tells the category where this language should be grouped when
72
+ it is presented to the user. Currently available categories in GtkSourceView are
73
+ "Source", "Script", "Markup", "Scientific" and "Other".
74
+ </p>
75
+ <p>
76
+ The attribute <code class="code">version</code> specifies the version of the xml syntax
77
+ used in your language definition file, so it should always be <code class="code">2.0</code>.
78
+ </p>
79
+ <p>
80
+ The <code class="code">&lt;language&gt;</code> element contains three sections:
81
+ <code class="code">&lt;metadata&gt;</code>, <code class="code">&lt;styles&gt;</code> and
82
+ <code class="code">&lt;definitions&gt;</code>
83
+ </p>
84
+ <pre class="programlisting">
85
+ &lt;metadata&gt;
86
+ </pre>
87
+ <p>
88
+ The <code class="code">&lt;metadata&gt;</code> element is optional and provides a collection
89
+ of properties which specify arbitrary information about the language definition
90
+ file itself. It is particularly important to specify the conventional
91
+ <code class="code">mimetypes</code> and <code class="code">globs</code> properties that
92
+ GtkSourceView uses to automatically detect which syntax highlighting to use
93
+ for a given file. They respectively contain a semi-colon separated list of
94
+ mimetypes and filename extensions.
95
+ </p>
96
+ <pre class="programlisting">
97
+ &lt;metadata&gt;
98
+ &lt;property name="mimetypes"&gt;text/x-c;text/x-csrc&lt;/property&gt;
99
+ &lt;property name="globs"&gt;*.c&lt;/property&gt;
100
+ &lt;/metadata&gt;
101
+ </pre>
102
+ <pre class="programlisting">
103
+ &lt;styles&gt;
104
+ </pre>
105
+ <p>
106
+ This element contains every association between the styles used in the
107
+ description and the defaults stored internally in GtkSourceView.
108
+ For each style there is a <code class="code">&lt;style&gt;</code> element:
109
+ </p>
110
+ <pre class="programlisting">
111
+ &lt;style id="comment" name="Comment" map-to="def:comment"/&gt;
112
+ </pre>
113
+ <p>
114
+ This defines a <code class="code">comment</code> style, which inherits the font
115
+ properties from the defaults style <code class="code">def:comment</code>.
116
+ The <code class="code">name</code> attribute is the name to show to the user (that string
117
+ could for example be used by a GUI tool to edit or create style schemes).
118
+ </p>
119
+ <p>
120
+ For each style used in the language definition there is a corresponding
121
+ <code class="code">&lt;style&gt;</code> element; every style can be used in different
122
+ contexts, so they will share the same appearance.
123
+ </p>
124
+ <pre class="programlisting">
125
+ &lt;style id="string" name="String" map-to="def:string"/&gt;
126
+ &lt;style id="escaped-character" name="Escaped Character" map-to="def:special-char"/&gt;
127
+ &lt;style id="preprocessor" name="Preprocessor" map-to="def:preprocessor"/&gt;
128
+ &lt;style id="included-file" name="Included File" map-to="def:string"/&gt;
129
+ &lt;style id="char" name="Character" map-to="def:character"/&gt;
130
+ &lt;style id="keyword" name="Keyword" map-to="def:keyword"/&gt;
131
+ &lt;style id="type" name="Data Type" map-to="def:type"/&gt;
132
+ </pre>
133
+ <p>
134
+ Following the <code class="code">&lt;styles&gt;</code> element there is the
135
+ <code class="code">&lt;definitions&gt;</code> element, which contains the
136
+ description proper of the syntax:
137
+ </p>
138
+ <pre class="programlisting">
139
+ &lt;definitions&gt;
140
+ </pre>
141
+ <p>
142
+ Here we should define a main context, the one we enter at the beginning of
143
+ the file: to do so we use the <code class="code">&lt;context&gt;</code> tag, with an
144
+ <code class="code">id</code> equal to the <code class="code">id</code> of the
145
+ <code class="code">&lt;language&gt;</code> element:
146
+ </p>
147
+ <pre class="programlisting">
148
+ &lt;context id="c"&gt;
149
+ </pre>
150
+ <p>
151
+ The element <code class="code">&lt;include&gt;</code> contains the list of sub-contexts
152
+ for the current context: as we are in the main context we should put here
153
+ the top level contexts for the C language:
154
+ </p>
155
+ <pre class="programlisting">
156
+ &lt;include&gt;
157
+ </pre>
158
+ <p>
159
+ The first context defined is the one for single-line C style comments: they
160
+ start with a double slash <code class="code">//</code> and end at the end of the line:
161
+ </p>
162
+ <pre class="programlisting">
163
+ &lt;context id="comment" style-ref="comment"&gt;
164
+ &lt;start&gt;\/\/&lt;/start&gt;
165
+ &lt;end&gt;$&lt;/end&gt;
166
+ &lt;/context&gt;
167
+ </pre>
168
+ <p>
169
+ The <code class="code">&lt;start&gt;</code> element contains the regular expression telling
170
+ the highlighting engine to enter in the defined context, until the terminating
171
+ regular expression contained in the <code class="code">&lt;end&gt;</code> element is found.
172
+ </p>
173
+ <p>
174
+ Those regular expressions are PCRE regular expressions in the form
175
+ <code class="code">/regex/options</code> (see the documentation of PCRE for details.) If
176
+ there are no options to be specified and you don't need to match the spaces at
177
+ the start and at the end of the regular expression, you can omit the slashes,
178
+ putting here only <code class="code">regex</code>.
179
+ </p>
180
+ <p>
181
+ The possible options are:
182
+ </p>
183
+ <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
184
+ <li class="listitem"><p>
185
+ <code class="code">i</code>: case insensitive;
186
+ </p></li>
187
+ <li class="listitem"><p>
188
+ <code class="code">x</code>: extended (spaces are ignored and it is possible to put comments
189
+ starting with <code class="code">#</code> and ending at the end of the line);
190
+ </p></li>
191
+ <li class="listitem"><p>
192
+ <code class="code">s</code>: the metacharacter <code class="code">.</code> matches the <code class="code">\n</code>.
193
+ </p></li>
194
+ </ul></div>
195
+ <p>
196
+ You can set the default options using the <code class="code">&lt;default-regex-options</code> tag
197
+ before the <code class="code">&lt;definitions&gt;</code> element. To disable a group of options,
198
+ instead, you have to preced them with a hyphen (<code class="code">-</code>).
199
+ [FIXME: add an example]
200
+ </p>
201
+ <p>
202
+ In GtkSourceView are available also some extensions to the standard perl
203
+ style regular expressions:
204
+ </p>
205
+ <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
206
+ <li class="listitem"><p>
207
+ <code class="code">\%[</code> and <code class="code">\%]</code> are custom word boundaries, which can
208
+ be redefined with the <code class="code">&lt;keyword-char-class&gt;</code> tag (in
209
+ contrast with <code class="code">\b</code>);
210
+ </p></li>
211
+ <li class="listitem"><p>
212
+ <code class="code">\%{id}</code> will include the regular expression defined in the
213
+ <code class="code">&lt;define-regex&gt;</code> tag with the same id, useful if you have
214
+ common portions of regular expressions used in different contexts;
215
+ </p></li>
216
+ <li class="listitem"><p>
217
+ <code class="code">\%{subpattern@start}</code> can be used only inside the
218
+ <code class="code">&lt;end&gt;</code> tag and will be substituted with the
219
+ string matched in the corresponding
220
+ sub-pattern (can be a number or a name if named sub-patterns are
221
+ used) in the preceding <code class="code">&lt;start&gt;</code> element. For an example
222
+ see the implementation of here-documents in the <code class="filename">sh.lang</code>
223
+ language description distribuited with GtkSourceView.
224
+ </p></li>
225
+ </ul></div>
226
+ <p>
227
+ The next context is for C-style strings. They start and end with a double
228
+ quote but they can contain escaped double quotes, so we sould make sure
229
+ we don't end the string prematurely:
230
+ </p>
231
+ <pre class="programlisting">
232
+ &lt;context id="string" end-at-line-end="true" style-ref="string"&gt;
233
+ </pre>
234
+ <p>
235
+ The <code class="code">end-at-line-end</code> attribute tells the engine that the current context
236
+ should be forced to terminate at the end of the line, even if the ending
237
+ regular expression is not found, and that an error should be displayed.
238
+ </p>
239
+ <pre class="programlisting">
240
+ &lt;start&gt;"&lt;/start&gt;
241
+ &lt;end&gt;"&lt;/end&gt;
242
+ &lt;include&gt;
243
+ </pre>
244
+ <p>
245
+ To implement the escape handling we include a <code class="code">escape</code> context:
246
+ </p>
247
+ <pre class="programlisting">
248
+ &lt;context id="escape" style-ref="escaped-character"&gt;
249
+ &lt;match&gt;\\.&lt;/match&gt;
250
+ &lt;/context&gt;
251
+ </pre>
252
+ <p>
253
+ This is a simple context matching a single regular expression, contained in
254
+ the <code class="code">&lt;match&gt;</code> element. This context will extend its parent, causing the
255
+ ending regular expression of the <code class="code">"string"</code> context to not match the escaped
256
+ double quote.
257
+ </p>
258
+ <pre class="programlisting">
259
+ &lt;/include&gt;
260
+ &lt;/context&gt;
261
+ </pre>
262
+ <p>
263
+ Multiline C-style comment can span over multiple lines and cannot be
264
+ escaped, but to make things more interesting we want to highlight every
265
+ internet address contained:
266
+ </p>
267
+ <pre class="programlisting">
268
+ &lt;context id="comment-multiline" style-ref="comment"&gt;
269
+ &lt;start&gt;\/\*&lt;/start&gt;
270
+ &lt;end&gt;\*\/&lt;/end&gt;
271
+ &lt;include&gt;
272
+ &lt;context id="net-address" style-ref="net-address" extend-parent="false"&gt;
273
+ </pre>
274
+ <p>
275
+ In this case, the child should be terminated if the end of the parent is
276
+ found, so we use <code class="code">false</code> in the <code class="code">extend-parent</code> attribute.
277
+ </p>
278
+ <pre class="programlisting">
279
+ &lt;match&gt;http:\/\/[^\s]*&lt;/match&gt;
280
+ &lt;/context&gt;
281
+ &lt;/include&gt;
282
+ &lt;/context&gt;
283
+ </pre>
284
+ <p>
285
+ For instance in the following comment the string <code class="code">http://www.gnome.org*/</code>
286
+ matches the <code class="code">net-address</code> context but it contains the end of the parent
287
+ context (<code class="code">*/</code>.) As <code class="code">extend-parent</code> is false,
288
+ only <code class="code">http://www.gnome.org</code> is
289
+ highlighted as an address and <code class="code">*/</code> is correctly recognized as the end of
290
+ the comment.
291
+ </p>
292
+ <pre class="programlisting">
293
+ /* This is a comment http://www.gnome.org */
294
+ </pre>
295
+ <p>
296
+ Character constants in C are delimited by single quotes (<code class="code">'</code>) and can
297
+ contain escaped characters:
298
+ </p>
299
+ <pre class="programlisting">
300
+ &lt;context id="char" end-at-line-end="true" style-ref="string"&gt;
301
+ &lt;start&gt;'&lt;/start&gt;
302
+ &lt;end&gt;'&lt;/end&gt;
303
+ &lt;include&gt;
304
+ &lt;context ref="escape"/&gt;
305
+ </pre>
306
+ <p>
307
+ The <code class="code">ref</code> attribute is used when we want to reuse a previously defined
308
+ context. Here we reuse the <code class="code">escape</code> context defined in the <code class="code">string</code>
309
+ context, without repeating its definition.
310
+ </p>
311
+ <pre class="programlisting">
312
+ &lt;/include&gt;
313
+ &lt;/context&gt;
314
+ </pre>
315
+ <p>
316
+ Using <code class="code">ref</code> it is also possible to refer to contexts defined in other
317
+ languages, preceding the id of the context with the id of the containing
318
+ language, separating them with a colon:
319
+ </p>
320
+ <pre class="programlisting">
321
+ &lt;context ref="def:decimal"/&gt;
322
+ &lt;context ref="def:float"/&gt;
323
+ </pre>
324
+ <p>
325
+ The definitions for decimal and float constants are in a external file,
326
+ with id <code class="code">def</code>, which is not associated with any language but contains
327
+ reusable contexts wich every language definition can import.
328
+ </p>
329
+ <p>
330
+ The <code class="code">def</code> language file contains an <code class="code">in-comment</code> context that can contain
331
+ addresses and tags such as FIXME and TODO, so we can write a new version of
332
+ our <code class="code">comment-multiline</code> context that uses the definitions from <code class="code">def.lang</code>.
333
+ </p>
334
+ <pre class="programlisting">
335
+ &lt;context id="comment-multiline" style-ref="comment"&gt;
336
+ &lt;start&gt;\/\*&lt;/start&gt;
337
+ &lt;end&gt;\*\/&lt;/end&gt;
338
+ &lt;include&gt;
339
+ &lt;context ref="def:in-comment"/&gt;
340
+ </pre>
341
+ <pre class="programlisting">
342
+ &lt;/include&gt;
343
+ &lt;/context&gt;
344
+ </pre>
345
+ <p>
346
+ Keywords can be grouped in a context using a list of <code class="code">&lt;keyword&gt;</code>
347
+ elements:
348
+ </p>
349
+ <pre class="programlisting">
350
+ &lt;context id="keywords" style-ref="keyword"&gt;
351
+ &lt;keyword&gt;if&lt;/keyword&gt;
352
+ &lt;keyword&gt;else&lt;/keyword&gt;
353
+ &lt;keyword&gt;for&lt;/keyword&gt;
354
+ &lt;keyword&gt;while&lt;/keyword&gt;
355
+ &lt;keyword&gt;return&lt;/keyword&gt;
356
+ &lt;keyword&gt;break&lt;/keyword&gt;
357
+ &lt;keyword&gt;switch&lt;/keyword&gt;
358
+ &lt;keyword&gt;case&lt;/keyword&gt;
359
+ &lt;keyword&gt;default&lt;/keyword&gt;
360
+ &lt;keyword&gt;do&lt;/keyword&gt;
361
+ &lt;keyword&gt;continue&lt;/keyword&gt;
362
+ &lt;keyword&gt;goto&lt;/keyword&gt;
363
+ &lt;keyword&gt;sizeof&lt;/keyword&gt;
364
+ &lt;/context&gt;
365
+ </pre>
366
+ <p>
367
+ Keywords with different meaning can be grouped in different context, making
368
+ possible to highlight them differently:
369
+ </p>
370
+ <pre class="programlisting">
371
+ &lt;context id="types" style-ref="type"&gt;
372
+ &lt;keyword&gt;char&lt;/keyword&gt;
373
+ &lt;keyword&gt;const&lt;/keyword&gt;
374
+ &lt;keyword&gt;double&lt;/keyword&gt;
375
+ &lt;keyword&gt;enum&lt;/keyword&gt;
376
+ &lt;keyword&gt;float&lt;/keyword&gt;
377
+ &lt;keyword&gt;int&lt;/keyword&gt;
378
+ &lt;keyword&gt;long&lt;/keyword&gt;
379
+ &lt;keyword&gt;short&lt;/keyword&gt;
380
+ &lt;keyword&gt;signed&lt;/keyword&gt;
381
+ &lt;keyword&gt;static&lt;/keyword&gt;
382
+ &lt;keyword&gt;struct&lt;/keyword&gt;
383
+ &lt;keyword&gt;typedef&lt;/keyword&gt;
384
+ &lt;keyword&gt;union&lt;/keyword&gt;
385
+ &lt;keyword&gt;unsigned&lt;/keyword&gt;
386
+ &lt;keyword&gt;void&lt;/keyword&gt;
387
+ &lt;/context&gt;
388
+ </pre>
389
+ <p>
390
+ You can also set a prefix (or a suffix) common to every keyword using the
391
+ <code class="code">&lt;prefix&gt;</code> and <code class="code">&lt;suffix&gt;</code> tags:
392
+ </p>
393
+ <pre class="programlisting">
394
+ &lt;context id="preprocessor" style-ref="preprocessor"&gt;
395
+ &lt;prefix&gt;^#&lt;/prefix&gt;
396
+ </pre>
397
+ <p>
398
+ If not specified, <code class="code">&lt;prefix&gt;</code> and <code class="code">&lt;suffix&gt;</code>
399
+ are set to, respectively, <code class="code">\%[</code> and
400
+ <code class="code">\%]</code>.
401
+ </p>
402
+ <pre class="programlisting">
403
+ &lt;keyword&gt;define&lt;/keyword&gt;
404
+ &lt;keyword&gt;undef&lt;/keyword&gt;
405
+ </pre>
406
+ <p>
407
+ Keep in mind that every keyword is a regular expression:
408
+ </p>
409
+ <pre class="programlisting">
410
+ &lt;keyword&gt;if(n?def)?&lt;/keyword&gt;
411
+ &lt;keyword&gt;else&lt;/keyword&gt;
412
+ &lt;keyword&gt;elif&lt;/keyword&gt;
413
+ &lt;keyword&gt;endif&lt;/keyword&gt;
414
+ &lt;/context&gt;
415
+ </pre>
416
+ <p>
417
+ In C, there is a common pratice to use <code class="code">#if 0</code> to express multi-line
418
+ nesting comments. To make things easier to the user, we want to highlight
419
+ these pseudo-comments as comments:
420
+ </p>
421
+ <pre class="programlisting">
422
+ &lt;context id="if0-comment" style-ref="comment"&gt;
423
+ &lt;start&gt;^#if 0\b&lt;/start&gt;
424
+ &lt;end&gt;^#(endif|else|elif)\b&lt;/end&gt;
425
+ &lt;include&gt;
426
+ </pre>
427
+ <p>
428
+ As <code class="code">#if 0</code> comments are nesting, we should consider that inside a comment
429
+ we can find other <code class="code">#if</code>s with the corresponding <code class="code">#endif</code>s, avoiding
430
+ the termination of the comment on the wrong <code class="code">#endif</code>. To do so we use a
431
+ nested context, that will extend the parent on every nested
432
+ <code class="code">#if</code>/<code class="code">#endif</code>:
433
+ </p>
434
+ <pre class="programlisting">
435
+ &lt;context id="if-in-if0"&gt;
436
+ &lt;start&gt;^#if(n?def)?\b&lt;/start&gt;
437
+ &lt;end&gt;^#endif\b&lt;/end&gt;
438
+ &lt;include&gt;
439
+ </pre>
440
+ <p>
441
+ Nested contexts can be recursive:
442
+ </p>
443
+ <pre class="programlisting">
444
+ &lt;context ref="if-in-if0"/&gt;
445
+ &lt;/include&gt;
446
+ &lt;/context&gt;
447
+ &lt;/include&gt;
448
+ &lt;/context&gt;
449
+ </pre>
450
+ <p>
451
+ Because contexts defined before have higher priority, <code class="code">if0-comment</code> will
452
+ never be matched. To make things work we should move it before the
453
+ <code class="code">preprocessor</code> context, thus giving <code class="code">if0-comment</code> a higher priority.
454
+ </p>
455
+ <p>
456
+ For the <code class="code">#include</code> preprocessor directive it could be useful to highlight
457
+ differently the included file:
458
+ </p>
459
+ <pre class="programlisting">
460
+ &lt;context id="include" style-ref="preprocessor"&gt;
461
+ &lt;match&gt;^#include (".*"|&amp;lt;.*&amp;gt;)&lt;/match&gt;
462
+ &lt;include&gt;
463
+ </pre>
464
+ <p>
465
+ To do this we use grouping sub-patterns in the regular expression,
466
+ associating them with a context with the <code class="code">sub-pattern</code> attribute:
467
+ </p>
468
+ <pre class="programlisting">
469
+ &lt;context id="included-file" sub-pattern="1"
470
+ style-ref="included-file"/&gt;
471
+ </pre>
472
+ <p>
473
+ In the <code class="code">sub-pattern</code> attribute we could use:
474
+ </p>
475
+ <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
476
+ <li class="listitem"><p>
477
+ 0: the whole regular expression;
478
+ </p></li>
479
+ <li class="listitem"><p>
480
+ 1: the first sub-pattern (a sub-espression enclosed in
481
+ parenthesis);
482
+ </p></li>
483
+ <li class="listitem"><p>
484
+ 2: the second;
485
+ </p></li>
486
+ <li class="listitem"><p>
487
+ ...
488
+ </p></li>
489
+ <li class="listitem"><p>
490
+ <code class="code">name</code>: a named sub-pattern with name <code class="code">name</code> (see the PCRE
491
+ documentation.)
492
+ </p></li>
493
+ </ul></div>
494
+ <p>
495
+ We could also use a <code class="code">where</code> attribute with value
496
+ <code class="code">start</code> or <code class="code">end</code> to
497
+ specify the regular expression the context is referring, when we have both
498
+ the <code class="code">&lt;start&gt;</code> and <code class="code">&lt;end&gt;</code> element.
499
+ </p>
500
+ <pre class="programlisting">
501
+ &lt;/include&gt;
502
+ &lt;/context&gt;
503
+ </pre>
504
+ <p>
505
+ Having defined a good subset of the C syntax we close every tag still open:
506
+ </p>
507
+ <pre class="programlisting">
508
+ &lt;/include&gt;
509
+ &lt;/context&gt;
510
+ &lt;/definitions&gt;
511
+ &lt;/language&gt;
512
+ </pre>
513
+ </div>
514
+ <div class="refsect1">
515
+ <a name="id-1.4.2.4"></a><h2>The full language definition</h2>
516
+ <p>
517
+ This is the full language definition for the subset of C taken in consideration
518
+ for this tutorial:
519
+ </p>
520
+ <pre class="programlisting">
521
+ &lt;?xml version="1.0" encoding="UTF-8"?&gt;
522
+ &lt;language id="c" name="C" version="2.0" _section="Source"&gt;
523
+ &lt;metadata&gt;
524
+ &lt;property name="mimetypes"&gt;text/x-c;text/x-csrc&lt;/property&gt;
525
+ &lt;property name="globs"&gt;*.c&lt;/property&gt;
526
+ &lt;/metadata&gt;
527
+ &lt;styles&gt;
528
+ &lt;style id="comment" name="Comment" map-to="def:comment"/&gt;
529
+ &lt;style id="string" name="String" map-to="def:string"/&gt;
530
+ &lt;style id="escaped-character" name="Escaped Character" map-to="def:special-char"/&gt;
531
+ &lt;style id="preprocessor" name="Preprocessor" map-to="def:preprocessor"/&gt;
532
+ &lt;style id="included-file" name="Included File" map-to="def:string"/&gt;
533
+ &lt;style id="char" name="Character" map-to="def:character"/&gt;
534
+ &lt;style id="keyword" name="Keyword" map-to="def:keyword"/&gt;
535
+ &lt;style id="type" name="Data Type" map-to="def:type"/&gt;
536
+ &lt;/styles&gt;
537
+ &lt;definitions&gt;
538
+ &lt;context id="c"&gt;
539
+ &lt;include&gt;
540
+
541
+ &lt;context id="comment" style-ref="comment"&gt;
542
+ &lt;start&gt;\/\/&lt;/start&gt;
543
+ &lt;end&gt;$&lt;/end&gt;
544
+ &lt;/context&gt;
545
+
546
+ &lt;context id="string" end-at-line-end="true" style-ref="string"&gt;
547
+ &lt;start&gt;"&lt;/start&gt;
548
+ &lt;end&gt;"&lt;/end&gt;
549
+ &lt;include&gt;
550
+ &lt;context id="escape" style-ref="escaped-character"&gt;
551
+ &lt;match&gt;\\.&lt;/match&gt;
552
+ &lt;/context&gt;
553
+ &lt;/include&gt;
554
+ &lt;/context&gt;
555
+
556
+ &lt;context id="comment-multiline" style-ref="comment"&gt;
557
+ &lt;start&gt;\/\*&lt;/start&gt;
558
+ &lt;end&gt;\*\/&lt;/end&gt;
559
+ &lt;include&gt;
560
+ &lt;context ref="def:in-comment"/&gt;
561
+ &lt;/include&gt;
562
+ &lt;/context&gt;
563
+
564
+ &lt;context id="char" end-at-line-end="true" style-ref="string"&gt;
565
+ &lt;start&gt;'&lt;/start&gt;
566
+ &lt;end&gt;'&lt;/end&gt;
567
+ &lt;include&gt;
568
+ &lt;context ref="escape"/&gt;
569
+ &lt;/include&gt;
570
+ &lt;/context&gt;
571
+
572
+ &lt;context ref="def:decimal"/&gt;
573
+ &lt;context ref="def:float"/&gt;
574
+
575
+ &lt;context id="keywords" style-ref="keyword"&gt;
576
+ &lt;keyword&gt;if&lt;/keyword&gt;
577
+ &lt;keyword&gt;else&lt;/keyword&gt;
578
+ &lt;keyword&gt;for&lt;/keyword&gt;
579
+ &lt;keyword&gt;while&lt;/keyword&gt;
580
+ &lt;keyword&gt;return&lt;/keyword&gt;
581
+ &lt;keyword&gt;break&lt;/keyword&gt;
582
+ &lt;keyword&gt;switch&lt;/keyword&gt;
583
+ &lt;keyword&gt;case&lt;/keyword&gt;
584
+ &lt;keyword&gt;default&lt;/keyword&gt;
585
+ &lt;keyword&gt;do&lt;/keyword&gt;
586
+ &lt;keyword&gt;continue&lt;/keyword&gt;
587
+ &lt;keyword&gt;goto&lt;/keyword&gt;
588
+ &lt;keyword&gt;sizeof&lt;/keyword&gt;
589
+ &lt;/context&gt;
590
+
591
+ &lt;context id="types" style-ref="type"&gt;
592
+ &lt;keyword&gt;char&lt;/keyword&gt;
593
+ &lt;keyword&gt;const&lt;/keyword&gt;
594
+ &lt;keyword&gt;double&lt;/keyword&gt;
595
+ &lt;keyword&gt;enum&lt;/keyword&gt;
596
+ &lt;keyword&gt;float&lt;/keyword&gt;
597
+ &lt;keyword&gt;int&lt;/keyword&gt;
598
+ &lt;keyword&gt;long&lt;/keyword&gt;
599
+ &lt;keyword&gt;short&lt;/keyword&gt;
600
+ &lt;keyword&gt;signed&lt;/keyword&gt;
601
+ &lt;keyword&gt;static&lt;/keyword&gt;
602
+ &lt;keyword&gt;struct&lt;/keyword&gt;
603
+ &lt;keyword&gt;typedef&lt;/keyword&gt;
604
+ &lt;keyword&gt;union&lt;/keyword&gt;
605
+ &lt;keyword&gt;unsigned&lt;/keyword&gt;
606
+ &lt;keyword&gt;void&lt;/keyword&gt;
607
+ &lt;/context&gt;
608
+
609
+ &lt;context id="if0-comment" style-ref="comment"&gt;
610
+ &lt;start&gt;^#if 0\b&lt;/start&gt;
611
+ &lt;end&gt;^#(endif|else|elif)\b&lt;/end&gt;
612
+ &lt;include&gt;
613
+ &lt;context id="if-in-if0"&gt;
614
+ &lt;start&gt;^#if(n?def)?\b&lt;/start&gt;
615
+ &lt;end&gt;^#endif\b&lt;/end&gt;
616
+ &lt;include&gt;
617
+ &lt;context ref="if-in-if0"/&gt;
618
+ &lt;/include&gt;
619
+ &lt;/context&gt;
620
+ &lt;/include&gt;
621
+ &lt;/context&gt;
622
+
623
+ &lt;context id="preprocessor" style-ref="preprocessor"&gt;
624
+ &lt;prefix&gt;^#&lt;/prefix&gt;
625
+ &lt;keyword&gt;define&lt;/keyword&gt;
626
+ &lt;keyword&gt;undef&lt;/keyword&gt;
627
+ &lt;keyword&gt;if(n?def)?&lt;/keyword&gt;
628
+ &lt;keyword&gt;else&lt;/keyword&gt;
629
+ &lt;keyword&gt;elif&lt;/keyword&gt;
630
+ &lt;keyword&gt;endif&lt;/keyword&gt;
631
+ &lt;/context&gt;
632
+
633
+ &lt;context id="include" style-ref="preprocessor"&gt;
634
+ &lt;match&gt;^#include (".*"|&amp;lt;.*&amp;gt;)&lt;/match&gt;
635
+ &lt;include&gt;
636
+ &lt;context id="included-file"
637
+ sub-pattern="1"
638
+ style-ref="included-file"/&gt;
639
+ &lt;/include&gt;
640
+ &lt;/context&gt;
641
+
642
+ &lt;/include&gt;
643
+ &lt;/context&gt;
644
+ &lt;/definitions&gt;
645
+ &lt;/language&gt;
646
+ </pre>
647
+ </div>
648
+ </div>
649
+ <div class="footer">
650
+ <hr>Generated by GTK-Doc V1.28.1</div>
651
+ </body>
652
+ </html>