jekyll-theme-anc 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (263) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/README.md +1 -0
  4. data/_includes/disqus.html +42 -0
  5. data/_includes/facebook_share_btn.html +1 -0
  6. data/_includes/footer.html +79 -0
  7. data/_includes/go2top.html +22 -0
  8. data/_includes/google-analytics.html +11 -0
  9. data/_includes/head.html +50 -0
  10. data/_includes/header.html +13 -0
  11. data/_includes/jspdf.html +41 -0
  12. data/_includes/nav.html +25 -0
  13. data/_includes/pageloginpoper.html +59 -0
  14. data/_includes/post-categories.html +8 -0
  15. data/_includes/post_seo.html +59 -0
  16. data/_includes/youtube_video.html +11 -0
  17. data/_layouts/blog.html +33 -0
  18. data/_layouts/default.html +151 -0
  19. data/_layouts/home.html +26 -0
  20. data/_layouts/page.html +5 -0
  21. data/_layouts/post.html +83 -0
  22. data/_sass/anc.scss +9 -0
  23. data/_sass/anc/_base.scss +144 -0
  24. data/_sass/anc/_layout.scss +0 -0
  25. data/_sass/anc/_materialize.scss +38 -0
  26. data/_sass/anc/_syntax-highlighting.scss +78 -0
  27. data/_sass/anc/components/_variables.scss +343 -0
  28. data/_sass/materialize-css/components/_badges.scss +47 -0
  29. data/_sass/materialize-css/components/_buttons.scss +291 -0
  30. data/_sass/materialize-css/components/_cards.scss +196 -0
  31. data/_sass/materialize-css/components/_carousel.scss +90 -0
  32. data/_sass/materialize-css/components/_chips.scss +89 -0
  33. data/_sass/materialize-css/components/_collapsible.scss +84 -0
  34. data/_sass/materialize-css/components/_color.scss +412 -0
  35. data/_sass/materialize-css/components/_dropdown.scss +68 -0
  36. data/_sass/materialize-css/components/_global.scss +734 -0
  37. data/_sass/materialize-css/components/_grid.scss +156 -0
  38. data/_sass/materialize-css/components/_icons-material-design.scss +5 -0
  39. data/_sass/materialize-css/components/_materialbox.scss +43 -0
  40. data/_sass/materialize-css/components/_modal.scss +90 -0
  41. data/_sass/materialize-css/components/_navbar.scss +208 -0
  42. data/_sass/materialize-css/components/_normalize.scss +424 -0
  43. data/_sass/materialize-css/components/_preloader.scss +334 -0
  44. data/_sass/materialize-css/components/_pulse.scss +34 -0
  45. data/_sass/materialize-css/components/_roboto.scss +39 -0
  46. data/_sass/materialize-css/components/_sideNav.scss +214 -0
  47. data/_sass/materialize-css/components/_slider.scss +92 -0
  48. data/_sass/materialize-css/components/_table_of_contents.scss +33 -0
  49. data/_sass/materialize-css/components/_tabs.scss +93 -0
  50. data/_sass/materialize-css/components/_tapTarget.scss +103 -0
  51. data/_sass/materialize-css/components/_toast.scss +59 -0
  52. data/_sass/materialize-css/components/_tooltip.scss +31 -0
  53. data/_sass/materialize-css/components/_transitions.scss +13 -0
  54. data/_sass/materialize-css/components/_typography.scss +61 -0
  55. data/_sass/materialize-css/components/_variables.scss +343 -0
  56. data/_sass/materialize-css/components/_waves.scss +114 -0
  57. data/_sass/materialize-css/components/date_picker/_default.date.scss +456 -0
  58. data/_sass/materialize-css/components/date_picker/_default.scss +212 -0
  59. data/_sass/materialize-css/components/date_picker/_default.time.scss +267 -0
  60. data/_sass/materialize-css/components/forms/_checkboxes.scss +210 -0
  61. data/_sass/materialize-css/components/forms/_file-input.scss +44 -0
  62. data/_sass/materialize-css/components/forms/_forms.scss +22 -0
  63. data/_sass/materialize-css/components/forms/_input-fields.scss +333 -0
  64. data/_sass/materialize-css/components/forms/_radio-buttons.scss +115 -0
  65. data/_sass/materialize-css/components/forms/_range.scss +160 -0
  66. data/_sass/materialize-css/components/forms/_select.scss +182 -0
  67. data/_sass/materialize-css/components/forms/_switches.scss +89 -0
  68. data/_sass/materialize-css/materialize.scss +42 -0
  69. data/_sass/materialize/components/_badges.scss +47 -0
  70. data/_sass/materialize/components/_buttons.scss +291 -0
  71. data/_sass/materialize/components/_cards.scss +196 -0
  72. data/_sass/materialize/components/_carousel.scss +90 -0
  73. data/_sass/materialize/components/_chips.scss +89 -0
  74. data/_sass/materialize/components/_collapsible.scss +84 -0
  75. data/_sass/materialize/components/_color.scss +412 -0
  76. data/_sass/materialize/components/_dropdown.scss +68 -0
  77. data/_sass/materialize/components/_global.scss +734 -0
  78. data/_sass/materialize/components/_grid.scss +156 -0
  79. data/_sass/materialize/components/_icons-material-design.scss +5 -0
  80. data/_sass/materialize/components/_materialbox.scss +43 -0
  81. data/_sass/materialize/components/_modal.scss +90 -0
  82. data/_sass/materialize/components/_navbar.scss +208 -0
  83. data/_sass/materialize/components/_normalize.scss +424 -0
  84. data/_sass/materialize/components/_preloader.scss +334 -0
  85. data/_sass/materialize/components/_pulse.scss +34 -0
  86. data/_sass/materialize/components/_roboto.scss +39 -0
  87. data/_sass/materialize/components/_sideNav.scss +214 -0
  88. data/_sass/materialize/components/_slider.scss +92 -0
  89. data/_sass/materialize/components/_table_of_contents.scss +33 -0
  90. data/_sass/materialize/components/_tabs.scss +93 -0
  91. data/_sass/materialize/components/_tapTarget.scss +103 -0
  92. data/_sass/materialize/components/_toast.scss +59 -0
  93. data/_sass/materialize/components/_tooltip.scss +31 -0
  94. data/_sass/materialize/components/_transitions.scss +13 -0
  95. data/_sass/materialize/components/_typography.scss +61 -0
  96. data/_sass/materialize/components/_variables.scss +343 -0
  97. data/_sass/materialize/components/_waves.scss +114 -0
  98. data/_sass/materialize/components/date_picker/_default.date.scss +456 -0
  99. data/_sass/materialize/components/date_picker/_default.scss +212 -0
  100. data/_sass/materialize/components/date_picker/_default.time.scss +267 -0
  101. data/_sass/materialize/components/forms/_checkboxes.scss +210 -0
  102. data/_sass/materialize/components/forms/_file-input.scss +44 -0
  103. data/_sass/materialize/components/forms/_forms.scss +22 -0
  104. data/_sass/materialize/components/forms/_input-fields.scss +333 -0
  105. data/_sass/materialize/components/forms/_radio-buttons.scss +115 -0
  106. data/_sass/materialize/components/forms/_range.scss +160 -0
  107. data/_sass/materialize/components/forms/_select.scss +182 -0
  108. data/_sass/materialize/components/forms/_switches.scss +89 -0
  109. data/_sass/materialize/materialize.scss +42 -0
  110. data/assets/fonts/FontAwesome.otf +0 -0
  111. data/assets/fonts/fontawesome-webfont.eot +0 -0
  112. data/assets/fonts/fontawesome-webfont.svg +2671 -0
  113. data/assets/fonts/fontawesome-webfont.ttf +0 -0
  114. data/assets/fonts/fontawesome-webfont.woff +0 -0
  115. data/assets/fonts/fontawesome-webfont.woff2 +0 -0
  116. data/assets/fonts/roboto/Roboto-Bold.woff +0 -0
  117. data/assets/fonts/roboto/Roboto-Bold.woff2 +0 -0
  118. data/assets/fonts/roboto/Roboto-Light.woff +0 -0
  119. data/assets/fonts/roboto/Roboto-Light.woff2 +0 -0
  120. data/assets/fonts/roboto/Roboto-Medium.woff +0 -0
  121. data/assets/fonts/roboto/Roboto-Medium.woff2 +0 -0
  122. data/assets/fonts/roboto/Roboto-Regular.woff +0 -0
  123. data/assets/fonts/roboto/Roboto-Regular.woff2 +0 -0
  124. data/assets/fonts/roboto/Roboto-Thin.woff +0 -0
  125. data/assets/fonts/roboto/Roboto-Thin.woff2 +0 -0
  126. data/assets/images/close.png +0 -0
  127. data/assets/images/loader.gif +0 -0
  128. data/assets/img/icons/facebook-square.png +0 -0
  129. data/assets/img/icons/github-square.png +0 -0
  130. data/assets/img/icons/twitter-square.png +0 -0
  131. data/assets/img/icons/youtube-square.png +0 -0
  132. data/assets/img/jubayed11.37-16.jpg +0 -0
  133. data/assets/img/parallax1.jpg +0 -0
  134. data/assets/img/sample-1.jpg +0 -0
  135. data/assets/js/custom_script.js +200 -0
  136. data/assets/js/highlight.pack.js +2 -0
  137. data/assets/js/materialize.min.js +6 -0
  138. data/assets/js/mode/apl/apl.js +174 -0
  139. data/assets/js/mode/asciiarmor/asciiarmor.js +74 -0
  140. data/assets/js/mode/asn.1/asn.1.js +204 -0
  141. data/assets/js/mode/asterisk/asterisk.js +196 -0
  142. data/assets/js/mode/brainfuck/brainfuck.js +85 -0
  143. data/assets/js/mode/clike/clike.js +789 -0
  144. data/assets/js/mode/clojure/clojure.js +306 -0
  145. data/assets/js/mode/cmake/cmake.js +97 -0
  146. data/assets/js/mode/cobol/cobol.js +255 -0
  147. data/assets/js/mode/coffeescript/coffeescript.js +359 -0
  148. data/assets/js/mode/commonlisp/commonlisp.js +124 -0
  149. data/assets/js/mode/crystal/crystal.js +433 -0
  150. data/assets/js/mode/css/css.js +831 -0
  151. data/assets/js/mode/cypher/cypher.js +150 -0
  152. data/assets/js/mode/d/d.js +218 -0
  153. data/assets/js/mode/dart/dart.js +157 -0
  154. data/assets/js/mode/diff/diff.js +47 -0
  155. data/assets/js/mode/django/django.js +356 -0
  156. data/assets/js/mode/dockerfile/dockerfile.js +79 -0
  157. data/assets/js/mode/dtd/dtd.js +142 -0
  158. data/assets/js/mode/dylan/dylan.js +352 -0
  159. data/assets/js/mode/ebnf/ebnf.js +195 -0
  160. data/assets/js/mode/ecl/ecl.js +206 -0
  161. data/assets/js/mode/eiffel/eiffel.js +160 -0
  162. data/assets/js/mode/elm/elm.js +205 -0
  163. data/assets/js/mode/erlang/erlang.js +619 -0
  164. data/assets/js/mode/factor/factor.js +85 -0
  165. data/assets/js/mode/fcl/fcl.js +173 -0
  166. data/assets/js/mode/forth/forth.js +180 -0
  167. data/assets/js/mode/fortran/fortran.js +188 -0
  168. data/assets/js/mode/gas/gas.js +345 -0
  169. data/assets/js/mode/gfm/gfm.js +129 -0
  170. data/assets/js/mode/gherkin/gherkin.js +178 -0
  171. data/assets/js/mode/go/go.js +187 -0
  172. data/assets/js/mode/groovy/groovy.js +230 -0
  173. data/assets/js/mode/haml/haml.js +161 -0
  174. data/assets/js/mode/handlebars/handlebars.js +62 -0
  175. data/assets/js/mode/haskell-literate/haskell-literate.js +43 -0
  176. data/assets/js/mode/haskell/haskell.js +267 -0
  177. data/assets/js/mode/haxe/haxe.js +515 -0
  178. data/assets/js/mode/htmlembedded/htmlembedded.js +28 -0
  179. data/assets/js/mode/htmlmixed/htmlmixed.js +152 -0
  180. data/assets/js/mode/http/http.js +113 -0
  181. data/assets/js/mode/idl/idl.js +290 -0
  182. data/assets/js/mode/javascript/javascript.js +838 -0
  183. data/assets/js/mode/jinja2/jinja2.js +142 -0
  184. data/assets/js/mode/jsx/jsx.js +148 -0
  185. data/assets/js/mode/julia/julia.js +418 -0
  186. data/assets/js/mode/livescript/livescript.js +280 -0
  187. data/assets/js/mode/lua/lua.js +159 -0
  188. data/assets/js/mode/markdown/markdown.js +859 -0
  189. data/assets/js/mode/mathematica/mathematica.js +176 -0
  190. data/assets/js/mode/mbox/mbox.js +129 -0
  191. data/assets/js/mode/meta.js +215 -0
  192. data/assets/js/mode/mirc/mirc.js +193 -0
  193. data/assets/js/mode/mllike/mllike.js +208 -0
  194. data/assets/js/mode/modelica/modelica.js +245 -0
  195. data/assets/js/mode/mscgen/mscgen.js +175 -0
  196. data/assets/js/mode/mumps/mumps.js +148 -0
  197. data/assets/js/mode/nginx/nginx.js +178 -0
  198. data/assets/js/mode/nsis/nsis.js +95 -0
  199. data/assets/js/mode/ntriples/ntriples.js +195 -0
  200. data/assets/js/mode/octave/octave.js +139 -0
  201. data/assets/js/mode/oz/oz.js +252 -0
  202. data/assets/js/mode/pascal/pascal.js +109 -0
  203. data/assets/js/mode/pegjs/pegjs.js +114 -0
  204. data/assets/js/mode/perl/perl.js +837 -0
  205. data/assets/js/mode/php/php.js +234 -0
  206. data/assets/js/mode/pig/pig.js +178 -0
  207. data/assets/js/mode/powershell/powershell.js +398 -0
  208. data/assets/js/mode/properties/properties.js +78 -0
  209. data/assets/js/mode/protobuf/protobuf.js +68 -0
  210. data/assets/js/mode/pug/pug.js +591 -0
  211. data/assets/js/mode/puppet/puppet.js +220 -0
  212. data/assets/js/mode/python/python.js +334 -0
  213. data/assets/js/mode/q/q.js +139 -0
  214. data/assets/js/mode/r/r.js +183 -0
  215. data/assets/js/mode/rpm/changes/index.html +66 -0
  216. data/assets/js/mode/rpm/rpm.js +109 -0
  217. data/assets/js/mode/rst/rst.js +557 -0
  218. data/assets/js/mode/ruby/ruby.js +295 -0
  219. data/assets/js/mode/rust/rust.js +72 -0
  220. data/assets/js/mode/sas/sas.js +303 -0
  221. data/assets/js/mode/sass/sass.js +454 -0
  222. data/assets/js/mode/scheme/scheme.js +249 -0
  223. data/assets/js/mode/shell/shell.js +142 -0
  224. data/assets/js/mode/sieve/sieve.js +193 -0
  225. data/assets/js/mode/slim/slim.js +575 -0
  226. data/assets/js/mode/smalltalk/smalltalk.js +168 -0
  227. data/assets/js/mode/smarty/smarty.js +225 -0
  228. data/assets/js/mode/solr/solr.js +104 -0
  229. data/assets/js/mode/soy/soy.js +342 -0
  230. data/assets/js/mode/sparql/sparql.js +180 -0
  231. data/assets/js/mode/spreadsheet/spreadsheet.js +112 -0
  232. data/assets/js/mode/sql/sql.js +475 -0
  233. data/assets/js/mode/stex/stex.js +251 -0
  234. data/assets/js/mode/stylus/stylus.js +771 -0
  235. data/assets/js/mode/swift/swift.js +210 -0
  236. data/assets/js/mode/tcl/tcl.js +139 -0
  237. data/assets/js/mode/textile/textile.js +469 -0
  238. data/assets/js/mode/tiddlywiki/tiddlywiki.css +14 -0
  239. data/assets/js/mode/tiddlywiki/tiddlywiki.js +308 -0
  240. data/assets/js/mode/tiki/tiki.css +26 -0
  241. data/assets/js/mode/tiki/tiki.js +312 -0
  242. data/assets/js/mode/toml/toml.js +88 -0
  243. data/assets/js/mode/tornado/tornado.js +68 -0
  244. data/assets/js/mode/troff/troff.js +84 -0
  245. data/assets/js/mode/ttcn-cfg/ttcn-cfg.js +214 -0
  246. data/assets/js/mode/ttcn/ttcn.js +283 -0
  247. data/assets/js/mode/turtle/turtle.js +162 -0
  248. data/assets/js/mode/twig/twig.js +141 -0
  249. data/assets/js/mode/vb/vb.js +275 -0
  250. data/assets/js/mode/vbscript/vbscript.js +350 -0
  251. data/assets/js/mode/velocity/velocity.js +201 -0
  252. data/assets/js/mode/verilog/verilog.js +675 -0
  253. data/assets/js/mode/vhdl/vhdl.js +189 -0
  254. data/assets/js/mode/vue/vue.js +70 -0
  255. data/assets/js/mode/webidl/webidl.js +195 -0
  256. data/assets/js/mode/xml/xml.js +394 -0
  257. data/assets/js/mode/xquery/xquery.js +448 -0
  258. data/assets/js/mode/yacas/yacas.js +204 -0
  259. data/assets/js/mode/yaml-frontmatter/yaml-frontmatter.js +68 -0
  260. data/assets/js/mode/yaml/yaml.js +118 -0
  261. data/assets/js/mode/z80/z80.js +116 -0
  262. data/assets/main.scss +5 -0
  263. metadata +347 -0
@@ -0,0 +1,295 @@
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("ruby", function(config) {
15
+ function wordObj(words) {
16
+ var o = {};
17
+ for (var i = 0, e = words.length; i < e; ++i) o[words[i]] = true;
18
+ return o;
19
+ }
20
+ var keywords = wordObj([
21
+ "alias", "and", "BEGIN", "begin", "break", "case", "class", "def", "defined?", "do", "else",
22
+ "elsif", "END", "end", "ensure", "false", "for", "if", "in", "module", "next", "not", "or",
23
+ "redo", "rescue", "retry", "return", "self", "super", "then", "true", "undef", "unless",
24
+ "until", "when", "while", "yield", "nil", "raise", "throw", "catch", "fail", "loop", "callcc",
25
+ "caller", "lambda", "proc", "public", "protected", "private", "require", "load",
26
+ "require_relative", "extend", "autoload", "__END__", "__FILE__", "__LINE__", "__dir__"
27
+ ]);
28
+ var indentWords = wordObj(["def", "class", "case", "for", "while", "until", "module", "then",
29
+ "catch", "loop", "proc", "begin"]);
30
+ var dedentWords = wordObj(["end", "until"]);
31
+ var matching = {"[": "]", "{": "}", "(": ")"};
32
+ var curPunc;
33
+
34
+ function chain(newtok, stream, state) {
35
+ state.tokenize.push(newtok);
36
+ return newtok(stream, state);
37
+ }
38
+
39
+ function tokenBase(stream, state) {
40
+ if (stream.sol() && stream.match("=begin") && stream.eol()) {
41
+ state.tokenize.push(readBlockComment);
42
+ return "comment";
43
+ }
44
+ if (stream.eatSpace()) return null;
45
+ var ch = stream.next(), m;
46
+ if (ch == "`" || ch == "'" || ch == '"') {
47
+ return chain(readQuoted(ch, "string", ch == '"' || ch == "`"), stream, state);
48
+ } else if (ch == "/") {
49
+ if (regexpAhead(stream))
50
+ return chain(readQuoted(ch, "string-2", true), stream, state);
51
+ else
52
+ return "operator";
53
+ } else if (ch == "%") {
54
+ var style = "string", embed = true;
55
+ if (stream.eat("s")) style = "atom";
56
+ else if (stream.eat(/[WQ]/)) style = "string";
57
+ else if (stream.eat(/[r]/)) style = "string-2";
58
+ else if (stream.eat(/[wxq]/)) { style = "string"; embed = false; }
59
+ var delim = stream.eat(/[^\w\s=]/);
60
+ if (!delim) return "operator";
61
+ if (matching.propertyIsEnumerable(delim)) delim = matching[delim];
62
+ return chain(readQuoted(delim, style, embed, true), stream, state);
63
+ } else if (ch == "#") {
64
+ stream.skipToEnd();
65
+ return "comment";
66
+ } else if (ch == "<" && (m = stream.match(/^<-?[\`\"\']?([a-zA-Z_?]\w*)[\`\"\']?(?:;|$)/))) {
67
+ return chain(readHereDoc(m[1]), stream, state);
68
+ } else if (ch == "0") {
69
+ if (stream.eat("x")) stream.eatWhile(/[\da-fA-F]/);
70
+ else if (stream.eat("b")) stream.eatWhile(/[01]/);
71
+ else stream.eatWhile(/[0-7]/);
72
+ return "number";
73
+ } else if (/\d/.test(ch)) {
74
+ stream.match(/^[\d_]*(?:\.[\d_]+)?(?:[eE][+\-]?[\d_]+)?/);
75
+ return "number";
76
+ } else if (ch == "?") {
77
+ while (stream.match(/^\\[CM]-/)) {}
78
+ if (stream.eat("\\")) stream.eatWhile(/\w/);
79
+ else stream.next();
80
+ return "string";
81
+ } else if (ch == ":") {
82
+ if (stream.eat("'")) return chain(readQuoted("'", "atom", false), stream, state);
83
+ if (stream.eat('"')) return chain(readQuoted('"', "atom", true), stream, state);
84
+
85
+ // :> :>> :< :<< are valid symbols
86
+ if (stream.eat(/[\<\>]/)) {
87
+ stream.eat(/[\<\>]/);
88
+ return "atom";
89
+ }
90
+
91
+ // :+ :- :/ :* :| :& :! are valid symbols
92
+ if (stream.eat(/[\+\-\*\/\&\|\:\!]/)) {
93
+ return "atom";
94
+ }
95
+
96
+ // Symbols can't start by a digit
97
+ if (stream.eat(/[a-zA-Z$@_\xa1-\uffff]/)) {
98
+ stream.eatWhile(/[\w$\xa1-\uffff]/);
99
+ // Only one ? ! = is allowed and only as the last character
100
+ stream.eat(/[\?\!\=]/);
101
+ return "atom";
102
+ }
103
+ return "operator";
104
+ } else if (ch == "@" && stream.match(/^@?[a-zA-Z_\xa1-\uffff]/)) {
105
+ stream.eat("@");
106
+ stream.eatWhile(/[\w\xa1-\uffff]/);
107
+ return "variable-2";
108
+ } else if (ch == "$") {
109
+ if (stream.eat(/[a-zA-Z_]/)) {
110
+ stream.eatWhile(/[\w]/);
111
+ } else if (stream.eat(/\d/)) {
112
+ stream.eat(/\d/);
113
+ } else {
114
+ stream.next(); // Must be a special global like $: or $!
115
+ }
116
+ return "variable-3";
117
+ } else if (/[a-zA-Z_\xa1-\uffff]/.test(ch)) {
118
+ stream.eatWhile(/[\w\xa1-\uffff]/);
119
+ stream.eat(/[\?\!]/);
120
+ if (stream.eat(":")) return "atom";
121
+ return "ident";
122
+ } else if (ch == "|" && (state.varList || state.lastTok == "{" || state.lastTok == "do")) {
123
+ curPunc = "|";
124
+ return null;
125
+ } else if (/[\(\)\[\]{}\\;]/.test(ch)) {
126
+ curPunc = ch;
127
+ return null;
128
+ } else if (ch == "-" && stream.eat(">")) {
129
+ return "arrow";
130
+ } else if (/[=+\-\/*:\.^%<>~|]/.test(ch)) {
131
+ var more = stream.eatWhile(/[=+\-\/*:\.^%<>~|]/);
132
+ if (ch == "." && !more) curPunc = ".";
133
+ return "operator";
134
+ } else {
135
+ return null;
136
+ }
137
+ }
138
+
139
+ function regexpAhead(stream) {
140
+ var start = stream.pos, depth = 0, next, found = false, escaped = false
141
+ while ((next = stream.next()) != null) {
142
+ if (!escaped) {
143
+ if ("[{(".indexOf(next) > -1) {
144
+ depth++
145
+ } else if ("]})".indexOf(next) > -1) {
146
+ depth--
147
+ if (depth < 0) break
148
+ } else if (next == "/" && depth == 0) {
149
+ found = true
150
+ break
151
+ }
152
+ escaped = next == "\\"
153
+ } else {
154
+ escaped = false
155
+ }
156
+ }
157
+ stream.backUp(stream.pos - start)
158
+ return found
159
+ }
160
+
161
+ function tokenBaseUntilBrace(depth) {
162
+ if (!depth) depth = 1;
163
+ return function(stream, state) {
164
+ if (stream.peek() == "}") {
165
+ if (depth == 1) {
166
+ state.tokenize.pop();
167
+ return state.tokenize[state.tokenize.length-1](stream, state);
168
+ } else {
169
+ state.tokenize[state.tokenize.length - 1] = tokenBaseUntilBrace(depth - 1);
170
+ }
171
+ } else if (stream.peek() == "{") {
172
+ state.tokenize[state.tokenize.length - 1] = tokenBaseUntilBrace(depth + 1);
173
+ }
174
+ return tokenBase(stream, state);
175
+ };
176
+ }
177
+ function tokenBaseOnce() {
178
+ var alreadyCalled = false;
179
+ return function(stream, state) {
180
+ if (alreadyCalled) {
181
+ state.tokenize.pop();
182
+ return state.tokenize[state.tokenize.length-1](stream, state);
183
+ }
184
+ alreadyCalled = true;
185
+ return tokenBase(stream, state);
186
+ };
187
+ }
188
+ function readQuoted(quote, style, embed, unescaped) {
189
+ return function(stream, state) {
190
+ var escaped = false, ch;
191
+
192
+ if (state.context.type === 'read-quoted-paused') {
193
+ state.context = state.context.prev;
194
+ stream.eat("}");
195
+ }
196
+
197
+ while ((ch = stream.next()) != null) {
198
+ if (ch == quote && (unescaped || !escaped)) {
199
+ state.tokenize.pop();
200
+ break;
201
+ }
202
+ if (embed && ch == "#" && !escaped) {
203
+ if (stream.eat("{")) {
204
+ if (quote == "}") {
205
+ state.context = {prev: state.context, type: 'read-quoted-paused'};
206
+ }
207
+ state.tokenize.push(tokenBaseUntilBrace());
208
+ break;
209
+ } else if (/[@\$]/.test(stream.peek())) {
210
+ state.tokenize.push(tokenBaseOnce());
211
+ break;
212
+ }
213
+ }
214
+ escaped = !escaped && ch == "\\";
215
+ }
216
+ return style;
217
+ };
218
+ }
219
+ function readHereDoc(phrase) {
220
+ return function(stream, state) {
221
+ if (stream.match(phrase)) state.tokenize.pop();
222
+ else stream.skipToEnd();
223
+ return "string";
224
+ };
225
+ }
226
+ function readBlockComment(stream, state) {
227
+ if (stream.sol() && stream.match("=end") && stream.eol())
228
+ state.tokenize.pop();
229
+ stream.skipToEnd();
230
+ return "comment";
231
+ }
232
+
233
+ return {
234
+ startState: function() {
235
+ return {tokenize: [tokenBase],
236
+ indented: 0,
237
+ context: {type: "top", indented: -config.indentUnit},
238
+ continuedLine: false,
239
+ lastTok: null,
240
+ varList: false};
241
+ },
242
+
243
+ token: function(stream, state) {
244
+ curPunc = null;
245
+ if (stream.sol()) state.indented = stream.indentation();
246
+ var style = state.tokenize[state.tokenize.length-1](stream, state), kwtype;
247
+ var thisTok = curPunc;
248
+ if (style == "ident") {
249
+ var word = stream.current();
250
+ style = state.lastTok == "." ? "property"
251
+ : keywords.propertyIsEnumerable(stream.current()) ? "keyword"
252
+ : /^[A-Z]/.test(word) ? "tag"
253
+ : (state.lastTok == "def" || state.lastTok == "class" || state.varList) ? "def"
254
+ : "variable";
255
+ if (style == "keyword") {
256
+ thisTok = word;
257
+ if (indentWords.propertyIsEnumerable(word)) kwtype = "indent";
258
+ else if (dedentWords.propertyIsEnumerable(word)) kwtype = "dedent";
259
+ else if ((word == "if" || word == "unless") && stream.column() == stream.indentation())
260
+ kwtype = "indent";
261
+ else if (word == "do" && state.context.indented < state.indented)
262
+ kwtype = "indent";
263
+ }
264
+ }
265
+ if (curPunc || (style && style != "comment")) state.lastTok = thisTok;
266
+ if (curPunc == "|") state.varList = !state.varList;
267
+
268
+ if (kwtype == "indent" || /[\(\[\{]/.test(curPunc))
269
+ state.context = {prev: state.context, type: curPunc || style, indented: state.indented};
270
+ else if ((kwtype == "dedent" || /[\)\]\}]/.test(curPunc)) && state.context.prev)
271
+ state.context = state.context.prev;
272
+
273
+ if (stream.eol())
274
+ state.continuedLine = (curPunc == "\\" || style == "operator");
275
+ return style;
276
+ },
277
+
278
+ indent: function(state, textAfter) {
279
+ if (state.tokenize[state.tokenize.length-1] != tokenBase) return 0;
280
+ var firstChar = textAfter && textAfter.charAt(0);
281
+ var ct = state.context;
282
+ var closing = ct.type == matching[firstChar] ||
283
+ ct.type == "keyword" && /^(?:end|until|else|elsif|when|rescue)\b/.test(textAfter);
284
+ return ct.indented + (closing ? 0 : config.indentUnit) +
285
+ (state.continuedLine ? config.indentUnit : 0);
286
+ },
287
+
288
+ electricInput: /^\s*(?:end|rescue|elsif|else|\})$/,
289
+ lineComment: "#"
290
+ };
291
+ });
292
+
293
+ CodeMirror.defineMIME("text/x-ruby", "ruby");
294
+
295
+ });
@@ -0,0 +1,72 @@
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"), require("../../addon/mode/simple"));
7
+ else if (typeof define == "function" && define.amd) // AMD
8
+ define(["../../lib/codemirror", "../../addon/mode/simple"], mod);
9
+ else // Plain browser env
10
+ mod(CodeMirror);
11
+ })(function(CodeMirror) {
12
+ "use strict";
13
+
14
+ CodeMirror.defineSimpleMode("rust",{
15
+ start: [
16
+ // string and byte string
17
+ {regex: /b?"/, token: "string", next: "string"},
18
+ // raw string and raw byte string
19
+ {regex: /b?r"/, token: "string", next: "string_raw"},
20
+ {regex: /b?r#+"/, token: "string", next: "string_raw_hash"},
21
+ // character
22
+ {regex: /'(?:[^'\\]|\\(?:[nrt0'"]|x[\da-fA-F]{2}|u\{[\da-fA-F]{6}\}))'/, token: "string-2"},
23
+ // byte
24
+ {regex: /b'(?:[^']|\\(?:['\\nrt0]|x[\da-fA-F]{2}))'/, token: "string-2"},
25
+
26
+ {regex: /(?:(?:[0-9][0-9_]*)(?:(?:[Ee][+-]?[0-9_]+)|\.[0-9_]+(?:[Ee][+-]?[0-9_]+)?)(?:f32|f64)?)|(?:0(?:b[01_]+|(?:o[0-7_]+)|(?:x[0-9a-fA-F_]+))|(?:[0-9][0-9_]*))(?:u8|u16|u32|u64|i8|i16|i32|i64|isize|usize)?/,
27
+ token: "number"},
28
+ {regex: /(let(?:\s+mut)?|fn|enum|mod|struct|type)(\s+)([a-zA-Z_][a-zA-Z0-9_]*)/, token: ["keyword", null, "def"]},
29
+ {regex: /(?:abstract|alignof|as|box|break|continue|const|crate|do|else|enum|extern|fn|for|final|if|impl|in|loop|macro|match|mod|move|offsetof|override|priv|proc|pub|pure|ref|return|self|sizeof|static|struct|super|trait|type|typeof|unsafe|unsized|use|virtual|where|while|yield)\b/, token: "keyword"},
30
+ {regex: /\b(?:Self|isize|usize|char|bool|u8|u16|u32|u64|f16|f32|f64|i8|i16|i32|i64|str|Option)\b/, token: "atom"},
31
+ {regex: /\b(?:true|false|Some|None|Ok|Err)\b/, token: "builtin"},
32
+ {regex: /\b(fn)(\s+)([a-zA-Z_][a-zA-Z0-9_]*)/,
33
+ token: ["keyword", null ,"def"]},
34
+ {regex: /#!?\[.*\]/, token: "meta"},
35
+ {regex: /\/\/.*/, token: "comment"},
36
+ {regex: /\/\*/, token: "comment", next: "comment"},
37
+ {regex: /[-+\/*=<>!]+/, token: "operator"},
38
+ {regex: /[a-zA-Z_]\w*!/,token: "variable-3"},
39
+ {regex: /[a-zA-Z_]\w*/, token: "variable"},
40
+ {regex: /[\{\[\(]/, indent: true},
41
+ {regex: /[\}\]\)]/, dedent: true}
42
+ ],
43
+ string: [
44
+ {regex: /"/, token: "string", next: "start"},
45
+ {regex: /(?:[^\\"]|\\(?:.|$))*/, token: "string"}
46
+ ],
47
+ string_raw: [
48
+ {regex: /"/, token: "string", next: "start"},
49
+ {regex: /[^"]*/, token: "string"}
50
+ ],
51
+ string_raw_hash: [
52
+ {regex: /"#+/, token: "string", next: "start"},
53
+ {regex: /(?:[^"]|"(?!#))*/, token: "string"}
54
+ ],
55
+ comment: [
56
+ {regex: /.*?\*\//, token: "comment", next: "start"},
57
+ {regex: /.*/, token: "comment"}
58
+ ],
59
+ meta: {
60
+ dontIndentStates: ["comment"],
61
+ electricInput: /^\s*\}$/,
62
+ blockCommentStart: "/*",
63
+ blockCommentEnd: "*/",
64
+ lineComment: "//",
65
+ fold: "brace"
66
+ }
67
+ });
68
+
69
+
70
+ CodeMirror.defineMIME("text/x-rustsrc", "rust");
71
+ CodeMirror.defineMIME("text/rust", "rust");
72
+ });
@@ -0,0 +1,303 @@
1
+ // CodeMirror, copyright (c) by Marijn Haverbeke and others
2
+ // Distributed under an MIT license: http://codemirror.net/LICENSE
3
+
4
+
5
+ // SAS mode copyright (c) 2016 Jared Dean, SAS Institute
6
+ // Created by Jared Dean
7
+
8
+ // TODO
9
+ // indent and de-indent
10
+ // identify macro variables
11
+
12
+
13
+ //Definitions
14
+ // comment -- text within * ; or /* */
15
+ // keyword -- SAS language variable
16
+ // variable -- macro variables starts with '&' or variable formats
17
+ // variable-2 -- DATA Step, proc, or macro names
18
+ // string -- text within ' ' or " "
19
+ // operator -- numeric operator + / - * ** le eq ge ... and so on
20
+ // builtin -- proc %macro data run mend
21
+ // atom
22
+ // def
23
+
24
+ (function(mod) {
25
+ if (typeof exports == "object" && typeof module == "object") // CommonJS
26
+ mod(require("../../lib/codemirror"));
27
+ else if (typeof define == "function" && define.amd) // AMD
28
+ define(["../../lib/codemirror"], mod);
29
+ else // Plain browser env
30
+ mod(CodeMirror);
31
+ })(function(CodeMirror) {
32
+ "use strict";
33
+
34
+ CodeMirror.defineMode("sas", function () {
35
+ var words = {};
36
+ var isDoubleOperatorSym = {
37
+ eq: 'operator',
38
+ lt: 'operator',
39
+ le: 'operator',
40
+ gt: 'operator',
41
+ ge: 'operator',
42
+ "in": 'operator',
43
+ ne: 'operator',
44
+ or: 'operator'
45
+ };
46
+ var isDoubleOperatorChar = /(<=|>=|!=|<>)/;
47
+ var isSingleOperatorChar = /[=\(:\),{}.*<>+\-\/^\[\]]/;
48
+
49
+ // Takes a string of words separated by spaces and adds them as
50
+ // keys with the value of the first argument 'style'
51
+ function define(style, string, context) {
52
+ if (context) {
53
+ var split = string.split(' ');
54
+ for (var i = 0; i < split.length; i++) {
55
+ words[split[i]] = {style: style, state: context};
56
+ }
57
+ }
58
+ }
59
+ //datastep
60
+ define('def', 'stack pgm view source debug nesting nolist', ['inDataStep']);
61
+ define('def', 'if while until for do do; end end; then else cancel', ['inDataStep']);
62
+ define('def', 'label format _n_ _error_', ['inDataStep']);
63
+ define('def', 'ALTER BUFNO BUFSIZE CNTLLEV COMPRESS DLDMGACTION ENCRYPT ENCRYPTKEY EXTENDOBSCOUNTER GENMAX GENNUM INDEX LABEL OBSBUF OUTREP PW PWREQ READ REPEMPTY REPLACE REUSE ROLE SORTEDBY SPILL TOBSNO TYPE WRITE FILECLOSE FIRSTOBS IN OBS POINTOBS WHERE WHEREUP IDXNAME IDXWHERE DROP KEEP RENAME', ['inDataStep']);
64
+ define('def', 'filevar finfo finv fipname fipnamel fipstate first firstobs floor', ['inDataStep']);
65
+ define('def', 'varfmt varinfmt varlabel varlen varname varnum varray varrayx vartype verify vformat vformatd vformatdx vformatn vformatnx vformatw vformatwx vformatx vinarray vinarrayx vinformat vinformatd vinformatdx vinformatn vinformatnx vinformatw vinformatwx vinformatx vlabel vlabelx vlength vlengthx vname vnamex vnferr vtype vtypex weekday', ['inDataStep']);
66
+ define('def', 'zipfips zipname zipnamel zipstate', ['inDataStep']);
67
+ define('def', 'put putc putn', ['inDataStep']);
68
+ define('builtin', 'data run', ['inDataStep']);
69
+
70
+
71
+ //proc
72
+ define('def', 'data', ['inProc']);
73
+
74
+ // flow control for macros
75
+ define('def', '%if %end %end; %else %else; %do %do; %then', ['inMacro']);
76
+
77
+ //everywhere
78
+ define('builtin', 'proc run; quit; libname filename %macro %mend option options', ['ALL']);
79
+
80
+ define('def', 'footnote title libname ods', ['ALL']);
81
+ define('def', '%let %put %global %sysfunc %eval ', ['ALL']);
82
+ // automatic macro variables http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/viewer.htm#a003167023.htm
83
+ define('variable', '&sysbuffr &syscc &syscharwidth &syscmd &sysdate &sysdate9 &sysday &sysdevic &sysdmg &sysdsn &sysencoding &sysenv &syserr &syserrortext &sysfilrc &syshostname &sysindex &sysinfo &sysjobid &syslast &syslckrc &syslibrc &syslogapplname &sysmacroname &sysmenv &sysmsg &sysncpu &sysodspath &sysparm &syspbuff &sysprocessid &sysprocessname &sysprocname &sysrc &sysscp &sysscpl &sysscpl &syssite &sysstartid &sysstartname &systcpiphostname &systime &sysuserid &sysver &sysvlong &sysvlong4 &syswarningtext', ['ALL']);
84
+
85
+ //footnote[1-9]? title[1-9]?
86
+
87
+ //options statement
88
+ define('def', 'source2 nosource2 page pageno pagesize', ['ALL']);
89
+
90
+ //proc and datastep
91
+ define('def', '_all_ _character_ _cmd_ _freq_ _i_ _infile_ _last_ _msg_ _null_ _numeric_ _temporary_ _type_ abort abs addr adjrsq airy alpha alter altlog altprint and arcos array arsin as atan attrc attrib attrn authserver autoexec awscontrol awsdef awsmenu awsmenumerge awstitle backward band base betainv between blocksize blshift bnot bor brshift bufno bufsize bxor by byerr byline byte calculated call cards cards4 catcache cbufno cdf ceil center cexist change chisq cinv class cleanup close cnonct cntllev coalesce codegen col collate collin column comamid comaux1 comaux2 comdef compbl compound compress config continue convert cos cosh cpuid create cross crosstab css curobs cv daccdb daccdbsl daccsl daccsyd dacctab dairy datalines datalines4 datejul datepart datetime day dbcslang dbcstype dclose ddm delete delimiter depdb depdbsl depsl depsyd deptab dequote descending descript design= device dflang dhms dif digamma dim dinfo display distinct dkricond dkrocond dlm dnum do dopen doptname doptnum dread drop dropnote dsname dsnferr echo else emaildlg emailid emailpw emailserver emailsys encrypt end endsas engine eof eov erf erfc error errorcheck errors exist exp fappend fclose fcol fdelete feedback fetch fetchobs fexist fget file fileclose fileexist filefmt filename fileref fmterr fmtsearch fnonct fnote font fontalias fopen foptname foptnum force formatted formchar formdelim formdlim forward fpoint fpos fput fread frewind frlen from fsep fuzz fwrite gaminv gamma getoption getvarc getvarn go goto group gwindow hbar hbound helpenv helploc hms honorappearance hosthelp hostprint hour hpct html hvar ibessel ibr id if index indexc indexw initcmd initstmt inner input inputc inputn inr insert int intck intnx into intrr invaliddata irr is jbessel join juldate keep kentb kurtosis label lag last lbound leave left length levels lgamma lib library libref line linesize link list log log10 log2 logpdf logpmf logsdf lostcard lowcase lrecl ls macro macrogen maps mautosource max maxdec maxr mdy mean measures median memtype merge merror min minute missing missover mlogic mod mode model modify month mopen mort mprint mrecall msglevel msymtabmax mvarsize myy n nest netpv new news nmiss no nobatch nobs nocaps nocardimage nocenter nocharcode nocmdmac nocol nocum nodate nodbcs nodetails nodmr nodms nodmsbatch nodup nodupkey noduplicates noechoauto noequals noerrorabend noexitwindows nofullstimer noicon noimplmac noint nolist noloadlist nomiss nomlogic nomprint nomrecall nomsgcase nomstored nomultenvappl nonotes nonumber noobs noovp nopad nopercent noprint noprintinit normal norow norsasuser nosetinit nosplash nosymbolgen note notes notitle notitles notsorted noverbose noxsync noxwait npv null number numkeys nummousekeys nway obs on open order ordinal otherwise out outer outp= output over ovp p(1 5 10 25 50 75 90 95 99) pad pad2 paired parm parmcards path pathdll pathname pdf peek peekc pfkey pmf point poisson poke position printer probbeta probbnml probchi probf probgam probhypr probit probnegb probnorm probsig probt procleave prt ps pw pwreq qtr quote r ranbin rancau ranexp rangam range ranks rannor ranpoi rantbl rantri ranuni read recfm register regr remote remove rename repeat replace resolve retain return reuse reverse rewind right round rsquare rtf rtrace rtraceloc s s2 samploc sasautos sascontrol sasfrscr sasmsg sasmstore sasscript sasuser saving scan sdf second select selection separated seq serror set setcomm setot sign simple sin sinh siteinfo skewness skip sle sls sortedby sortpgm sortseq sortsize soundex spedis splashlocation split spool sqrt start std stderr stdin stfips stimer stname stnamel stop stopover subgroup subpopn substr sum sumwgt symbol symbolgen symget symput sysget sysin sysleave sysmsg sysparm sysprint sysprintfont sysprod sysrc system t table tables tan tanh tapeclose tbufsize terminal test then timepart tinv tnonct to today tol tooldef totper transformout translate trantab tranwrd trigamma trim trimn trunc truncover type unformatted uniform union until upcase update user usericon uss validate value var weight when where while wincharset window work workinit workterm write wsum xsync xwait yearcutoff yes yyq min max', ['inDataStep', 'inProc']);
92
+ define('operator', 'and not ', ['inDataStep', 'inProc']);
93
+
94
+ // Main function
95
+ function tokenize(stream, state) {
96
+ // Finally advance the stream
97
+ var ch = stream.next();
98
+
99
+ // BLOCKCOMMENT
100
+ if (ch === '/' && stream.eat('*')) {
101
+ state.continueComment = true;
102
+ return "comment";
103
+ } else if (state.continueComment === true) { // in comment block
104
+ //comment ends at the beginning of the line
105
+ if (ch === '*' && stream.peek() === '/') {
106
+ stream.next();
107
+ state.continueComment = false;
108
+ } else if (stream.skipTo('*')) { //comment is potentially later in line
109
+ stream.skipTo('*');
110
+ stream.next();
111
+ if (stream.eat('/'))
112
+ state.continueComment = false;
113
+ } else {
114
+ stream.skipToEnd();
115
+ }
116
+ return "comment";
117
+ }
118
+
119
+ if (ch == "*" && stream.column() == stream.indentation()) {
120
+ stream.skipToEnd()
121
+ return "comment"
122
+ }
123
+
124
+ // DoubleOperator match
125
+ var doubleOperator = ch + stream.peek();
126
+
127
+ if ((ch === '"' || ch === "'") && !state.continueString) {
128
+ state.continueString = ch
129
+ return "string"
130
+ } else if (state.continueString) {
131
+ if (state.continueString == ch) {
132
+ state.continueString = null;
133
+ } else if (stream.skipTo(state.continueString)) {
134
+ // quote found on this line
135
+ stream.next();
136
+ state.continueString = null;
137
+ } else {
138
+ stream.skipToEnd();
139
+ }
140
+ return "string";
141
+ } else if (state.continueString !== null && stream.eol()) {
142
+ stream.skipTo(state.continueString) || stream.skipToEnd();
143
+ return "string";
144
+ } else if (/[\d\.]/.test(ch)) { //find numbers
145
+ if (ch === ".")
146
+ stream.match(/^[0-9]+([eE][\-+]?[0-9]+)?/);
147
+ else if (ch === "0")
148
+ stream.match(/^[xX][0-9a-fA-F]+/) || stream.match(/^0[0-7]+/);
149
+ else
150
+ stream.match(/^[0-9]*\.?[0-9]*([eE][\-+]?[0-9]+)?/);
151
+ return "number";
152
+ } else if (isDoubleOperatorChar.test(ch + stream.peek())) { // TWO SYMBOL TOKENS
153
+ stream.next();
154
+ return "operator";
155
+ } else if (isDoubleOperatorSym.hasOwnProperty(doubleOperator)) {
156
+ stream.next();
157
+ if (stream.peek() === ' ')
158
+ return isDoubleOperatorSym[doubleOperator.toLowerCase()];
159
+ } else if (isSingleOperatorChar.test(ch)) { // SINGLE SYMBOL TOKENS
160
+ return "operator";
161
+ }
162
+
163
+ // Matches one whole word -- even if the word is a character
164
+ var word;
165
+ if (stream.match(/[%&;\w]+/, false) != null) {
166
+ word = ch + stream.match(/[%&;\w]+/, true);
167
+ if (/&/.test(word)) return 'variable'
168
+ } else {
169
+ word = ch;
170
+ }
171
+ // the word after DATA PROC or MACRO
172
+ if (state.nextword) {
173
+ stream.match(/[\w]+/);
174
+ // match memname.libname
175
+ if (stream.peek() === '.') stream.skipTo(' ');
176
+ state.nextword = false;
177
+ return 'variable-2';
178
+ }
179
+
180
+ word = word.toLowerCase()
181
+ // Are we in a DATA Step?
182
+ if (state.inDataStep) {
183
+ if (word === 'run;' || stream.match(/run\s;/)) {
184
+ state.inDataStep = false;
185
+ return 'builtin';
186
+ }
187
+ // variable formats
188
+ if ((word) && stream.next() === '.') {
189
+ //either a format or libname.memname
190
+ if (/\w/.test(stream.peek())) return 'variable-2';
191
+ else return 'variable';
192
+ }
193
+ // do we have a DATA Step keyword
194
+ if (word && words.hasOwnProperty(word) &&
195
+ (words[word].state.indexOf("inDataStep") !== -1 ||
196
+ words[word].state.indexOf("ALL") !== -1)) {
197
+ //backup to the start of the word
198
+ if (stream.start < stream.pos)
199
+ stream.backUp(stream.pos - stream.start);
200
+ //advance the length of the word and return
201
+ for (var i = 0; i < word.length; ++i) stream.next();
202
+ return words[word].style;
203
+ }
204
+ }
205
+ // Are we in an Proc statement?
206
+ if (state.inProc) {
207
+ if (word === 'run;' || word === 'quit;') {
208
+ state.inProc = false;
209
+ return 'builtin';
210
+ }
211
+ // do we have a proc keyword
212
+ if (word && words.hasOwnProperty(word) &&
213
+ (words[word].state.indexOf("inProc") !== -1 ||
214
+ words[word].state.indexOf("ALL") !== -1)) {
215
+ stream.match(/[\w]+/);
216
+ return words[word].style;
217
+ }
218
+ }
219
+ // Are we in a Macro statement?
220
+ if (state.inMacro) {
221
+ if (word === '%mend') {
222
+ if (stream.peek() === ';') stream.next();
223
+ state.inMacro = false;
224
+ return 'builtin';
225
+ }
226
+ if (word && words.hasOwnProperty(word) &&
227
+ (words[word].state.indexOf("inMacro") !== -1 ||
228
+ words[word].state.indexOf("ALL") !== -1)) {
229
+ stream.match(/[\w]+/);
230
+ return words[word].style;
231
+ }
232
+
233
+ return 'atom';
234
+ }
235
+ // Do we have Keywords specific words?
236
+ if (word && words.hasOwnProperty(word)) {
237
+ // Negates the initial next()
238
+ stream.backUp(1);
239
+ // Actually move the stream
240
+ stream.match(/[\w]+/);
241
+ if (word === 'data' && /=/.test(stream.peek()) === false) {
242
+ state.inDataStep = true;
243
+ state.nextword = true;
244
+ return 'builtin';
245
+ }
246
+ if (word === 'proc') {
247
+ state.inProc = true;
248
+ state.nextword = true;
249
+ return 'builtin';
250
+ }
251
+ if (word === '%macro') {
252
+ state.inMacro = true;
253
+ state.nextword = true;
254
+ return 'builtin';
255
+ }
256
+ if (/title[1-9]/.test(word)) return 'def';
257
+
258
+ if (word === 'footnote') {
259
+ stream.eat(/[1-9]/);
260
+ return 'def';
261
+ }
262
+
263
+ // Returns their value as state in the prior define methods
264
+ if (state.inDataStep === true && words[word].state.indexOf("inDataStep") !== -1)
265
+ return words[word].style;
266
+ if (state.inProc === true && words[word].state.indexOf("inProc") !== -1)
267
+ return words[word].style;
268
+ if (state.inMacro === true && words[word].state.indexOf("inMacro") !== -1)
269
+ return words[word].style;
270
+ if (words[word].state.indexOf("ALL") !== -1)
271
+ return words[word].style;
272
+ return null;
273
+ }
274
+ // Unrecognized syntax
275
+ return null;
276
+ }
277
+
278
+ return {
279
+ startState: function () {
280
+ return {
281
+ inDataStep: false,
282
+ inProc: false,
283
+ inMacro: false,
284
+ nextword: false,
285
+ continueString: null,
286
+ continueComment: false
287
+ };
288
+ },
289
+ token: function (stream, state) {
290
+ // Strip the spaces, but regex will account for them either way
291
+ if (stream.eatSpace()) return null;
292
+ // Go through the main process
293
+ return tokenize(stream, state);
294
+ },
295
+
296
+ blockCommentStart: "/*",
297
+ blockCommentEnd: "*/"
298
+ };
299
+
300
+ });
301
+
302
+ CodeMirror.defineMIME("text/x-sas", "sas");
303
+ });