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,789 @@
|
|
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
|
+
function Context(indented, column, type, info, align, prev) {
|
15
|
+
this.indented = indented;
|
16
|
+
this.column = column;
|
17
|
+
this.type = type;
|
18
|
+
this.info = info;
|
19
|
+
this.align = align;
|
20
|
+
this.prev = prev;
|
21
|
+
}
|
22
|
+
function pushContext(state, col, type, info) {
|
23
|
+
var indent = state.indented;
|
24
|
+
if (state.context && state.context.type == "statement" && type != "statement")
|
25
|
+
indent = state.context.indented;
|
26
|
+
return state.context = new Context(indent, col, type, info, null, state.context);
|
27
|
+
}
|
28
|
+
function popContext(state) {
|
29
|
+
var t = state.context.type;
|
30
|
+
if (t == ")" || t == "]" || t == "}")
|
31
|
+
state.indented = state.context.indented;
|
32
|
+
return state.context = state.context.prev;
|
33
|
+
}
|
34
|
+
|
35
|
+
function typeBefore(stream, state, pos) {
|
36
|
+
if (state.prevToken == "variable" || state.prevToken == "type") return true;
|
37
|
+
if (/\S(?:[^- ]>|[*\]])\s*$|\*$/.test(stream.string.slice(0, pos))) return true;
|
38
|
+
if (state.typeAtEndOfLine && stream.column() == stream.indentation()) return true;
|
39
|
+
}
|
40
|
+
|
41
|
+
function isTopScope(context) {
|
42
|
+
for (;;) {
|
43
|
+
if (!context || context.type == "top") return true;
|
44
|
+
if (context.type == "}" && context.prev.info != "namespace") return false;
|
45
|
+
context = context.prev;
|
46
|
+
}
|
47
|
+
}
|
48
|
+
|
49
|
+
CodeMirror.defineMode("clike", function(config, parserConfig) {
|
50
|
+
var indentUnit = config.indentUnit,
|
51
|
+
statementIndentUnit = parserConfig.statementIndentUnit || indentUnit,
|
52
|
+
dontAlignCalls = parserConfig.dontAlignCalls,
|
53
|
+
keywords = parserConfig.keywords || {},
|
54
|
+
types = parserConfig.types || {},
|
55
|
+
builtin = parserConfig.builtin || {},
|
56
|
+
blockKeywords = parserConfig.blockKeywords || {},
|
57
|
+
defKeywords = parserConfig.defKeywords || {},
|
58
|
+
atoms = parserConfig.atoms || {},
|
59
|
+
hooks = parserConfig.hooks || {},
|
60
|
+
multiLineStrings = parserConfig.multiLineStrings,
|
61
|
+
indentStatements = parserConfig.indentStatements !== false,
|
62
|
+
indentSwitch = parserConfig.indentSwitch !== false,
|
63
|
+
namespaceSeparator = parserConfig.namespaceSeparator,
|
64
|
+
isPunctuationChar = parserConfig.isPunctuationChar || /[\[\]{}\(\),;\:\.]/,
|
65
|
+
numberStart = parserConfig.numberStart || /[\d\.]/,
|
66
|
+
number = parserConfig.number || /^(?:0x[a-f\d]+|0b[01]+|(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?)(u|ll?|l|f)?/i,
|
67
|
+
isOperatorChar = parserConfig.isOperatorChar || /[+\-*&%=<>!?|\/]/,
|
68
|
+
isIdentifierChar = parserConfig.isIdentifierChar || /[\w\$_\xa1-\uffff]/;
|
69
|
+
|
70
|
+
var curPunc, isDefKeyword;
|
71
|
+
|
72
|
+
function tokenBase(stream, state) {
|
73
|
+
var ch = stream.next();
|
74
|
+
if (hooks[ch]) {
|
75
|
+
var result = hooks[ch](stream, state);
|
76
|
+
if (result !== false) return result;
|
77
|
+
}
|
78
|
+
if (ch == '"' || ch == "'") {
|
79
|
+
state.tokenize = tokenString(ch);
|
80
|
+
return state.tokenize(stream, state);
|
81
|
+
}
|
82
|
+
if (isPunctuationChar.test(ch)) {
|
83
|
+
curPunc = ch;
|
84
|
+
return null;
|
85
|
+
}
|
86
|
+
if (numberStart.test(ch)) {
|
87
|
+
stream.backUp(1)
|
88
|
+
if (stream.match(number)) return "number"
|
89
|
+
stream.next()
|
90
|
+
}
|
91
|
+
if (ch == "/") {
|
92
|
+
if (stream.eat("*")) {
|
93
|
+
state.tokenize = tokenComment;
|
94
|
+
return tokenComment(stream, state);
|
95
|
+
}
|
96
|
+
if (stream.eat("/")) {
|
97
|
+
stream.skipToEnd();
|
98
|
+
return "comment";
|
99
|
+
}
|
100
|
+
}
|
101
|
+
if (isOperatorChar.test(ch)) {
|
102
|
+
while (!stream.match(/^\/[\/*]/, false) && stream.eat(isOperatorChar)) {}
|
103
|
+
return "operator";
|
104
|
+
}
|
105
|
+
stream.eatWhile(isIdentifierChar);
|
106
|
+
if (namespaceSeparator) while (stream.match(namespaceSeparator))
|
107
|
+
stream.eatWhile(isIdentifierChar);
|
108
|
+
|
109
|
+
var cur = stream.current();
|
110
|
+
if (contains(keywords, cur)) {
|
111
|
+
if (contains(blockKeywords, cur)) curPunc = "newstatement";
|
112
|
+
if (contains(defKeywords, cur)) isDefKeyword = true;
|
113
|
+
return "keyword";
|
114
|
+
}
|
115
|
+
if (contains(types, cur)) return "type";
|
116
|
+
if (contains(builtin, cur)) {
|
117
|
+
if (contains(blockKeywords, cur)) curPunc = "newstatement";
|
118
|
+
return "builtin";
|
119
|
+
}
|
120
|
+
if (contains(atoms, cur)) return "atom";
|
121
|
+
return "variable";
|
122
|
+
}
|
123
|
+
|
124
|
+
function tokenString(quote) {
|
125
|
+
return function(stream, state) {
|
126
|
+
var escaped = false, next, end = false;
|
127
|
+
while ((next = stream.next()) != null) {
|
128
|
+
if (next == quote && !escaped) {end = true; break;}
|
129
|
+
escaped = !escaped && next == "\\";
|
130
|
+
}
|
131
|
+
if (end || !(escaped || multiLineStrings))
|
132
|
+
state.tokenize = null;
|
133
|
+
return "string";
|
134
|
+
};
|
135
|
+
}
|
136
|
+
|
137
|
+
function tokenComment(stream, state) {
|
138
|
+
var maybeEnd = false, ch;
|
139
|
+
while (ch = stream.next()) {
|
140
|
+
if (ch == "/" && maybeEnd) {
|
141
|
+
state.tokenize = null;
|
142
|
+
break;
|
143
|
+
}
|
144
|
+
maybeEnd = (ch == "*");
|
145
|
+
}
|
146
|
+
return "comment";
|
147
|
+
}
|
148
|
+
|
149
|
+
function maybeEOL(stream, state) {
|
150
|
+
if (parserConfig.typeFirstDefinitions && stream.eol() && isTopScope(state.context))
|
151
|
+
state.typeAtEndOfLine = typeBefore(stream, state, stream.pos)
|
152
|
+
}
|
153
|
+
|
154
|
+
// Interface
|
155
|
+
|
156
|
+
return {
|
157
|
+
startState: function(basecolumn) {
|
158
|
+
return {
|
159
|
+
tokenize: null,
|
160
|
+
context: new Context((basecolumn || 0) - indentUnit, 0, "top", null, false),
|
161
|
+
indented: 0,
|
162
|
+
startOfLine: true,
|
163
|
+
prevToken: null
|
164
|
+
};
|
165
|
+
},
|
166
|
+
|
167
|
+
token: function(stream, state) {
|
168
|
+
var ctx = state.context;
|
169
|
+
if (stream.sol()) {
|
170
|
+
if (ctx.align == null) ctx.align = false;
|
171
|
+
state.indented = stream.indentation();
|
172
|
+
state.startOfLine = true;
|
173
|
+
}
|
174
|
+
if (stream.eatSpace()) { maybeEOL(stream, state); return null; }
|
175
|
+
curPunc = isDefKeyword = null;
|
176
|
+
var style = (state.tokenize || tokenBase)(stream, state);
|
177
|
+
if (style == "comment" || style == "meta") return style;
|
178
|
+
if (ctx.align == null) ctx.align = true;
|
179
|
+
|
180
|
+
if (curPunc == ";" || curPunc == ":" || (curPunc == "," && stream.match(/^\s*(?:\/\/.*)?$/, false)))
|
181
|
+
while (state.context.type == "statement") popContext(state);
|
182
|
+
else if (curPunc == "{") pushContext(state, stream.column(), "}");
|
183
|
+
else if (curPunc == "[") pushContext(state, stream.column(), "]");
|
184
|
+
else if (curPunc == "(") pushContext(state, stream.column(), ")");
|
185
|
+
else if (curPunc == "}") {
|
186
|
+
while (ctx.type == "statement") ctx = popContext(state);
|
187
|
+
if (ctx.type == "}") ctx = popContext(state);
|
188
|
+
while (ctx.type == "statement") ctx = popContext(state);
|
189
|
+
}
|
190
|
+
else if (curPunc == ctx.type) popContext(state);
|
191
|
+
else if (indentStatements &&
|
192
|
+
(((ctx.type == "}" || ctx.type == "top") && curPunc != ";") ||
|
193
|
+
(ctx.type == "statement" && curPunc == "newstatement"))) {
|
194
|
+
pushContext(state, stream.column(), "statement", stream.current());
|
195
|
+
}
|
196
|
+
|
197
|
+
if (style == "variable" &&
|
198
|
+
((state.prevToken == "def" ||
|
199
|
+
(parserConfig.typeFirstDefinitions && typeBefore(stream, state, stream.start) &&
|
200
|
+
isTopScope(state.context) && stream.match(/^\s*\(/, false)))))
|
201
|
+
style = "def";
|
202
|
+
|
203
|
+
if (hooks.token) {
|
204
|
+
var result = hooks.token(stream, state, style);
|
205
|
+
if (result !== undefined) style = result;
|
206
|
+
}
|
207
|
+
|
208
|
+
if (style == "def" && parserConfig.styleDefs === false) style = "variable";
|
209
|
+
|
210
|
+
state.startOfLine = false;
|
211
|
+
state.prevToken = isDefKeyword ? "def" : style || curPunc;
|
212
|
+
maybeEOL(stream, state);
|
213
|
+
return style;
|
214
|
+
},
|
215
|
+
|
216
|
+
indent: function(state, textAfter) {
|
217
|
+
if (state.tokenize != tokenBase && state.tokenize != null || state.typeAtEndOfLine) return CodeMirror.Pass;
|
218
|
+
var ctx = state.context, firstChar = textAfter && textAfter.charAt(0);
|
219
|
+
if (ctx.type == "statement" && firstChar == "}") ctx = ctx.prev;
|
220
|
+
if (parserConfig.dontIndentStatements)
|
221
|
+
while (ctx.type == "statement" && parserConfig.dontIndentStatements.test(ctx.info))
|
222
|
+
ctx = ctx.prev
|
223
|
+
if (hooks.indent) {
|
224
|
+
var hook = hooks.indent(state, ctx, textAfter);
|
225
|
+
if (typeof hook == "number") return hook
|
226
|
+
}
|
227
|
+
var closing = firstChar == ctx.type;
|
228
|
+
var switchBlock = ctx.prev && ctx.prev.info == "switch";
|
229
|
+
if (parserConfig.allmanIndentation && /[{(]/.test(firstChar)) {
|
230
|
+
while (ctx.type != "top" && ctx.type != "}") ctx = ctx.prev
|
231
|
+
return ctx.indented
|
232
|
+
}
|
233
|
+
if (ctx.type == "statement")
|
234
|
+
return ctx.indented + (firstChar == "{" ? 0 : statementIndentUnit);
|
235
|
+
if (ctx.align && (!dontAlignCalls || ctx.type != ")"))
|
236
|
+
return ctx.column + (closing ? 0 : 1);
|
237
|
+
if (ctx.type == ")" && !closing)
|
238
|
+
return ctx.indented + statementIndentUnit;
|
239
|
+
|
240
|
+
return ctx.indented + (closing ? 0 : indentUnit) +
|
241
|
+
(!closing && switchBlock && !/^(?:case|default)\b/.test(textAfter) ? indentUnit : 0);
|
242
|
+
},
|
243
|
+
|
244
|
+
electricInput: indentSwitch ? /^\s*(?:case .*?:|default:|\{\}?|\})$/ : /^\s*[{}]$/,
|
245
|
+
blockCommentStart: "/*",
|
246
|
+
blockCommentEnd: "*/",
|
247
|
+
lineComment: "//",
|
248
|
+
fold: "brace"
|
249
|
+
};
|
250
|
+
});
|
251
|
+
|
252
|
+
function words(str) {
|
253
|
+
var obj = {}, words = str.split(" ");
|
254
|
+
for (var i = 0; i < words.length; ++i) obj[words[i]] = true;
|
255
|
+
return obj;
|
256
|
+
}
|
257
|
+
function contains(words, word) {
|
258
|
+
if (typeof words === "function") {
|
259
|
+
return words(word);
|
260
|
+
} else {
|
261
|
+
return words.propertyIsEnumerable(word);
|
262
|
+
}
|
263
|
+
}
|
264
|
+
var cKeywords = "auto if break case register continue return default do sizeof " +
|
265
|
+
"static else struct switch extern typedef union for goto while enum const volatile";
|
266
|
+
var cTypes = "int long char short double float unsigned signed void size_t ptrdiff_t";
|
267
|
+
|
268
|
+
function cppHook(stream, state) {
|
269
|
+
if (!state.startOfLine) return false
|
270
|
+
for (var ch, next = null; ch = stream.peek();) {
|
271
|
+
if (ch == "\\" && stream.match(/^.$/)) {
|
272
|
+
next = cppHook
|
273
|
+
break
|
274
|
+
} else if (ch == "/" && stream.match(/^\/[\/\*]/, false)) {
|
275
|
+
break
|
276
|
+
}
|
277
|
+
stream.next()
|
278
|
+
}
|
279
|
+
state.tokenize = next
|
280
|
+
return "meta"
|
281
|
+
}
|
282
|
+
|
283
|
+
function pointerHook(_stream, state) {
|
284
|
+
if (state.prevToken == "type") return "type";
|
285
|
+
return false;
|
286
|
+
}
|
287
|
+
|
288
|
+
function cpp14Literal(stream) {
|
289
|
+
stream.eatWhile(/[\w\.']/);
|
290
|
+
return "number";
|
291
|
+
}
|
292
|
+
|
293
|
+
function cpp11StringHook(stream, state) {
|
294
|
+
stream.backUp(1);
|
295
|
+
// Raw strings.
|
296
|
+
if (stream.match(/(R|u8R|uR|UR|LR)/)) {
|
297
|
+
var match = stream.match(/"([^\s\\()]{0,16})\(/);
|
298
|
+
if (!match) {
|
299
|
+
return false;
|
300
|
+
}
|
301
|
+
state.cpp11RawStringDelim = match[1];
|
302
|
+
state.tokenize = tokenRawString;
|
303
|
+
return tokenRawString(stream, state);
|
304
|
+
}
|
305
|
+
// Unicode strings/chars.
|
306
|
+
if (stream.match(/(u8|u|U|L)/)) {
|
307
|
+
if (stream.match(/["']/, /* eat */ false)) {
|
308
|
+
return "string";
|
309
|
+
}
|
310
|
+
return false;
|
311
|
+
}
|
312
|
+
// Ignore this hook.
|
313
|
+
stream.next();
|
314
|
+
return false;
|
315
|
+
}
|
316
|
+
|
317
|
+
function cppLooksLikeConstructor(word) {
|
318
|
+
var lastTwo = /(\w+)::~?(\w+)$/.exec(word);
|
319
|
+
return lastTwo && lastTwo[1] == lastTwo[2];
|
320
|
+
}
|
321
|
+
|
322
|
+
// C#-style strings where "" escapes a quote.
|
323
|
+
function tokenAtString(stream, state) {
|
324
|
+
var next;
|
325
|
+
while ((next = stream.next()) != null) {
|
326
|
+
if (next == '"' && !stream.eat('"')) {
|
327
|
+
state.tokenize = null;
|
328
|
+
break;
|
329
|
+
}
|
330
|
+
}
|
331
|
+
return "string";
|
332
|
+
}
|
333
|
+
|
334
|
+
// C++11 raw string literal is <prefix>"<delim>( anything )<delim>", where
|
335
|
+
// <delim> can be a string up to 16 characters long.
|
336
|
+
function tokenRawString(stream, state) {
|
337
|
+
// Escape characters that have special regex meanings.
|
338
|
+
var delim = state.cpp11RawStringDelim.replace(/[^\w\s]/g, '\\$&');
|
339
|
+
var match = stream.match(new RegExp(".*?\\)" + delim + '"'));
|
340
|
+
if (match)
|
341
|
+
state.tokenize = null;
|
342
|
+
else
|
343
|
+
stream.skipToEnd();
|
344
|
+
return "string";
|
345
|
+
}
|
346
|
+
|
347
|
+
function def(mimes, mode) {
|
348
|
+
if (typeof mimes == "string") mimes = [mimes];
|
349
|
+
var words = [];
|
350
|
+
function add(obj) {
|
351
|
+
if (obj) for (var prop in obj) if (obj.hasOwnProperty(prop))
|
352
|
+
words.push(prop);
|
353
|
+
}
|
354
|
+
add(mode.keywords);
|
355
|
+
add(mode.types);
|
356
|
+
add(mode.builtin);
|
357
|
+
add(mode.atoms);
|
358
|
+
if (words.length) {
|
359
|
+
mode.helperType = mimes[0];
|
360
|
+
CodeMirror.registerHelper("hintWords", mimes[0], words);
|
361
|
+
}
|
362
|
+
|
363
|
+
for (var i = 0; i < mimes.length; ++i)
|
364
|
+
CodeMirror.defineMIME(mimes[i], mode);
|
365
|
+
}
|
366
|
+
|
367
|
+
def(["text/x-csrc", "text/x-c", "text/x-chdr"], {
|
368
|
+
name: "clike",
|
369
|
+
keywords: words(cKeywords),
|
370
|
+
types: words(cTypes + " bool _Complex _Bool float_t double_t intptr_t intmax_t " +
|
371
|
+
"int8_t int16_t int32_t int64_t uintptr_t uintmax_t uint8_t uint16_t " +
|
372
|
+
"uint32_t uint64_t"),
|
373
|
+
blockKeywords: words("case do else for if switch while struct"),
|
374
|
+
defKeywords: words("struct"),
|
375
|
+
typeFirstDefinitions: true,
|
376
|
+
atoms: words("null true false"),
|
377
|
+
hooks: {"#": cppHook, "*": pointerHook},
|
378
|
+
modeProps: {fold: ["brace", "include"]}
|
379
|
+
});
|
380
|
+
|
381
|
+
def(["text/x-c++src", "text/x-c++hdr"], {
|
382
|
+
name: "clike",
|
383
|
+
keywords: words(cKeywords + " asm dynamic_cast namespace reinterpret_cast try explicit new " +
|
384
|
+
"static_cast typeid catch operator template typename class friend private " +
|
385
|
+
"this using const_cast inline public throw virtual delete mutable protected " +
|
386
|
+
"alignas alignof constexpr decltype nullptr noexcept thread_local final " +
|
387
|
+
"static_assert override"),
|
388
|
+
types: words(cTypes + " bool wchar_t"),
|
389
|
+
blockKeywords: words("catch class do else finally for if struct switch try while"),
|
390
|
+
defKeywords: words("class namespace struct enum union"),
|
391
|
+
typeFirstDefinitions: true,
|
392
|
+
atoms: words("true false null"),
|
393
|
+
dontIndentStatements: /^template$/,
|
394
|
+
isIdentifierChar: /[\w\$_~\xa1-\uffff]/,
|
395
|
+
hooks: {
|
396
|
+
"#": cppHook,
|
397
|
+
"*": pointerHook,
|
398
|
+
"u": cpp11StringHook,
|
399
|
+
"U": cpp11StringHook,
|
400
|
+
"L": cpp11StringHook,
|
401
|
+
"R": cpp11StringHook,
|
402
|
+
"0": cpp14Literal,
|
403
|
+
"1": cpp14Literal,
|
404
|
+
"2": cpp14Literal,
|
405
|
+
"3": cpp14Literal,
|
406
|
+
"4": cpp14Literal,
|
407
|
+
"5": cpp14Literal,
|
408
|
+
"6": cpp14Literal,
|
409
|
+
"7": cpp14Literal,
|
410
|
+
"8": cpp14Literal,
|
411
|
+
"9": cpp14Literal,
|
412
|
+
token: function(stream, state, style) {
|
413
|
+
if (style == "variable" && stream.peek() == "(" &&
|
414
|
+
(state.prevToken == ";" || state.prevToken == null ||
|
415
|
+
state.prevToken == "}") &&
|
416
|
+
cppLooksLikeConstructor(stream.current()))
|
417
|
+
return "def";
|
418
|
+
}
|
419
|
+
},
|
420
|
+
namespaceSeparator: "::",
|
421
|
+
modeProps: {fold: ["brace", "include"]}
|
422
|
+
});
|
423
|
+
|
424
|
+
def("text/x-java", {
|
425
|
+
name: "clike",
|
426
|
+
keywords: words("abstract assert break case catch class const continue default " +
|
427
|
+
"do else enum extends final finally float for goto if implements import " +
|
428
|
+
"instanceof interface native new package private protected public " +
|
429
|
+
"return static strictfp super switch synchronized this throw throws transient " +
|
430
|
+
"try volatile while @interface"),
|
431
|
+
types: words("byte short int long float double boolean char void Boolean Byte Character Double Float " +
|
432
|
+
"Integer Long Number Object Short String StringBuffer StringBuilder Void"),
|
433
|
+
blockKeywords: words("catch class do else finally for if switch try while"),
|
434
|
+
defKeywords: words("class interface package enum @interface"),
|
435
|
+
typeFirstDefinitions: true,
|
436
|
+
atoms: words("true false null"),
|
437
|
+
number: /^(?:0x[a-f\d_]+|0b[01_]+|(?:[\d_]+\.?\d*|\.\d+)(?:e[-+]?[\d_]+)?)(u|ll?|l|f)?/i,
|
438
|
+
hooks: {
|
439
|
+
"@": function(stream) {
|
440
|
+
// Don't match the @interface keyword.
|
441
|
+
if (stream.match('interface', false)) return false;
|
442
|
+
|
443
|
+
stream.eatWhile(/[\w\$_]/);
|
444
|
+
return "meta";
|
445
|
+
}
|
446
|
+
},
|
447
|
+
modeProps: {fold: ["brace", "import"]}
|
448
|
+
});
|
449
|
+
|
450
|
+
def("text/x-csharp", {
|
451
|
+
name: "clike",
|
452
|
+
keywords: words("abstract as async await base break case catch checked class const continue" +
|
453
|
+
" default delegate do else enum event explicit extern finally fixed for" +
|
454
|
+
" foreach goto if implicit in interface internal is lock namespace new" +
|
455
|
+
" operator out override params private protected public readonly ref return sealed" +
|
456
|
+
" sizeof stackalloc static struct switch this throw try typeof unchecked" +
|
457
|
+
" unsafe using virtual void volatile while add alias ascending descending dynamic from get" +
|
458
|
+
" global group into join let orderby partial remove select set value var yield"),
|
459
|
+
types: words("Action Boolean Byte Char DateTime DateTimeOffset Decimal Double Func" +
|
460
|
+
" Guid Int16 Int32 Int64 Object SByte Single String Task TimeSpan UInt16 UInt32" +
|
461
|
+
" UInt64 bool byte char decimal double short int long object" +
|
462
|
+
" sbyte float string ushort uint ulong"),
|
463
|
+
blockKeywords: words("catch class do else finally for foreach if struct switch try while"),
|
464
|
+
defKeywords: words("class interface namespace struct var"),
|
465
|
+
typeFirstDefinitions: true,
|
466
|
+
atoms: words("true false null"),
|
467
|
+
hooks: {
|
468
|
+
"@": function(stream, state) {
|
469
|
+
if (stream.eat('"')) {
|
470
|
+
state.tokenize = tokenAtString;
|
471
|
+
return tokenAtString(stream, state);
|
472
|
+
}
|
473
|
+
stream.eatWhile(/[\w\$_]/);
|
474
|
+
return "meta";
|
475
|
+
}
|
476
|
+
}
|
477
|
+
});
|
478
|
+
|
479
|
+
function tokenTripleString(stream, state) {
|
480
|
+
var escaped = false;
|
481
|
+
while (!stream.eol()) {
|
482
|
+
if (!escaped && stream.match('"""')) {
|
483
|
+
state.tokenize = null;
|
484
|
+
break;
|
485
|
+
}
|
486
|
+
escaped = stream.next() == "\\" && !escaped;
|
487
|
+
}
|
488
|
+
return "string";
|
489
|
+
}
|
490
|
+
|
491
|
+
def("text/x-scala", {
|
492
|
+
name: "clike",
|
493
|
+
keywords: words(
|
494
|
+
|
495
|
+
/* scala */
|
496
|
+
"abstract case catch class def do else extends final finally for forSome if " +
|
497
|
+
"implicit import lazy match new null object override package private protected return " +
|
498
|
+
"sealed super this throw trait try type val var while with yield _ " +
|
499
|
+
|
500
|
+
/* package scala */
|
501
|
+
"assert assume require print println printf readLine readBoolean readByte readShort " +
|
502
|
+
"readChar readInt readLong readFloat readDouble"
|
503
|
+
),
|
504
|
+
types: words(
|
505
|
+
"AnyVal App Application Array BufferedIterator BigDecimal BigInt Char Console Either " +
|
506
|
+
"Enumeration Equiv Error Exception Fractional Function IndexedSeq Int Integral Iterable " +
|
507
|
+
"Iterator List Map Numeric Nil NotNull Option Ordered Ordering PartialFunction PartialOrdering " +
|
508
|
+
"Product Proxy Range Responder Seq Serializable Set Specializable Stream StringBuilder " +
|
509
|
+
"StringContext Symbol Throwable Traversable TraversableOnce Tuple Unit Vector " +
|
510
|
+
|
511
|
+
/* package java.lang */
|
512
|
+
"Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable " +
|
513
|
+
"Compiler Double Exception Float Integer Long Math Number Object Package Pair Process " +
|
514
|
+
"Runtime Runnable SecurityManager Short StackTraceElement StrictMath String " +
|
515
|
+
"StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void"
|
516
|
+
),
|
517
|
+
multiLineStrings: true,
|
518
|
+
blockKeywords: words("catch class enum do else finally for forSome if match switch try while"),
|
519
|
+
defKeywords: words("class enum def object package trait type val var"),
|
520
|
+
atoms: words("true false null"),
|
521
|
+
indentStatements: false,
|
522
|
+
indentSwitch: false,
|
523
|
+
isOperatorChar: /[+\-*&%=<>!?|\/#:@]/,
|
524
|
+
hooks: {
|
525
|
+
"@": function(stream) {
|
526
|
+
stream.eatWhile(/[\w\$_]/);
|
527
|
+
return "meta";
|
528
|
+
},
|
529
|
+
'"': function(stream, state) {
|
530
|
+
if (!stream.match('""')) return false;
|
531
|
+
state.tokenize = tokenTripleString;
|
532
|
+
return state.tokenize(stream, state);
|
533
|
+
},
|
534
|
+
"'": function(stream) {
|
535
|
+
stream.eatWhile(/[\w\$_\xa1-\uffff]/);
|
536
|
+
return "atom";
|
537
|
+
},
|
538
|
+
"=": function(stream, state) {
|
539
|
+
var cx = state.context
|
540
|
+
if (cx.type == "}" && cx.align && stream.eat(">")) {
|
541
|
+
state.context = new Context(cx.indented, cx.column, cx.type, cx.info, null, cx.prev)
|
542
|
+
return "operator"
|
543
|
+
} else {
|
544
|
+
return false
|
545
|
+
}
|
546
|
+
}
|
547
|
+
},
|
548
|
+
modeProps: {closeBrackets: {triples: '"'}}
|
549
|
+
});
|
550
|
+
|
551
|
+
function tokenKotlinString(tripleString){
|
552
|
+
return function (stream, state) {
|
553
|
+
var escaped = false, next, end = false;
|
554
|
+
while (!stream.eol()) {
|
555
|
+
if (!tripleString && !escaped && stream.match('"') ) {end = true; break;}
|
556
|
+
if (tripleString && stream.match('"""')) {end = true; break;}
|
557
|
+
next = stream.next();
|
558
|
+
if(!escaped && next == "$" && stream.match('{'))
|
559
|
+
stream.skipTo("}");
|
560
|
+
escaped = !escaped && next == "\\" && !tripleString;
|
561
|
+
}
|
562
|
+
if (end || !tripleString)
|
563
|
+
state.tokenize = null;
|
564
|
+
return "string";
|
565
|
+
}
|
566
|
+
}
|
567
|
+
|
568
|
+
def("text/x-kotlin", {
|
569
|
+
name: "clike",
|
570
|
+
keywords: words(
|
571
|
+
/*keywords*/
|
572
|
+
"package as typealias class interface this super val " +
|
573
|
+
"var fun for is in This throw return " +
|
574
|
+
"break continue object if else while do try when !in !is as? " +
|
575
|
+
|
576
|
+
/*soft keywords*/
|
577
|
+
"file import where by get set abstract enum open inner override private public internal " +
|
578
|
+
"protected catch finally out final vararg reified dynamic companion constructor init " +
|
579
|
+
"sealed field property receiver param sparam lateinit data inline noinline tailrec " +
|
580
|
+
"external annotation crossinline const operator infix suspend"
|
581
|
+
),
|
582
|
+
types: words(
|
583
|
+
/* package java.lang */
|
584
|
+
"Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable " +
|
585
|
+
"Compiler Double Exception Float Integer Long Math Number Object Package Pair Process " +
|
586
|
+
"Runtime Runnable SecurityManager Short StackTraceElement StrictMath String " +
|
587
|
+
"StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void"
|
588
|
+
),
|
589
|
+
intendSwitch: false,
|
590
|
+
indentStatements: false,
|
591
|
+
multiLineStrings: true,
|
592
|
+
number: /^(?:0x[a-f\d_]+|0b[01_]+|(?:[\d_]+\.?\d*|\.\d+)(?:e[-+]?[\d_]+)?)(u|ll?|l|f)?/i,
|
593
|
+
blockKeywords: words("catch class do else finally for if where try while enum"),
|
594
|
+
defKeywords: words("class val var object package interface fun"),
|
595
|
+
atoms: words("true false null this"),
|
596
|
+
hooks: {
|
597
|
+
'"': function(stream, state) {
|
598
|
+
state.tokenize = tokenKotlinString(stream.match('""'));
|
599
|
+
return state.tokenize(stream, state);
|
600
|
+
}
|
601
|
+
},
|
602
|
+
modeProps: {closeBrackets: {triples: '"'}}
|
603
|
+
});
|
604
|
+
|
605
|
+
def(["x-shader/x-vertex", "x-shader/x-fragment"], {
|
606
|
+
name: "clike",
|
607
|
+
keywords: words("sampler1D sampler2D sampler3D samplerCube " +
|
608
|
+
"sampler1DShadow sampler2DShadow " +
|
609
|
+
"const attribute uniform varying " +
|
610
|
+
"break continue discard return " +
|
611
|
+
"for while do if else struct " +
|
612
|
+
"in out inout"),
|
613
|
+
types: words("float int bool void " +
|
614
|
+
"vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 " +
|
615
|
+
"mat2 mat3 mat4"),
|
616
|
+
blockKeywords: words("for while do if else struct"),
|
617
|
+
builtin: words("radians degrees sin cos tan asin acos atan " +
|
618
|
+
"pow exp log exp2 sqrt inversesqrt " +
|
619
|
+
"abs sign floor ceil fract mod min max clamp mix step smoothstep " +
|
620
|
+
"length distance dot cross normalize ftransform faceforward " +
|
621
|
+
"reflect refract matrixCompMult " +
|
622
|
+
"lessThan lessThanEqual greaterThan greaterThanEqual " +
|
623
|
+
"equal notEqual any all not " +
|
624
|
+
"texture1D texture1DProj texture1DLod texture1DProjLod " +
|
625
|
+
"texture2D texture2DProj texture2DLod texture2DProjLod " +
|
626
|
+
"texture3D texture3DProj texture3DLod texture3DProjLod " +
|
627
|
+
"textureCube textureCubeLod " +
|
628
|
+
"shadow1D shadow2D shadow1DProj shadow2DProj " +
|
629
|
+
"shadow1DLod shadow2DLod shadow1DProjLod shadow2DProjLod " +
|
630
|
+
"dFdx dFdy fwidth " +
|
631
|
+
"noise1 noise2 noise3 noise4"),
|
632
|
+
atoms: words("true false " +
|
633
|
+
"gl_FragColor gl_SecondaryColor gl_Normal gl_Vertex " +
|
634
|
+
"gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord3 " +
|
635
|
+
"gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 " +
|
636
|
+
"gl_FogCoord gl_PointCoord " +
|
637
|
+
"gl_Position gl_PointSize gl_ClipVertex " +
|
638
|
+
"gl_FrontColor gl_BackColor gl_FrontSecondaryColor gl_BackSecondaryColor " +
|
639
|
+
"gl_TexCoord gl_FogFragCoord " +
|
640
|
+
"gl_FragCoord gl_FrontFacing " +
|
641
|
+
"gl_FragData gl_FragDepth " +
|
642
|
+
"gl_ModelViewMatrix gl_ProjectionMatrix gl_ModelViewProjectionMatrix " +
|
643
|
+
"gl_TextureMatrix gl_NormalMatrix gl_ModelViewMatrixInverse " +
|
644
|
+
"gl_ProjectionMatrixInverse gl_ModelViewProjectionMatrixInverse " +
|
645
|
+
"gl_TexureMatrixTranspose gl_ModelViewMatrixInverseTranspose " +
|
646
|
+
"gl_ProjectionMatrixInverseTranspose " +
|
647
|
+
"gl_ModelViewProjectionMatrixInverseTranspose " +
|
648
|
+
"gl_TextureMatrixInverseTranspose " +
|
649
|
+
"gl_NormalScale gl_DepthRange gl_ClipPlane " +
|
650
|
+
"gl_Point gl_FrontMaterial gl_BackMaterial gl_LightSource gl_LightModel " +
|
651
|
+
"gl_FrontLightModelProduct gl_BackLightModelProduct " +
|
652
|
+
"gl_TextureColor gl_EyePlaneS gl_EyePlaneT gl_EyePlaneR gl_EyePlaneQ " +
|
653
|
+
"gl_FogParameters " +
|
654
|
+
"gl_MaxLights gl_MaxClipPlanes gl_MaxTextureUnits gl_MaxTextureCoords " +
|
655
|
+
"gl_MaxVertexAttribs gl_MaxVertexUniformComponents gl_MaxVaryingFloats " +
|
656
|
+
"gl_MaxVertexTextureImageUnits gl_MaxTextureImageUnits " +
|
657
|
+
"gl_MaxFragmentUniformComponents gl_MaxCombineTextureImageUnits " +
|
658
|
+
"gl_MaxDrawBuffers"),
|
659
|
+
indentSwitch: false,
|
660
|
+
hooks: {"#": cppHook},
|
661
|
+
modeProps: {fold: ["brace", "include"]}
|
662
|
+
});
|
663
|
+
|
664
|
+
def("text/x-nesc", {
|
665
|
+
name: "clike",
|
666
|
+
keywords: words(cKeywords + "as atomic async call command component components configuration event generic " +
|
667
|
+
"implementation includes interface module new norace nx_struct nx_union post provides " +
|
668
|
+
"signal task uses abstract extends"),
|
669
|
+
types: words(cTypes),
|
670
|
+
blockKeywords: words("case do else for if switch while struct"),
|
671
|
+
atoms: words("null true false"),
|
672
|
+
hooks: {"#": cppHook},
|
673
|
+
modeProps: {fold: ["brace", "include"]}
|
674
|
+
});
|
675
|
+
|
676
|
+
def("text/x-objectivec", {
|
677
|
+
name: "clike",
|
678
|
+
keywords: words(cKeywords + "inline restrict _Bool _Complex _Imaginary BOOL Class bycopy byref id IMP in " +
|
679
|
+
"inout nil oneway out Protocol SEL self super atomic nonatomic retain copy readwrite readonly"),
|
680
|
+
types: words(cTypes),
|
681
|
+
atoms: words("YES NO NULL NILL ON OFF true false"),
|
682
|
+
hooks: {
|
683
|
+
"@": function(stream) {
|
684
|
+
stream.eatWhile(/[\w\$]/);
|
685
|
+
return "keyword";
|
686
|
+
},
|
687
|
+
"#": cppHook,
|
688
|
+
indent: function(_state, ctx, textAfter) {
|
689
|
+
if (ctx.type == "statement" && /^@\w/.test(textAfter)) return ctx.indented
|
690
|
+
}
|
691
|
+
},
|
692
|
+
modeProps: {fold: "brace"}
|
693
|
+
});
|
694
|
+
|
695
|
+
def("text/x-squirrel", {
|
696
|
+
name: "clike",
|
697
|
+
keywords: words("base break clone continue const default delete enum extends function in class" +
|
698
|
+
" foreach local resume return this throw typeof yield constructor instanceof static"),
|
699
|
+
types: words(cTypes),
|
700
|
+
blockKeywords: words("case catch class else for foreach if switch try while"),
|
701
|
+
defKeywords: words("function local class"),
|
702
|
+
typeFirstDefinitions: true,
|
703
|
+
atoms: words("true false null"),
|
704
|
+
hooks: {"#": cppHook},
|
705
|
+
modeProps: {fold: ["brace", "include"]}
|
706
|
+
});
|
707
|
+
|
708
|
+
// Ceylon Strings need to deal with interpolation
|
709
|
+
var stringTokenizer = null;
|
710
|
+
function tokenCeylonString(type) {
|
711
|
+
return function(stream, state) {
|
712
|
+
var escaped = false, next, end = false;
|
713
|
+
while (!stream.eol()) {
|
714
|
+
if (!escaped && stream.match('"') &&
|
715
|
+
(type == "single" || stream.match('""'))) {
|
716
|
+
end = true;
|
717
|
+
break;
|
718
|
+
}
|
719
|
+
if (!escaped && stream.match('``')) {
|
720
|
+
stringTokenizer = tokenCeylonString(type);
|
721
|
+
end = true;
|
722
|
+
break;
|
723
|
+
}
|
724
|
+
next = stream.next();
|
725
|
+
escaped = type == "single" && !escaped && next == "\\";
|
726
|
+
}
|
727
|
+
if (end)
|
728
|
+
state.tokenize = null;
|
729
|
+
return "string";
|
730
|
+
}
|
731
|
+
}
|
732
|
+
|
733
|
+
def("text/x-ceylon", {
|
734
|
+
name: "clike",
|
735
|
+
keywords: words("abstracts alias assembly assert assign break case catch class continue dynamic else" +
|
736
|
+
" exists extends finally for function given if import in interface is let module new" +
|
737
|
+
" nonempty object of out outer package return satisfies super switch then this throw" +
|
738
|
+
" try value void while"),
|
739
|
+
types: function(word) {
|
740
|
+
// In Ceylon all identifiers that start with an uppercase are types
|
741
|
+
var first = word.charAt(0);
|
742
|
+
return (first === first.toUpperCase() && first !== first.toLowerCase());
|
743
|
+
},
|
744
|
+
blockKeywords: words("case catch class dynamic else finally for function if interface module new object switch try while"),
|
745
|
+
defKeywords: words("class dynamic function interface module object package value"),
|
746
|
+
builtin: words("abstract actual aliased annotation by default deprecated doc final formal late license" +
|
747
|
+
" native optional sealed see serializable shared suppressWarnings tagged throws variable"),
|
748
|
+
isPunctuationChar: /[\[\]{}\(\),;\:\.`]/,
|
749
|
+
isOperatorChar: /[+\-*&%=<>!?|^~:\/]/,
|
750
|
+
numberStart: /[\d#$]/,
|
751
|
+
number: /^(?:#[\da-fA-F_]+|\$[01_]+|[\d_]+[kMGTPmunpf]?|[\d_]+\.[\d_]+(?:[eE][-+]?\d+|[kMGTPmunpf]|)|)/i,
|
752
|
+
multiLineStrings: true,
|
753
|
+
typeFirstDefinitions: true,
|
754
|
+
atoms: words("true false null larger smaller equal empty finished"),
|
755
|
+
indentSwitch: false,
|
756
|
+
styleDefs: false,
|
757
|
+
hooks: {
|
758
|
+
"@": function(stream) {
|
759
|
+
stream.eatWhile(/[\w\$_]/);
|
760
|
+
return "meta";
|
761
|
+
},
|
762
|
+
'"': function(stream, state) {
|
763
|
+
state.tokenize = tokenCeylonString(stream.match('""') ? "triple" : "single");
|
764
|
+
return state.tokenize(stream, state);
|
765
|
+
},
|
766
|
+
'`': function(stream, state) {
|
767
|
+
if (!stringTokenizer || !stream.match('`')) return false;
|
768
|
+
state.tokenize = stringTokenizer;
|
769
|
+
stringTokenizer = null;
|
770
|
+
return state.tokenize(stream, state);
|
771
|
+
},
|
772
|
+
"'": function(stream) {
|
773
|
+
stream.eatWhile(/[\w\$_\xa1-\uffff]/);
|
774
|
+
return "atom";
|
775
|
+
},
|
776
|
+
token: function(_stream, state, style) {
|
777
|
+
if ((style == "variable" || style == "type") &&
|
778
|
+
state.prevToken == ".") {
|
779
|
+
return "variable-2";
|
780
|
+
}
|
781
|
+
}
|
782
|
+
},
|
783
|
+
modeProps: {
|
784
|
+
fold: ["brace", "import"],
|
785
|
+
closeBrackets: {triples: '"'}
|
786
|
+
}
|
787
|
+
});
|
788
|
+
|
789
|
+
});
|