fluentd-ui 0.3.12 → 0.3.13

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of fluentd-ui might be problematic. Click here for more details.

Files changed (234) hide show
  1. checksums.yaml +4 -4
  2. data/ChangeLog +4 -0
  3. data/Gemfile.lock +1 -1
  4. data/app/assets/javascripts/application.js +2 -0
  5. data/app/assets/javascripts/codemirror.js +29 -0
  6. data/app/assets/javascripts/codemirror_fluentd.js +59 -0
  7. data/app/assets/stylesheets/application.css +6 -0
  8. data/app/views/fluentd/settings/edit.html.haml +1 -1
  9. data/app/views/shared/vue/_setting.html.erb +1 -1
  10. data/bower.json +2 -1
  11. data/lib/fluentd-ui/version.rb +1 -1
  12. data/spec/features/source_and_output_spec.rb +16 -6
  13. data/vendor/assets/javascripts/bower/codemirror/.bower.json +29 -0
  14. data/vendor/assets/javascripts/bower/codemirror/AUTHORS +423 -0
  15. data/vendor/assets/javascripts/bower/codemirror/CONTRIBUTING.md +76 -0
  16. data/vendor/assets/javascripts/bower/codemirror/LICENSE +19 -0
  17. data/vendor/assets/javascripts/bower/codemirror/README.md +11 -0
  18. data/vendor/assets/javascripts/bower/codemirror/addon/comment/comment.js +183 -0
  19. data/vendor/assets/javascripts/bower/codemirror/addon/comment/continuecomment.js +85 -0
  20. data/vendor/assets/javascripts/bower/codemirror/addon/dialog/dialog.css +32 -0
  21. data/vendor/assets/javascripts/bower/codemirror/addon/dialog/dialog.js +155 -0
  22. data/vendor/assets/javascripts/bower/codemirror/addon/display/fullscreen.css +6 -0
  23. data/vendor/assets/javascripts/bower/codemirror/addon/display/fullscreen.js +41 -0
  24. data/vendor/assets/javascripts/bower/codemirror/addon/display/panel.js +94 -0
  25. data/vendor/assets/javascripts/bower/codemirror/addon/display/placeholder.js +58 -0
  26. data/vendor/assets/javascripts/bower/codemirror/addon/display/rulers.js +64 -0
  27. data/vendor/assets/javascripts/bower/codemirror/addon/edit/closebrackets.js +159 -0
  28. data/vendor/assets/javascripts/bower/codemirror/addon/edit/closetag.js +159 -0
  29. data/vendor/assets/javascripts/bower/codemirror/addon/edit/continuelist.js +51 -0
  30. data/vendor/assets/javascripts/bower/codemirror/addon/edit/matchbrackets.js +120 -0
  31. data/vendor/assets/javascripts/bower/codemirror/addon/edit/matchtags.js +66 -0
  32. data/vendor/assets/javascripts/bower/codemirror/addon/edit/trailingspace.js +27 -0
  33. data/vendor/assets/javascripts/bower/codemirror/addon/fold/brace-fold.js +105 -0
  34. data/vendor/assets/javascripts/bower/codemirror/addon/fold/comment-fold.js +57 -0
  35. data/vendor/assets/javascripts/bower/codemirror/addon/fold/foldcode.js +145 -0
  36. data/vendor/assets/javascripts/bower/codemirror/addon/fold/foldgutter.css +20 -0
  37. data/vendor/assets/javascripts/bower/codemirror/addon/fold/foldgutter.js +134 -0
  38. data/vendor/assets/javascripts/bower/codemirror/addon/fold/indent-fold.js +44 -0
  39. data/vendor/assets/javascripts/bower/codemirror/addon/fold/markdown-fold.js +49 -0
  40. data/vendor/assets/javascripts/bower/codemirror/addon/fold/xml-fold.js +182 -0
  41. data/vendor/assets/javascripts/bower/codemirror/addon/hint/anyword-hint.js +41 -0
  42. data/vendor/assets/javascripts/bower/codemirror/addon/hint/css-hint.js +56 -0
  43. data/vendor/assets/javascripts/bower/codemirror/addon/hint/html-hint.js +348 -0
  44. data/vendor/assets/javascripts/bower/codemirror/addon/hint/javascript-hint.js +146 -0
  45. data/vendor/assets/javascripts/bower/codemirror/addon/hint/show-hint.css +38 -0
  46. data/vendor/assets/javascripts/bower/codemirror/addon/hint/show-hint.js +389 -0
  47. data/vendor/assets/javascripts/bower/codemirror/addon/hint/sql-hint.js +197 -0
  48. data/vendor/assets/javascripts/bower/codemirror/addon/hint/xml-hint.js +110 -0
  49. data/vendor/assets/javascripts/bower/codemirror/addon/lint/coffeescript-lint.js +41 -0
  50. data/vendor/assets/javascripts/bower/codemirror/addon/lint/css-lint.js +35 -0
  51. data/vendor/assets/javascripts/bower/codemirror/addon/lint/javascript-lint.js +136 -0
  52. data/vendor/assets/javascripts/bower/codemirror/addon/lint/json-lint.js +31 -0
  53. data/vendor/assets/javascripts/bower/codemirror/addon/lint/lint.css +73 -0
  54. data/vendor/assets/javascripts/bower/codemirror/addon/lint/lint.js +204 -0
  55. data/vendor/assets/javascripts/bower/codemirror/addon/lint/yaml-lint.js +28 -0
  56. data/vendor/assets/javascripts/bower/codemirror/addon/merge/merge.css +112 -0
  57. data/vendor/assets/javascripts/bower/codemirror/addon/merge/merge.js +643 -0
  58. data/vendor/assets/javascripts/bower/codemirror/addon/mode/loadmode.js +64 -0
  59. data/vendor/assets/javascripts/bower/codemirror/addon/mode/multiplex.js +118 -0
  60. data/vendor/assets/javascripts/bower/codemirror/addon/mode/multiplex_test.js +33 -0
  61. data/vendor/assets/javascripts/bower/codemirror/addon/mode/overlay.js +85 -0
  62. data/vendor/assets/javascripts/bower/codemirror/addon/mode/simple.js +213 -0
  63. data/vendor/assets/javascripts/bower/codemirror/addon/runmode/colorize.js +40 -0
  64. data/vendor/assets/javascripts/bower/codemirror/addon/runmode/runmode-standalone.js +157 -0
  65. data/vendor/assets/javascripts/bower/codemirror/addon/runmode/runmode.js +72 -0
  66. data/vendor/assets/javascripts/bower/codemirror/addon/runmode/runmode.node.js +120 -0
  67. data/vendor/assets/javascripts/bower/codemirror/addon/scroll/annotatescrollbar.js +76 -0
  68. data/vendor/assets/javascripts/bower/codemirror/addon/scroll/scrollpastend.js +46 -0
  69. data/vendor/assets/javascripts/bower/codemirror/addon/scroll/simplescrollbars.css +66 -0
  70. data/vendor/assets/javascripts/bower/codemirror/addon/scroll/simplescrollbars.js +139 -0
  71. data/vendor/assets/javascripts/bower/codemirror/addon/search/match-highlighter.js +128 -0
  72. data/vendor/assets/javascripts/bower/codemirror/addon/search/matchesonscrollbar.css +8 -0
  73. data/vendor/assets/javascripts/bower/codemirror/addon/search/matchesonscrollbar.js +90 -0
  74. data/vendor/assets/javascripts/bower/codemirror/addon/search/search.js +164 -0
  75. data/vendor/assets/javascripts/bower/codemirror/addon/search/searchcursor.js +189 -0
  76. data/vendor/assets/javascripts/bower/codemirror/addon/selection/active-line.js +71 -0
  77. data/vendor/assets/javascripts/bower/codemirror/addon/selection/mark-selection.js +118 -0
  78. data/vendor/assets/javascripts/bower/codemirror/addon/tern/tern.css +86 -0
  79. data/vendor/assets/javascripts/bower/codemirror/addon/tern/tern.js +670 -0
  80. data/vendor/assets/javascripts/bower/codemirror/addon/tern/worker.js +44 -0
  81. data/vendor/assets/javascripts/bower/codemirror/addon/wrap/hardwrap.js +139 -0
  82. data/vendor/assets/javascripts/bower/codemirror/bower.json +16 -0
  83. data/vendor/assets/javascripts/bower/codemirror/keymap/emacs.js +411 -0
  84. data/vendor/assets/javascripts/bower/codemirror/keymap/sublime.js +540 -0
  85. data/vendor/assets/javascripts/bower/codemirror/keymap/vim.js +4901 -0
  86. data/vendor/assets/javascripts/bower/codemirror/lib/codemirror.css +309 -0
  87. data/vendor/assets/javascripts/bower/codemirror/lib/codemirror.js +8029 -0
  88. data/vendor/assets/javascripts/bower/codemirror/mode/apl/apl.js +175 -0
  89. data/vendor/assets/javascripts/bower/codemirror/mode/asterisk/asterisk.js +198 -0
  90. data/vendor/assets/javascripts/bower/codemirror/mode/clike/clike.js +489 -0
  91. data/vendor/assets/javascripts/bower/codemirror/mode/clike/scala.html +767 -0
  92. data/vendor/assets/javascripts/bower/codemirror/mode/clojure/clojure.js +243 -0
  93. data/vendor/assets/javascripts/bower/codemirror/mode/cobol/cobol.js +255 -0
  94. data/vendor/assets/javascripts/bower/codemirror/mode/coffeescript/coffeescript.js +369 -0
  95. data/vendor/assets/javascripts/bower/codemirror/mode/commonlisp/commonlisp.js +122 -0
  96. data/vendor/assets/javascripts/bower/codemirror/mode/css/css.js +717 -0
  97. data/vendor/assets/javascripts/bower/codemirror/mode/css/less.html +152 -0
  98. data/vendor/assets/javascripts/bower/codemirror/mode/css/less_test.js +51 -0
  99. data/vendor/assets/javascripts/bower/codemirror/mode/css/scss.html +157 -0
  100. data/vendor/assets/javascripts/bower/codemirror/mode/css/scss_test.js +110 -0
  101. data/vendor/assets/javascripts/bower/codemirror/mode/css/test.js +135 -0
  102. data/vendor/assets/javascripts/bower/codemirror/mode/cypher/cypher.js +146 -0
  103. data/vendor/assets/javascripts/bower/codemirror/mode/d/d.js +218 -0
  104. data/vendor/assets/javascripts/bower/codemirror/mode/dart/dart.js +50 -0
  105. data/vendor/assets/javascripts/bower/codemirror/mode/diff/diff.js +47 -0
  106. data/vendor/assets/javascripts/bower/codemirror/mode/django/django.js +67 -0
  107. data/vendor/assets/javascripts/bower/codemirror/mode/dockerfile/dockerfile.js +76 -0
  108. data/vendor/assets/javascripts/bower/codemirror/mode/dtd/dtd.js +142 -0
  109. data/vendor/assets/javascripts/bower/codemirror/mode/dylan/dylan.js +299 -0
  110. data/vendor/assets/javascripts/bower/codemirror/mode/ebnf/ebnf.js +195 -0
  111. data/vendor/assets/javascripts/bower/codemirror/mode/ecl/ecl.js +207 -0
  112. data/vendor/assets/javascripts/bower/codemirror/mode/eiffel/eiffel.js +162 -0
  113. data/vendor/assets/javascripts/bower/codemirror/mode/erlang/erlang.js +622 -0
  114. data/vendor/assets/javascripts/bower/codemirror/mode/fortran/fortran.js +188 -0
  115. data/vendor/assets/javascripts/bower/codemirror/mode/gas/gas.js +345 -0
  116. data/vendor/assets/javascripts/bower/codemirror/mode/gfm/gfm.js +123 -0
  117. data/vendor/assets/javascripts/bower/codemirror/mode/gfm/test.js +213 -0
  118. data/vendor/assets/javascripts/bower/codemirror/mode/gherkin/gherkin.js +178 -0
  119. data/vendor/assets/javascripts/bower/codemirror/mode/go/go.js +184 -0
  120. data/vendor/assets/javascripts/bower/codemirror/mode/groovy/groovy.js +226 -0
  121. data/vendor/assets/javascripts/bower/codemirror/mode/haml/haml.js +159 -0
  122. data/vendor/assets/javascripts/bower/codemirror/mode/haml/test.js +97 -0
  123. data/vendor/assets/javascripts/bower/codemirror/mode/haskell/haskell.js +267 -0
  124. data/vendor/assets/javascripts/bower/codemirror/mode/haxe/haxe.js +518 -0
  125. data/vendor/assets/javascripts/bower/codemirror/mode/htmlembedded/htmlembedded.js +86 -0
  126. data/vendor/assets/javascripts/bower/codemirror/mode/htmlmixed/htmlmixed.js +121 -0
  127. data/vendor/assets/javascripts/bower/codemirror/mode/http/http.js +113 -0
  128. data/vendor/assets/javascripts/bower/codemirror/mode/idl/idl.js +290 -0
  129. data/vendor/assets/javascripts/bower/codemirror/mode/jade/jade.js +590 -0
  130. data/vendor/assets/javascripts/bower/codemirror/mode/javascript/javascript.js +686 -0
  131. data/vendor/assets/javascripts/bower/codemirror/mode/javascript/json-ld.html +72 -0
  132. data/vendor/assets/javascripts/bower/codemirror/mode/javascript/test.js +200 -0
  133. data/vendor/assets/javascripts/bower/codemirror/mode/javascript/typescript.html +61 -0
  134. data/vendor/assets/javascripts/bower/codemirror/mode/jinja2/jinja2.js +142 -0
  135. data/vendor/assets/javascripts/bower/codemirror/mode/julia/julia.js +301 -0
  136. data/vendor/assets/javascripts/bower/codemirror/mode/kotlin/kotlin.js +280 -0
  137. data/vendor/assets/javascripts/bower/codemirror/mode/livescript/livescript.js +280 -0
  138. data/vendor/assets/javascripts/bower/codemirror/mode/lua/lua.js +159 -0
  139. data/vendor/assets/javascripts/bower/codemirror/mode/markdown/markdown.js +765 -0
  140. data/vendor/assets/javascripts/bower/codemirror/mode/markdown/test.js +754 -0
  141. data/vendor/assets/javascripts/bower/codemirror/mode/meta.js +165 -0
  142. data/vendor/assets/javascripts/bower/codemirror/mode/mirc/mirc.js +193 -0
  143. data/vendor/assets/javascripts/bower/codemirror/mode/mllike/mllike.js +205 -0
  144. data/vendor/assets/javascripts/bower/codemirror/mode/modelica/modelica.js +245 -0
  145. data/vendor/assets/javascripts/bower/codemirror/mode/nginx/nginx.js +178 -0
  146. data/vendor/assets/javascripts/bower/codemirror/mode/ntriples/ntriples.js +186 -0
  147. data/vendor/assets/javascripts/bower/codemirror/mode/octave/octave.js +135 -0
  148. data/vendor/assets/javascripts/bower/codemirror/mode/pascal/pascal.js +109 -0
  149. data/vendor/assets/javascripts/bower/codemirror/mode/pegjs/pegjs.js +114 -0
  150. data/vendor/assets/javascripts/bower/codemirror/mode/perl/perl.js +832 -0
  151. data/vendor/assets/javascripts/bower/codemirror/mode/php/php.js +226 -0
  152. data/vendor/assets/javascripts/bower/codemirror/mode/php/test.js +154 -0
  153. data/vendor/assets/javascripts/bower/codemirror/mode/pig/pig.js +188 -0
  154. data/vendor/assets/javascripts/bower/codemirror/mode/properties/properties.js +78 -0
  155. data/vendor/assets/javascripts/bower/codemirror/mode/puppet/puppet.js +220 -0
  156. data/vendor/assets/javascripts/bower/codemirror/mode/python/python.js +359 -0
  157. data/vendor/assets/javascripts/bower/codemirror/mode/q/q.js +139 -0
  158. data/vendor/assets/javascripts/bower/codemirror/mode/r/r.js +162 -0
  159. data/vendor/assets/javascripts/bower/codemirror/mode/rpm/rpm.js +101 -0
  160. data/vendor/assets/javascripts/bower/codemirror/mode/rst/rst.js +557 -0
  161. data/vendor/assets/javascripts/bower/codemirror/mode/ruby/ruby.js +285 -0
  162. data/vendor/assets/javascripts/bower/codemirror/mode/ruby/test.js +14 -0
  163. data/vendor/assets/javascripts/bower/codemirror/mode/rust/rust.js +451 -0
  164. data/vendor/assets/javascripts/bower/codemirror/mode/sass/sass.js +327 -0
  165. data/vendor/assets/javascripts/bower/codemirror/mode/scheme/scheme.js +248 -0
  166. data/vendor/assets/javascripts/bower/codemirror/mode/shell/shell.js +139 -0
  167. data/vendor/assets/javascripts/bower/codemirror/mode/shell/test.js +58 -0
  168. data/vendor/assets/javascripts/bower/codemirror/mode/sieve/sieve.js +193 -0
  169. data/vendor/assets/javascripts/bower/codemirror/mode/slim/slim.js +575 -0
  170. data/vendor/assets/javascripts/bower/codemirror/mode/slim/test.js +96 -0
  171. data/vendor/assets/javascripts/bower/codemirror/mode/smalltalk/smalltalk.js +168 -0
  172. data/vendor/assets/javascripts/bower/codemirror/mode/smarty/smarty.js +221 -0
  173. data/vendor/assets/javascripts/bower/codemirror/mode/smartymixed/smartymixed.js +197 -0
  174. data/vendor/assets/javascripts/bower/codemirror/mode/solr/solr.js +104 -0
  175. data/vendor/assets/javascripts/bower/codemirror/mode/soy/soy.js +198 -0
  176. data/vendor/assets/javascripts/bower/codemirror/mode/sparql/sparql.js +174 -0
  177. data/vendor/assets/javascripts/bower/codemirror/mode/spreadsheet/spreadsheet.js +109 -0
  178. data/vendor/assets/javascripts/bower/codemirror/mode/sql/sql.js +391 -0
  179. data/vendor/assets/javascripts/bower/codemirror/mode/stex/stex.js +251 -0
  180. data/vendor/assets/javascripts/bower/codemirror/mode/stex/test.js +123 -0
  181. data/vendor/assets/javascripts/bower/codemirror/mode/tcl/tcl.js +147 -0
  182. data/vendor/assets/javascripts/bower/codemirror/mode/textile/test.js +417 -0
  183. data/vendor/assets/javascripts/bower/codemirror/mode/textile/textile.js +469 -0
  184. data/vendor/assets/javascripts/bower/codemirror/mode/tiddlywiki/tiddlywiki.css +14 -0
  185. data/vendor/assets/javascripts/bower/codemirror/mode/tiddlywiki/tiddlywiki.js +369 -0
  186. data/vendor/assets/javascripts/bower/codemirror/mode/tiki/tiki.css +26 -0
  187. data/vendor/assets/javascripts/bower/codemirror/mode/tiki/tiki.js +323 -0
  188. data/vendor/assets/javascripts/bower/codemirror/mode/toml/toml.js +88 -0
  189. data/vendor/assets/javascripts/bower/codemirror/mode/tornado/tornado.js +68 -0
  190. data/vendor/assets/javascripts/bower/codemirror/mode/turtle/turtle.js +162 -0
  191. data/vendor/assets/javascripts/bower/codemirror/mode/vb/vb.js +274 -0
  192. data/vendor/assets/javascripts/bower/codemirror/mode/vbscript/vbscript.js +350 -0
  193. data/vendor/assets/javascripts/bower/codemirror/mode/velocity/velocity.js +201 -0
  194. data/vendor/assets/javascripts/bower/codemirror/mode/verilog/test.js +273 -0
  195. data/vendor/assets/javascripts/bower/codemirror/mode/verilog/verilog.js +364 -0
  196. data/vendor/assets/javascripts/bower/codemirror/mode/xml/test.js +51 -0
  197. data/vendor/assets/javascripts/bower/codemirror/mode/xml/xml.js +384 -0
  198. data/vendor/assets/javascripts/bower/codemirror/mode/xquery/test.js +67 -0
  199. data/vendor/assets/javascripts/bower/codemirror/mode/xquery/xquery.js +447 -0
  200. data/vendor/assets/javascripts/bower/codemirror/mode/yaml/yaml.js +117 -0
  201. data/vendor/assets/javascripts/bower/codemirror/mode/z80/z80.js +100 -0
  202. data/vendor/assets/javascripts/bower/codemirror/theme/3024-day.css +38 -0
  203. data/vendor/assets/javascripts/bower/codemirror/theme/3024-night.css +37 -0
  204. data/vendor/assets/javascripts/bower/codemirror/theme/ambiance-mobile.css +5 -0
  205. data/vendor/assets/javascripts/bower/codemirror/theme/ambiance.css +77 -0
  206. data/vendor/assets/javascripts/bower/codemirror/theme/base16-dark.css +36 -0
  207. data/vendor/assets/javascripts/bower/codemirror/theme/base16-light.css +36 -0
  208. data/vendor/assets/javascripts/bower/codemirror/theme/blackboard.css +30 -0
  209. data/vendor/assets/javascripts/bower/codemirror/theme/cobalt.css +23 -0
  210. data/vendor/assets/javascripts/bower/codemirror/theme/eclipse.css +23 -0
  211. data/vendor/assets/javascripts/bower/codemirror/theme/elegant.css +13 -0
  212. data/vendor/assets/javascripts/bower/codemirror/theme/erlang-dark.css +32 -0
  213. data/vendor/assets/javascripts/bower/codemirror/theme/lesser-dark.css +45 -0
  214. data/vendor/assets/javascripts/bower/codemirror/theme/mbo.css +35 -0
  215. data/vendor/assets/javascripts/bower/codemirror/theme/mdn-like.css +44 -0
  216. data/vendor/assets/javascripts/bower/codemirror/theme/midnight.css +45 -0
  217. data/vendor/assets/javascripts/bower/codemirror/theme/monokai.css +31 -0
  218. data/vendor/assets/javascripts/bower/codemirror/theme/neat.css +12 -0
  219. data/vendor/assets/javascripts/bower/codemirror/theme/neo.css +43 -0
  220. data/vendor/assets/javascripts/bower/codemirror/theme/night.css +26 -0
  221. data/vendor/assets/javascripts/bower/codemirror/theme/paraiso-dark.css +36 -0
  222. data/vendor/assets/javascripts/bower/codemirror/theme/paraiso-light.css +36 -0
  223. data/vendor/assets/javascripts/bower/codemirror/theme/pastel-on-dark.css +50 -0
  224. data/vendor/assets/javascripts/bower/codemirror/theme/rubyblue.css +23 -0
  225. data/vendor/assets/javascripts/bower/codemirror/theme/solarized.css +165 -0
  226. data/vendor/assets/javascripts/bower/codemirror/theme/the-matrix.css +28 -0
  227. data/vendor/assets/javascripts/bower/codemirror/theme/tomorrow-night-bright.css +35 -0
  228. data/vendor/assets/javascripts/bower/codemirror/theme/tomorrow-night-eighties.css +36 -0
  229. data/vendor/assets/javascripts/bower/codemirror/theme/twilight.css +30 -0
  230. data/vendor/assets/javascripts/bower/codemirror/theme/vibrant-ink.css +32 -0
  231. data/vendor/assets/javascripts/bower/codemirror/theme/xq-dark.css +51 -0
  232. data/vendor/assets/javascripts/bower/codemirror/theme/xq-light.css +43 -0
  233. data/vendor/assets/javascripts/bower/codemirror/theme/zenburn.css +37 -0
  234. metadata +225 -2
@@ -0,0 +1,97 @@
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: http://codemirror.net/LICENSE
3
+
4
+ (function() {
5
+ var mode = CodeMirror.getMode({tabSize: 4, indentUnit: 2}, "haml");
6
+ function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); }
7
+
8
+ // Requires at least one media query
9
+ MT("elementName",
10
+ "[tag %h1] Hey There");
11
+
12
+ MT("oneElementPerLine",
13
+ "[tag %h1] Hey There %h2");
14
+
15
+ MT("idSelector",
16
+ "[tag %h1][attribute #test] Hey There");
17
+
18
+ MT("classSelector",
19
+ "[tag %h1][attribute .hello] Hey There");
20
+
21
+ MT("docType",
22
+ "[tag !!! XML]");
23
+
24
+ MT("comment",
25
+ "[comment / Hello WORLD]");
26
+
27
+ MT("notComment",
28
+ "[tag %h1] This is not a / comment ");
29
+
30
+ MT("attributes",
31
+ "[tag %a]([variable title][operator =][string \"test\"]){[atom :title] [operator =>] [string \"test\"]}");
32
+
33
+ MT("htmlCode",
34
+ "[tag&bracket <][tag h1][tag&bracket >]Title[tag&bracket </][tag h1][tag&bracket >]");
35
+
36
+ MT("rubyBlock",
37
+ "[operator =][variable-2 @item]");
38
+
39
+ MT("selectorRubyBlock",
40
+ "[tag %a.selector=] [variable-2 @item]");
41
+
42
+ MT("nestedRubyBlock",
43
+ "[tag %a]",
44
+ " [operator =][variable puts] [string \"test\"]");
45
+
46
+ MT("multilinePlaintext",
47
+ "[tag %p]",
48
+ " Hello,",
49
+ " World");
50
+
51
+ MT("multilineRuby",
52
+ "[tag %p]",
53
+ " [comment -# this is a comment]",
54
+ " [comment and this is a comment too]",
55
+ " Date/Time",
56
+ " [operator -] [variable now] [operator =] [tag DateTime][operator .][property now]",
57
+ " [tag %strong=] [variable now]",
58
+ " [operator -] [keyword if] [variable now] [operator >] [tag DateTime][operator .][property parse]([string \"December 31, 2006\"])",
59
+ " [operator =][string \"Happy\"]",
60
+ " [operator =][string \"Belated\"]",
61
+ " [operator =][string \"Birthday\"]");
62
+
63
+ MT("multilineComment",
64
+ "[comment /]",
65
+ " [comment Multiline]",
66
+ " [comment Comment]");
67
+
68
+ MT("hamlComment",
69
+ "[comment -# this is a comment]");
70
+
71
+ MT("multilineHamlComment",
72
+ "[comment -# this is a comment]",
73
+ " [comment and this is a comment too]");
74
+
75
+ MT("multilineHTMLComment",
76
+ "[comment <!--]",
77
+ " [comment what a comment]",
78
+ " [comment -->]");
79
+
80
+ MT("hamlAfterRubyTag",
81
+ "[attribute .block]",
82
+ " [tag %strong=] [variable now]",
83
+ " [attribute .test]",
84
+ " [operator =][variable now]",
85
+ " [attribute .right]");
86
+
87
+ MT("stretchedRuby",
88
+ "[operator =] [variable puts] [string \"Hello\"],",
89
+ " [string \"World\"]");
90
+
91
+ MT("interpolationInHashAttribute",
92
+ //"[tag %div]{[atom :id] [operator =>] [string \"#{][variable test][string }_#{][variable ting][string }\"]} test");
93
+ "[tag %div]{[atom :id] [operator =>] [string \"#{][variable test][string }_#{][variable ting][string }\"]} test");
94
+
95
+ MT("interpolationInHTMLAttribute",
96
+ "[tag %div]([variable title][operator =][string \"#{][variable test][string }_#{][variable ting]()[string }\"]) Test");
97
+ })();
@@ -0,0 +1,267 @@
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: http://codemirror.net/LICENSE
3
+
4
+ (function(mod) {
5
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
6
+ mod(require("../../lib/codemirror"));
7
+ else if (typeof define == "function" && define.amd) // AMD
8
+ define(["../../lib/codemirror"], mod);
9
+ else // Plain browser env
10
+ mod(CodeMirror);
11
+ })(function(CodeMirror) {
12
+ "use strict";
13
+
14
+ CodeMirror.defineMode("haskell", function(_config, modeConfig) {
15
+
16
+ function switchState(source, setState, f) {
17
+ setState(f);
18
+ return f(source, setState);
19
+ }
20
+
21
+ // These should all be Unicode extended, as per the Haskell 2010 report
22
+ var smallRE = /[a-z_]/;
23
+ var largeRE = /[A-Z]/;
24
+ var digitRE = /\d/;
25
+ var hexitRE = /[0-9A-Fa-f]/;
26
+ var octitRE = /[0-7]/;
27
+ var idRE = /[a-z_A-Z0-9'\xa1-\uffff]/;
28
+ var symbolRE = /[-!#$%&*+.\/<=>?@\\^|~:]/;
29
+ var specialRE = /[(),;[\]`{}]/;
30
+ var whiteCharRE = /[ \t\v\f]/; // newlines are handled in tokenizer
31
+
32
+ function normal(source, setState) {
33
+ if (source.eatWhile(whiteCharRE)) {
34
+ return null;
35
+ }
36
+
37
+ var ch = source.next();
38
+ if (specialRE.test(ch)) {
39
+ if (ch == '{' && source.eat('-')) {
40
+ var t = "comment";
41
+ if (source.eat('#')) {
42
+ t = "meta";
43
+ }
44
+ return switchState(source, setState, ncomment(t, 1));
45
+ }
46
+ return null;
47
+ }
48
+
49
+ if (ch == '\'') {
50
+ if (source.eat('\\')) {
51
+ source.next(); // should handle other escapes here
52
+ }
53
+ else {
54
+ source.next();
55
+ }
56
+ if (source.eat('\'')) {
57
+ return "string";
58
+ }
59
+ return "error";
60
+ }
61
+
62
+ if (ch == '"') {
63
+ return switchState(source, setState, stringLiteral);
64
+ }
65
+
66
+ if (largeRE.test(ch)) {
67
+ source.eatWhile(idRE);
68
+ if (source.eat('.')) {
69
+ return "qualifier";
70
+ }
71
+ return "variable-2";
72
+ }
73
+
74
+ if (smallRE.test(ch)) {
75
+ source.eatWhile(idRE);
76
+ return "variable";
77
+ }
78
+
79
+ if (digitRE.test(ch)) {
80
+ if (ch == '0') {
81
+ if (source.eat(/[xX]/)) {
82
+ source.eatWhile(hexitRE); // should require at least 1
83
+ return "integer";
84
+ }
85
+ if (source.eat(/[oO]/)) {
86
+ source.eatWhile(octitRE); // should require at least 1
87
+ return "number";
88
+ }
89
+ }
90
+ source.eatWhile(digitRE);
91
+ var t = "number";
92
+ if (source.match(/^\.\d+/)) {
93
+ t = "number";
94
+ }
95
+ if (source.eat(/[eE]/)) {
96
+ t = "number";
97
+ source.eat(/[-+]/);
98
+ source.eatWhile(digitRE); // should require at least 1
99
+ }
100
+ return t;
101
+ }
102
+
103
+ if (ch == "." && source.eat("."))
104
+ return "keyword";
105
+
106
+ if (symbolRE.test(ch)) {
107
+ if (ch == '-' && source.eat(/-/)) {
108
+ source.eatWhile(/-/);
109
+ if (!source.eat(symbolRE)) {
110
+ source.skipToEnd();
111
+ return "comment";
112
+ }
113
+ }
114
+ var t = "variable";
115
+ if (ch == ':') {
116
+ t = "variable-2";
117
+ }
118
+ source.eatWhile(symbolRE);
119
+ return t;
120
+ }
121
+
122
+ return "error";
123
+ }
124
+
125
+ function ncomment(type, nest) {
126
+ if (nest == 0) {
127
+ return normal;
128
+ }
129
+ return function(source, setState) {
130
+ var currNest = nest;
131
+ while (!source.eol()) {
132
+ var ch = source.next();
133
+ if (ch == '{' && source.eat('-')) {
134
+ ++currNest;
135
+ }
136
+ else if (ch == '-' && source.eat('}')) {
137
+ --currNest;
138
+ if (currNest == 0) {
139
+ setState(normal);
140
+ return type;
141
+ }
142
+ }
143
+ }
144
+ setState(ncomment(type, currNest));
145
+ return type;
146
+ };
147
+ }
148
+
149
+ function stringLiteral(source, setState) {
150
+ while (!source.eol()) {
151
+ var ch = source.next();
152
+ if (ch == '"') {
153
+ setState(normal);
154
+ return "string";
155
+ }
156
+ if (ch == '\\') {
157
+ if (source.eol() || source.eat(whiteCharRE)) {
158
+ setState(stringGap);
159
+ return "string";
160
+ }
161
+ if (source.eat('&')) {
162
+ }
163
+ else {
164
+ source.next(); // should handle other escapes here
165
+ }
166
+ }
167
+ }
168
+ setState(normal);
169
+ return "error";
170
+ }
171
+
172
+ function stringGap(source, setState) {
173
+ if (source.eat('\\')) {
174
+ return switchState(source, setState, stringLiteral);
175
+ }
176
+ source.next();
177
+ setState(normal);
178
+ return "error";
179
+ }
180
+
181
+
182
+ var wellKnownWords = (function() {
183
+ var wkw = {};
184
+ function setType(t) {
185
+ return function () {
186
+ for (var i = 0; i < arguments.length; i++)
187
+ wkw[arguments[i]] = t;
188
+ };
189
+ }
190
+
191
+ setType("keyword")(
192
+ "case", "class", "data", "default", "deriving", "do", "else", "foreign",
193
+ "if", "import", "in", "infix", "infixl", "infixr", "instance", "let",
194
+ "module", "newtype", "of", "then", "type", "where", "_");
195
+
196
+ setType("keyword")(
197
+ "\.\.", ":", "::", "=", "\\", "\"", "<-", "->", "@", "~", "=>");
198
+
199
+ setType("builtin")(
200
+ "!!", "$!", "$", "&&", "+", "++", "-", ".", "/", "/=", "<", "<=", "=<<",
201
+ "==", ">", ">=", ">>", ">>=", "^", "^^", "||", "*", "**");
202
+
203
+ setType("builtin")(
204
+ "Bool", "Bounded", "Char", "Double", "EQ", "Either", "Enum", "Eq",
205
+ "False", "FilePath", "Float", "Floating", "Fractional", "Functor", "GT",
206
+ "IO", "IOError", "Int", "Integer", "Integral", "Just", "LT", "Left",
207
+ "Maybe", "Monad", "Nothing", "Num", "Ord", "Ordering", "Rational", "Read",
208
+ "ReadS", "Real", "RealFloat", "RealFrac", "Right", "Show", "ShowS",
209
+ "String", "True");
210
+
211
+ setType("builtin")(
212
+ "abs", "acos", "acosh", "all", "and", "any", "appendFile", "asTypeOf",
213
+ "asin", "asinh", "atan", "atan2", "atanh", "break", "catch", "ceiling",
214
+ "compare", "concat", "concatMap", "const", "cos", "cosh", "curry",
215
+ "cycle", "decodeFloat", "div", "divMod", "drop", "dropWhile", "either",
216
+ "elem", "encodeFloat", "enumFrom", "enumFromThen", "enumFromThenTo",
217
+ "enumFromTo", "error", "even", "exp", "exponent", "fail", "filter",
218
+ "flip", "floatDigits", "floatRadix", "floatRange", "floor", "fmap",
219
+ "foldl", "foldl1", "foldr", "foldr1", "fromEnum", "fromInteger",
220
+ "fromIntegral", "fromRational", "fst", "gcd", "getChar", "getContents",
221
+ "getLine", "head", "id", "init", "interact", "ioError", "isDenormalized",
222
+ "isIEEE", "isInfinite", "isNaN", "isNegativeZero", "iterate", "last",
223
+ "lcm", "length", "lex", "lines", "log", "logBase", "lookup", "map",
224
+ "mapM", "mapM_", "max", "maxBound", "maximum", "maybe", "min", "minBound",
225
+ "minimum", "mod", "negate", "not", "notElem", "null", "odd", "or",
226
+ "otherwise", "pi", "pred", "print", "product", "properFraction",
227
+ "putChar", "putStr", "putStrLn", "quot", "quotRem", "read", "readFile",
228
+ "readIO", "readList", "readLn", "readParen", "reads", "readsPrec",
229
+ "realToFrac", "recip", "rem", "repeat", "replicate", "return", "reverse",
230
+ "round", "scaleFloat", "scanl", "scanl1", "scanr", "scanr1", "seq",
231
+ "sequence", "sequence_", "show", "showChar", "showList", "showParen",
232
+ "showString", "shows", "showsPrec", "significand", "signum", "sin",
233
+ "sinh", "snd", "span", "splitAt", "sqrt", "subtract", "succ", "sum",
234
+ "tail", "take", "takeWhile", "tan", "tanh", "toEnum", "toInteger",
235
+ "toRational", "truncate", "uncurry", "undefined", "unlines", "until",
236
+ "unwords", "unzip", "unzip3", "userError", "words", "writeFile", "zip",
237
+ "zip3", "zipWith", "zipWith3");
238
+
239
+ var override = modeConfig.overrideKeywords;
240
+ if (override) for (var word in override) if (override.hasOwnProperty(word))
241
+ wkw[word] = override[word];
242
+
243
+ return wkw;
244
+ })();
245
+
246
+
247
+
248
+ return {
249
+ startState: function () { return { f: normal }; },
250
+ copyState: function (s) { return { f: s.f }; },
251
+
252
+ token: function(stream, state) {
253
+ var t = state.f(stream, function(s) { state.f = s; });
254
+ var w = stream.current();
255
+ return wellKnownWords.hasOwnProperty(w) ? wellKnownWords[w] : t;
256
+ },
257
+
258
+ blockCommentStart: "{-",
259
+ blockCommentEnd: "-}",
260
+ lineComment: "--"
261
+ };
262
+
263
+ });
264
+
265
+ CodeMirror.defineMIME("text/x-haskell", "haskell");
266
+
267
+ });
@@ -0,0 +1,518 @@
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: http://codemirror.net/LICENSE
3
+
4
+ (function(mod) {
5
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
6
+ mod(require("../../lib/codemirror"));
7
+ else if (typeof define == "function" && define.amd) // AMD
8
+ define(["../../lib/codemirror"], mod);
9
+ else // Plain browser env
10
+ mod(CodeMirror);
11
+ })(function(CodeMirror) {
12
+ "use strict";
13
+
14
+ CodeMirror.defineMode("haxe", function(config, parserConfig) {
15
+ var indentUnit = config.indentUnit;
16
+
17
+ // Tokenizer
18
+
19
+ var keywords = function(){
20
+ function kw(type) {return {type: type, style: "keyword"};}
21
+ var A = kw("keyword a"), B = kw("keyword b"), C = kw("keyword c");
22
+ var operator = kw("operator"), atom = {type: "atom", style: "atom"}, attribute = {type:"attribute", style: "attribute"};
23
+ var type = kw("typedef");
24
+ return {
25
+ "if": A, "while": A, "else": B, "do": B, "try": B,
26
+ "return": C, "break": C, "continue": C, "new": C, "throw": C,
27
+ "var": kw("var"), "inline":attribute, "static": attribute, "using":kw("import"),
28
+ "public": attribute, "private": attribute, "cast": kw("cast"), "import": kw("import"), "macro": kw("macro"),
29
+ "function": kw("function"), "catch": kw("catch"), "untyped": kw("untyped"), "callback": kw("cb"),
30
+ "for": kw("for"), "switch": kw("switch"), "case": kw("case"), "default": kw("default"),
31
+ "in": operator, "never": kw("property_access"), "trace":kw("trace"),
32
+ "class": type, "abstract":type, "enum":type, "interface":type, "typedef":type, "extends":type, "implements":type, "dynamic":type,
33
+ "true": atom, "false": atom, "null": atom
34
+ };
35
+ }();
36
+
37
+ var isOperatorChar = /[+\-*&%=<>!?|]/;
38
+
39
+ function chain(stream, state, f) {
40
+ state.tokenize = f;
41
+ return f(stream, state);
42
+ }
43
+
44
+ function nextUntilUnescaped(stream, end) {
45
+ var escaped = false, next;
46
+ while ((next = stream.next()) != null) {
47
+ if (next == end && !escaped)
48
+ return false;
49
+ escaped = !escaped && next == "\\";
50
+ }
51
+ return escaped;
52
+ }
53
+
54
+ // Used as scratch variables to communicate multiple values without
55
+ // consing up tons of objects.
56
+ var type, content;
57
+ function ret(tp, style, cont) {
58
+ type = tp; content = cont;
59
+ return style;
60
+ }
61
+
62
+ function haxeTokenBase(stream, state) {
63
+ var ch = stream.next();
64
+ if (ch == '"' || ch == "'")
65
+ return chain(stream, state, haxeTokenString(ch));
66
+ else if (/[\[\]{}\(\),;\:\.]/.test(ch))
67
+ return ret(ch);
68
+ else if (ch == "0" && stream.eat(/x/i)) {
69
+ stream.eatWhile(/[\da-f]/i);
70
+ return ret("number", "number");
71
+ }
72
+ else if (/\d/.test(ch) || ch == "-" && stream.eat(/\d/)) {
73
+ stream.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/);
74
+ return ret("number", "number");
75
+ }
76
+ else if (state.reAllowed && (ch == "~" && stream.eat(/\//))) {
77
+ nextUntilUnescaped(stream, "/");
78
+ stream.eatWhile(/[gimsu]/);
79
+ return ret("regexp", "string-2");
80
+ }
81
+ else if (ch == "/") {
82
+ if (stream.eat("*")) {
83
+ return chain(stream, state, haxeTokenComment);
84
+ }
85
+ else if (stream.eat("/")) {
86
+ stream.skipToEnd();
87
+ return ret("comment", "comment");
88
+ }
89
+ else {
90
+ stream.eatWhile(isOperatorChar);
91
+ return ret("operator", null, stream.current());
92
+ }
93
+ }
94
+ else if (ch == "#") {
95
+ stream.skipToEnd();
96
+ return ret("conditional", "meta");
97
+ }
98
+ else if (ch == "@") {
99
+ stream.eat(/:/);
100
+ stream.eatWhile(/[\w_]/);
101
+ return ret ("metadata", "meta");
102
+ }
103
+ else if (isOperatorChar.test(ch)) {
104
+ stream.eatWhile(isOperatorChar);
105
+ return ret("operator", null, stream.current());
106
+ }
107
+ else {
108
+ var word;
109
+ if(/[A-Z]/.test(ch))
110
+ {
111
+ stream.eatWhile(/[\w_<>]/);
112
+ word = stream.current();
113
+ return ret("type", "variable-3", word);
114
+ }
115
+ else
116
+ {
117
+ stream.eatWhile(/[\w_]/);
118
+ var word = stream.current(), known = keywords.propertyIsEnumerable(word) && keywords[word];
119
+ return (known && state.kwAllowed) ? ret(known.type, known.style, word) :
120
+ ret("variable", "variable", word);
121
+ }
122
+ }
123
+ }
124
+
125
+ function haxeTokenString(quote) {
126
+ return function(stream, state) {
127
+ if (!nextUntilUnescaped(stream, quote))
128
+ state.tokenize = haxeTokenBase;
129
+ return ret("string", "string");
130
+ };
131
+ }
132
+
133
+ function haxeTokenComment(stream, state) {
134
+ var maybeEnd = false, ch;
135
+ while (ch = stream.next()) {
136
+ if (ch == "/" && maybeEnd) {
137
+ state.tokenize = haxeTokenBase;
138
+ break;
139
+ }
140
+ maybeEnd = (ch == "*");
141
+ }
142
+ return ret("comment", "comment");
143
+ }
144
+
145
+ // Parser
146
+
147
+ var atomicTypes = {"atom": true, "number": true, "variable": true, "string": true, "regexp": true};
148
+
149
+ function HaxeLexical(indented, column, type, align, prev, info) {
150
+ this.indented = indented;
151
+ this.column = column;
152
+ this.type = type;
153
+ this.prev = prev;
154
+ this.info = info;
155
+ if (align != null) this.align = align;
156
+ }
157
+
158
+ function inScope(state, varname) {
159
+ for (var v = state.localVars; v; v = v.next)
160
+ if (v.name == varname) return true;
161
+ }
162
+
163
+ function parseHaxe(state, style, type, content, stream) {
164
+ var cc = state.cc;
165
+ // Communicate our context to the combinators.
166
+ // (Less wasteful than consing up a hundred closures on every call.)
167
+ cx.state = state; cx.stream = stream; cx.marked = null, cx.cc = cc;
168
+
169
+ if (!state.lexical.hasOwnProperty("align"))
170
+ state.lexical.align = true;
171
+
172
+ while(true) {
173
+ var combinator = cc.length ? cc.pop() : statement;
174
+ if (combinator(type, content)) {
175
+ while(cc.length && cc[cc.length - 1].lex)
176
+ cc.pop()();
177
+ if (cx.marked) return cx.marked;
178
+ if (type == "variable" && inScope(state, content)) return "variable-2";
179
+ if (type == "variable" && imported(state, content)) return "variable-3";
180
+ return style;
181
+ }
182
+ }
183
+ }
184
+
185
+ function imported(state, typename)
186
+ {
187
+ if (/[a-z]/.test(typename.charAt(0)))
188
+ return false;
189
+ var len = state.importedtypes.length;
190
+ for (var i = 0; i<len; i++)
191
+ if(state.importedtypes[i]==typename) return true;
192
+ }
193
+
194
+
195
+ function registerimport(importname) {
196
+ var state = cx.state;
197
+ for (var t = state.importedtypes; t; t = t.next)
198
+ if(t.name == importname) return;
199
+ state.importedtypes = { name: importname, next: state.importedtypes };
200
+ }
201
+ // Combinator utils
202
+
203
+ var cx = {state: null, column: null, marked: null, cc: null};
204
+ function pass() {
205
+ for (var i = arguments.length - 1; i >= 0; i--) cx.cc.push(arguments[i]);
206
+ }
207
+ function cont() {
208
+ pass.apply(null, arguments);
209
+ return true;
210
+ }
211
+ function register(varname) {
212
+ var state = cx.state;
213
+ if (state.context) {
214
+ cx.marked = "def";
215
+ for (var v = state.localVars; v; v = v.next)
216
+ if (v.name == varname) return;
217
+ state.localVars = {name: varname, next: state.localVars};
218
+ }
219
+ }
220
+
221
+ // Combinators
222
+
223
+ var defaultVars = {name: "this", next: null};
224
+ function pushcontext() {
225
+ if (!cx.state.context) cx.state.localVars = defaultVars;
226
+ cx.state.context = {prev: cx.state.context, vars: cx.state.localVars};
227
+ }
228
+ function popcontext() {
229
+ cx.state.localVars = cx.state.context.vars;
230
+ cx.state.context = cx.state.context.prev;
231
+ }
232
+ function pushlex(type, info) {
233
+ var result = function() {
234
+ var state = cx.state;
235
+ state.lexical = new HaxeLexical(state.indented, cx.stream.column(), type, null, state.lexical, info);
236
+ };
237
+ result.lex = true;
238
+ return result;
239
+ }
240
+ function poplex() {
241
+ var state = cx.state;
242
+ if (state.lexical.prev) {
243
+ if (state.lexical.type == ")")
244
+ state.indented = state.lexical.indented;
245
+ state.lexical = state.lexical.prev;
246
+ }
247
+ }
248
+ poplex.lex = true;
249
+
250
+ function expect(wanted) {
251
+ function f(type) {
252
+ if (type == wanted) return cont();
253
+ else if (wanted == ";") return pass();
254
+ else return cont(f);
255
+ };
256
+ return f;
257
+ }
258
+
259
+ function statement(type) {
260
+ if (type == "@") return cont(metadef);
261
+ if (type == "var") return cont(pushlex("vardef"), vardef1, expect(";"), poplex);
262
+ if (type == "keyword a") return cont(pushlex("form"), expression, statement, poplex);
263
+ if (type == "keyword b") return cont(pushlex("form"), statement, poplex);
264
+ if (type == "{") return cont(pushlex("}"), pushcontext, block, poplex, popcontext);
265
+ if (type == ";") return cont();
266
+ if (type == "attribute") return cont(maybeattribute);
267
+ if (type == "function") return cont(functiondef);
268
+ if (type == "for") return cont(pushlex("form"), expect("("), pushlex(")"), forspec1, expect(")"),
269
+ poplex, statement, poplex);
270
+ if (type == "variable") return cont(pushlex("stat"), maybelabel);
271
+ if (type == "switch") return cont(pushlex("form"), expression, pushlex("}", "switch"), expect("{"),
272
+ block, poplex, poplex);
273
+ if (type == "case") return cont(expression, expect(":"));
274
+ if (type == "default") return cont(expect(":"));
275
+ if (type == "catch") return cont(pushlex("form"), pushcontext, expect("("), funarg, expect(")"),
276
+ statement, poplex, popcontext);
277
+ if (type == "import") return cont(importdef, expect(";"));
278
+ if (type == "typedef") return cont(typedef);
279
+ return pass(pushlex("stat"), expression, expect(";"), poplex);
280
+ }
281
+ function expression(type) {
282
+ if (atomicTypes.hasOwnProperty(type)) return cont(maybeoperator);
283
+ if (type == "function") return cont(functiondef);
284
+ if (type == "keyword c") return cont(maybeexpression);
285
+ if (type == "(") return cont(pushlex(")"), maybeexpression, expect(")"), poplex, maybeoperator);
286
+ if (type == "operator") return cont(expression);
287
+ if (type == "[") return cont(pushlex("]"), commasep(expression, "]"), poplex, maybeoperator);
288
+ if (type == "{") return cont(pushlex("}"), commasep(objprop, "}"), poplex, maybeoperator);
289
+ return cont();
290
+ }
291
+ function maybeexpression(type) {
292
+ if (type.match(/[;\}\)\],]/)) return pass();
293
+ return pass(expression);
294
+ }
295
+
296
+ function maybeoperator(type, value) {
297
+ if (type == "operator" && /\+\+|--/.test(value)) return cont(maybeoperator);
298
+ if (type == "operator" || type == ":") return cont(expression);
299
+ if (type == ";") return;
300
+ if (type == "(") return cont(pushlex(")"), commasep(expression, ")"), poplex, maybeoperator);
301
+ if (type == ".") return cont(property, maybeoperator);
302
+ if (type == "[") return cont(pushlex("]"), expression, expect("]"), poplex, maybeoperator);
303
+ }
304
+
305
+ function maybeattribute(type) {
306
+ if (type == "attribute") return cont(maybeattribute);
307
+ if (type == "function") return cont(functiondef);
308
+ if (type == "var") return cont(vardef1);
309
+ }
310
+
311
+ function metadef(type) {
312
+ if(type == ":") return cont(metadef);
313
+ if(type == "variable") return cont(metadef);
314
+ if(type == "(") return cont(pushlex(")"), commasep(metaargs, ")"), poplex, statement);
315
+ }
316
+ function metaargs(type) {
317
+ if(type == "variable") return cont();
318
+ }
319
+
320
+ function importdef (type, value) {
321
+ if(type == "variable" && /[A-Z]/.test(value.charAt(0))) { registerimport(value); return cont(); }
322
+ else if(type == "variable" || type == "property" || type == "." || value == "*") return cont(importdef);
323
+ }
324
+
325
+ function typedef (type, value)
326
+ {
327
+ if(type == "variable" && /[A-Z]/.test(value.charAt(0))) { registerimport(value); return cont(); }
328
+ else if (type == "type" && /[A-Z]/.test(value.charAt(0))) { return cont(); }
329
+ }
330
+
331
+ function maybelabel(type) {
332
+ if (type == ":") return cont(poplex, statement);
333
+ return pass(maybeoperator, expect(";"), poplex);
334
+ }
335
+ function property(type) {
336
+ if (type == "variable") {cx.marked = "property"; return cont();}
337
+ }
338
+ function objprop(type) {
339
+ if (type == "variable") cx.marked = "property";
340
+ if (atomicTypes.hasOwnProperty(type)) return cont(expect(":"), expression);
341
+ }
342
+ function commasep(what, end) {
343
+ function proceed(type) {
344
+ if (type == ",") return cont(what, proceed);
345
+ if (type == end) return cont();
346
+ return cont(expect(end));
347
+ }
348
+ return function(type) {
349
+ if (type == end) return cont();
350
+ else return pass(what, proceed);
351
+ };
352
+ }
353
+ function block(type) {
354
+ if (type == "}") return cont();
355
+ return pass(statement, block);
356
+ }
357
+ function vardef1(type, value) {
358
+ if (type == "variable"){register(value); return cont(typeuse, vardef2);}
359
+ return cont();
360
+ }
361
+ function vardef2(type, value) {
362
+ if (value == "=") return cont(expression, vardef2);
363
+ if (type == ",") return cont(vardef1);
364
+ }
365
+ function forspec1(type, value) {
366
+ if (type == "variable") {
367
+ register(value);
368
+ }
369
+ return cont(pushlex(")"), pushcontext, forin, expression, poplex, statement, popcontext);
370
+ }
371
+ function forin(_type, value) {
372
+ if (value == "in") return cont();
373
+ }
374
+ function functiondef(type, value) {
375
+ if (type == "variable") {register(value); return cont(functiondef);}
376
+ if (value == "new") return cont(functiondef);
377
+ if (type == "(") return cont(pushlex(")"), pushcontext, commasep(funarg, ")"), poplex, typeuse, statement, popcontext);
378
+ }
379
+ function typeuse(type) {
380
+ if(type == ":") return cont(typestring);
381
+ }
382
+ function typestring(type) {
383
+ if(type == "type") return cont();
384
+ if(type == "variable") return cont();
385
+ if(type == "{") return cont(pushlex("}"), commasep(typeprop, "}"), poplex);
386
+ }
387
+ function typeprop(type) {
388
+ if(type == "variable") return cont(typeuse);
389
+ }
390
+ function funarg(type, value) {
391
+ if (type == "variable") {register(value); return cont(typeuse);}
392
+ }
393
+
394
+ // Interface
395
+
396
+ return {
397
+ startState: function(basecolumn) {
398
+ var defaulttypes = ["Int", "Float", "String", "Void", "Std", "Bool", "Dynamic", "Array"];
399
+ return {
400
+ tokenize: haxeTokenBase,
401
+ reAllowed: true,
402
+ kwAllowed: true,
403
+ cc: [],
404
+ lexical: new HaxeLexical((basecolumn || 0) - indentUnit, 0, "block", false),
405
+ localVars: parserConfig.localVars,
406
+ importedtypes: defaulttypes,
407
+ context: parserConfig.localVars && {vars: parserConfig.localVars},
408
+ indented: 0
409
+ };
410
+ },
411
+
412
+ token: function(stream, state) {
413
+ if (stream.sol()) {
414
+ if (!state.lexical.hasOwnProperty("align"))
415
+ state.lexical.align = false;
416
+ state.indented = stream.indentation();
417
+ }
418
+ if (stream.eatSpace()) return null;
419
+ var style = state.tokenize(stream, state);
420
+ if (type == "comment") return style;
421
+ state.reAllowed = !!(type == "operator" || type == "keyword c" || type.match(/^[\[{}\(,;:]$/));
422
+ state.kwAllowed = type != '.';
423
+ return parseHaxe(state, style, type, content, stream);
424
+ },
425
+
426
+ indent: function(state, textAfter) {
427
+ if (state.tokenize != haxeTokenBase) return 0;
428
+ var firstChar = textAfter && textAfter.charAt(0), lexical = state.lexical;
429
+ if (lexical.type == "stat" && firstChar == "}") lexical = lexical.prev;
430
+ var type = lexical.type, closing = firstChar == type;
431
+ if (type == "vardef") return lexical.indented + 4;
432
+ else if (type == "form" && firstChar == "{") return lexical.indented;
433
+ else if (type == "stat" || type == "form") return lexical.indented + indentUnit;
434
+ else if (lexical.info == "switch" && !closing)
435
+ return lexical.indented + (/^(?:case|default)\b/.test(textAfter) ? indentUnit : 2 * indentUnit);
436
+ else if (lexical.align) return lexical.column + (closing ? 0 : 1);
437
+ else return lexical.indented + (closing ? 0 : indentUnit);
438
+ },
439
+
440
+ electricChars: "{}",
441
+ blockCommentStart: "/*",
442
+ blockCommentEnd: "*/",
443
+ lineComment: "//"
444
+ };
445
+ });
446
+
447
+ CodeMirror.defineMIME("text/x-haxe", "haxe");
448
+
449
+ CodeMirror.defineMode("hxml", function () {
450
+
451
+ return {
452
+ startState: function () {
453
+ return {
454
+ define: false,
455
+ inString: false
456
+ };
457
+ },
458
+ token: function (stream, state) {
459
+ var ch = stream.peek();
460
+ var sol = stream.sol();
461
+
462
+ ///* comments */
463
+ if (ch == "#") {
464
+ stream.skipToEnd();
465
+ return "comment";
466
+ }
467
+ if (sol && ch == "-") {
468
+ var style = "variable-2";
469
+
470
+ stream.eat(/-/);
471
+
472
+ if (stream.peek() == "-") {
473
+ stream.eat(/-/);
474
+ style = "keyword a";
475
+ }
476
+
477
+ if (stream.peek() == "D") {
478
+ stream.eat(/[D]/);
479
+ style = "keyword c";
480
+ state.define = true;
481
+ }
482
+
483
+ stream.eatWhile(/[A-Z]/i);
484
+ return style;
485
+ }
486
+
487
+ var ch = stream.peek();
488
+
489
+ if (state.inString == false && ch == "'") {
490
+ state.inString = true;
491
+ ch = stream.next();
492
+ }
493
+
494
+ if (state.inString == true) {
495
+ if (stream.skipTo("'")) {
496
+
497
+ } else {
498
+ stream.skipToEnd();
499
+ }
500
+
501
+ if (stream.peek() == "'") {
502
+ stream.next();
503
+ state.inString = false;
504
+ }
505
+
506
+ return "string";
507
+ }
508
+
509
+ stream.next();
510
+ return null;
511
+ },
512
+ lineComment: "#"
513
+ };
514
+ });
515
+
516
+ CodeMirror.defineMIME("text/x-hxml", "hxml");
517
+
518
+ });