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
@@ -0,0 +1,123 @@
1
+ //test comment
2
+ START a = node(*)
3
+ MATCH (a)-[:ACTED_IN]->(m)<-[:DIRECTED]-(d)
4
+ RETURN a.name, m.title, d.name;
5
+
6
+ START a = node(*)
7
+ MATCH (a)-[:ACTED_IN]->(m)<-[:DIRECTED]-(d)
8
+ WITH d,m,count(a) as Actors
9
+ WHERE Actors > 4
10
+ RETURN d.name as Director,m.title as Movie, Actors ORDER BY Actors;
11
+
12
+ START a=node(*)
13
+ MATCH p=(a)-[:ACTED_IN]->(m)<-[:DIRECTED]-(d)
14
+ return p;
15
+
16
+ START a = node(*)
17
+ MATCH p1=(a)-[:ACTED_IN]->(m), p2=d-[:DIRECTED]->(m)
18
+ WHERE m.title="The Matrix"
19
+ RETURN p1, p2;
20
+
21
+ START a = node(*)
22
+ MATCH (a)-[:ACTED_IN]->(m)<-[:DIRECTED]-(d)
23
+ WHERE a=d
24
+ RETURN a.name;
25
+
26
+ START a = node(*)
27
+ MATCH (a)-[:ACTED_IN]->(m)<-[:DIRECTED]-(d)
28
+ WHERE a=d
29
+ RETURN a.name;
30
+
31
+ START a=node(*)
32
+ MATCH (a)-[:ACTED_IN]->(m)<-[:DIRECTED]-(d)
33
+ RETURN a.name, d.name, count(*) as Movies,collect(m.title) as Titles
34
+ ORDER BY (Movies) DESC
35
+ LIMIT 5;
36
+
37
+ START keanu=node:node_auto_index(name="Keanu Reeves")
38
+ RETURN keanu;
39
+
40
+ START keanu=node:node_auto_index(name="Keanu Reeves")
41
+ MATCH (keanu)-[:ACTED_IN]->(movie)
42
+ RETURN movie.title;
43
+
44
+ START keanu=node:node_auto_index(name="Keanu Reeves")
45
+ MATCH (keanu)-[r:ACTED_IN]->(movie)
46
+ WHERE "Neo" in r.roles
47
+ RETURN DISTINCT movie.title;
48
+
49
+ START keanu=node:node_auto_index(name="Keanu Reeves")
50
+ MATCH (keanu)-[:ACTED_IN]->()<-[:DIRECTED]-(director)
51
+ RETURN director.name;
52
+
53
+ START keanu=node:node_auto_index(name="Keanu Reeves")
54
+ MATCH (keanu)-[:ACTED_IN]->(movie)<-[:ACTED_IN]-(n)
55
+ WHERE n.born < keanu.born
56
+ RETURN DISTINCT n.name, keanu.born ,n.born;
57
+
58
+ START keanu=node:node_auto_index(name="Keanu Reeves"),
59
+ hugo=node:node_auto_index(name="Hugo Weaving")
60
+ MATCH (keanu)-[:ACTED_IN]->(movie)
61
+ WHERE NOT((hugo)-[:ACTED_IN]->(movie))
62
+ RETURN DISTINCT movie.title;
63
+
64
+ START a = node(*)
65
+ MATCH (a)-[:ACTED_IN]->(m)
66
+ WITH a,count(m) as Movies
67
+ RETURN a.name as Actor, Movies ORDER BY Movies;
68
+
69
+ START keanu=node:node_auto_index(name="Keanu Reeves"),actor
70
+ MATCH past=(keanu)-[:ACTED_IN]->()<-[:ACTED_IN]-(),
71
+ actors=(actor)-[:ACTED_IN]->()
72
+ WHERE hasnt=actors NOT IN past
73
+ RETURN hasnt;
74
+
75
+ START keanu=node:node_auto_index(name="Keanu Reeves")
76
+ MATCH (keanu)-[:ACTED_IN]->()<-[:ACTED_IN]-(c),
77
+ (c)-[:ACTED_IN]->()<-[:ACTED_IN]-(coc)
78
+ WHERE NOT((keanu)-[:ACTED_IN]->()<-[:ACTED_IN]-(coc))
79
+ AND coc > keanu
80
+ RETURN coc.name, count(coc)
81
+ ORDER BY count(coc) DESC
82
+ LIMIT 3;
83
+
84
+ START kevin=node:node_auto_index(name="Kevin Bacon"),
85
+ movie=node:node_auto_index(name="Mystic River")
86
+ MATCH (kevin)-[:ACTED_IN]->(movie)
87
+ RETURN DISTINCT movie.title;
88
+
89
+ CREATE (n
90
+ {
91
+ title:"Mystic River",
92
+ released:1993,
93
+ tagline:"We bury our sins here, Dave. We wash them clean."
94
+ }
95
+ ) RETURN n;
96
+
97
+
98
+ START movie=node:node_auto_index(title="Mystic River")
99
+ SET movie.released = 2003
100
+ RETURN movie;
101
+
102
+ start emil=node:node_auto_index(name="Emil Eifrem") MATCH emil-[r]->(n) DELETE r, emil;
103
+
104
+ START a=node(*)
105
+ MATCH (a)-[:ACTED_IN]->()<-[:ACTED_IN]-(b)
106
+ CREATE UNIQUE (a)-[:KNOWS]->(b);
107
+
108
+ START keanu=node:node_auto_index(name="Keanu Reeves")
109
+ MATCH (keanu)-[:KNOWS*2]->(fof)
110
+ WHERE keanu <> fof
111
+ RETURN distinct fof.name;
112
+
113
+ START charlize=node:node_auto_index(name="Charlize Theron"),
114
+ bacon=node:node_auto_index(name="Kevin Bacon")
115
+ MATCH p=shortestPath((charlize)-[:KNOWS*]->(bacon))
116
+ RETURN extract(n in nodes(p) | n.name)[1];
117
+
118
+ START actors=node:
119
+
120
+ MATCH (alice)-[:`REALLY LIKES`]->(bob)
121
+ MATCH (alice)-[:`REALLY ``LIKES```]->(bob)
122
+ myFancyIdentifier.`(weird property name)`
123
+ "string\t\n\b\f\\\''\""
@@ -0,0 +1,93 @@
1
+ module Main
2
+
3
+ data Ty = TyInt | TyBool | TyFun Ty Ty
4
+
5
+ interpTy : Ty -> Type
6
+ interpTy TyInt = Int
7
+ interpTy TyBool = Bool
8
+ interpTy (TyFun s t) = interpTy s -> interpTy t
9
+
10
+ using (G : Vect n Ty)
11
+
12
+ data Env : Vect n Ty -> Type where
13
+ Nil : Env Nil
14
+ (::) : interpTy a -> Env G -> Env (a :: G)
15
+
16
+ data HasType : (i : Fin n) -> Vect n Ty -> Ty -> Type where
17
+ stop : HasType fZ (t :: G) t
18
+ pop : HasType k G t -> HasType (fS k) (u :: G) t
19
+
20
+ lookup : HasType i G t -> Env G -> interpTy t
21
+ lookup stop (x :: xs) = x
22
+ lookup (pop k) (x :: xs) = lookup k xs
23
+
24
+ data Expr : Vect n Ty -> Ty -> Type where
25
+ Var : HasType i G t -> Expr G t
26
+ Val : (x : Int) -> Expr G TyInt
27
+ Lam : Expr (a :: G) t -> Expr G (TyFun a t)
28
+ App : Expr G (TyFun a t) -> Expr G a -> Expr G t
29
+ Op : (interpTy a -> interpTy b -> interpTy c) -> Expr G a -> Expr G b ->
30
+ Expr G c
31
+ If : Expr G TyBool -> Expr G a -> Expr G a -> Expr G a
32
+ Bind : Expr G a -> (interpTy a -> Expr G b) -> Expr G b
33
+
34
+ dsl expr
35
+ lambda = Lam
36
+ variable = Var
37
+ index_first = stop
38
+ index_next = pop
39
+
40
+ (<$>) : |(f : Expr G (TyFun a t)) -> Expr G a -> Expr G t
41
+ (<$>) = \f, a => App f a
42
+
43
+ pure : Expr G a -> Expr G a
44
+ pure = id
45
+
46
+ syntax IF [x] THEN [t] ELSE [e] = If x t e
47
+
48
+ (==) : Expr G TyInt -> Expr G TyInt -> Expr G TyBool
49
+ (==) = Op (==)
50
+
51
+ (<) : Expr G TyInt -> Expr G TyInt -> Expr G TyBool
52
+ (<) = Op (<)
53
+
54
+ instance Num (Expr G TyInt) where
55
+ (+) x y = Op (+) x y
56
+ (-) x y = Op (-) x y
57
+ (*) x y = Op (*) x y
58
+
59
+ abs x = IF (x < 0) THEN (-x) ELSE x
60
+
61
+ fromInteger = Val . fromInteger
62
+
63
+ interp : Env G -> {static} Expr G t -> interpTy t
64
+ interp env (Var i) = lookup i env
65
+ interp env (Val x) = x
66
+ interp env (Lam sc) = \x => interp (x :: env) sc
67
+ interp env (App f s) = (interp env f) (interp env s)
68
+ interp env (Op op x y) = op (interp env x) (interp env y)
69
+ interp env (If x t e) = if (interp env x) then (interp env t) else (interp env e)
70
+ interp env (Bind v f) = interp env (f (interp env v))
71
+
72
+ eId : Expr G (TyFun TyInt TyInt)
73
+ eId = expr (\x => x)
74
+
75
+ eTEST : Expr G (TyFun TyInt (TyFun TyInt TyInt))
76
+ eTEST = expr (\x, y => y)
77
+
78
+ eAdd : Expr G (TyFun TyInt (TyFun TyInt TyInt))
79
+ eAdd = expr (\x, y => Op (+) x y)
80
+
81
+ eDouble : Expr G (TyFun TyInt TyInt)
82
+ eDouble = expr (\x => App (App eAdd x) (Var stop))
83
+
84
+ eFac : Expr G (TyFun TyInt TyInt)
85
+ eFac = expr (\x => IF x == 0 THEN 1 ELSE [| eFac (x - 1) |] * x)
86
+
87
+ testFac : Int
88
+ testFac = interp [] eFac 4
89
+
90
+ main : IO ()
91
+ main = print testFac
92
+
93
+
@@ -0,0 +1,41 @@
1
+
2
+ // comment
3
+ h4.class-1#id.class-2.other checked='true' disabled name = x param > 'Enter ..'
4
+ input placeholder=Password type=password >
5
+ :dualbind x-signal='dom:create' value=user.passord;
6
+ % each='flowers' >
7
+ div style='
8
+ position: absolute;
9
+ display: inline-block;
10
+ background: url("image.png") center center no-repeat;
11
+ ';
12
+ #skippedDiv.other {
13
+ img src='~[url]';
14
+ div style="text-align:center;" {
15
+ '~[: $obj.foo("username", name) + 2]'
16
+ "~[Localize: stringId]"
17
+ }
18
+
19
+ p > """
20
+
21
+ Hello "world"
22
+ """
23
+
24
+ p > '
25
+ Hello "world"
26
+ '
27
+
28
+ p > "Hello 'world'"
29
+
30
+ :customComponent x-value='tt';
31
+ /* footer > '(c) 2014' */
32
+ }
33
+
34
+ .skippedDiv >
35
+ span >
36
+ #skipped >
37
+ table >
38
+ td >
39
+ tr > ';)'
40
+
41
+ br;
@@ -0,0 +1,54 @@
1
+ object template pantest;
2
+
3
+ # Very simple pan test file
4
+ "/long/decimal" = 123;
5
+ "/long/octal" = 0755;
6
+ "/long/hexadecimal" = 0xFF;
7
+
8
+ "/double/simple" = 0.01;
9
+ "/double/pi" = 3.14159;
10
+ "/double/exponent" = 1e-8;
11
+ "/double/scientific" = 1.3E10;
12
+
13
+ "/string/single" = 'Faster, but escapes like \t, \n and \x3d don''t work, but '' should work.';
14
+ "/string/double" = "Slower, but escapes like \t, \n and \x3d do work";
15
+
16
+ variable TEST = 2;
17
+
18
+ "/x2" = to_string(TEST);
19
+ "/x2" ?= 'Default value';
20
+
21
+ "/x3" = 1 + 2 + value("/long/decimal");
22
+
23
+ "/x4" = undef;
24
+
25
+ "/x5" = null;
26
+
27
+ variable e ?= error("Test error message");
28
+
29
+ # include gmond config for services-monitoring
30
+ include { 'site/ganglia/gmond/services-monitoring' };
31
+
32
+ "/software/packages"=pkg_repl("httpd","2.2.3-43.sl5.3",PKG_ARCH_DEFAULT);
33
+ "/software/packages"=pkg_repl("php");
34
+
35
+ # Example function
36
+ function show_things_view_for_stuff = {
37
+ thing = ARGV[0];
38
+ foreach( i; mything; STUFF ) {
39
+ if ( thing == mything ) {
40
+ return( true );
41
+ } else {
42
+ return SELF;
43
+ };
44
+ };
45
+ false;
46
+ };
47
+
48
+ variable HERE = <<EOF;
49
+ ; This example demonstrates an in-line heredoc style config file
50
+ [main]
51
+ awesome = true
52
+ EOF
53
+
54
+ variable small = false;#This should be highlighted normally again.
@@ -1,5 +1,7 @@
1
1
  <?php
2
2
 
3
+ $disapproval_ಠ_ಠ_of_php = 'unicode var';
4
+
3
5
  $test = function($a) { $lambda = 1; }
4
6
 
5
7
  /**
@@ -16,7 +18,7 @@ if(!defined('UNLOCK') || !UNLOCK)
16
18
  // Load the parent archive class
17
19
  require_once(ROOT_PATH.'/classes/archive.class.php');
18
20
 
19
- class Zip\Zipp {
21
+ class Zip\Zippಠ_ಠ_ {
20
22
 
21
23
  }
22
24
 
@@ -0,0 +1,148 @@
1
+ /**
2
+ * This script is an example recommender (using made up data) showing how you might modify item-item links
3
+ * by defining similar relations between items in a dataset and customizing the change in weighting.
4
+ * This example creates metadata by using the genre field as the metadata_field. The items with
5
+ * the same genre have it's weight cut in half in order to boost the signals of movies that do not have the same genre.
6
+ * This technique requires a customization of the standard GetItemItemRecommendations macro
7
+ */
8
+ import 'recommenders.pig';
9
+
10
+
11
+
12
+ %default INPUT_PATH_PURCHASES '../data/retail/purchases.json'
13
+ %default INPUT_PATH_WISHLIST '../data/retail/wishlists.json'
14
+ %default INPUT_PATH_INVENTORY '../data/retail/inventory.json'
15
+ %default OUTPUT_PATH '../data/retail/out/modify_item_item'
16
+
17
+
18
+ /******** Custom GetItemItemRecommnedations *********/
19
+ define recsys__GetItemItemRecommendations_ModifyCustom(user_item_signals, metadata) returns item_item_recs {
20
+
21
+ -- Convert user_item_signals to an item_item_graph
22
+ ii_links_raw, item_weights = recsys__BuildItemItemGraph(
23
+ $user_item_signals,
24
+ $LOGISTIC_PARAM,
25
+ $MIN_LINK_WEIGHT,
26
+ $MAX_LINKS_PER_USER
27
+ );
28
+ -- NOTE this function is added in order to combine metadata with item-item links
29
+ -- See macro for more detailed explination
30
+ ii_links_metadata = recsys__AddMetadataToItemItemLinks(
31
+ ii_links_raw,
32
+ $metadata
33
+ );
34
+
35
+ /********* Custom Code starts here ********/
36
+
37
+ --The code here should adjust the weights based on an item-item link and the equality of metadata.
38
+ -- In this case, if the metadata is the same, the weight is reduced. Otherwise the weight is left alone.
39
+ ii_links_adjusted = foreach ii_links_metadata generate item_A, item_B,
40
+ -- the amount of weight adjusted is dependant on the domain of data and what is expected
41
+ -- It is always best to adjust the weight by multiplying it by a factor rather than addition with a constant
42
+ (metadata_B == metadata_A ? (weight * 0.5): weight) as weight;
43
+
44
+
45
+ /******** Custom Code stops here *********/
46
+
47
+ -- remove negative numbers just incase
48
+ ii_links_adjusted_filt = foreach ii_links_adjusted generate item_A, item_B,
49
+ (weight <= 0 ? 0: weight) as weight;
50
+ -- Adjust the weights of the graph to improve recommendations.
51
+ ii_links = recsys__AdjustItemItemGraphWeight(
52
+ ii_links_adjusted_filt,
53
+ item_weights,
54
+ $BAYESIAN_PRIOR
55
+ );
56
+
57
+ -- Use the item-item graph to create item-item recommendations.
58
+ $item_item_recs = recsys__BuildItemItemRecommendationsFromGraph(
59
+ ii_links,
60
+ $NUM_RECS_PER_ITEM,
61
+ $NUM_RECS_PER_ITEM
62
+ );
63
+ };
64
+
65
+
66
+ /******* Load Data **********/
67
+
68
+ --Get purchase signals
69
+ purchase_input = load '$INPUT_PATH_PURCHASES' using org.apache.pig.piggybank.storage.JsonLoader(
70
+ 'row_id: int,
71
+ movie_id: chararray,
72
+ movie_name: chararray,
73
+ user_id: chararray,
74
+ purchase_price: int');
75
+
76
+ --Get wishlist signals
77
+ wishlist_input = load '$INPUT_PATH_WISHLIST' using org.apache.pig.piggybank.storage.JsonLoader(
78
+ 'row_id: int,
79
+ movie_id: chararray,
80
+ movie_name: chararray,
81
+ user_id: chararray');
82
+
83
+
84
+ /******* Convert Data to Signals **********/
85
+
86
+ -- Start with choosing 1 as max weight for a signal.
87
+ purchase_signals = foreach purchase_input generate
88
+ user_id as user,
89
+ movie_name as item,
90
+ 1.0 as weight;
91
+
92
+
93
+ -- Start with choosing 0.5 as weight for wishlist items because that is a weaker signal than
94
+ -- purchasing an item.
95
+ wishlist_signals = foreach wishlist_input generate
96
+ user_id as user,
97
+ movie_name as item,
98
+ 0.5 as weight;
99
+
100
+ user_signals = union purchase_signals, wishlist_signals;
101
+
102
+
103
+ /******** Changes for Modifying item-item links ******/
104
+ inventory_input = load '$INPUT_PATH_INVENTORY' using org.apache.pig.piggybank.storage.JsonLoader(
105
+ 'movie_title: chararray,
106
+ genres: bag{tuple(content:chararray)}');
107
+
108
+
109
+ metadata = foreach inventory_input generate
110
+ FLATTEN(genres) as metadata_field,
111
+ movie_title as item;
112
+ -- requires the macro to be written seperately
113
+ --NOTE this macro is defined within this file for clarity
114
+ item_item_recs = recsys__GetItemItemRecommendations_ModifyCustom(user_signals, metadata);
115
+ /******* No more changes ********/
116
+
117
+
118
+ user_item_recs = recsys__GetUserItemRecommendations(user_signals, item_item_recs);
119
+
120
+ --Completely unrelated code stuck in the middle
121
+ data = LOAD 's3n://my-s3-bucket/path/to/responses'
122
+ USING org.apache.pig.piggybank.storage.JsonLoader();
123
+ responses = FOREACH data GENERATE object#'response' AS response: map[];
124
+ out = FOREACH responses
125
+ GENERATE response#'id' AS id: int, response#'thread' AS thread: chararray,
126
+ response#'comments' AS comments: {t: (comment: chararray)};
127
+ STORE out INTO 's3n://path/to/output' USING PigStorage('|');
128
+
129
+
130
+ /******* Store recommendations **********/
131
+
132
+ -- If your output folder exists already, hadoop will refuse to write data to it.
133
+
134
+ rmf $OUTPUT_PATH/item_item_recs;
135
+ rmf $OUTPUT_PATH/user_item_recs;
136
+
137
+ store item_item_recs into '$OUTPUT_PATH/item_item_recs' using PigStorage();
138
+ store user_item_recs into '$OUTPUT_PATH/user_item_recs' using PigStorage();
139
+
140
+ -- STORE the item_item_recs into dynamo
141
+ STORE item_item_recs
142
+ INTO '$OUTPUT_PATH/unused-ii-table-data'
143
+ USING com.mortardata.pig.storage.DynamoDBStorage('$II_TABLE', '$AWS_ACCESS_KEY_ID', '$AWS_SECRET_ACCESS_KEY');
144
+
145
+ -- STORE the user_item_recs into dynamo
146
+ STORE user_item_recs
147
+ INTO '$OUTPUT_PATH/unused-ui-table-data'
148
+ USING com.mortardata.pig.storage.DynamoDBStorage('$UI_TABLE', '$AWS_ACCESS_KEY_ID', '$AWS_SECRET_ACCESS_KEY');