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,283 @@
|
|
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("ttcn", function(config, parserConfig) {
|
15
|
+
var indentUnit = config.indentUnit,
|
16
|
+
keywords = parserConfig.keywords || {},
|
17
|
+
builtin = parserConfig.builtin || {},
|
18
|
+
timerOps = parserConfig.timerOps || {},
|
19
|
+
portOps = parserConfig.portOps || {},
|
20
|
+
configOps = parserConfig.configOps || {},
|
21
|
+
verdictOps = parserConfig.verdictOps || {},
|
22
|
+
sutOps = parserConfig.sutOps || {},
|
23
|
+
functionOps = parserConfig.functionOps || {},
|
24
|
+
|
25
|
+
verdictConsts = parserConfig.verdictConsts || {},
|
26
|
+
booleanConsts = parserConfig.booleanConsts || {},
|
27
|
+
otherConsts = parserConfig.otherConsts || {},
|
28
|
+
|
29
|
+
types = parserConfig.types || {},
|
30
|
+
visibilityModifiers = parserConfig.visibilityModifiers || {},
|
31
|
+
templateMatch = parserConfig.templateMatch || {},
|
32
|
+
multiLineStrings = parserConfig.multiLineStrings,
|
33
|
+
indentStatements = parserConfig.indentStatements !== false;
|
34
|
+
var isOperatorChar = /[+\-*&@=<>!\/]/;
|
35
|
+
var curPunc;
|
36
|
+
|
37
|
+
function tokenBase(stream, state) {
|
38
|
+
var ch = stream.next();
|
39
|
+
|
40
|
+
if (ch == '"' || ch == "'") {
|
41
|
+
state.tokenize = tokenString(ch);
|
42
|
+
return state.tokenize(stream, state);
|
43
|
+
}
|
44
|
+
if (/[\[\]{}\(\),;\\:\?\.]/.test(ch)) {
|
45
|
+
curPunc = ch;
|
46
|
+
return "punctuation";
|
47
|
+
}
|
48
|
+
if (ch == "#"){
|
49
|
+
stream.skipToEnd();
|
50
|
+
return "atom preprocessor";
|
51
|
+
}
|
52
|
+
if (ch == "%"){
|
53
|
+
stream.eatWhile(/\b/);
|
54
|
+
return "atom ttcn3Macros";
|
55
|
+
}
|
56
|
+
if (/\d/.test(ch)) {
|
57
|
+
stream.eatWhile(/[\w\.]/);
|
58
|
+
return "number";
|
59
|
+
}
|
60
|
+
if (ch == "/") {
|
61
|
+
if (stream.eat("*")) {
|
62
|
+
state.tokenize = tokenComment;
|
63
|
+
return tokenComment(stream, state);
|
64
|
+
}
|
65
|
+
if (stream.eat("/")) {
|
66
|
+
stream.skipToEnd();
|
67
|
+
return "comment";
|
68
|
+
}
|
69
|
+
}
|
70
|
+
if (isOperatorChar.test(ch)) {
|
71
|
+
if(ch == "@"){
|
72
|
+
if(stream.match("try") || stream.match("catch")
|
73
|
+
|| stream.match("lazy")){
|
74
|
+
return "keyword";
|
75
|
+
}
|
76
|
+
}
|
77
|
+
stream.eatWhile(isOperatorChar);
|
78
|
+
return "operator";
|
79
|
+
}
|
80
|
+
stream.eatWhile(/[\w\$_\xa1-\uffff]/);
|
81
|
+
var cur = stream.current();
|
82
|
+
|
83
|
+
if (keywords.propertyIsEnumerable(cur)) return "keyword";
|
84
|
+
if (builtin.propertyIsEnumerable(cur)) return "builtin";
|
85
|
+
|
86
|
+
if (timerOps.propertyIsEnumerable(cur)) return "def timerOps";
|
87
|
+
if (configOps.propertyIsEnumerable(cur)) return "def configOps";
|
88
|
+
if (verdictOps.propertyIsEnumerable(cur)) return "def verdictOps";
|
89
|
+
if (portOps.propertyIsEnumerable(cur)) return "def portOps";
|
90
|
+
if (sutOps.propertyIsEnumerable(cur)) return "def sutOps";
|
91
|
+
if (functionOps.propertyIsEnumerable(cur)) return "def functionOps";
|
92
|
+
|
93
|
+
if (verdictConsts.propertyIsEnumerable(cur)) return "string verdictConsts";
|
94
|
+
if (booleanConsts.propertyIsEnumerable(cur)) return "string booleanConsts";
|
95
|
+
if (otherConsts.propertyIsEnumerable(cur)) return "string otherConsts";
|
96
|
+
|
97
|
+
if (types.propertyIsEnumerable(cur)) return "builtin types";
|
98
|
+
if (visibilityModifiers.propertyIsEnumerable(cur))
|
99
|
+
return "builtin visibilityModifiers";
|
100
|
+
if (templateMatch.propertyIsEnumerable(cur)) return "atom templateMatch";
|
101
|
+
|
102
|
+
return "variable";
|
103
|
+
}
|
104
|
+
|
105
|
+
function tokenString(quote) {
|
106
|
+
return function(stream, state) {
|
107
|
+
var escaped = false, next, end = false;
|
108
|
+
while ((next = stream.next()) != null) {
|
109
|
+
if (next == quote && !escaped){
|
110
|
+
var afterQuote = stream.peek();
|
111
|
+
//look if the character after the quote is like the B in '10100010'B
|
112
|
+
if (afterQuote){
|
113
|
+
afterQuote = afterQuote.toLowerCase();
|
114
|
+
if(afterQuote == "b" || afterQuote == "h" || afterQuote == "o")
|
115
|
+
stream.next();
|
116
|
+
}
|
117
|
+
end = true; break;
|
118
|
+
}
|
119
|
+
escaped = !escaped && next == "\\";
|
120
|
+
}
|
121
|
+
if (end || !(escaped || multiLineStrings))
|
122
|
+
state.tokenize = null;
|
123
|
+
return "string";
|
124
|
+
};
|
125
|
+
}
|
126
|
+
|
127
|
+
function tokenComment(stream, state) {
|
128
|
+
var maybeEnd = false, ch;
|
129
|
+
while (ch = stream.next()) {
|
130
|
+
if (ch == "/" && maybeEnd) {
|
131
|
+
state.tokenize = null;
|
132
|
+
break;
|
133
|
+
}
|
134
|
+
maybeEnd = (ch == "*");
|
135
|
+
}
|
136
|
+
return "comment";
|
137
|
+
}
|
138
|
+
|
139
|
+
function Context(indented, column, type, align, prev) {
|
140
|
+
this.indented = indented;
|
141
|
+
this.column = column;
|
142
|
+
this.type = type;
|
143
|
+
this.align = align;
|
144
|
+
this.prev = prev;
|
145
|
+
}
|
146
|
+
|
147
|
+
function pushContext(state, col, type) {
|
148
|
+
var indent = state.indented;
|
149
|
+
if (state.context && state.context.type == "statement")
|
150
|
+
indent = state.context.indented;
|
151
|
+
return state.context = new Context(indent, col, type, null, state.context);
|
152
|
+
}
|
153
|
+
|
154
|
+
function popContext(state) {
|
155
|
+
var t = state.context.type;
|
156
|
+
if (t == ")" || t == "]" || t == "}")
|
157
|
+
state.indented = state.context.indented;
|
158
|
+
return state.context = state.context.prev;
|
159
|
+
}
|
160
|
+
|
161
|
+
//Interface
|
162
|
+
return {
|
163
|
+
startState: function(basecolumn) {
|
164
|
+
return {
|
165
|
+
tokenize: null,
|
166
|
+
context: new Context((basecolumn || 0) - indentUnit, 0, "top", false),
|
167
|
+
indented: 0,
|
168
|
+
startOfLine: true
|
169
|
+
};
|
170
|
+
},
|
171
|
+
|
172
|
+
token: function(stream, state) {
|
173
|
+
var ctx = state.context;
|
174
|
+
if (stream.sol()) {
|
175
|
+
if (ctx.align == null) ctx.align = false;
|
176
|
+
state.indented = stream.indentation();
|
177
|
+
state.startOfLine = true;
|
178
|
+
}
|
179
|
+
if (stream.eatSpace()) return null;
|
180
|
+
curPunc = null;
|
181
|
+
var style = (state.tokenize || tokenBase)(stream, state);
|
182
|
+
if (style == "comment") return style;
|
183
|
+
if (ctx.align == null) ctx.align = true;
|
184
|
+
|
185
|
+
if ((curPunc == ";" || curPunc == ":" || curPunc == ",")
|
186
|
+
&& ctx.type == "statement"){
|
187
|
+
popContext(state);
|
188
|
+
}
|
189
|
+
else if (curPunc == "{") pushContext(state, stream.column(), "}");
|
190
|
+
else if (curPunc == "[") pushContext(state, stream.column(), "]");
|
191
|
+
else if (curPunc == "(") pushContext(state, stream.column(), ")");
|
192
|
+
else if (curPunc == "}") {
|
193
|
+
while (ctx.type == "statement") ctx = popContext(state);
|
194
|
+
if (ctx.type == "}") ctx = popContext(state);
|
195
|
+
while (ctx.type == "statement") ctx = popContext(state);
|
196
|
+
}
|
197
|
+
else if (curPunc == ctx.type) popContext(state);
|
198
|
+
else if (indentStatements &&
|
199
|
+
(((ctx.type == "}" || ctx.type == "top") && curPunc != ';') ||
|
200
|
+
(ctx.type == "statement" && curPunc == "newstatement")))
|
201
|
+
pushContext(state, stream.column(), "statement");
|
202
|
+
|
203
|
+
state.startOfLine = false;
|
204
|
+
|
205
|
+
return style;
|
206
|
+
},
|
207
|
+
|
208
|
+
electricChars: "{}",
|
209
|
+
blockCommentStart: "/*",
|
210
|
+
blockCommentEnd: "*/",
|
211
|
+
lineComment: "//",
|
212
|
+
fold: "brace"
|
213
|
+
};
|
214
|
+
});
|
215
|
+
|
216
|
+
function words(str) {
|
217
|
+
var obj = {}, words = str.split(" ");
|
218
|
+
for (var i = 0; i < words.length; ++i) obj[words[i]] = true;
|
219
|
+
return obj;
|
220
|
+
}
|
221
|
+
|
222
|
+
function def(mimes, mode) {
|
223
|
+
if (typeof mimes == "string") mimes = [mimes];
|
224
|
+
var words = [];
|
225
|
+
function add(obj) {
|
226
|
+
if (obj) for (var prop in obj) if (obj.hasOwnProperty(prop))
|
227
|
+
words.push(prop);
|
228
|
+
}
|
229
|
+
|
230
|
+
add(mode.keywords);
|
231
|
+
add(mode.builtin);
|
232
|
+
add(mode.timerOps);
|
233
|
+
add(mode.portOps);
|
234
|
+
|
235
|
+
if (words.length) {
|
236
|
+
mode.helperType = mimes[0];
|
237
|
+
CodeMirror.registerHelper("hintWords", mimes[0], words);
|
238
|
+
}
|
239
|
+
|
240
|
+
for (var i = 0; i < mimes.length; ++i)
|
241
|
+
CodeMirror.defineMIME(mimes[i], mode);
|
242
|
+
}
|
243
|
+
|
244
|
+
def(["text/x-ttcn", "text/x-ttcn3", "text/x-ttcnpp"], {
|
245
|
+
name: "ttcn",
|
246
|
+
keywords: words("activate address alive all alt altstep and and4b any" +
|
247
|
+
" break case component const continue control deactivate" +
|
248
|
+
" display do else encode enumerated except exception" +
|
249
|
+
" execute extends extension external for from function" +
|
250
|
+
" goto group if import in infinity inout interleave" +
|
251
|
+
" label language length log match message mixed mod" +
|
252
|
+
" modifies module modulepar mtc noblock not not4b nowait" +
|
253
|
+
" of on optional or or4b out override param pattern port" +
|
254
|
+
" procedure record recursive rem repeat return runs select" +
|
255
|
+
" self sender set signature system template testcase to" +
|
256
|
+
" type union value valueof var variant while with xor xor4b"),
|
257
|
+
builtin: words("bit2hex bit2int bit2oct bit2str char2int char2oct encvalue" +
|
258
|
+
" decomp decvalue float2int float2str hex2bit hex2int" +
|
259
|
+
" hex2oct hex2str int2bit int2char int2float int2hex" +
|
260
|
+
" int2oct int2str int2unichar isbound ischosen ispresent" +
|
261
|
+
" isvalue lengthof log2str oct2bit oct2char oct2hex oct2int" +
|
262
|
+
" oct2str regexp replace rnd sizeof str2bit str2float" +
|
263
|
+
" str2hex str2int str2oct substr unichar2int unichar2char" +
|
264
|
+
" enum2int"),
|
265
|
+
types: words("anytype bitstring boolean char charstring default float" +
|
266
|
+
" hexstring integer objid octetstring universal verdicttype timer"),
|
267
|
+
timerOps: words("read running start stop timeout"),
|
268
|
+
portOps: words("call catch check clear getcall getreply halt raise receive" +
|
269
|
+
" reply send trigger"),
|
270
|
+
configOps: words("create connect disconnect done kill killed map unmap"),
|
271
|
+
verdictOps: words("getverdict setverdict"),
|
272
|
+
sutOps: words("action"),
|
273
|
+
functionOps: words("apply derefers refers"),
|
274
|
+
|
275
|
+
verdictConsts: words("error fail inconc none pass"),
|
276
|
+
booleanConsts: words("true false"),
|
277
|
+
otherConsts: words("null NULL omit"),
|
278
|
+
|
279
|
+
visibilityModifiers: words("private public friend"),
|
280
|
+
templateMatch: words("complement ifpresent subset superset permutation"),
|
281
|
+
multiLineStrings: true
|
282
|
+
});
|
283
|
+
});
|
@@ -0,0 +1,162 @@
|
|
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("turtle", function(config) {
|
15
|
+
var indentUnit = config.indentUnit;
|
16
|
+
var curPunc;
|
17
|
+
|
18
|
+
function wordRegexp(words) {
|
19
|
+
return new RegExp("^(?:" + words.join("|") + ")$", "i");
|
20
|
+
}
|
21
|
+
var ops = wordRegexp([]);
|
22
|
+
var keywords = wordRegexp(["@prefix", "@base", "a"]);
|
23
|
+
var operatorChars = /[*+\-<>=&|]/;
|
24
|
+
|
25
|
+
function tokenBase(stream, state) {
|
26
|
+
var ch = stream.next();
|
27
|
+
curPunc = null;
|
28
|
+
if (ch == "<" && !stream.match(/^[\s\u00a0=]/, false)) {
|
29
|
+
stream.match(/^[^\s\u00a0>]*>?/);
|
30
|
+
return "atom";
|
31
|
+
}
|
32
|
+
else if (ch == "\"" || ch == "'") {
|
33
|
+
state.tokenize = tokenLiteral(ch);
|
34
|
+
return state.tokenize(stream, state);
|
35
|
+
}
|
36
|
+
else if (/[{}\(\),\.;\[\]]/.test(ch)) {
|
37
|
+
curPunc = ch;
|
38
|
+
return null;
|
39
|
+
}
|
40
|
+
else if (ch == "#") {
|
41
|
+
stream.skipToEnd();
|
42
|
+
return "comment";
|
43
|
+
}
|
44
|
+
else if (operatorChars.test(ch)) {
|
45
|
+
stream.eatWhile(operatorChars);
|
46
|
+
return null;
|
47
|
+
}
|
48
|
+
else if (ch == ":") {
|
49
|
+
return "operator";
|
50
|
+
} else {
|
51
|
+
stream.eatWhile(/[_\w\d]/);
|
52
|
+
if(stream.peek() == ":") {
|
53
|
+
return "variable-3";
|
54
|
+
} else {
|
55
|
+
var word = stream.current();
|
56
|
+
|
57
|
+
if(keywords.test(word)) {
|
58
|
+
return "meta";
|
59
|
+
}
|
60
|
+
|
61
|
+
if(ch >= "A" && ch <= "Z") {
|
62
|
+
return "comment";
|
63
|
+
} else {
|
64
|
+
return "keyword";
|
65
|
+
}
|
66
|
+
}
|
67
|
+
var word = stream.current();
|
68
|
+
if (ops.test(word))
|
69
|
+
return null;
|
70
|
+
else if (keywords.test(word))
|
71
|
+
return "meta";
|
72
|
+
else
|
73
|
+
return "variable";
|
74
|
+
}
|
75
|
+
}
|
76
|
+
|
77
|
+
function tokenLiteral(quote) {
|
78
|
+
return function(stream, state) {
|
79
|
+
var escaped = false, ch;
|
80
|
+
while ((ch = stream.next()) != null) {
|
81
|
+
if (ch == quote && !escaped) {
|
82
|
+
state.tokenize = tokenBase;
|
83
|
+
break;
|
84
|
+
}
|
85
|
+
escaped = !escaped && ch == "\\";
|
86
|
+
}
|
87
|
+
return "string";
|
88
|
+
};
|
89
|
+
}
|
90
|
+
|
91
|
+
function pushContext(state, type, col) {
|
92
|
+
state.context = {prev: state.context, indent: state.indent, col: col, type: type};
|
93
|
+
}
|
94
|
+
function popContext(state) {
|
95
|
+
state.indent = state.context.indent;
|
96
|
+
state.context = state.context.prev;
|
97
|
+
}
|
98
|
+
|
99
|
+
return {
|
100
|
+
startState: function() {
|
101
|
+
return {tokenize: tokenBase,
|
102
|
+
context: null,
|
103
|
+
indent: 0,
|
104
|
+
col: 0};
|
105
|
+
},
|
106
|
+
|
107
|
+
token: function(stream, state) {
|
108
|
+
if (stream.sol()) {
|
109
|
+
if (state.context && state.context.align == null) state.context.align = false;
|
110
|
+
state.indent = stream.indentation();
|
111
|
+
}
|
112
|
+
if (stream.eatSpace()) return null;
|
113
|
+
var style = state.tokenize(stream, state);
|
114
|
+
|
115
|
+
if (style != "comment" && state.context && state.context.align == null && state.context.type != "pattern") {
|
116
|
+
state.context.align = true;
|
117
|
+
}
|
118
|
+
|
119
|
+
if (curPunc == "(") pushContext(state, ")", stream.column());
|
120
|
+
else if (curPunc == "[") pushContext(state, "]", stream.column());
|
121
|
+
else if (curPunc == "{") pushContext(state, "}", stream.column());
|
122
|
+
else if (/[\]\}\)]/.test(curPunc)) {
|
123
|
+
while (state.context && state.context.type == "pattern") popContext(state);
|
124
|
+
if (state.context && curPunc == state.context.type) popContext(state);
|
125
|
+
}
|
126
|
+
else if (curPunc == "." && state.context && state.context.type == "pattern") popContext(state);
|
127
|
+
else if (/atom|string|variable/.test(style) && state.context) {
|
128
|
+
if (/[\}\]]/.test(state.context.type))
|
129
|
+
pushContext(state, "pattern", stream.column());
|
130
|
+
else if (state.context.type == "pattern" && !state.context.align) {
|
131
|
+
state.context.align = true;
|
132
|
+
state.context.col = stream.column();
|
133
|
+
}
|
134
|
+
}
|
135
|
+
|
136
|
+
return style;
|
137
|
+
},
|
138
|
+
|
139
|
+
indent: function(state, textAfter) {
|
140
|
+
var firstChar = textAfter && textAfter.charAt(0);
|
141
|
+
var context = state.context;
|
142
|
+
if (/[\]\}]/.test(firstChar))
|
143
|
+
while (context && context.type == "pattern") context = context.prev;
|
144
|
+
|
145
|
+
var closing = context && firstChar == context.type;
|
146
|
+
if (!context)
|
147
|
+
return 0;
|
148
|
+
else if (context.type == "pattern")
|
149
|
+
return context.col;
|
150
|
+
else if (context.align)
|
151
|
+
return context.col + (closing ? 0 : 1);
|
152
|
+
else
|
153
|
+
return context.indent + (closing ? 0 : indentUnit);
|
154
|
+
},
|
155
|
+
|
156
|
+
lineComment: "#"
|
157
|
+
};
|
158
|
+
});
|
159
|
+
|
160
|
+
CodeMirror.defineMIME("text/turtle", "turtle");
|
161
|
+
|
162
|
+
});
|
@@ -0,0 +1,141 @@
|
|
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/multiplex"));
|
7
|
+
else if (typeof define == "function" && define.amd) // AMD
|
8
|
+
define(["../../lib/codemirror", "../../addon/mode/multiplex"], mod);
|
9
|
+
else // Plain browser env
|
10
|
+
mod(CodeMirror);
|
11
|
+
})(function(CodeMirror) {
|
12
|
+
"use strict";
|
13
|
+
|
14
|
+
CodeMirror.defineMode("twig:inner", function() {
|
15
|
+
var keywords = ["and", "as", "autoescape", "endautoescape", "block", "do", "endblock", "else", "elseif", "extends", "for", "endfor", "embed", "endembed", "filter", "endfilter", "flush", "from", "if", "endif", "in", "is", "include", "import", "not", "or", "set", "spaceless", "endspaceless", "with", "endwith", "trans", "endtrans", "blocktrans", "endblocktrans", "macro", "endmacro", "use", "verbatim", "endverbatim"],
|
16
|
+
operator = /^[+\-*&%=<>!?|~^]/,
|
17
|
+
sign = /^[:\[\(\{]/,
|
18
|
+
atom = ["true", "false", "null", "empty", "defined", "divisibleby", "divisible by", "even", "odd", "iterable", "sameas", "same as"],
|
19
|
+
number = /^(\d[+\-\*\/])?\d+(\.\d+)?/;
|
20
|
+
|
21
|
+
keywords = new RegExp("((" + keywords.join(")|(") + "))\\b");
|
22
|
+
atom = new RegExp("((" + atom.join(")|(") + "))\\b");
|
23
|
+
|
24
|
+
function tokenBase (stream, state) {
|
25
|
+
var ch = stream.peek();
|
26
|
+
|
27
|
+
//Comment
|
28
|
+
if (state.incomment) {
|
29
|
+
if (!stream.skipTo("#}")) {
|
30
|
+
stream.skipToEnd();
|
31
|
+
} else {
|
32
|
+
stream.eatWhile(/\#|}/);
|
33
|
+
state.incomment = false;
|
34
|
+
}
|
35
|
+
return "comment";
|
36
|
+
//Tag
|
37
|
+
} else if (state.intag) {
|
38
|
+
//After operator
|
39
|
+
if (state.operator) {
|
40
|
+
state.operator = false;
|
41
|
+
if (stream.match(atom)) {
|
42
|
+
return "atom";
|
43
|
+
}
|
44
|
+
if (stream.match(number)) {
|
45
|
+
return "number";
|
46
|
+
}
|
47
|
+
}
|
48
|
+
//After sign
|
49
|
+
if (state.sign) {
|
50
|
+
state.sign = false;
|
51
|
+
if (stream.match(atom)) {
|
52
|
+
return "atom";
|
53
|
+
}
|
54
|
+
if (stream.match(number)) {
|
55
|
+
return "number";
|
56
|
+
}
|
57
|
+
}
|
58
|
+
|
59
|
+
if (state.instring) {
|
60
|
+
if (ch == state.instring) {
|
61
|
+
state.instring = false;
|
62
|
+
}
|
63
|
+
stream.next();
|
64
|
+
return "string";
|
65
|
+
} else if (ch == "'" || ch == '"') {
|
66
|
+
state.instring = ch;
|
67
|
+
stream.next();
|
68
|
+
return "string";
|
69
|
+
} else if (stream.match(state.intag + "}") || stream.eat("-") && stream.match(state.intag + "}")) {
|
70
|
+
state.intag = false;
|
71
|
+
return "tag";
|
72
|
+
} else if (stream.match(operator)) {
|
73
|
+
state.operator = true;
|
74
|
+
return "operator";
|
75
|
+
} else if (stream.match(sign)) {
|
76
|
+
state.sign = true;
|
77
|
+
} else {
|
78
|
+
if (stream.eat(" ") || stream.sol()) {
|
79
|
+
if (stream.match(keywords)) {
|
80
|
+
return "keyword";
|
81
|
+
}
|
82
|
+
if (stream.match(atom)) {
|
83
|
+
return "atom";
|
84
|
+
}
|
85
|
+
if (stream.match(number)) {
|
86
|
+
return "number";
|
87
|
+
}
|
88
|
+
if (stream.sol()) {
|
89
|
+
stream.next();
|
90
|
+
}
|
91
|
+
} else {
|
92
|
+
stream.next();
|
93
|
+
}
|
94
|
+
|
95
|
+
}
|
96
|
+
return "variable";
|
97
|
+
} else if (stream.eat("{")) {
|
98
|
+
if (stream.eat("#")) {
|
99
|
+
state.incomment = true;
|
100
|
+
if (!stream.skipTo("#}")) {
|
101
|
+
stream.skipToEnd();
|
102
|
+
} else {
|
103
|
+
stream.eatWhile(/\#|}/);
|
104
|
+
state.incomment = false;
|
105
|
+
}
|
106
|
+
return "comment";
|
107
|
+
//Open tag
|
108
|
+
} else if (ch = stream.eat(/\{|%/)) {
|
109
|
+
//Cache close tag
|
110
|
+
state.intag = ch;
|
111
|
+
if (ch == "{") {
|
112
|
+
state.intag = "}";
|
113
|
+
}
|
114
|
+
stream.eat("-");
|
115
|
+
return "tag";
|
116
|
+
}
|
117
|
+
}
|
118
|
+
stream.next();
|
119
|
+
};
|
120
|
+
|
121
|
+
return {
|
122
|
+
startState: function () {
|
123
|
+
return {};
|
124
|
+
},
|
125
|
+
token: function (stream, state) {
|
126
|
+
return tokenBase(stream, state);
|
127
|
+
}
|
128
|
+
};
|
129
|
+
});
|
130
|
+
|
131
|
+
CodeMirror.defineMode("twig", function(config, parserConfig) {
|
132
|
+
var twigInner = CodeMirror.getMode(config, "twig:inner");
|
133
|
+
if (!parserConfig || !parserConfig.base) return twigInner;
|
134
|
+
return CodeMirror.multiplexingMode(
|
135
|
+
CodeMirror.getMode(config, parserConfig.base), {
|
136
|
+
open: /\{[{#%]/, close: /[}#%]\}/, mode: twigInner, parseDelimiters: true
|
137
|
+
}
|
138
|
+
);
|
139
|
+
});
|
140
|
+
CodeMirror.defineMIME("text/x-twig", "twig");
|
141
|
+
});
|