jekyll-theme-anc 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE.txt +21 -0
- data/README.md +1 -0
- data/_includes/disqus.html +42 -0
- data/_includes/facebook_share_btn.html +1 -0
- data/_includes/footer.html +79 -0
- data/_includes/go2top.html +22 -0
- data/_includes/google-analytics.html +11 -0
- data/_includes/head.html +50 -0
- data/_includes/header.html +13 -0
- data/_includes/jspdf.html +41 -0
- data/_includes/nav.html +25 -0
- data/_includes/pageloginpoper.html +59 -0
- data/_includes/post-categories.html +8 -0
- data/_includes/post_seo.html +59 -0
- data/_includes/youtube_video.html +11 -0
- data/_layouts/blog.html +33 -0
- data/_layouts/default.html +151 -0
- data/_layouts/home.html +26 -0
- data/_layouts/page.html +5 -0
- data/_layouts/post.html +83 -0
- data/_sass/anc.scss +9 -0
- data/_sass/anc/_base.scss +144 -0
- data/_sass/anc/_layout.scss +0 -0
- data/_sass/anc/_materialize.scss +38 -0
- data/_sass/anc/_syntax-highlighting.scss +78 -0
- data/_sass/anc/components/_variables.scss +343 -0
- data/_sass/materialize-css/components/_badges.scss +47 -0
- data/_sass/materialize-css/components/_buttons.scss +291 -0
- data/_sass/materialize-css/components/_cards.scss +196 -0
- data/_sass/materialize-css/components/_carousel.scss +90 -0
- data/_sass/materialize-css/components/_chips.scss +89 -0
- data/_sass/materialize-css/components/_collapsible.scss +84 -0
- data/_sass/materialize-css/components/_color.scss +412 -0
- data/_sass/materialize-css/components/_dropdown.scss +68 -0
- data/_sass/materialize-css/components/_global.scss +734 -0
- data/_sass/materialize-css/components/_grid.scss +156 -0
- data/_sass/materialize-css/components/_icons-material-design.scss +5 -0
- data/_sass/materialize-css/components/_materialbox.scss +43 -0
- data/_sass/materialize-css/components/_modal.scss +90 -0
- data/_sass/materialize-css/components/_navbar.scss +208 -0
- data/_sass/materialize-css/components/_normalize.scss +424 -0
- data/_sass/materialize-css/components/_preloader.scss +334 -0
- data/_sass/materialize-css/components/_pulse.scss +34 -0
- data/_sass/materialize-css/components/_roboto.scss +39 -0
- data/_sass/materialize-css/components/_sideNav.scss +214 -0
- data/_sass/materialize-css/components/_slider.scss +92 -0
- data/_sass/materialize-css/components/_table_of_contents.scss +33 -0
- data/_sass/materialize-css/components/_tabs.scss +93 -0
- data/_sass/materialize-css/components/_tapTarget.scss +103 -0
- data/_sass/materialize-css/components/_toast.scss +59 -0
- data/_sass/materialize-css/components/_tooltip.scss +31 -0
- data/_sass/materialize-css/components/_transitions.scss +13 -0
- data/_sass/materialize-css/components/_typography.scss +61 -0
- data/_sass/materialize-css/components/_variables.scss +343 -0
- data/_sass/materialize-css/components/_waves.scss +114 -0
- data/_sass/materialize-css/components/date_picker/_default.date.scss +456 -0
- data/_sass/materialize-css/components/date_picker/_default.scss +212 -0
- data/_sass/materialize-css/components/date_picker/_default.time.scss +267 -0
- data/_sass/materialize-css/components/forms/_checkboxes.scss +210 -0
- data/_sass/materialize-css/components/forms/_file-input.scss +44 -0
- data/_sass/materialize-css/components/forms/_forms.scss +22 -0
- data/_sass/materialize-css/components/forms/_input-fields.scss +333 -0
- data/_sass/materialize-css/components/forms/_radio-buttons.scss +115 -0
- data/_sass/materialize-css/components/forms/_range.scss +160 -0
- data/_sass/materialize-css/components/forms/_select.scss +182 -0
- data/_sass/materialize-css/components/forms/_switches.scss +89 -0
- data/_sass/materialize-css/materialize.scss +42 -0
- data/_sass/materialize/components/_badges.scss +47 -0
- data/_sass/materialize/components/_buttons.scss +291 -0
- data/_sass/materialize/components/_cards.scss +196 -0
- data/_sass/materialize/components/_carousel.scss +90 -0
- data/_sass/materialize/components/_chips.scss +89 -0
- data/_sass/materialize/components/_collapsible.scss +84 -0
- data/_sass/materialize/components/_color.scss +412 -0
- data/_sass/materialize/components/_dropdown.scss +68 -0
- data/_sass/materialize/components/_global.scss +734 -0
- data/_sass/materialize/components/_grid.scss +156 -0
- data/_sass/materialize/components/_icons-material-design.scss +5 -0
- data/_sass/materialize/components/_materialbox.scss +43 -0
- data/_sass/materialize/components/_modal.scss +90 -0
- data/_sass/materialize/components/_navbar.scss +208 -0
- data/_sass/materialize/components/_normalize.scss +424 -0
- data/_sass/materialize/components/_preloader.scss +334 -0
- data/_sass/materialize/components/_pulse.scss +34 -0
- data/_sass/materialize/components/_roboto.scss +39 -0
- data/_sass/materialize/components/_sideNav.scss +214 -0
- data/_sass/materialize/components/_slider.scss +92 -0
- data/_sass/materialize/components/_table_of_contents.scss +33 -0
- data/_sass/materialize/components/_tabs.scss +93 -0
- data/_sass/materialize/components/_tapTarget.scss +103 -0
- data/_sass/materialize/components/_toast.scss +59 -0
- data/_sass/materialize/components/_tooltip.scss +31 -0
- data/_sass/materialize/components/_transitions.scss +13 -0
- data/_sass/materialize/components/_typography.scss +61 -0
- data/_sass/materialize/components/_variables.scss +343 -0
- data/_sass/materialize/components/_waves.scss +114 -0
- data/_sass/materialize/components/date_picker/_default.date.scss +456 -0
- data/_sass/materialize/components/date_picker/_default.scss +212 -0
- data/_sass/materialize/components/date_picker/_default.time.scss +267 -0
- data/_sass/materialize/components/forms/_checkboxes.scss +210 -0
- data/_sass/materialize/components/forms/_file-input.scss +44 -0
- data/_sass/materialize/components/forms/_forms.scss +22 -0
- data/_sass/materialize/components/forms/_input-fields.scss +333 -0
- data/_sass/materialize/components/forms/_radio-buttons.scss +115 -0
- data/_sass/materialize/components/forms/_range.scss +160 -0
- data/_sass/materialize/components/forms/_select.scss +182 -0
- data/_sass/materialize/components/forms/_switches.scss +89 -0
- data/_sass/materialize/materialize.scss +42 -0
- data/assets/fonts/FontAwesome.otf +0 -0
- data/assets/fonts/fontawesome-webfont.eot +0 -0
- data/assets/fonts/fontawesome-webfont.svg +2671 -0
- data/assets/fonts/fontawesome-webfont.ttf +0 -0
- data/assets/fonts/fontawesome-webfont.woff +0 -0
- data/assets/fonts/fontawesome-webfont.woff2 +0 -0
- data/assets/fonts/roboto/Roboto-Bold.woff +0 -0
- data/assets/fonts/roboto/Roboto-Bold.woff2 +0 -0
- data/assets/fonts/roboto/Roboto-Light.woff +0 -0
- data/assets/fonts/roboto/Roboto-Light.woff2 +0 -0
- data/assets/fonts/roboto/Roboto-Medium.woff +0 -0
- data/assets/fonts/roboto/Roboto-Medium.woff2 +0 -0
- data/assets/fonts/roboto/Roboto-Regular.woff +0 -0
- data/assets/fonts/roboto/Roboto-Regular.woff2 +0 -0
- data/assets/fonts/roboto/Roboto-Thin.woff +0 -0
- data/assets/fonts/roboto/Roboto-Thin.woff2 +0 -0
- data/assets/images/close.png +0 -0
- data/assets/images/loader.gif +0 -0
- data/assets/img/icons/facebook-square.png +0 -0
- data/assets/img/icons/github-square.png +0 -0
- data/assets/img/icons/twitter-square.png +0 -0
- data/assets/img/icons/youtube-square.png +0 -0
- data/assets/img/jubayed11.37-16.jpg +0 -0
- data/assets/img/parallax1.jpg +0 -0
- data/assets/img/sample-1.jpg +0 -0
- data/assets/js/custom_script.js +200 -0
- data/assets/js/highlight.pack.js +2 -0
- data/assets/js/materialize.min.js +6 -0
- data/assets/js/mode/apl/apl.js +174 -0
- data/assets/js/mode/asciiarmor/asciiarmor.js +74 -0
- data/assets/js/mode/asn.1/asn.1.js +204 -0
- data/assets/js/mode/asterisk/asterisk.js +196 -0
- data/assets/js/mode/brainfuck/brainfuck.js +85 -0
- data/assets/js/mode/clike/clike.js +789 -0
- data/assets/js/mode/clojure/clojure.js +306 -0
- data/assets/js/mode/cmake/cmake.js +97 -0
- data/assets/js/mode/cobol/cobol.js +255 -0
- data/assets/js/mode/coffeescript/coffeescript.js +359 -0
- data/assets/js/mode/commonlisp/commonlisp.js +124 -0
- data/assets/js/mode/crystal/crystal.js +433 -0
- data/assets/js/mode/css/css.js +831 -0
- data/assets/js/mode/cypher/cypher.js +150 -0
- data/assets/js/mode/d/d.js +218 -0
- data/assets/js/mode/dart/dart.js +157 -0
- data/assets/js/mode/diff/diff.js +47 -0
- data/assets/js/mode/django/django.js +356 -0
- data/assets/js/mode/dockerfile/dockerfile.js +79 -0
- data/assets/js/mode/dtd/dtd.js +142 -0
- data/assets/js/mode/dylan/dylan.js +352 -0
- data/assets/js/mode/ebnf/ebnf.js +195 -0
- data/assets/js/mode/ecl/ecl.js +206 -0
- data/assets/js/mode/eiffel/eiffel.js +160 -0
- data/assets/js/mode/elm/elm.js +205 -0
- data/assets/js/mode/erlang/erlang.js +619 -0
- data/assets/js/mode/factor/factor.js +85 -0
- data/assets/js/mode/fcl/fcl.js +173 -0
- data/assets/js/mode/forth/forth.js +180 -0
- data/assets/js/mode/fortran/fortran.js +188 -0
- data/assets/js/mode/gas/gas.js +345 -0
- data/assets/js/mode/gfm/gfm.js +129 -0
- data/assets/js/mode/gherkin/gherkin.js +178 -0
- data/assets/js/mode/go/go.js +187 -0
- data/assets/js/mode/groovy/groovy.js +230 -0
- data/assets/js/mode/haml/haml.js +161 -0
- data/assets/js/mode/handlebars/handlebars.js +62 -0
- data/assets/js/mode/haskell-literate/haskell-literate.js +43 -0
- data/assets/js/mode/haskell/haskell.js +267 -0
- data/assets/js/mode/haxe/haxe.js +515 -0
- data/assets/js/mode/htmlembedded/htmlembedded.js +28 -0
- data/assets/js/mode/htmlmixed/htmlmixed.js +152 -0
- data/assets/js/mode/http/http.js +113 -0
- data/assets/js/mode/idl/idl.js +290 -0
- data/assets/js/mode/javascript/javascript.js +838 -0
- data/assets/js/mode/jinja2/jinja2.js +142 -0
- data/assets/js/mode/jsx/jsx.js +148 -0
- data/assets/js/mode/julia/julia.js +418 -0
- data/assets/js/mode/livescript/livescript.js +280 -0
- data/assets/js/mode/lua/lua.js +159 -0
- data/assets/js/mode/markdown/markdown.js +859 -0
- data/assets/js/mode/mathematica/mathematica.js +176 -0
- data/assets/js/mode/mbox/mbox.js +129 -0
- data/assets/js/mode/meta.js +215 -0
- data/assets/js/mode/mirc/mirc.js +193 -0
- data/assets/js/mode/mllike/mllike.js +208 -0
- data/assets/js/mode/modelica/modelica.js +245 -0
- data/assets/js/mode/mscgen/mscgen.js +175 -0
- data/assets/js/mode/mumps/mumps.js +148 -0
- data/assets/js/mode/nginx/nginx.js +178 -0
- data/assets/js/mode/nsis/nsis.js +95 -0
- data/assets/js/mode/ntriples/ntriples.js +195 -0
- data/assets/js/mode/octave/octave.js +139 -0
- data/assets/js/mode/oz/oz.js +252 -0
- data/assets/js/mode/pascal/pascal.js +109 -0
- data/assets/js/mode/pegjs/pegjs.js +114 -0
- data/assets/js/mode/perl/perl.js +837 -0
- data/assets/js/mode/php/php.js +234 -0
- data/assets/js/mode/pig/pig.js +178 -0
- data/assets/js/mode/powershell/powershell.js +398 -0
- data/assets/js/mode/properties/properties.js +78 -0
- data/assets/js/mode/protobuf/protobuf.js +68 -0
- data/assets/js/mode/pug/pug.js +591 -0
- data/assets/js/mode/puppet/puppet.js +220 -0
- data/assets/js/mode/python/python.js +334 -0
- data/assets/js/mode/q/q.js +139 -0
- data/assets/js/mode/r/r.js +183 -0
- data/assets/js/mode/rpm/changes/index.html +66 -0
- data/assets/js/mode/rpm/rpm.js +109 -0
- data/assets/js/mode/rst/rst.js +557 -0
- data/assets/js/mode/ruby/ruby.js +295 -0
- data/assets/js/mode/rust/rust.js +72 -0
- data/assets/js/mode/sas/sas.js +303 -0
- data/assets/js/mode/sass/sass.js +454 -0
- data/assets/js/mode/scheme/scheme.js +249 -0
- data/assets/js/mode/shell/shell.js +142 -0
- data/assets/js/mode/sieve/sieve.js +193 -0
- data/assets/js/mode/slim/slim.js +575 -0
- data/assets/js/mode/smalltalk/smalltalk.js +168 -0
- data/assets/js/mode/smarty/smarty.js +225 -0
- data/assets/js/mode/solr/solr.js +104 -0
- data/assets/js/mode/soy/soy.js +342 -0
- data/assets/js/mode/sparql/sparql.js +180 -0
- data/assets/js/mode/spreadsheet/spreadsheet.js +112 -0
- data/assets/js/mode/sql/sql.js +475 -0
- data/assets/js/mode/stex/stex.js +251 -0
- data/assets/js/mode/stylus/stylus.js +771 -0
- data/assets/js/mode/swift/swift.js +210 -0
- data/assets/js/mode/tcl/tcl.js +139 -0
- data/assets/js/mode/textile/textile.js +469 -0
- data/assets/js/mode/tiddlywiki/tiddlywiki.css +14 -0
- data/assets/js/mode/tiddlywiki/tiddlywiki.js +308 -0
- data/assets/js/mode/tiki/tiki.css +26 -0
- data/assets/js/mode/tiki/tiki.js +312 -0
- data/assets/js/mode/toml/toml.js +88 -0
- data/assets/js/mode/tornado/tornado.js +68 -0
- data/assets/js/mode/troff/troff.js +84 -0
- data/assets/js/mode/ttcn-cfg/ttcn-cfg.js +214 -0
- data/assets/js/mode/ttcn/ttcn.js +283 -0
- data/assets/js/mode/turtle/turtle.js +162 -0
- data/assets/js/mode/twig/twig.js +141 -0
- data/assets/js/mode/vb/vb.js +275 -0
- data/assets/js/mode/vbscript/vbscript.js +350 -0
- data/assets/js/mode/velocity/velocity.js +201 -0
- data/assets/js/mode/verilog/verilog.js +675 -0
- data/assets/js/mode/vhdl/vhdl.js +189 -0
- data/assets/js/mode/vue/vue.js +70 -0
- data/assets/js/mode/webidl/webidl.js +195 -0
- data/assets/js/mode/xml/xml.js +394 -0
- data/assets/js/mode/xquery/xquery.js +448 -0
- data/assets/js/mode/yacas/yacas.js +204 -0
- data/assets/js/mode/yaml-frontmatter/yaml-frontmatter.js +68 -0
- data/assets/js/mode/yaml/yaml.js +118 -0
- data/assets/js/mode/z80/z80.js +116 -0
- data/assets/main.scss +5 -0
- metadata +347 -0
@@ -0,0 +1,150 @@
|
|
1
|
+
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
2
|
+
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
3
|
+
|
4
|
+
// By the Neo4j Team and contributors.
|
5
|
+
// https://github.com/neo4j-contrib/CodeMirror
|
6
|
+
|
7
|
+
(function(mod) {
|
8
|
+
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
9
|
+
mod(require("../../lib/codemirror"));
|
10
|
+
else if (typeof define == "function" && define.amd) // AMD
|
11
|
+
define(["../../lib/codemirror"], mod);
|
12
|
+
else // Plain browser env
|
13
|
+
mod(CodeMirror);
|
14
|
+
})(function(CodeMirror) {
|
15
|
+
"use strict";
|
16
|
+
var wordRegexp = function(words) {
|
17
|
+
return new RegExp("^(?:" + words.join("|") + ")$", "i");
|
18
|
+
};
|
19
|
+
|
20
|
+
CodeMirror.defineMode("cypher", function(config) {
|
21
|
+
var tokenBase = function(stream/*, state*/) {
|
22
|
+
var ch = stream.next();
|
23
|
+
if (ch ==='"') {
|
24
|
+
stream.match(/.*?"/);
|
25
|
+
return "string";
|
26
|
+
}
|
27
|
+
if (ch === "'") {
|
28
|
+
stream.match(/.*?'/);
|
29
|
+
return "string";
|
30
|
+
}
|
31
|
+
if (/[{}\(\),\.;\[\]]/.test(ch)) {
|
32
|
+
curPunc = ch;
|
33
|
+
return "node";
|
34
|
+
} else if (ch === "/" && stream.eat("/")) {
|
35
|
+
stream.skipToEnd();
|
36
|
+
return "comment";
|
37
|
+
} else if (operatorChars.test(ch)) {
|
38
|
+
stream.eatWhile(operatorChars);
|
39
|
+
return null;
|
40
|
+
} else {
|
41
|
+
stream.eatWhile(/[_\w\d]/);
|
42
|
+
if (stream.eat(":")) {
|
43
|
+
stream.eatWhile(/[\w\d_\-]/);
|
44
|
+
return "atom";
|
45
|
+
}
|
46
|
+
var word = stream.current();
|
47
|
+
if (funcs.test(word)) return "builtin";
|
48
|
+
if (preds.test(word)) return "def";
|
49
|
+
if (keywords.test(word)) return "keyword";
|
50
|
+
return "variable";
|
51
|
+
}
|
52
|
+
};
|
53
|
+
var pushContext = function(state, type, col) {
|
54
|
+
return state.context = {
|
55
|
+
prev: state.context,
|
56
|
+
indent: state.indent,
|
57
|
+
col: col,
|
58
|
+
type: type
|
59
|
+
};
|
60
|
+
};
|
61
|
+
var popContext = function(state) {
|
62
|
+
state.indent = state.context.indent;
|
63
|
+
return state.context = state.context.prev;
|
64
|
+
};
|
65
|
+
var indentUnit = config.indentUnit;
|
66
|
+
var curPunc;
|
67
|
+
var funcs = wordRegexp(["abs", "acos", "allShortestPaths", "asin", "atan", "atan2", "avg", "ceil", "coalesce", "collect", "cos", "cot", "count", "degrees", "e", "endnode", "exp", "extract", "filter", "floor", "haversin", "head", "id", "keys", "labels", "last", "left", "length", "log", "log10", "lower", "ltrim", "max", "min", "node", "nodes", "percentileCont", "percentileDisc", "pi", "radians", "rand", "range", "reduce", "rel", "relationship", "relationships", "replace", "reverse", "right", "round", "rtrim", "shortestPath", "sign", "sin", "size", "split", "sqrt", "startnode", "stdev", "stdevp", "str", "substring", "sum", "tail", "tan", "timestamp", "toFloat", "toInt", "toString", "trim", "type", "upper"]);
|
68
|
+
var preds = wordRegexp(["all", "and", "any", "contains", "exists", "has", "in", "none", "not", "or", "single", "xor"]);
|
69
|
+
var keywords = wordRegexp(["as", "asc", "ascending", "assert", "by", "case", "commit", "constraint", "create", "csv", "cypher", "delete", "desc", "descending", "detach", "distinct", "drop", "else", "end", "ends", "explain", "false", "fieldterminator", "foreach", "from", "headers", "in", "index", "is", "join", "limit", "load", "match", "merge", "null", "on", "optional", "order", "periodic", "profile", "remove", "return", "scan", "set", "skip", "start", "starts", "then", "true", "union", "unique", "unwind", "using", "when", "where", "with", "call", "yield"]);
|
70
|
+
var operatorChars = /[*+\-<>=&|~%^]/;
|
71
|
+
|
72
|
+
return {
|
73
|
+
startState: function(/*base*/) {
|
74
|
+
return {
|
75
|
+
tokenize: tokenBase,
|
76
|
+
context: null,
|
77
|
+
indent: 0,
|
78
|
+
col: 0
|
79
|
+
};
|
80
|
+
},
|
81
|
+
token: function(stream, state) {
|
82
|
+
if (stream.sol()) {
|
83
|
+
if (state.context && (state.context.align == null)) {
|
84
|
+
state.context.align = false;
|
85
|
+
}
|
86
|
+
state.indent = stream.indentation();
|
87
|
+
}
|
88
|
+
if (stream.eatSpace()) {
|
89
|
+
return null;
|
90
|
+
}
|
91
|
+
var style = state.tokenize(stream, state);
|
92
|
+
if (style !== "comment" && state.context && (state.context.align == null) && state.context.type !== "pattern") {
|
93
|
+
state.context.align = true;
|
94
|
+
}
|
95
|
+
if (curPunc === "(") {
|
96
|
+
pushContext(state, ")", stream.column());
|
97
|
+
} else if (curPunc === "[") {
|
98
|
+
pushContext(state, "]", stream.column());
|
99
|
+
} else if (curPunc === "{") {
|
100
|
+
pushContext(state, "}", stream.column());
|
101
|
+
} else if (/[\]\}\)]/.test(curPunc)) {
|
102
|
+
while (state.context && state.context.type === "pattern") {
|
103
|
+
popContext(state);
|
104
|
+
}
|
105
|
+
if (state.context && curPunc === state.context.type) {
|
106
|
+
popContext(state);
|
107
|
+
}
|
108
|
+
} else if (curPunc === "." && state.context && state.context.type === "pattern") {
|
109
|
+
popContext(state);
|
110
|
+
} else if (/atom|string|variable/.test(style) && state.context) {
|
111
|
+
if (/[\}\]]/.test(state.context.type)) {
|
112
|
+
pushContext(state, "pattern", stream.column());
|
113
|
+
} else if (state.context.type === "pattern" && !state.context.align) {
|
114
|
+
state.context.align = true;
|
115
|
+
state.context.col = stream.column();
|
116
|
+
}
|
117
|
+
}
|
118
|
+
return style;
|
119
|
+
},
|
120
|
+
indent: function(state, textAfter) {
|
121
|
+
var firstChar = textAfter && textAfter.charAt(0);
|
122
|
+
var context = state.context;
|
123
|
+
if (/[\]\}]/.test(firstChar)) {
|
124
|
+
while (context && context.type === "pattern") {
|
125
|
+
context = context.prev;
|
126
|
+
}
|
127
|
+
}
|
128
|
+
var closing = context && firstChar === context.type;
|
129
|
+
if (!context) return 0;
|
130
|
+
if (context.type === "keywords") return CodeMirror.commands.newlineAndIndent;
|
131
|
+
if (context.align) return context.col + (closing ? 0 : 1);
|
132
|
+
return context.indent + (closing ? 0 : indentUnit);
|
133
|
+
}
|
134
|
+
};
|
135
|
+
});
|
136
|
+
|
137
|
+
CodeMirror.modeExtensions["cypher"] = {
|
138
|
+
autoFormatLineBreaks: function(text) {
|
139
|
+
var i, lines, reProcessedPortion;
|
140
|
+
var lines = text.split("\n");
|
141
|
+
var reProcessedPortion = /\s+\b(return|where|order by|match|with|skip|limit|create|delete|set)\b\s/g;
|
142
|
+
for (var i = 0; i < lines.length; i++)
|
143
|
+
lines[i] = lines[i].replace(reProcessedPortion, " \n$1 ").trim();
|
144
|
+
return lines.join("\n");
|
145
|
+
}
|
146
|
+
};
|
147
|
+
|
148
|
+
CodeMirror.defineMIME("application/x-cypher-query", "cypher");
|
149
|
+
|
150
|
+
});
|
@@ -0,0 +1,218 @@
|
|
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("d", function(config, parserConfig) {
|
15
|
+
var indentUnit = config.indentUnit,
|
16
|
+
statementIndentUnit = parserConfig.statementIndentUnit || indentUnit,
|
17
|
+
keywords = parserConfig.keywords || {},
|
18
|
+
builtin = parserConfig.builtin || {},
|
19
|
+
blockKeywords = parserConfig.blockKeywords || {},
|
20
|
+
atoms = parserConfig.atoms || {},
|
21
|
+
hooks = parserConfig.hooks || {},
|
22
|
+
multiLineStrings = parserConfig.multiLineStrings;
|
23
|
+
var isOperatorChar = /[+\-*&%=<>!?|\/]/;
|
24
|
+
|
25
|
+
var curPunc;
|
26
|
+
|
27
|
+
function tokenBase(stream, state) {
|
28
|
+
var ch = stream.next();
|
29
|
+
if (hooks[ch]) {
|
30
|
+
var result = hooks[ch](stream, state);
|
31
|
+
if (result !== false) return result;
|
32
|
+
}
|
33
|
+
if (ch == '"' || ch == "'" || ch == "`") {
|
34
|
+
state.tokenize = tokenString(ch);
|
35
|
+
return state.tokenize(stream, state);
|
36
|
+
}
|
37
|
+
if (/[\[\]{}\(\),;\:\.]/.test(ch)) {
|
38
|
+
curPunc = ch;
|
39
|
+
return null;
|
40
|
+
}
|
41
|
+
if (/\d/.test(ch)) {
|
42
|
+
stream.eatWhile(/[\w\.]/);
|
43
|
+
return "number";
|
44
|
+
}
|
45
|
+
if (ch == "/") {
|
46
|
+
if (stream.eat("+")) {
|
47
|
+
state.tokenize = tokenNestedComment;
|
48
|
+
return tokenNestedComment(stream, state);
|
49
|
+
}
|
50
|
+
if (stream.eat("*")) {
|
51
|
+
state.tokenize = tokenComment;
|
52
|
+
return tokenComment(stream, state);
|
53
|
+
}
|
54
|
+
if (stream.eat("/")) {
|
55
|
+
stream.skipToEnd();
|
56
|
+
return "comment";
|
57
|
+
}
|
58
|
+
}
|
59
|
+
if (isOperatorChar.test(ch)) {
|
60
|
+
stream.eatWhile(isOperatorChar);
|
61
|
+
return "operator";
|
62
|
+
}
|
63
|
+
stream.eatWhile(/[\w\$_\xa1-\uffff]/);
|
64
|
+
var cur = stream.current();
|
65
|
+
if (keywords.propertyIsEnumerable(cur)) {
|
66
|
+
if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement";
|
67
|
+
return "keyword";
|
68
|
+
}
|
69
|
+
if (builtin.propertyIsEnumerable(cur)) {
|
70
|
+
if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement";
|
71
|
+
return "builtin";
|
72
|
+
}
|
73
|
+
if (atoms.propertyIsEnumerable(cur)) return "atom";
|
74
|
+
return "variable";
|
75
|
+
}
|
76
|
+
|
77
|
+
function tokenString(quote) {
|
78
|
+
return function(stream, state) {
|
79
|
+
var escaped = false, next, end = false;
|
80
|
+
while ((next = stream.next()) != null) {
|
81
|
+
if (next == quote && !escaped) {end = true; break;}
|
82
|
+
escaped = !escaped && next == "\\";
|
83
|
+
}
|
84
|
+
if (end || !(escaped || multiLineStrings))
|
85
|
+
state.tokenize = null;
|
86
|
+
return "string";
|
87
|
+
};
|
88
|
+
}
|
89
|
+
|
90
|
+
function tokenComment(stream, state) {
|
91
|
+
var maybeEnd = false, ch;
|
92
|
+
while (ch = stream.next()) {
|
93
|
+
if (ch == "/" && maybeEnd) {
|
94
|
+
state.tokenize = null;
|
95
|
+
break;
|
96
|
+
}
|
97
|
+
maybeEnd = (ch == "*");
|
98
|
+
}
|
99
|
+
return "comment";
|
100
|
+
}
|
101
|
+
|
102
|
+
function tokenNestedComment(stream, state) {
|
103
|
+
var maybeEnd = false, ch;
|
104
|
+
while (ch = stream.next()) {
|
105
|
+
if (ch == "/" && maybeEnd) {
|
106
|
+
state.tokenize = null;
|
107
|
+
break;
|
108
|
+
}
|
109
|
+
maybeEnd = (ch == "+");
|
110
|
+
}
|
111
|
+
return "comment";
|
112
|
+
}
|
113
|
+
|
114
|
+
function Context(indented, column, type, align, prev) {
|
115
|
+
this.indented = indented;
|
116
|
+
this.column = column;
|
117
|
+
this.type = type;
|
118
|
+
this.align = align;
|
119
|
+
this.prev = prev;
|
120
|
+
}
|
121
|
+
function pushContext(state, col, type) {
|
122
|
+
var indent = state.indented;
|
123
|
+
if (state.context && state.context.type == "statement")
|
124
|
+
indent = state.context.indented;
|
125
|
+
return state.context = new Context(indent, col, type, null, state.context);
|
126
|
+
}
|
127
|
+
function popContext(state) {
|
128
|
+
var t = state.context.type;
|
129
|
+
if (t == ")" || t == "]" || t == "}")
|
130
|
+
state.indented = state.context.indented;
|
131
|
+
return state.context = state.context.prev;
|
132
|
+
}
|
133
|
+
|
134
|
+
// Interface
|
135
|
+
|
136
|
+
return {
|
137
|
+
startState: function(basecolumn) {
|
138
|
+
return {
|
139
|
+
tokenize: null,
|
140
|
+
context: new Context((basecolumn || 0) - indentUnit, 0, "top", false),
|
141
|
+
indented: 0,
|
142
|
+
startOfLine: true
|
143
|
+
};
|
144
|
+
},
|
145
|
+
|
146
|
+
token: function(stream, state) {
|
147
|
+
var ctx = state.context;
|
148
|
+
if (stream.sol()) {
|
149
|
+
if (ctx.align == null) ctx.align = false;
|
150
|
+
state.indented = stream.indentation();
|
151
|
+
state.startOfLine = true;
|
152
|
+
}
|
153
|
+
if (stream.eatSpace()) return null;
|
154
|
+
curPunc = null;
|
155
|
+
var style = (state.tokenize || tokenBase)(stream, state);
|
156
|
+
if (style == "comment" || style == "meta") return style;
|
157
|
+
if (ctx.align == null) ctx.align = true;
|
158
|
+
|
159
|
+
if ((curPunc == ";" || curPunc == ":" || curPunc == ",") && ctx.type == "statement") popContext(state);
|
160
|
+
else if (curPunc == "{") pushContext(state, stream.column(), "}");
|
161
|
+
else if (curPunc == "[") pushContext(state, stream.column(), "]");
|
162
|
+
else if (curPunc == "(") pushContext(state, stream.column(), ")");
|
163
|
+
else if (curPunc == "}") {
|
164
|
+
while (ctx.type == "statement") ctx = popContext(state);
|
165
|
+
if (ctx.type == "}") ctx = popContext(state);
|
166
|
+
while (ctx.type == "statement") ctx = popContext(state);
|
167
|
+
}
|
168
|
+
else if (curPunc == ctx.type) popContext(state);
|
169
|
+
else if (((ctx.type == "}" || ctx.type == "top") && curPunc != ';') || (ctx.type == "statement" && curPunc == "newstatement"))
|
170
|
+
pushContext(state, stream.column(), "statement");
|
171
|
+
state.startOfLine = false;
|
172
|
+
return style;
|
173
|
+
},
|
174
|
+
|
175
|
+
indent: function(state, textAfter) {
|
176
|
+
if (state.tokenize != tokenBase && state.tokenize != null) return CodeMirror.Pass;
|
177
|
+
var ctx = state.context, firstChar = textAfter && textAfter.charAt(0);
|
178
|
+
if (ctx.type == "statement" && firstChar == "}") ctx = ctx.prev;
|
179
|
+
var closing = firstChar == ctx.type;
|
180
|
+
if (ctx.type == "statement") return ctx.indented + (firstChar == "{" ? 0 : statementIndentUnit);
|
181
|
+
else if (ctx.align) return ctx.column + (closing ? 0 : 1);
|
182
|
+
else return ctx.indented + (closing ? 0 : indentUnit);
|
183
|
+
},
|
184
|
+
|
185
|
+
electricChars: "{}"
|
186
|
+
};
|
187
|
+
});
|
188
|
+
|
189
|
+
function words(str) {
|
190
|
+
var obj = {}, words = str.split(" ");
|
191
|
+
for (var i = 0; i < words.length; ++i) obj[words[i]] = true;
|
192
|
+
return obj;
|
193
|
+
}
|
194
|
+
|
195
|
+
var blockKeywords = "body catch class do else enum for foreach foreach_reverse if in interface mixin " +
|
196
|
+
"out scope struct switch try union unittest version while with";
|
197
|
+
|
198
|
+
CodeMirror.defineMIME("text/x-d", {
|
199
|
+
name: "d",
|
200
|
+
keywords: words("abstract alias align asm assert auto break case cast cdouble cent cfloat const continue " +
|
201
|
+
"debug default delegate delete deprecated export extern final finally function goto immutable " +
|
202
|
+
"import inout invariant is lazy macro module new nothrow override package pragma private " +
|
203
|
+
"protected public pure ref return shared short static super synchronized template this " +
|
204
|
+
"throw typedef typeid typeof volatile __FILE__ __LINE__ __gshared __traits __vector __parameters " +
|
205
|
+
blockKeywords),
|
206
|
+
blockKeywords: words(blockKeywords),
|
207
|
+
builtin: words("bool byte char creal dchar double float idouble ifloat int ireal long real short ubyte " +
|
208
|
+
"ucent uint ulong ushort wchar wstring void size_t sizediff_t"),
|
209
|
+
atoms: words("exit failure success true false null"),
|
210
|
+
hooks: {
|
211
|
+
"@": function(stream, _state) {
|
212
|
+
stream.eatWhile(/[\w\$_]/);
|
213
|
+
return "meta";
|
214
|
+
}
|
215
|
+
}
|
216
|
+
});
|
217
|
+
|
218
|
+
});
|
@@ -0,0 +1,157 @@
|
|
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("../clike/clike"));
|
7
|
+
else if (typeof define == "function" && define.amd) // AMD
|
8
|
+
define(["../../lib/codemirror", "../clike/clike"], mod);
|
9
|
+
else // Plain browser env
|
10
|
+
mod(CodeMirror);
|
11
|
+
})(function(CodeMirror) {
|
12
|
+
"use strict";
|
13
|
+
|
14
|
+
var keywords = ("this super static final const abstract class extends external factory " +
|
15
|
+
"implements get native operator set typedef with enum throw rethrow " +
|
16
|
+
"assert break case continue default in return new deferred async await covariant " +
|
17
|
+
"try catch finally do else for if switch while import library export " +
|
18
|
+
"part of show hide is as").split(" ");
|
19
|
+
var blockKeywords = "try catch finally do else for if switch while".split(" ");
|
20
|
+
var atoms = "true false null".split(" ");
|
21
|
+
var builtins = "void bool num int double dynamic var String".split(" ");
|
22
|
+
|
23
|
+
function set(words) {
|
24
|
+
var obj = {};
|
25
|
+
for (var i = 0; i < words.length; ++i) obj[words[i]] = true;
|
26
|
+
return obj;
|
27
|
+
}
|
28
|
+
|
29
|
+
function pushInterpolationStack(state) {
|
30
|
+
(state.interpolationStack || (state.interpolationStack = [])).push(state.tokenize);
|
31
|
+
}
|
32
|
+
|
33
|
+
function popInterpolationStack(state) {
|
34
|
+
return (state.interpolationStack || (state.interpolationStack = [])).pop();
|
35
|
+
}
|
36
|
+
|
37
|
+
function sizeInterpolationStack(state) {
|
38
|
+
return state.interpolationStack ? state.interpolationStack.length : 0;
|
39
|
+
}
|
40
|
+
|
41
|
+
CodeMirror.defineMIME("application/dart", {
|
42
|
+
name: "clike",
|
43
|
+
keywords: set(keywords),
|
44
|
+
blockKeywords: set(blockKeywords),
|
45
|
+
builtin: set(builtins),
|
46
|
+
atoms: set(atoms),
|
47
|
+
hooks: {
|
48
|
+
"@": function(stream) {
|
49
|
+
stream.eatWhile(/[\w\$_\.]/);
|
50
|
+
return "meta";
|
51
|
+
},
|
52
|
+
|
53
|
+
// custom string handling to deal with triple-quoted strings and string interpolation
|
54
|
+
"'": function(stream, state) {
|
55
|
+
return tokenString("'", stream, state, false);
|
56
|
+
},
|
57
|
+
"\"": function(stream, state) {
|
58
|
+
return tokenString("\"", stream, state, false);
|
59
|
+
},
|
60
|
+
"r": function(stream, state) {
|
61
|
+
var peek = stream.peek();
|
62
|
+
if (peek == "'" || peek == "\"") {
|
63
|
+
return tokenString(stream.next(), stream, state, true);
|
64
|
+
}
|
65
|
+
return false;
|
66
|
+
},
|
67
|
+
|
68
|
+
"}": function(_stream, state) {
|
69
|
+
// "}" is end of interpolation, if interpolation stack is non-empty
|
70
|
+
if (sizeInterpolationStack(state) > 0) {
|
71
|
+
state.tokenize = popInterpolationStack(state);
|
72
|
+
return null;
|
73
|
+
}
|
74
|
+
return false;
|
75
|
+
},
|
76
|
+
|
77
|
+
"/": function(stream, state) {
|
78
|
+
if (!stream.eat("*")) return false
|
79
|
+
state.tokenize = tokenNestedComment(1)
|
80
|
+
return state.tokenize(stream, state)
|
81
|
+
}
|
82
|
+
}
|
83
|
+
});
|
84
|
+
|
85
|
+
function tokenString(quote, stream, state, raw) {
|
86
|
+
var tripleQuoted = false;
|
87
|
+
if (stream.eat(quote)) {
|
88
|
+
if (stream.eat(quote)) tripleQuoted = true;
|
89
|
+
else return "string"; //empty string
|
90
|
+
}
|
91
|
+
function tokenStringHelper(stream, state) {
|
92
|
+
var escaped = false;
|
93
|
+
while (!stream.eol()) {
|
94
|
+
if (!raw && !escaped && stream.peek() == "$") {
|
95
|
+
pushInterpolationStack(state);
|
96
|
+
state.tokenize = tokenInterpolation;
|
97
|
+
return "string";
|
98
|
+
}
|
99
|
+
var next = stream.next();
|
100
|
+
if (next == quote && !escaped && (!tripleQuoted || stream.match(quote + quote))) {
|
101
|
+
state.tokenize = null;
|
102
|
+
break;
|
103
|
+
}
|
104
|
+
escaped = !raw && !escaped && next == "\\";
|
105
|
+
}
|
106
|
+
return "string";
|
107
|
+
}
|
108
|
+
state.tokenize = tokenStringHelper;
|
109
|
+
return tokenStringHelper(stream, state);
|
110
|
+
}
|
111
|
+
|
112
|
+
function tokenInterpolation(stream, state) {
|
113
|
+
stream.eat("$");
|
114
|
+
if (stream.eat("{")) {
|
115
|
+
// let clike handle the content of ${...},
|
116
|
+
// we take over again when "}" appears (see hooks).
|
117
|
+
state.tokenize = null;
|
118
|
+
} else {
|
119
|
+
state.tokenize = tokenInterpolationIdentifier;
|
120
|
+
}
|
121
|
+
return null;
|
122
|
+
}
|
123
|
+
|
124
|
+
function tokenInterpolationIdentifier(stream, state) {
|
125
|
+
stream.eatWhile(/[\w_]/);
|
126
|
+
state.tokenize = popInterpolationStack(state);
|
127
|
+
return "variable";
|
128
|
+
}
|
129
|
+
|
130
|
+
function tokenNestedComment(depth) {
|
131
|
+
return function (stream, state) {
|
132
|
+
var ch
|
133
|
+
while (ch = stream.next()) {
|
134
|
+
if (ch == "*" && stream.eat("/")) {
|
135
|
+
if (depth == 1) {
|
136
|
+
state.tokenize = null
|
137
|
+
break
|
138
|
+
} else {
|
139
|
+
state.tokenize = tokenNestedComment(depth - 1)
|
140
|
+
return state.tokenize(stream, state)
|
141
|
+
}
|
142
|
+
} else if (ch == "/" && stream.eat("*")) {
|
143
|
+
state.tokenize = tokenNestedComment(depth + 1)
|
144
|
+
return state.tokenize(stream, state)
|
145
|
+
}
|
146
|
+
}
|
147
|
+
return "comment"
|
148
|
+
}
|
149
|
+
}
|
150
|
+
|
151
|
+
CodeMirror.registerHelper("hintWords", "application/dart", keywords.concat(atoms).concat(builtins));
|
152
|
+
|
153
|
+
// This is needed to make loading through meta.js work.
|
154
|
+
CodeMirror.defineMode("dart", function(conf) {
|
155
|
+
return CodeMirror.getMode(conf, "application/dart");
|
156
|
+
}, "clike");
|
157
|
+
});
|