pygments.rb 0.5.4 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (267) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +40 -0
  3. data/README.md +3 -0
  4. data/lexers +0 -0
  5. data/lib/pygments/popen.rb +3 -2
  6. data/lib/pygments/version.rb +1 -1
  7. data/pygments.rb.gemspec +2 -1
  8. data/vendor/pygments-main/AUTHORS +20 -1
  9. data/vendor/pygments-main/CHANGES +55 -3
  10. data/vendor/pygments-main/LICENSE +1 -1
  11. data/vendor/pygments-main/MANIFEST.in +1 -1
  12. data/vendor/pygments-main/Makefile +5 -8
  13. data/vendor/pygments-main/REVISION +1 -1
  14. data/vendor/pygments-main/doc/Makefile +153 -0
  15. data/vendor/pygments-main/doc/_static/favicon.ico +0 -0
  16. data/vendor/pygments-main/doc/_static/logo_new.png +0 -0
  17. data/vendor/pygments-main/doc/_static/logo_only.png +0 -0
  18. data/vendor/pygments-main/doc/_templates/docssidebar.html +3 -0
  19. data/vendor/pygments-main/doc/_templates/indexsidebar.html +25 -0
  20. data/vendor/pygments-main/doc/_themes/pygments14/layout.html +98 -0
  21. data/vendor/pygments-main/doc/_themes/pygments14/static/bodybg.png +0 -0
  22. data/vendor/pygments-main/doc/_themes/pygments14/static/docbg.png +0 -0
  23. data/vendor/pygments-main/doc/_themes/pygments14/static/listitem.png +0 -0
  24. data/vendor/pygments-main/doc/_themes/pygments14/static/logo.png +0 -0
  25. data/vendor/pygments-main/doc/_themes/pygments14/static/pocoo.png +0 -0
  26. data/vendor/pygments-main/doc/_themes/pygments14/static/pygments14.css_t +401 -0
  27. data/vendor/pygments-main/doc/_themes/pygments14/theme.conf +15 -0
  28. data/vendor/pygments-main/doc/conf.py +249 -0
  29. data/vendor/pygments-main/doc/docs/api.rst +316 -0
  30. data/vendor/pygments-main/doc/docs/authors.rst +4 -0
  31. data/vendor/pygments-main/doc/docs/changelog.rst +1 -0
  32. data/vendor/pygments-main/{docs/src/cmdline.txt → doc/docs/cmdline.rst} +9 -11
  33. data/vendor/pygments-main/{docs/src/filterdevelopment.txt → doc/docs/filterdevelopment.rst} +1 -1
  34. data/vendor/pygments-main/{docs/src/filters.txt → doc/docs/filters.rst} +4 -5
  35. data/vendor/pygments-main/{docs/src/formatterdevelopment.txt → doc/docs/formatterdevelopment.rst} +1 -1
  36. data/vendor/pygments-main/{docs/src/formatters.txt → doc/docs/formatters.rst} +6 -6
  37. data/vendor/pygments-main/doc/docs/index.rst +66 -0
  38. data/vendor/pygments-main/{docs/src/integrate.txt → doc/docs/integrate.rst} +3 -7
  39. data/vendor/pygments-main/{docs/src/java.txt → doc/docs/java.rst} +0 -0
  40. data/vendor/pygments-main/{docs/src/lexerdevelopment.txt → doc/docs/lexerdevelopment.rst} +13 -14
  41. data/vendor/pygments-main/{docs/src/lexers.txt → doc/docs/lexers.rst} +7 -5
  42. data/vendor/pygments-main/{docs/src/moinmoin.txt → doc/docs/moinmoin.rst} +0 -0
  43. data/vendor/pygments-main/{docs/src/plugins.txt → doc/docs/plugins.rst} +0 -0
  44. data/vendor/pygments-main/{docs/src/quickstart.txt → doc/docs/quickstart.rst} +22 -19
  45. data/vendor/pygments-main/{docs/src/rstdirective.txt → doc/docs/rstdirective.rst} +0 -0
  46. data/vendor/pygments-main/{docs/src/styles.txt → doc/docs/styles.rst} +2 -2
  47. data/vendor/pygments-main/{docs/src/tokens.txt → doc/docs/tokens.rst} +10 -7
  48. data/vendor/pygments-main/{docs/src/unicode.txt → doc/docs/unicode.rst} +8 -7
  49. data/vendor/pygments-main/doc/download.rst +41 -0
  50. data/vendor/pygments-main/doc/faq.rst +143 -0
  51. data/vendor/pygments-main/doc/index.rst +53 -0
  52. data/vendor/pygments-main/doc/languages.rst +151 -0
  53. data/vendor/pygments-main/doc/make.bat +190 -0
  54. data/vendor/pygments-main/{docs → doc}/pygmentize.1 +0 -0
  55. data/vendor/pygments-main/external/autopygmentize +65 -48
  56. data/vendor/pygments-main/external/markdown-processor.py +15 -15
  57. data/vendor/pygments-main/external/moin-parser.py +1 -1
  58. data/vendor/pygments-main/external/rst-directive.py +2 -3
  59. data/vendor/pygments-main/ez_setup.py +340 -234
  60. data/vendor/pygments-main/pygments/__init__.py +4 -4
  61. data/vendor/pygments-main/pygments/cmdline.py +81 -68
  62. data/vendor/pygments-main/pygments/console.py +1 -1
  63. data/vendor/pygments-main/pygments/filter.py +1 -1
  64. data/vendor/pygments-main/pygments/filters/__init__.py +11 -9
  65. data/vendor/pygments-main/pygments/formatter.py +3 -3
  66. data/vendor/pygments-main/pygments/formatters/__init__.py +5 -3
  67. data/vendor/pygments-main/pygments/formatters/_mapping.py +16 -5
  68. data/vendor/pygments-main/pygments/formatters/bbcode.py +1 -1
  69. data/vendor/pygments-main/pygments/formatters/html.py +44 -26
  70. data/vendor/pygments-main/pygments/formatters/img.py +21 -14
  71. data/vendor/pygments-main/pygments/formatters/latex.py +104 -12
  72. data/vendor/pygments-main/pygments/formatters/other.py +53 -6
  73. data/vendor/pygments-main/pygments/formatters/rtf.py +30 -16
  74. data/vendor/pygments-main/pygments/formatters/svg.py +2 -2
  75. data/vendor/pygments-main/pygments/formatters/terminal.py +41 -1
  76. data/vendor/pygments-main/pygments/formatters/terminal256.py +2 -2
  77. data/vendor/pygments-main/pygments/lexer.py +59 -39
  78. data/vendor/pygments-main/pygments/lexers/__init__.py +38 -15
  79. data/vendor/pygments-main/pygments/lexers/_asybuiltins.py +1 -1
  80. data/vendor/pygments-main/pygments/lexers/_clbuiltins.py +15 -15
  81. data/vendor/pygments-main/pygments/lexers/_cocoabuiltins.py +73 -0
  82. data/vendor/pygments-main/pygments/lexers/_lassobuiltins.py +11 -1
  83. data/vendor/pygments-main/pygments/lexers/_luabuiltins.py +14 -8
  84. data/vendor/pygments-main/pygments/lexers/_mapping.py +81 -30
  85. data/vendor/pygments-main/pygments/lexers/_openedgebuiltins.py +1 -1
  86. data/vendor/pygments-main/pygments/lexers/_phpbuiltins.py +1067 -95
  87. data/vendor/pygments-main/pygments/lexers/_postgres_builtins.py +7 -7
  88. data/vendor/pygments-main/pygments/lexers/_robotframeworklexer.py +5 -4
  89. data/vendor/pygments-main/pygments/lexers/_scilab_builtins.py +1 -1
  90. data/vendor/pygments-main/pygments/lexers/_sourcemodbuiltins.py +12 -7
  91. data/vendor/pygments-main/pygments/lexers/_stan_builtins.py +112 -18
  92. data/vendor/pygments-main/pygments/lexers/_vimbuiltins.py +1 -1
  93. data/vendor/pygments-main/pygments/lexers/agile.py +644 -382
  94. data/vendor/pygments-main/pygments/lexers/asm.py +66 -29
  95. data/vendor/pygments-main/pygments/lexers/compiled.py +1643 -174
  96. data/vendor/pygments-main/pygments/lexers/dalvik.py +27 -6
  97. data/vendor/pygments-main/pygments/lexers/dotnet.py +45 -33
  98. data/vendor/pygments-main/pygments/lexers/foxpro.py +3 -3
  99. data/vendor/pygments-main/pygments/lexers/functional.py +1510 -570
  100. data/vendor/pygments-main/pygments/lexers/graph.py +81 -0
  101. data/vendor/pygments-main/pygments/lexers/hdl.py +29 -30
  102. data/vendor/pygments-main/pygments/lexers/inferno.py +96 -0
  103. data/vendor/pygments-main/pygments/lexers/jvm.py +622 -207
  104. data/vendor/pygments-main/pygments/lexers/math.py +438 -70
  105. data/vendor/pygments-main/pygments/lexers/other.py +885 -171
  106. data/vendor/pygments-main/pygments/lexers/parsers.py +24 -24
  107. data/vendor/pygments-main/pygments/lexers/qbasic.py +157 -0
  108. data/vendor/pygments-main/pygments/lexers/rdf.py +99 -0
  109. data/vendor/pygments-main/pygments/lexers/shell.py +28 -25
  110. data/vendor/pygments-main/pygments/lexers/special.py +7 -8
  111. data/vendor/pygments-main/pygments/lexers/sql.py +56 -23
  112. data/vendor/pygments-main/pygments/lexers/templates.py +377 -59
  113. data/vendor/pygments-main/pygments/lexers/text.py +208 -46
  114. data/vendor/pygments-main/pygments/lexers/web.py +729 -264
  115. data/vendor/pygments-main/pygments/modeline.py +1 -1
  116. data/vendor/pygments-main/pygments/plugin.py +1 -1
  117. data/vendor/pygments-main/pygments/scanner.py +1 -1
  118. data/vendor/pygments-main/pygments/sphinxext.py +153 -0
  119. data/vendor/pygments-main/pygments/style.py +3 -2
  120. data/vendor/pygments-main/pygments/styles/__init__.py +5 -1
  121. data/vendor/pygments-main/pygments/styles/autumn.py +1 -1
  122. data/vendor/pygments-main/pygments/styles/borland.py +1 -1
  123. data/vendor/pygments-main/pygments/styles/bw.py +1 -1
  124. data/vendor/pygments-main/pygments/styles/colorful.py +1 -1
  125. data/vendor/pygments-main/pygments/styles/default.py +1 -1
  126. data/vendor/pygments-main/pygments/styles/emacs.py +1 -1
  127. data/vendor/pygments-main/pygments/styles/friendly.py +1 -1
  128. data/vendor/pygments-main/pygments/styles/fruity.py +1 -1
  129. data/vendor/pygments-main/pygments/styles/igor.py +29 -0
  130. data/vendor/pygments-main/pygments/styles/manni.py +1 -1
  131. data/vendor/pygments-main/pygments/styles/monokai.py +4 -4
  132. data/vendor/pygments-main/pygments/styles/murphy.py +1 -1
  133. data/vendor/pygments-main/pygments/styles/native.py +1 -1
  134. data/vendor/pygments-main/pygments/styles/paraiso_dark.py +125 -0
  135. data/vendor/pygments-main/pygments/styles/paraiso_light.py +125 -0
  136. data/vendor/pygments-main/pygments/styles/pastie.py +1 -1
  137. data/vendor/pygments-main/pygments/styles/perldoc.py +1 -1
  138. data/vendor/pygments-main/pygments/styles/rrt.py +1 -1
  139. data/vendor/pygments-main/pygments/styles/tango.py +1 -1
  140. data/vendor/pygments-main/pygments/styles/trac.py +1 -1
  141. data/vendor/pygments-main/pygments/styles/vim.py +1 -1
  142. data/vendor/pygments-main/pygments/styles/vs.py +1 -1
  143. data/vendor/pygments-main/pygments/styles/xcode.py +51 -0
  144. data/vendor/pygments-main/pygments/token.py +4 -1
  145. data/vendor/pygments-main/pygments/unistring.py +6 -5
  146. data/vendor/pygments-main/pygments/util.py +35 -21
  147. data/vendor/pygments-main/scripts/check_sources.py +28 -44
  148. data/vendor/pygments-main/scripts/detect_missing_analyse_text.py +5 -4
  149. data/vendor/pygments-main/scripts/find_codetags.py +27 -19
  150. data/vendor/pygments-main/scripts/find_error.py +16 -13
  151. data/vendor/pygments-main/scripts/get_vimkw.py +3 -3
  152. data/vendor/pygments-main/scripts/vim2pygments.py +9 -7
  153. data/vendor/pygments-main/setup.py +19 -19
  154. data/vendor/pygments-main/tests/examplefiles/99_bottles_of_beer.chpl +118 -0
  155. data/vendor/pygments-main/tests/examplefiles/Error.pmod +38 -0
  156. data/vendor/pygments-main/tests/examplefiles/FakeFile.pike +360 -0
  157. data/vendor/pygments-main/tests/examplefiles/{ANTLRv3.g → antlr_ANTLRv3.g} +0 -0
  158. data/vendor/pygments-main/tests/examplefiles/clojure-weird-keywords.clj +5 -0
  159. data/vendor/pygments-main/tests/examplefiles/core.cljs +52 -0
  160. data/vendor/pygments-main/tests/examplefiles/demo.cfm +13 -1
  161. data/vendor/pygments-main/tests/examplefiles/demo.hbs +12 -0
  162. data/vendor/pygments-main/tests/examplefiles/ember.handlebars +33 -0
  163. data/vendor/pygments-main/tests/examplefiles/example.als +217 -0
  164. data/vendor/pygments-main/tests/examplefiles/example.c +1 -1
  165. data/vendor/pygments-main/tests/examplefiles/example.chai +6 -0
  166. data/vendor/pygments-main/tests/examplefiles/example.coffee +27 -0
  167. data/vendor/pygments-main/tests/examplefiles/example.e +124 -0
  168. data/vendor/pygments-main/tests/examplefiles/example.f90 +8 -0
  169. data/vendor/pygments-main/tests/examplefiles/example.feature +16 -0
  170. data/vendor/pygments-main/tests/examplefiles/example.gd +23 -0
  171. data/vendor/pygments-main/tests/examplefiles/example.gi +64 -0
  172. data/vendor/pygments-main/tests/examplefiles/example.groovy +2 -0
  173. data/vendor/pygments-main/tests/examplefiles/example.hs +27 -0
  174. data/vendor/pygments-main/tests/examplefiles/example.hx +44 -1
  175. data/vendor/pygments-main/tests/examplefiles/example.i6t +32 -0
  176. data/vendor/pygments-main/tests/examplefiles/example.i7x +45 -0
  177. data/vendor/pygments-main/tests/examplefiles/example.inf +374 -0
  178. data/vendor/pygments-main/tests/examplefiles/example.j +564 -0
  179. data/vendor/pygments-main/tests/examplefiles/example.java +16 -0
  180. data/vendor/pygments-main/tests/examplefiles/example.kal +75 -0
  181. data/vendor/pygments-main/tests/examplefiles/example.liquid +42 -0
  182. data/vendor/pygments-main/tests/examplefiles/example.ma +8 -0
  183. data/vendor/pygments-main/tests/examplefiles/example.mq4 +187 -0
  184. data/vendor/pygments-main/tests/examplefiles/example.mqh +123 -0
  185. data/vendor/pygments-main/tests/examplefiles/example.ni +57 -0
  186. data/vendor/pygments-main/tests/examplefiles/example.nix +80 -0
  187. data/vendor/pygments-main/tests/examplefiles/example.pp +8 -0
  188. data/vendor/pygments-main/tests/examplefiles/example.red +257 -0
  189. data/vendor/pygments-main/tests/examplefiles/example.reds +150 -0
  190. data/vendor/pygments-main/tests/examplefiles/example.rkt +677 -29
  191. data/vendor/pygments-main/tests/examplefiles/example.sh +22 -0
  192. data/vendor/pygments-main/tests/examplefiles/example.slim +31 -0
  193. data/vendor/pygments-main/tests/examplefiles/example.sls +51 -0
  194. data/vendor/pygments-main/tests/examplefiles/example.stan +2 -0
  195. data/vendor/pygments-main/tests/examplefiles/example.todotxt +9 -0
  196. data/vendor/pygments-main/tests/examplefiles/exampleScript.cfc +241 -0
  197. data/vendor/pygments-main/tests/examplefiles/exampleTag.cfc +18 -0
  198. data/vendor/pygments-main/tests/examplefiles/example_elixir.ex +192 -350
  199. data/vendor/pygments-main/tests/examplefiles/hash_syntax.rb +5 -0
  200. data/vendor/pygments-main/tests/examplefiles/hello.at +6 -0
  201. data/vendor/pygments-main/tests/examplefiles/hello.golo +5 -0
  202. data/vendor/pygments-main/tests/examplefiles/hello.lsl +12 -0
  203. data/vendor/pygments-main/tests/examplefiles/{File.hy → hybris_File.hy} +0 -0
  204. data/vendor/pygments-main/tests/examplefiles/{mg_sample.pro → idl_sample.pro} +0 -0
  205. data/vendor/pygments-main/tests/examplefiles/iex_example +23 -0
  206. data/vendor/pygments-main/tests/examplefiles/inet_pton6.dg +24 -24
  207. data/vendor/pygments-main/tests/examplefiles/language.hy +165 -0
  208. data/vendor/pygments-main/tests/examplefiles/limbo.b +456 -0
  209. data/vendor/pygments-main/tests/examplefiles/livescript-demo.ls +3 -1
  210. data/vendor/pygments-main/tests/examplefiles/main.cmake +2 -0
  211. data/vendor/pygments-main/tests/examplefiles/objc_example.m +163 -16
  212. data/vendor/pygments-main/tests/examplefiles/{example.p → openedge_example} +0 -0
  213. data/vendor/pygments-main/tests/examplefiles/pawn_example +25 -0
  214. data/vendor/pygments-main/tests/examplefiles/qbasic_example +2 -0
  215. data/vendor/pygments-main/tests/examplefiles/r6rs-comments.scm +23 -0
  216. data/vendor/pygments-main/tests/examplefiles/{robotframework.txt → robotframework_test.txt} +0 -0
  217. data/vendor/pygments-main/tests/examplefiles/rql-queries.rql +34 -0
  218. data/vendor/pygments-main/tests/examplefiles/scope.cirru +43 -0
  219. data/vendor/pygments-main/tests/examplefiles/sparql.rq +23 -0
  220. data/vendor/pygments-main/tests/examplefiles/test.R +37 -5
  221. data/vendor/pygments-main/tests/examplefiles/test.apl +26 -0
  222. data/vendor/pygments-main/tests/examplefiles/test.cyp +123 -0
  223. data/vendor/pygments-main/tests/examplefiles/test.idr +93 -0
  224. data/vendor/pygments-main/tests/examplefiles/test.mask +41 -0
  225. data/vendor/pygments-main/tests/examplefiles/test.pan +54 -0
  226. data/vendor/pygments-main/tests/examplefiles/test.php +3 -1
  227. data/vendor/pygments-main/tests/examplefiles/test.pig +148 -0
  228. data/vendor/pygments-main/tests/examplefiles/test.pwn +253 -0
  229. data/vendor/pygments-main/tests/examplefiles/test.r3 +27 -7
  230. data/vendor/pygments-main/tests/examplefiles/test.rsl +111 -0
  231. data/vendor/pygments-main/tests/examplefiles/test.swift +65 -0
  232. data/vendor/pygments-main/tests/examplefiles/test.zep +33 -0
  233. data/vendor/pygments-main/tests/examplefiles/unicode.go +10 -0
  234. data/vendor/pygments-main/tests/examplefiles/{test.bas → vbnet_test.bas} +0 -0
  235. data/vendor/pygments-main/tests/examplefiles/vctreestatus_hg +4 -0
  236. data/vendor/pygments-main/tests/examplefiles/vimrc +21 -0
  237. data/vendor/pygments-main/tests/run.py +14 -19
  238. data/vendor/pygments-main/tests/string_asserts.py +22 -0
  239. data/vendor/pygments-main/tests/test_basic_api.py +28 -14
  240. data/vendor/pygments-main/tests/test_cfm.py +46 -0
  241. data/vendor/pygments-main/tests/test_clexer.py +208 -3
  242. data/vendor/pygments-main/tests/test_cmdline.py +6 -5
  243. data/vendor/pygments-main/tests/test_examplefiles.py +30 -19
  244. data/vendor/pygments-main/tests/test_html_formatter.py +15 -13
  245. data/vendor/pygments-main/tests/test_latex_formatter.py +4 -2
  246. data/vendor/pygments-main/tests/test_lexers_other.py +11 -11
  247. data/vendor/pygments-main/tests/test_objectiveclexer.py +81 -0
  248. data/vendor/pygments-main/tests/test_perllexer.py +1 -1
  249. data/vendor/pygments-main/tests/test_qbasiclexer.py +43 -0
  250. data/vendor/pygments-main/tests/test_regexlexer.py +8 -1
  251. data/vendor/pygments-main/tests/test_rtf_formatter.py +109 -0
  252. data/vendor/pygments-main/tests/test_string_asserts.py +39 -0
  253. data/vendor/pygments-main/tests/test_token.py +3 -3
  254. data/vendor/pygments-main/tests/test_using_api.py +1 -1
  255. data/vendor/pygments-main/tests/test_util.py +1 -1
  256. metadata +138 -51
  257. data/vendor/pygments-main/docs/generate.py +0 -472
  258. data/vendor/pygments-main/docs/src/api.txt +0 -270
  259. data/vendor/pygments-main/docs/src/authors.txt +0 -5
  260. data/vendor/pygments-main/docs/src/changelog.txt +0 -5
  261. data/vendor/pygments-main/docs/src/index.txt +0 -69
  262. data/vendor/pygments-main/docs/src/installation.txt +0 -71
  263. data/vendor/pygments-main/external/rst-directive-old.py +0 -77
  264. data/vendor/pygments-main/scripts/reindent.py +0 -291
  265. data/vendor/pygments-main/tests/examplefiles/import.hs +0 -4
  266. data/vendor/pygments-main/tests/examplefiles/objc_example2.m +0 -24
  267. data/vendor/pygments-main/tests/old_run.py +0 -138
@@ -7,7 +7,9 @@ dashes-identifiers = ->
7
7
  underscores_i$d = ->
8
8
  /regexp1/
9
9
  //regexp2//g
10
- 'strings' and "strings" and \strings
10
+ 'strings' and "strings" and \strings and \#$-"\'strings
11
+
12
+ another-word-list = <[ more words ]>
11
13
 
12
14
  [2 til 10]
13
15
  |> map (* 2)
@@ -1,3 +1,5 @@
1
+ CMAKE_MINIMUM_REQUIRED(VERSION 2.6 FATAL_ERROR)
2
+
1
3
  SET( SOURCES back.c io.c main.c )
2
4
  MESSAGE( ${SOURCES} ) # three arguments, prints "back.cio.cmain.c"
3
5
  MESSAGE( "${SOURCES}" ) # one argument, prints "back.c;io.c;main.c"
@@ -1,32 +1,179 @@
1
- #import "Somefile.h"
1
+ // Test various types of includes
2
+ #import <Foundation/Foundation.h>
3
+ # import <AppKit/AppKit.h>
4
+ #import "stdio.h"
5
+ #\
6
+ import \
7
+ "stdlib.h"
8
+ # /*line1*/ \
9
+ import /* line 2 */ \
10
+ "stdlib.h" // line 3
2
11
 
3
- @implementation ABC
12
+ // Commented out code with preprocessor
13
+ #if 0
14
+ #define MY_NUMBER 3
15
+ #endif
4
16
 
5
- - (id)a:(B)b {
6
- return 1;
17
+ #\
18
+ if 1
19
+ #define TEST_NUMBER 3
20
+ #endif
21
+
22
+ // Empty preprocessor
23
+ #
24
+
25
+ // Class forward declaration
26
+ @class MyClass;
27
+
28
+ // Empty classes
29
+ @interface EmptyClass
30
+ @end
31
+ @interface EmptyClass2
32
+ {
33
+ }
34
+ @end
35
+ @interface EmptyClass3 : EmptyClass2
36
+ {
37
+ }
38
+ @end
39
+
40
+ // Custom class inheriting from built-in
41
+ @interface MyClass : NSObject
42
+ {
43
+ @public
44
+ NSString *myString;
45
+ __weak NSString *_weakString;
46
+ @protected
47
+ NSTextField *_textField;
48
+ @private
49
+ NSDate *privateDate;
7
50
  }
8
51
 
52
+ // Various property aatributes
53
+ @property(copy, readwrite, nonatomic) NSString *myString;
54
+ @property(weak) NSString *weakString;
55
+ @property(retain, strong, atomic) IBOutlet NSTextField *textField;
56
+
57
+ // Class methods
58
+ + (void)classMethod1:(NSString *)arg;
59
+ + (void)classMethod2:(NSString *) arg; // Test space before arg
60
+
9
61
  @end
10
62
 
11
- @implementation ABC
63
+ typedef id B;
12
64
 
13
- - (void)xyz;
65
+ #pragma mark MyMarker
14
66
 
67
+ // MyClass.m
68
+ // Class extension to declare private property
69
+ @interface MyClass ()
70
+ @property(retain) NSDate *privateDate;
71
+ - (void)hiddenMethod;
15
72
  @end
16
73
 
17
- NSDictionary *dictionary = [NSDictionary dictionaryWithObjectsAndKeys:
18
- @"quattuor", @"four", @"quinque", @"five", @"sex", @"six", nil];
74
+ // Special category
75
+ @interface MyClass (Special)
76
+ @property(retain) NSDate *specialDate;
77
+ @end
78
+
79
+ @implementation MyClass
80
+ @synthesize myString;
81
+ @synthesize privateDate;
82
+
83
+ - (id)a:(B)b {
84
+ /**
85
+ * C-style comment
86
+ */
87
+
88
+ // Selector keywords/types
89
+ SEL someMethod = @selector(hiddenMethod);
90
+
91
+ // Boolean types
92
+ Boolean b1 = FALSE;
93
+ BOOL b2 = NO;
94
+ bool b3 = true;
19
95
 
96
+ /**
97
+ * Number literals
98
+ */
99
+ // Int Literal
100
+ NSNumber *n1 = @( 1 );
101
+ // Method call
102
+ NSNumber *n2 = @( [b length] );
103
+ // Define variable
104
+ NSNumber *n3 = @( TEST_NUMBER );
105
+ // Arthimetic expression
106
+ NSNumber *n4 = @(1 + 2);
107
+ // From variable
108
+ int myInt = 5;
109
+ NSNumber *n5 = @(myInt);
110
+ // Nest expression
111
+ NSNumber *n6 = @(1 + (2 + 6.0));
112
+ // Bool literal
113
+ NSNumber *n7 = @NO;
114
+ // Bool expression
115
+ NSNumber *n8 = @(YES);
116
+ // Character
117
+ NSNumber *n9 = @'a';
118
+ // int
119
+ NSNumber *n10 = @123;
120
+ // unsigned
121
+ NSNumber *n11 = @1234U;
122
+ // long
123
+ NSNumber *n12 = @1234567890L;
124
+ // float
125
+ NSNumber *n13 = @3.14F;
126
+ // double
127
+ NSNumber *n14 = @3.14F;
128
+
129
+ // Array literals
130
+ NSArray *arr = @[ @"1", @"2" ];
131
+ arr = @[ @[ @"1", @"2" ], [arr lastObject] ];
132
+ [arr lastObject];
133
+ [@[ @"1", @"2" ] lastObject];
134
+
135
+ // Dictionary literals
136
+ NSDictionary *d = @{ @"key": @"value" };
137
+ [[d allKeys] lastObject];
138
+ [[@{ @"key": @"value" } allKeys] lastObject];
139
+ d = @{ @"key": @{ @"key": @"value" } };
20
140
 
21
- NSString *key;
22
- for (key in dictionary) {
23
- NSLog(@"English: %@, Latin: %@", key, [dictionary valueForKey:key]);
141
+ [self hiddenMethod];
142
+ [b length];
143
+ [privateDate class];
144
+
145
+ NSDictionary *dictionary = [NSDictionary dictionaryWithObjectsAndKeys:
146
+ @"1", @"one", @"2", @"two", @"3", @"three", nil];
147
+
148
+ NSString *key;
149
+ for (key in dictionary) {
150
+ NSLog(@"Number: %@, Word: %@", key, [dictionary valueForKey:key]);
151
+ }
152
+
153
+ // Blocks
154
+ int (^myBlock)(int arg1, int arg2);
155
+ NSString *(^myName)(NSString *) = ^(NSString *value) {
156
+ return value;
157
+ };
158
+
159
+ return nil;
24
160
  }
25
161
 
26
- // Literals
27
- NSArray *a = @[ @"1", @"2" ];
162
+ - (void)hiddenMethod {
163
+ // Synchronized block
164
+ @synchronized(self) {
165
+ [myString retain];
166
+ [myString release];
167
+ }
168
+ }
28
169
 
29
- NSDictionary *d = @{ @"key": @"value" };
170
+ + (void)classMethod1:(NSString *)arg {}
171
+ + (void)classMethod2:(NSString *) arg
172
+ {
173
+ // Autorelease pool block
174
+ @autoreleasepool {
175
+ NSLog(@"Hello, World!");
176
+ }
177
+ }
30
178
 
31
- NSNumber *n1 = @( 1 );
32
- NSNumber *n2 = @( [a length] );
179
+ @end
@@ -0,0 +1,25 @@
1
+ {include.i}
2
+ {nested.i {include.i}}
3
+
4
+ &SCOPED-DEFINE MY_NAME "Abe"
5
+
6
+ DEF VAR i AS INT NO-UNDO.
7
+ i = 0xABE + 1337 / (1 * 1.00)
8
+
9
+ def var clowercasetest as char no-undo.
10
+ DEF VAR vardashtest AS DATETIME-TZ NO-UNDO.
11
+
12
+ DEFINE TEMP-TABLE ttNames NO-UNDO
13
+ FIELD cName AS CHAR
14
+ INDEX IXPK_ttNames IS PRIMARY UNIQUE cName.
15
+
16
+ /* One-line comment */
17
+ /* Two-line
18
+ Comment */
19
+
20
+ CREATE ttNames.
21
+ ASSIGN ttNames.cName = {&MY_NAME}.
22
+
23
+ FOR EACH ttNames:
24
+ MESSAGE "Hello, " + ttNames.cName + '!' VIEW-AS ALERT-BOX.
25
+ END.
@@ -0,0 +1,2 @@
1
+ 10 print RIGHT$("hi there", 5)
2
+ 20 goto 10
@@ -0,0 +1,23 @@
1
+ #!r6rs
2
+
3
+ #|
4
+
5
+ The FACT procedure computes the factorial
6
+
7
+ of a non-negative integer.
8
+
9
+ |#
10
+
11
+ (define fact
12
+
13
+ (lambda (n)
14
+
15
+ ;; base case
16
+
17
+ (if (= n 0)
18
+
19
+ #;(= n 1)
20
+
21
+ 1 ; identity of *
22
+
23
+ (* n (fact (- n 1))))))
@@ -0,0 +1,34 @@
1
+ Any N, N2 where N is Note, N2 is Note, N a_faire_par P1, P1 nom 'john', N2 a_faire_par P2, P2 nom 'jane' ;
2
+ DISTINCT Any N, D, C, T, A ORDERBY D DESC LIMIT 40 where N is Note, N diem D, W is Workcase, W concerned_by N, N cost C, N text T, N author A, N diem <= today
3
+ Bookmark B WHERE B owned_by G, G eid 5;
4
+ Any X WHERE E eid 22762, NOT E is_in X, X modification_date D ORDERBY D DESC LIMIT 41;
5
+ Any A, R, SUB ORDERBY R WHERE A is "Workcase", S is Division, S concerned_by A, A subject SUB, S eid 85, A ref R;
6
+ Any D, T, L WHERE D is Document, A concerned_by D,A eid 14533, D title T, D location L;
7
+ Any N,A,B,C,D ORDERBY A DESC WHERE N is Note, W concerned_by N, W eid 14533, N diem A,N author B,N text C,N cost D;
8
+ Any X ORDERBY D DESC LIMIT 41 WHERE E eid 18134, NOT E concerned_by X, X modification_date D
9
+ DISTINCT Any N, D, C, T, A ORDERBY D ASC LIMIT 40 WHERE N is Note, N diem D, P is Person, N to_be_contacted_by G, N cost C, N text T, N author A, G login "john";
10
+ INSERT Person X: X surname "Doe", X firstname "John";
11
+ Workcase W where W ref "ABCD12";
12
+ Workcase W where W ref LIKE "AB%";
13
+ Any X WHERE X X eid 53
14
+ Any X WHERE X Document X occurence_of F, F class C, C name 'Comics' X owned_by U, U login 'syt' X available true
15
+ Person P WHERE P work_for P, S name 'Acme', P interested_by T, T name 'training'
16
+ Note N WHERE N written_on D, D day> (today -10), N written_by P, P name 'joe' or P name 'jack'
17
+ Person P WHERE (P interested_by T, T name 'training') or (P city 'Paris')
18
+ Any N, P WHERE X is Person, X name N, X first_name P
19
+ String N, P WHERE X is Person, X name N, X first_name P
20
+ INSERT Person X: X name 'widget'
21
+ INSERT Person X, Person Y: X name 'foo', Y name 'nice', X friend Y
22
+ INSERT Person X: X name 'foo', X friend Y WHERE name 'nice'
23
+ SET X name 'bar', X first_name 'original' where X is Person X name 'foo'
24
+ SET X know Y WHERE X friend Y
25
+ DELETE Person X WHERE X name 'foo'
26
+ DELETE X friend Y WHERE X is Person, X name 'foo'
27
+ Any X WHERE X name LIKE '%lt'
28
+ Any X WHERE X name IN ( 'joe', 'jack', 'william', 'averell')
29
+ Any X, V WHERE X concerns P, P eid 42, X corrected_in V?
30
+ Any C, P WHERE C is Card, P? documented_by C
31
+ Point P where P abs X, P ord Y, P value X+Y
32
+ Document X where X class C, C name 'Cartoon', X owned_by U, U login 'joe', X available true
33
+ (Any X WHERE X is Document) UNION (Any X WHERE X is File)
34
+ Any A,B WHERE A creation_date B WITH A BEING (Any X WHERE X is Document) UNION (Any X WHERE X is File)
@@ -0,0 +1,43 @@
1
+
2
+ -- https://github.com/Cirru/cirru-gopher/blob/master/code/scope.cr
3
+
4
+ set a (int 2)
5
+
6
+ print (self)
7
+
8
+ set c (child)
9
+
10
+ under c
11
+ under parent
12
+ print a
13
+
14
+ print $ get c a
15
+
16
+ set c x (int 3)
17
+ print $ get c x
18
+
19
+ set just-print $ code
20
+ print a
21
+
22
+ print just-print
23
+
24
+ eval (self) just-print
25
+ eval just-print
26
+
27
+ print (string "string with space")
28
+ print (string "escapes \n \"\\")
29
+
30
+ brackets ((((()))))
31
+
32
+ "eval" $ string "eval"
33
+
34
+ print (add $ (int 1) (int 2))
35
+
36
+ print $ unwrap $
37
+ map (a $ int 1) (b $ int 2)
38
+
39
+ print a
40
+ int 1
41
+ , b c
42
+ int 2
43
+ , d
@@ -0,0 +1,23 @@
1
+ # This is a test SPARQL query
2
+
3
+ PREFIX foaf: <http://xmlns.com/foaf/0.1/>
4
+ PREFIX ex: <http://example.org/>
5
+ PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
6
+ PREFIX dcterms: <http://purl.org/dc/terms/>
7
+
8
+ SELECT ?person (COUNT(?nick) AS ?nickCount) {
9
+ ?person foaf:nick ?nick ;
10
+ foaf:lastName "Smith" ;
11
+ foaf:age "21"^^xsd:int ;
12
+ ex:title 'Mr' ; # single-quoted string
13
+ ex:height 1.80 ; # float
14
+ ex:distanceToSun +1.4e8 ; # float with exponent
15
+ ex:ownsACat true ;
16
+ dcterms:description "Someone with a cat called \"cat\"."@en .
17
+ OPTIONAL { ?person foaf:isPrimaryTopicOf ?page }
18
+ OPTIONAL { ?person foaf:name ?name
19
+ { ?person foaf:depiction ?img }
20
+ UNION
21
+ { ?person foaf:firstName ?firstN } }
22
+ FILTER ( bound(?page) || bound(?img) || bound(?firstN) )
23
+ } GROUP BY ?person ORDER BY ?img
@@ -33,10 +33,11 @@ NA_foo_ <- NULL
33
33
  123456.78901
34
34
  123e3
35
35
  123E3
36
- 1.23e-3
37
- 1.23e3
38
- 1.23e-3
39
- ## integer constants
36
+ 6.02e23
37
+ 1.6e-35
38
+ 1.E12
39
+ .1234
40
+ ## integers
40
41
  123L
41
42
  1.23L
42
43
  ## imaginary numbers
@@ -80,7 +81,7 @@ repeat {1+1}
80
81
  ## Switch
81
82
  x <- 3
82
83
  switch(x, 2+2, mean(1:10), rnorm(5))
83
- ## Function, dot-dot-dot, return
84
+ ## Function, dot-dot-dot, return, sum
84
85
  foo <- function(...) {
85
86
  return(sum(...))
86
87
  }
@@ -151,3 +152,34 @@ world!'
151
152
 
152
153
  ## Backtick strings
153
154
  `foo123 +!"bar'baz` <- 2 + 2
155
+
156
+ ## Builtin funcitons
157
+ file.create()
158
+ gamma()
159
+ grep()
160
+ paste()
161
+ rbind()
162
+ rownames()
163
+ R.Version()
164
+ R.version.string()
165
+ sample()
166
+ sapply()
167
+ save.image()
168
+ seq()
169
+ setwd()
170
+ sin()
171
+
172
+ ## Data structures
173
+ servo <- matrix(1:25, nrow = 5)
174
+ numeric()
175
+ vector(servo)
176
+ data.frame()
177
+ list1 <- list(time = 1:40)
178
+ # multidimensional array
179
+ array(c(c(c(2,300,4),c(8,9,0)),c(c(5,60,0),c(66,7,847))), dim=c(3,2,2))
180
+
181
+ ## Namespace
182
+ library(ggplot2)
183
+ require(plyr)
184
+ attach(cars)
185
+ source("test.R")
@@ -0,0 +1,26 @@
1
+ ∇ R←M COMBIN N;D;E;F;G;P
2
+ ⍝ Returns a matrix of every possible
3
+ ⍝ combination of M elements from the
4
+ ⍝ vector ⍳N. That is, returns a
5
+ ⍝ matrix with M!N rows and N columns.
6
+
7
+ E←(⍳P←N-R←M-1)-⎕IO
8
+ D←R+⍳P
9
+ R←(P,1)⍴D
10
+ P←P⍴1
11
+ L1:→(⎕IO>1↑D←D-1)⍴0
12
+ P←+\P
13
+ G←+\¯1↓0,F←⌽P
14
+ E←F/E-G
15
+ R←(F/D),R[E+⍳⍴E;]
16
+ E←G
17
+ →L1
18
+
19
+
20
+ ∇ R←M QUICKEXP N
21
+ ⍝ Matrix exponentiation
22
+ B ← ⌊ 1 + 2 ⍟ N
23
+ V ← (B ⍴ 2) ⊤ N
24
+ L ← ⊂ M
25
+ R ← ⊃ +.× / V / L ⊣ { L ← (⊂ A +.× A ← ↑L) , L }¨ ⍳ B-1
26
+