Version Description
March 17, 2016, dev time: 5 minutes
- FIX: Backwards-compatibility bugfix
Download this release
Release Info
Developer | aristath |
Plugin | Kirki |
Version | 2.2.2.1 |
Comparing to | |
See all releases |
Code changes from version 2.2.2 to 2.2.2.1
- README.md +7 -1
- assets/css/customizer.css +19 -0
- assets/css/customizer.css.map +2 -2
- assets/css/customizer.min.css +1 -1
- assets/js/controls/repeater.js +16 -2
- assets/js/customizer.js +16 -3
- assets/js/customizer.min.js +1 -1
- assets/js/customizer.min.js.map +1 -1
- assets/js/vendor/codemirror/mode/apl/apl.js +0 -174
- assets/js/vendor/codemirror/mode/apl/index.html +0 -72
- assets/js/vendor/codemirror/mode/asciiarmor/asciiarmor.js +0 -73
- assets/js/vendor/codemirror/mode/asciiarmor/index.html +0 -46
- assets/js/vendor/codemirror/mode/asn.1/asn.1.js +0 -204
- assets/js/vendor/codemirror/mode/asn.1/index.html +0 -78
- assets/js/vendor/codemirror/mode/asterisk/asterisk.js +0 -196
- assets/js/vendor/codemirror/mode/asterisk/index.html +0 -154
- assets/js/vendor/codemirror/mode/brainfuck/brainfuck.js +0 -85
- assets/js/vendor/codemirror/mode/brainfuck/index.html +0 -85
- assets/js/vendor/codemirror/mode/clike/clike.js +0 -775
- assets/js/vendor/codemirror/mode/clike/index.html +0 -360
- assets/js/vendor/codemirror/mode/clike/scala.html +0 -767
- assets/js/vendor/codemirror/mode/clike/test.js +0 -42
- assets/js/vendor/codemirror/mode/clojure/clojure.js +0 -244
- assets/js/vendor/codemirror/mode/clojure/index.html +0 -88
- assets/js/vendor/codemirror/mode/cmake/cmake.js +0 -97
- assets/js/vendor/codemirror/mode/cmake/index.html +0 -129
- assets/js/vendor/codemirror/mode/cobol/cobol.js +0 -255
- assets/js/vendor/codemirror/mode/cobol/index.html +0 -210
- assets/js/vendor/codemirror/mode/commonlisp/commonlisp.js +0 -123
- assets/js/vendor/codemirror/mode/commonlisp/index.html +0 -177
- assets/js/vendor/codemirror/mode/cypher/cypher.js +0 -146
- assets/js/vendor/codemirror/mode/cypher/index.html +0 -63
- assets/js/vendor/codemirror/mode/d/d.js +0 -218
- assets/js/vendor/codemirror/mode/d/index.html +0 -273
- assets/js/vendor/codemirror/mode/dart/dart.js +0 -130
- assets/js/vendor/codemirror/mode/dart/index.html +0 -71
- assets/js/vendor/codemirror/mode/diff/diff.js +0 -47
- assets/js/vendor/codemirror/mode/diff/index.html +0 -117
- assets/js/vendor/codemirror/mode/django/django.js +0 -350
- assets/js/vendor/codemirror/mode/django/index.html +0 -73
- assets/js/vendor/codemirror/mode/dockerfile/dockerfile.js +0 -79
- assets/js/vendor/codemirror/mode/dockerfile/index.html +0 -73
- assets/js/vendor/codemirror/mode/dtd/dtd.js +0 -142
- assets/js/vendor/codemirror/mode/dtd/index.html +0 -89
- assets/js/vendor/codemirror/mode/dylan/dylan.js +0 -291
- assets/js/vendor/codemirror/mode/dylan/index.html +0 -407
- assets/js/vendor/codemirror/mode/ebnf/ebnf.js +0 -195
- assets/js/vendor/codemirror/mode/ebnf/index.html +0 -102
- assets/js/vendor/codemirror/mode/ecl/ecl.js +0 -206
- assets/js/vendor/codemirror/mode/ecl/index.html +0 -52
- assets/js/vendor/codemirror/mode/eiffel/eiffel.js +0 -160
- assets/js/vendor/codemirror/mode/eiffel/index.html +0 -429
- assets/js/vendor/codemirror/mode/elm/elm.js +0 -205
- assets/js/vendor/codemirror/mode/elm/index.html +0 -61
- assets/js/vendor/codemirror/mode/erlang/erlang.js +0 -618
- assets/js/vendor/codemirror/mode/erlang/index.html +0 -76
- assets/js/vendor/codemirror/mode/factor/factor.js +0 -83
- assets/js/vendor/codemirror/mode/factor/index.html +0 -77
- assets/js/vendor/codemirror/mode/forth/forth.js +0 -180
- assets/js/vendor/codemirror/mode/forth/index.html +0 -75
- assets/js/vendor/codemirror/mode/fortran/fortran.js +0 -188
- assets/js/vendor/codemirror/mode/fortran/index.html +0 -81
- assets/js/vendor/codemirror/mode/gas/gas.js +0 -345
- assets/js/vendor/codemirror/mode/gas/index.html +0 -68
- assets/js/vendor/codemirror/mode/gfm/gfm.js +0 -130
- assets/js/vendor/codemirror/mode/gfm/index.html +0 -93
- assets/js/vendor/codemirror/mode/gfm/test.js +0 -230
- assets/js/vendor/codemirror/mode/gherkin/gherkin.js +0 -178
- assets/js/vendor/codemirror/mode/gherkin/index.html +0 -48
- assets/js/vendor/codemirror/mode/go/go.js +0 -185
- assets/js/vendor/codemirror/mode/go/index.html +0 -85
- assets/js/vendor/codemirror/mode/groovy/groovy.js +0 -230
- assets/js/vendor/codemirror/mode/groovy/index.html +0 -84
- assets/js/vendor/codemirror/mode/handlebars/handlebars.js +0 -53
- assets/js/vendor/codemirror/mode/handlebars/index.html +0 -83
- assets/js/vendor/codemirror/mode/haskell/haskell.js +0 -267
- assets/js/vendor/codemirror/mode/haskell/index.html +0 -73
- assets/js/vendor/codemirror/mode/haxe/haxe.js +0 -515
- assets/js/vendor/codemirror/mode/haxe/index.html +0 -124
- assets/js/vendor/codemirror/mode/http/http.js +0 -113
- assets/js/vendor/codemirror/mode/http/index.html +0 -45
- assets/js/vendor/codemirror/mode/idl/idl.js +0 -290
- assets/js/vendor/codemirror/mode/idl/index.html +0 -64
- assets/js/vendor/codemirror/mode/jade/index.html +0 -70
- assets/js/vendor/codemirror/mode/jade/jade.js +0 -590
- assets/js/vendor/codemirror/mode/jinja2/index.html +0 -54
- assets/js/vendor/codemirror/mode/jinja2/jinja2.js +0 -142
- assets/js/vendor/codemirror/mode/julia/index.html +0 -195
- assets/js/vendor/codemirror/mode/julia/julia.js +0 -299
- assets/js/vendor/codemirror/mode/livescript/index.html +0 -459
- assets/js/vendor/codemirror/mode/livescript/livescript.js +0 -280
- assets/js/vendor/codemirror/mode/lua/index.html +0 -85
- assets/js/vendor/codemirror/mode/lua/lua.js +0 -159
- assets/js/vendor/codemirror/mode/mathematica/index.html +0 -72
- assets/js/vendor/codemirror/mode/mathematica/mathematica.js +0 -175
- assets/js/vendor/codemirror/mode/mirc/index.html +0 -160
- assets/js/vendor/codemirror/mode/mirc/mirc.js +0 -193
- assets/js/vendor/codemirror/mode/mllike/index.html +0 -179
- assets/js/vendor/codemirror/mode/mllike/mllike.js +0 -205
- assets/js/vendor/codemirror/mode/modelica/index.html +0 -67
- assets/js/vendor/codemirror/mode/modelica/modelica.js +0 -245
- assets/js/vendor/codemirror/mode/mscgen/index.html +0 -65
- assets/js/vendor/codemirror/mode/mscgen/index_msgenny.html +0 -44
- assets/js/vendor/codemirror/mode/mscgen/index_xu.html +0 -70
- assets/js/vendor/codemirror/mode/mscgen/mscgen.js +0 -169
- assets/js/vendor/codemirror/mode/mscgen/mscgen_test.js +0 -75
- assets/js/vendor/codemirror/mode/mscgen/msgenny_test.js +0 -71
- assets/js/vendor/codemirror/mode/mscgen/xu_test.js +0 -75
- assets/js/vendor/codemirror/mode/mumps/index.html +0 -85
- assets/js/vendor/codemirror/mode/mumps/mumps.js +0 -148
- assets/js/vendor/codemirror/mode/nginx/index.html +0 -181
- assets/js/vendor/codemirror/mode/nginx/nginx.js +0 -178
- assets/js/vendor/codemirror/mode/nsis/index.html +0 -80
- assets/js/vendor/codemirror/mode/nsis/nsis.js +0 -95
- assets/js/vendor/codemirror/mode/ntriples/index.html +0 -45
- assets/js/vendor/codemirror/mode/ntriples/ntriples.js +0 -186
- assets/js/vendor/codemirror/mode/octave/index.html +0 -83
- assets/js/vendor/codemirror/mode/octave/octave.js +0 -135
- assets/js/vendor/codemirror/mode/oz/index.html +0 -59
- assets/js/vendor/codemirror/mode/oz/oz.js +0 -252
- assets/js/vendor/codemirror/mode/pascal/index.html +0 -61
- assets/js/vendor/codemirror/mode/pascal/pascal.js +0 -109
- assets/js/vendor/codemirror/mode/pegjs/index.html +0 -66
- assets/js/vendor/codemirror/mode/pegjs/pegjs.js +0 -114
- assets/js/vendor/codemirror/mode/perl/index.html +0 -75
- assets/js/vendor/codemirror/mode/perl/perl.js +0 -837
- assets/js/vendor/codemirror/mode/pig/index.html +0 -55
- assets/js/vendor/codemirror/mode/pig/pig.js +0 -178
- assets/js/vendor/codemirror/mode/properties/index.html +0 -53
- assets/js/vendor/codemirror/mode/properties/properties.js +0 -78
- assets/js/vendor/codemirror/mode/puppet/index.html +0 -121
- assets/js/vendor/codemirror/mode/puppet/puppet.js +0 -220
- assets/js/vendor/codemirror/mode/python/index.html +0 -198
- assets/js/vendor/codemirror/mode/python/python.js +0 -347
- assets/js/vendor/codemirror/mode/q/index.html +0 -144
- assets/js/vendor/codemirror/mode/q/q.js +0 -139
- assets/js/vendor/codemirror/mode/r/index.html +0 -85
- assets/js/vendor/codemirror/mode/r/r.js +0 -162
- assets/js/vendor/codemirror/mode/rpm/changes/index.html +0 -66
- assets/js/vendor/codemirror/mode/rpm/index.html +0 -149
- assets/js/vendor/codemirror/mode/rpm/rpm.js +0 -109
- assets/js/vendor/codemirror/mode/rst/index.html +0 -535
- assets/js/vendor/codemirror/mode/rst/rst.js +0 -377
README.md
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
**Donate link:** http://kirki.org/
|
5 |
**Requires at least:** 4.4
|
6 |
**Tested up to:** 4.5
|
7 |
-
**Stable tag:** 2.2.2
|
8 |
**License:** GPLv2 or later
|
9 |
**License URI:** http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -37,6 +37,12 @@ If you want to integrate Kirki in your theme or plugin, please read the instruct
|
|
37 |
|
38 |
## Changelog ##
|
39 |
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
### 2.2.2 ###
|
41 |
|
42 |
March 17, 2016, dev time: 10 minutes
|
4 |
**Donate link:** http://kirki.org/
|
5 |
**Requires at least:** 4.4
|
6 |
**Tested up to:** 4.5
|
7 |
+
**Stable tag:** 2.2.2.1
|
8 |
**License:** GPLv2 or later
|
9 |
**License URI:** http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
37 |
|
38 |
## Changelog ##
|
39 |
|
40 |
+
### 2.2.2.1 ###
|
41 |
+
|
42 |
+
March 17, 2016, dev time: 5 minutes
|
43 |
+
|
44 |
+
* FIX: Backwards-compatibility bugfix
|
45 |
+
|
46 |
### 2.2.2 ###
|
47 |
|
48 |
March 17, 2016, dev time: 10 minutes
|
assets/css/customizer.css
CHANGED
@@ -159,6 +159,18 @@ input[type="text"] {
|
|
159 |
display: block;
|
160 |
margin-top: 0 !important; }
|
161 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
162 |
.customize-control-kirki-checkbox input[type="checkbox"],
|
163 |
.customize-control-multicheck input[type="checkbox"],
|
164 |
.customize-control-repeater input[type="checkbox"] {
|
@@ -819,6 +831,13 @@ span.CodeMirror-selectedtext {
|
|
819 |
.kirki-image-attachment img {
|
820 |
display: inline-block; }
|
821 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
822 |
.selectize-control {
|
823 |
position: relative; }
|
824 |
.selectize-control.single .selectize-input,
|
159 |
display: block;
|
160 |
margin-top: 0 !important; }
|
161 |
|
162 |
+
#customize-theme-controls .control-section.control-section-kirki-hover:hover:not(.open) > ul.accordion-section-content, #customize-theme-controls .control-section.control-section-kirki-hover:focus:not(.open) > ul.accordion-section-content, #customize-theme-controls .control-section.control-section-kirki-hover:active:not(.open) > ul.accordion-section-content {
|
163 |
+
position: fixed;
|
164 |
+
left: 300px;
|
165 |
+
width: 300px;
|
166 |
+
background: #eee;
|
167 |
+
display: block;
|
168 |
+
height: 100%;
|
169 |
+
max-height: 100vh;
|
170 |
+
overflow-y: scroll; }
|
171 |
+
#customize-theme-controls .control-section.control-section-kirki-hover:hover:not(.open) .customize-section-title, #customize-theme-controls .control-section.control-section-kirki-hover:focus:not(.open) .customize-section-title, #customize-theme-controls .control-section.control-section-kirki-hover:active:not(.open) .customize-section-title {
|
172 |
+
display: none; }
|
173 |
+
|
174 |
.customize-control-kirki-checkbox input[type="checkbox"],
|
175 |
.customize-control-multicheck input[type="checkbox"],
|
176 |
.customize-control-repeater input[type="checkbox"] {
|
831 |
.kirki-image-attachment img {
|
832 |
display: inline-block; }
|
833 |
|
834 |
+
.limit {
|
835 |
+
padding: 3px;
|
836 |
+
border-radius: 3px; }
|
837 |
+
.limit.highlight {
|
838 |
+
background: #D32F2F;
|
839 |
+
color: #fff; }
|
840 |
+
|
841 |
.selectize-control {
|
842 |
position: relative; }
|
843 |
.selectize-control.single .selectize-input,
|
assets/css/customizer.css.map
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
{
|
2 |
"version": 3,
|
3 |
-
"mappings": "AAQQ,4DAAyB;EACrB,aAAa,EAAE,4BAAwB;AAQvC,2FAA2B;EACvB,aAAa,EAAE,4BAAwB;EACvC,iGAAQ;IACJ,YAAY,EAAE,sBAAwB;IACtC,YAAY,EAAE,sBAAsB;;AASxD;WACY;EACR,QAAQ,EAAE,QAAQ;EAClB,OAAO,EAAE,YAAY;EACrB;;mBACQ;IACJ,QAAQ,EAAE,QAAQ;IAGlB,iBAAiB,EAAE,oBAAoB;IACvC,cAAc,EAAE,oBAAoB;IACpC,SAAS,EAAE,oBAAoB;IAI/B,UAAU,EAAE,MAAM;IAClB,OAAO,EAAE,CAAC;IACV,OAAO,EAAE,GAAG;IAEZ,cAAc,EAAE,IAAI;IACpB,UAAU,EAAE,SAAS;IACrB,gBAAgB,EAAE,KAAK;EAE3B;;;;yBAGc;IACV,UAAU,EAAE,OAAO;IACnB,OAAO,EAAE,CAAC;EAEd;;yBACc;IACV,gBAAgB,EAAE,CAAC;EAGvB;oBAAS;IACL,OAAO,EAAE,EAAE;IACX,QAAQ,EAAE,QAAQ;IAClB,UAAU,EAAE,WAAW;IACvB,MAAM,EAAE,IAAI;IAEZ,OAAO,EAAE,GAAG;IACZ,KAAK,EAAE,CAAC;IACR,MAAM,EAAE,CAAC;IACT,UAAU,EAAE,qBAAqB;IACjC,aAAa,EAAE,qBAAqB;IACpC,WAAW,EAAE,cAAc;IAC3B,IAAI,EAAE,IAAI;IACV,GAAG,EAAE,GAAG;EAGZ;mBAAQ;IACJ,OAAO,EAAE,eAAe;IAExB,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AAoB;IAChC,SAAS,EAAE,mCAAmC;AAKjD,kDAAyB;EACxB,KAAK,EAAE,iBAAiB;EACxB,KAAK,EAAE,IAAI;;AC/DZ,sCAAS;EACR,kBAAkB,EAAC,mCAA+B;EAClD,UAAU,EAAC,mCAA+B;EAC1C,OAAO,EAAE,IAAI;EACb,aAAa,EAAE,GAAG;EAClB,OAAO,EAAE,IAAI;EACb,SAAS,EAAE,IAAI;EACf,eAAe,EAAE,aAAa;EAE9B;;;;;;+CAMO;IACN,KAAK,EAAE,IAAI;IACX,KAAK,EAAE,IAAI;IACX,KAAK,EAAE,IAAI;IACX;;;;;;oDAAG;MACF,MAAM,EAAE,SAAS;EAGnB;;wDAEgB;IACf,KAAK,EAAE,GAAG;EAEX,6CAAO;IACN,KAAK,EAAE,IAAI",
|
4 |
-
"sources": ["../scss/global.scss","../scss/panels/expanded.scss","../scss/sections/expanded.scss","../scss/controls/checkbox.scss","../scss/controls/code.scss","../scss/controls/dimension.scss","../scss/controls/number.scss","../scss/controls/palette.scss","../scss/controls/radio.scss","../scss/controls/radio-buttonset.scss","../scss/controls/radio-image.scss","../scss/controls/repeater.scss","../scss/controls/select.scss","../scss/controls/slider.scss","../scss/controls/sortable.scss","../scss/controls/spacing.scss","../scss/controls/switch.scss","../scss/controls/generic.scss","../scss/controls/toggle.scss","../scss/controls/typography.scss"],
|
5 |
"names": [],
|
6 |
"file": "customizer.css"
|
7 |
}
|
1 |
{
|
2 |
"version": 3,
|
3 |
+
"mappings": "AAQQ,4DAAyB;EACrB,aAAa,EAAE,4BAAwB;AAQvC,2FAA2B;EACvB,aAAa,EAAE,4BAAwB;EACvC,iGAAQ;IACJ,YAAY,EAAE,sBAAwB;IACtC,YAAY,EAAE,sBAAsB;;AASxD;WACY;EACR,QAAQ,EAAE,QAAQ;EAClB,OAAO,EAAE,YAAY;EACrB;;mBACQ;IACJ,QAAQ,EAAE,QAAQ;IAGlB,iBAAiB,EAAE,oBAAoB;IACvC,cAAc,EAAE,oBAAo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AAE,IAAI;EACb,SAAS,EAAE,IAAI;EACf,eAAe,EAAE,aAAa;EAE9B;;;;;;+CAMO;IACN,KAAK,EAAE,IAAI;IACX,KAAK,EAAE,IAAI;IACX,KAAK,EAAE,IAAI;IACX;;;;;;oDAAG;MACF,MAAM,EAAE,SAAS;EAGnB;;wDAEgB;IACf,KAAK,EAAE,GAAG;EAEX,6CAAO;IACN,KAAK,EAAE,IAAI",
|
4 |
+
"sources": ["../scss/global.scss","../scss/panels/expanded.scss","../scss/sections/expanded.scss","../scss/sections/hover.scss","../scss/controls/checkbox.scss","../scss/controls/code.scss","../scss/controls/dimension.scss","../scss/controls/number.scss","../scss/controls/palette.scss","../scss/controls/radio.scss","../scss/controls/radio-buttonset.scss","../scss/controls/radio-image.scss","../scss/controls/repeater.scss","../scss/controls/select.scss","../scss/controls/slider.scss","../scss/controls/sortable.scss","../scss/controls/spacing.scss","../scss/controls/switch.scss","../scss/controls/generic.scss","../scss/controls/toggle.scss","../scss/controls/typography.scss"],
|
5 |
"names": [],
|
6 |
"file": "customizer.css"
|
7 |
}
|
assets/css/customizer.min.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
#customize-controls #customize-info .accordion-section-title{border-bottom:1px solid rgba(0,0,0,.3)}#customize-controls #customize-theme-controls .accordion-section>.accordion-section-title{border-bottom:1px solid rgba(0,0,0,.1)}#customize-controls #customize-theme-controls .accordion-section>.accordion-section-title:after{border-color:transparent!important}.hint,[data-hint]{position:relative;display:inline-block}.hint:after,.hint:before,[data-hint]:after,[data-hint]:before{position:absolute;-webkit-transform:translate3d(0,0,0);-moz-transform:translate3d(0,0,0);transform:translate3d(0,0,0);visibility:hidden;opacity:0;z-index:998;pointer-events:none;transition:.3s ease;transition-delay:250ms}.hint:focus:after,.hint:focus:before,.hint:hover:after,.hint:hover:before,[data-hint]:focus:after,[data-hint]:focus:before,[data-hint]:hover:after,[data-hint]:hover:before{visibility:visible;opacity:1}.hint:hover:after,.hint:hover:before,[data-hint]:hover:after,[data-hint]:hover:before{transition-delay:0}.hint:before,[data-hint]:before{content:'';position:absolute;background:0 0;border:none;z-index:999;width:0;height:0;border-top:5px solid transparent;border-bottom:5px solid transparent;border-left:5px solid #333;left:-5px;top:5px}.hint:after,[data-hint]:after{content:attr(data-hint);background:#333;color:#fff;padding:5px 10px;font-size:12px;line-height:14px;height:auto;margin-bottom:-14px;width:170px;max-width:170px;display:block;white-space:normal;text-align:right;position:relative;top:-22px;left:-195px}li.customize-control{position:relative}li.customize-control a.tooltip.hint--left{display:block;position:absolute;top:5px;right:-10px;border-radius:50%;color:#999;border:none;line-height:8px;width:20px;height:20px;z-index:10}.rtl li.customize-control a.tooltip.hint--left{right:auto;left:0}.rtl .hint:before,.rtl [data-hint]:before{left:20px;border-left:none;border-right:5px solid #333}.rtl .hint:after,.rtl [data-hint]:after{left:195px}customize-control-upload .current .container{border:1px solid rgba(0,0,0,.05)}#customize-controls .description{font-style:normal;font-weight:300;font-size:.9em}.customize-control-color-alpha .wp-picker-container{width:100%}.customize-control-color-alpha .wp-picker-container a.wp-color-result{width:auto;display:block;border:none;padding-left:40px}.customize-control-color-alpha .wp-picker-container a.wp-color-result:after{background:rgba(0,0,0,.25);color:#fff;border:none;-webkit-box-shadow:none;box-shadow:none}.customize-control-color-alpha .wp-picker-container a.wp-color-result:focus:after,.customize-control-color-alpha .wp-picker-container a.wp-color-result:hover:after{color:#fff}input{font-size:16px}input[type=text]{border:1px solid rgba(0,0,0,.1);background-image:none;background-position:0 0;background-repeat:repeat;border-radius:3px;padding:.5em}.wp-full-overlay.expanded #customize-footer-actions .kirki-footer-thanks{position:fixed;bottom:8px;left:150px;padding:0;width:90px;height:25px;background-image:url(../images/kirki-bottom.png);background-repeat:no-repeat;background-position:center center}#customize-theme-controls .control-panel.control-panel-kirki-expanded>ul.control-panel-content{position:relative;left:0;display:block!important;margin-top:0!important}#customize-theme-controls .control-panel.control-panel-kirki-expanded>ul.control-panel-content .accordion-section-title{margin-left:0}#customize-theme-controls .control-panel.control-panel-kirki-expanded>ul.control-panel-content>li.customize-info{margin-bottom:0;border-top:none}#customize-theme-controls .control-panel.control-panel-kirki-expanded>ul.control-panel-content>li.customize-info .accordion-section-title{border-bottom:none!important}#customize-theme-controls .control-section.control-section-kirki-expanded>ul.accordion-section-content{position:relative;left:0;display:block;margin-top:0!important}.customize-control-kirki-checkbox input[type=checkbox],.customize-control-multicheck input[type=checkbox],.customize-control-repeater input[type=checkbox]{position:relative;margin:0 1rem 0 0;cursor:pointer;margin-bottom:5px;width:22px;height:22px;border-radius:3px;-webkit-border-radius:3px}.customize-control-kirki-checkbox input[type=checkbox]:before,.customize-control-multicheck input[type=checkbox]:before,.customize-control-repeater input[type=checkbox]:before{content:"";position:absolute;left:0;z-index:1;width:100%;height:100%;border:none}.customize-control-kirki-checkbox input[type=checkbox]:after,.customize-control-multicheck input[type=checkbox]:after,.customize-control-repeater input[type=checkbox]:after{content:"";position:absolute;left:0;top:0;width:100%;height:100%;background:#f2f2f2;cursor:pointer;border-radius:3px;-webkit-border-radius:3px}.customize-control-kirki-checkbox input[type=checkbox]:checked:before,.customize-control-multicheck input[type=checkbox]:checked:before,.customize-control-repeater input[type=checkbox]:checked:before{content:"\f147";font-family:dashicons;font-size:25px;left:0;top:2px}.customize-control-kirki-checkbox input[type=checkbox]:checked:after,.customize-control-multicheck input[type=checkbox]:checked:after,.customize-control-repeater input[type=checkbox]:checked:after{background:#fff}.CodeMirror{font-family:monospace;height:300px;color:#000}.CodeMirror-lines{padding:4px 0}.CodeMirror pre{padding:0 4px}.CodeMirror-gutter-filler,.CodeMirror-scrollbar-filler{background-color:#fff}.CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7;white-space:nowrap}.CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999;white-space:nowrap}.CodeMirror-guttermarker{color:#000}.CodeMirror-guttermarker-subtle{color:#999}.CodeMirror-cursor{border-left:1px solid #000;border-right:none;width:0}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.cm-fat-cursor .CodeMirror-cursor{width:auto;border:0;background:#7e7}.cm-fat-cursor div.CodeMirror-cursors{z-index:1}.cm-animate-fat-cursor{width:auto;border:0;-webkit-animation:blink 1.06s steps(1) infinite;-moz-animation:blink 1.06s steps(1) infinite;animation:blink 1.06s steps(1) infinite;background-color:#7e7}@-moz-keyframes blink{50%{background-color:transparent}}@-webkit-keyframes blink{50%{background-color:transparent}}@keyframes blink{50%{background-color:transparent}}.cm-tab{display:inline-block;text-decoration:inherit}.CodeMirror-ruler{border-left:1px solid #ccc;position:absolute}.cm-s-default .cm-header{color:#00f}.cm-s-default .cm-quote{color:#090}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:700}.cm-em{font-style:italic}.cm-link{text-decoration:underline}.cm-strikethrough{text-decoration:line-through}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:#00f}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-variable-3{color:#085}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta,.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-invalidchar,.cm-s-default .cm-error{color:red}.CodeMirror-composing{border-bottom:2px solid}div.CodeMirror span.CodeMirror-matchingbracket{color:#0f0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#f22}.CodeMirror-matchingtag{background:rgba(255,150,0,.3)}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{position:relative;overflow:hidden;background:#fff}.CodeMirror-scroll{overflow:scroll!important;margin-bottom:-30px;margin-right:-30px;padding-bottom:30px;height:100%;outline:0;position:relative}.CodeMirror-sizer{position:relative;border-right:30px solid transparent}.CodeMirror-gutter-filler,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-vscrollbar{position:absolute;z-index:6;display:none}.CodeMirror-vscrollbar{right:0;top:0;overflow-x:hidden;overflow-y:scroll}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-y:hidden;overflow-x:scroll}.CodeMirror-scrollbar-filler{right:0;bottom:0}.CodeMirror-gutter-filler{left:0;bottom:0}.CodeMirror-gutters{position:absolute;left:0;top:0;z-index:3}.CodeMirror-gutter{white-space:normal;height:100%;display:inline-block;margin-bottom:-30px}.CodeMirror-gutter-wrapper{position:absolute;z-index:4;background:0 0!important;border:none!important;-webkit-user-select:none;-moz-user-select:none;user-select:none}.CodeMirror-gutter-background{position:absolute;top:0;bottom:0;z-index:4}.CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}.CodeMirror-lines{cursor:text;min-height:1px}.CodeMirror pre{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border-width:0;background:0 0;font-family:inherit;font-size:inherit;margin:0;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;position:relative;overflow:visible;-webkit-tap-highlight-color:transparent}.CodeMirror-wrap pre{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-linebackground{position:absolute;left:0;right:0;top:0;bottom:0;z-index:0}.CodeMirror-linewidget{position:relative;z-index:2;overflow:auto}.CodeMirror-code{outline:0}.CodeMirror-gutter,.CodeMirror-gutters,.CodeMirror-linenumber,.CodeMirror-scroll,.CodeMirror-sizer{-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden}.CodeMirror-cursor{position:absolute}.CodeMirror-measure pre{position:static}div.CodeMirror-cursors{visibility:hidden;position:relative;z-index:3}.CodeMirror-focused div.CodeMirror-cursors,div.CodeMirror-dragcursors{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected,.CodeMirror-line::selection,.CodeMirror-line>span::selection,.CodeMirror-line>span>span::selection{background:#d7d4f0}.CodeMirror-crosshair{cursor:crosshair}.CodeMirror-line::-moz-selection,.CodeMirror-line>span::-moz-selection,.CodeMirror-line>span>span::-moz-selection{background:#d7d4f0}.cm-searching{background:#ffa;background:rgba(255,255,0,.4)}.cm-force-border{padding-right:.1px}@media print{.CodeMirror div.CodeMirror-cursors{visibility:hidden}}.cm-tab-wrap-hack:after{content:''}span.CodeMirror-selectedtext{background:0 0}.customize-control-dimension .input-wrapper .invalid-value{display:none;background:#D32F2F;font-size:.85em;color:#fff;float:left;padding:2px 0;border-radius:3px}.customize-control-dimension .input-wrapper.invalid .invalid-value{display:block;width:98%;text-align:center}.customize-control-number .ui-spinner.ui-widget-content .ui-spinner-button .ui-button-text,.customize-control-palette input[type=radio]{display:none}.customize-control-dimension .input-wrapper.invalid input[type=text]:focus{border-color:#D32F2F}.customize-control-number .ui-spinner.ui-widget-content{position:relative}.customize-control-number .ui-spinner.ui-widget-content .ui-spinner-button{position:absolute;right:0;color:rgba(0,0,0,.3);border:none;padding:0 5px;width:20px;height:calc(50% + .5em);border-radius:0;-webkit-border-radius:0;box-shadow:none;-webkit-box-shadow:none;background:0 0;margin:0}.customize-control-number .ui-spinner.ui-widget-content .ui-spinner-button.ui-spinner-down:before,.customize-control-number .ui-spinner.ui-widget-content .ui-spinner-button.ui-spinner-up:before{font-family:dashicons;position:absolute;left:0}.customize-control-number .ui-spinner.ui-widget-content .ui-spinner-button.ui-spinner-up{top:-50%}.customize-control-number .ui-spinner.ui-widget-content .ui-spinner-button.ui-spinner-up:before{content:"\f343"}.customize-control-number .ui-spinner.ui-widget-content .ui-spinner-button.ui-spinner-down{top:50%}.customize-control-number .ui-spinner.ui-widget-content .ui-spinner-button.ui-spinner-down:before{content:"\f347"}.customize-control-number .ui-spinner.ui-widget-content .ui-spinner-button:hover{color:rgba(0,0,0,.7)}.customize-control-palette input[type=radio]:checked+label{border:3px solid rgba(0,0,0,.4)}.customize-control-palette label{background:0 0;padding:0;border-top:3px solid transparent;border-bottom:3px solid transparent;margin-bottom:5px;display:flex}.customize-control-palette label span{padding:10px 0;flex-grow:1;font-size:0;line-height:10px;color:transparent;-webkit-transition:all .2s ease-in-out;-moz-transition:all .2s ease-in-out;-ms-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out;border-top:1px solid rgba(0,0,0,.1);border-bottom:1px solid rgba(0,0,0,.1)}.customize-control-palette label span:first-child{border-left:1px solid rgba(0,0,0,.1)}.customize-control-palette label span:last-child{border-right:1px solid rgba(0,0,0,.1)}.customize-control-palette label span:hover{padding:10px;flex-grow:3;min-width:60px;font-size:10px;line-height:10px;color:#000}.customize-control-kirki-radio input[type=radio]{width:18px;height:18px}.customize-control-kirki-radio input[type=radio]:checked:before{width:10px;height:10px;margin:3px}.customize-control-kirki-radio label{display:list-item;margin-bottom:7px}.customize-control-kirki-radio label .option-description{display:block;color:rgba(0,0,0,.35);font-size:.9em;padding-left:25px}.customize-control-radio-buttonset .buttonset .switch-label{background:rgba(0,0,0,.05);color:#555;border-right:1px solid rgba(0,0,0,.2);padding:4px 7px;margin:0;font-size:12px}.customize-control-radio-buttonset .buttonset .switch-label:last-child{border-right:none}.customize-control-radio-buttonset .buttonset .switch-input{display:none}.customize-control-radio-buttonset .buttonset .switch-input:checked+.switch-label{background-color:#3498DB;color:#fff}.customize-control-radio-image label{position:relative;display:inline-block}.customize-control-radio-image input,.customize-control-repeater .repeater-fields .repeater-row .repeater-field.repeater-field-radio-image input{display:none}.customize-control-radio-image input img{border:1px solid transparent}.customize-control-radio-image input:checked+label img{-webkit-box-shadow:0 0 5px 2px rgba(0,0,0,.25);box-shadow:0 0 5px 2px rgba(0,0,0,.25);border:1px solid #3498DB}.customize-control-radio-image input+label .image-clickable{position:absolute;top:0;bottom:0;left:0;right:0;width:100%;height:100%}.customize-control-repeater .repeater-fields .repeater-row{padding:.5rem;border:1px solid #999;margin-top:.5rem;background:#eee;position:relative;padding-top:48px}.customize-control-repeater .repeater-fields .repeater-row label{margin-bottom:12px;clear:both}.customize-control-repeater .repeater-fields .repeater-row .repeater-field.repeater-field-radio-image input img{border:1px solid transparent}.customize-control-repeater .repeater-fields .repeater-row .repeater-field.repeater-field-radio-image input:checked+label img{-webkit-box-shadow:0 0 5px 2px rgba(0,0,0,.25);box-shadow:0 0 5px 2px rgba(0,0,0,.25);border:1px solid #3498DB}.customize-control-repeater button.repeater-add{margin-top:1rem}.customize-control-repeater .repeater-field{margin-bottom:12px;width:100%;clear:both;padding-bottom:12px;border-bottom:1px dotted #CCC}.customize-control-repeater .repeater-row .repeater-field:last-child{border-bottom:none;padding-bottom:0}.customize-control-repeater .repeater-field-select select{margin-left:0}.customize-control-repeater .repeater-field-checkbox label{line-height:28px}.customize-control-repeater .repeater-field-checkbox input{line-height:28px;margin-right:5px}.customize-control-repeater .repeater-field-textarea textarea{width:100%;resize:vertical}.customize-control-repeater .repeater-row-header{background:#fff;position:absolute;top:0;left:0;right:0;height:36px;color:#555;border-bottom:1px solid #999;line-height:36px;font-size:15px}.customize-control-repeater .repeater-row-number{border-right:1px solid #ddd;display:inline-block;width:35px;text-align:center}.customize-control-repeater .repeater-row-minimize,.customize-control-repeater .repeater-row-move,.customize-control-repeater .repeater-row-remove{display:inline-block;float:right;border-left:1px solid #ddd;width:35px;height:36px;text-align:center}.customize-control-repeater .repeater-row-minimize:hover,.customize-control-repeater .repeater-row-move:hover,.customize-control-repeater .repeater-row-remove:hover{background:#ddd;cursor:pointer}.customize-control-repeater .repeater-row-move:hover{cursor:move}.customize-control-repeater .repeater-minimize,.customize-control-repeater .repeater-move,.customize-control-repeater .repeater-remove{line-height:36px}.customize-control-repeater .repeater-row.minimized{padding:0;height:36px;overflow:hidden}.customize-control-repeater .remove-button,.customize-control-repeater .upload-button{width:48%}.kirki-image-attachment{margin:0;text-align:center;margin-bottom:25px}.kirki-image-attachment img{display:inline-block}.selectize-control{position:relative}.selectize-control.single .selectize-input,.selectize-control.single .selectize-input input{cursor:pointer}.selectize-control.single .selectize-input.input-active,.selectize-control.single .selectize-input.input-active input{cursor:text}.selectize-control.single .selectize-input:after{content:"\f347";display:block;position:absolute;top:0;right:0;margin-top:0;width:12px;height:36px;font-family:dashicons;border-left:1px solid rgba(0,0,0,.06);line-height:36px;padding:0 3px}.selectize-control.single .selectize-input.dropdown-active:after{content:"\f343";border-left:1px solid rgba(0,0,0,.1)}.selectize-control.single .selectize-input.disabled{opacity:.5;background-color:#fafafa}.selectize-control.single.rtl .selectize-input:after{left:15px;right:auto}.selectize-control.rtl .selectize-input>input{margin:0 4px 0 -2px!important}.selectize-control .plugin-drag_drop.multi>.selectize-input>div.ui-sortable-placeholder{visibility:visible!important;background:#f2f2f2!important;background:rgba(0,0,0,.06)!important;border:0!important;-webkit-box-shadow:inset 0 0 12px 4px #fff;box-shadow:inset 0 0 12px 4px #fff}.selectize-control .plugin-drag_drop .ui-sortable-placeholder::after{content:'!';visibility:hidden}.selectize-control .plugin-drag_drop .ui-sortable-helper{-webkit-box-shadow:0 2px 5px rgba(0,0,0,.2);box-shadow:0 2px 5px rgba(0,0,0,.2)}.selectize-control .plugin-remove_button [data-value]{position:relative;padding-right:24px!important}.selectize-control .plugin-remove_button [data-value] .remove{z-index:1;position:absolute;top:0;right:0;bottom:0;width:17px;text-align:center;font-weight:700;font-size:12px;color:inherit;text-decoration:none;vertical-align:middle;display:inline-block;padding:2px 0 0;border-left:1px solid #d0d0d0;-webkit-border-radius:0 2px 2px 0;-moz-border-radius:0 2px 2px 0;border-radius:0 2px 2px 0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.selectize-control .plugin-remove_button .remove:hover{background:rgba(0,0,0,.05)}.selectize-control .plugin-remove_button.active .remove{border-left-color:#cacaca}.selectize-control .plugin .disabled [data-value] .remove:hover{background:0 0}.selectize-control .plugin .disabled [data-value] .remove{border-left-color:#fff}.selectize-control.multi .selectize-input{min-height:36px}.selectize-control.multi .selectize-input.has-items{padding:6px 8px 3px}.selectize-control.multi .selectize-input>div{cursor:pointer;margin:0 3px 3px 0;padding:2px 6px;background:#f2f2f2;color:#303030;border:0 solid #d0d0d0}.selectize-control.multi .selectize-input>div.active{background:#e8e8e8;color:#303030;border:0 solid #cacaca}.selectize-control.multi .selectize-input.disabled>div,.selectize-control.multi .selectize-input.disabled>div.active{color:#7d7d7d;background:#fff;border:0 solid #fff}.selectize-dropdown{position:relative;top:-4px!important;border:1px solid #d0d0d0;background:#fff;margin:-1px 0 0;border-top:0 none;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-box-shadow:0 1px 3px rgba(0,0,0,.1);box-shadow:0 1px 3px rgba(0,0,0,.1);-webkit-border-radius:0 0 3px 3px;-moz-border-radius:0 0 3px 3px;border-radius:0 0 3px 3px;z-index:999}.selectize-dropdown-header{position:relative;padding:5px 8px;border-bottom:1px solid #d0d0d0;background:#f8f8f8;-webkit-border-radius:3px 3px 0 0;-moz-border-radius:3px 3px 0 0;border-radius:3px 3px 0 0}.selectize-dropdown-header-close{position:absolute;right:8px;top:50%;color:#303030;opacity:.4;margin-top:-12px;line-height:20px;font-size:20px!important}.selectize-dropdown-header-close:hover{color:#000}.selectize-dropdown.plugin-optgroup_columns .optgroup{border-right:1px solid #f2f2f2;border-top:0 none;float:left;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.selectize-dropdown.plugin-optgroup_columns .optgroup:last-child{border-right:0 none}.selectize-dropdown.plugin-optgroup_columns .optgroup:before{display:none}.selectize-dropdown.plugin-optgroup_columns .optgroup-header{border-top:0 none}.selectize-dropdown,.selectize-input,.selectize-input input{color:#303030;font-family:inherit;font-size:13px;line-height:18px;-webkit-font-smoothing:inherit}.selectize-control.single .selectize-input.input-active,.selectize-input{background:#fff;cursor:text;display:inline-block}.selectize-input{border:1px solid rgba(0,0,0,.1);padding:8px;display:inline-block;width:100%;overflow:hidden;position:relative;z-index:1;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.selectize-input.full{background-color:#fff}.selectize-input.disabled,.selectize-input.disabled *{cursor:default!important}.selectize-input.focus{-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.15);box-shadow:inset 0 1px 2px rgba(0,0,0,.15)}.selectize-input.dropdown-active{-webkit-border-radius:3px 3px 0 0;-moz-border-radius:3px 3px 0 0;border-radius:3px 3px 0 0}.selectize-input>*{vertical-align:baseline;display:-moz-inline-stack;display:inline-block;zoom:1}.selectize-input>input{display:inline-block!important;padding:0!important;min-height:0!important;max-height:none!important;max-width:100%!important;margin:0 2px 0 0!important;text-indent:0!important;border:0!important;background:0 0!important;line-height:inherit!important;-webkit-user-select:auto!important;-webkit-box-shadow:none!important;box-shadow:none!important}.selectize-input>input::-ms-clear{display:none}.selectize-input>input:focus{outline:0!important}.selectize-input::after{content:' ';display:block;clear:left}.selectize-input.dropdown-active::before{content:' ';display:block;position:absolute;background:#f0f0f0;height:1px;bottom:0;left:0;right:0}.selectize-dropdown [data-selectable]{cursor:pointer;overflow:hidden}.selectize-dropdown [data-selectable] .highlight{background:rgba(125,168,208,.2);-webkit-border-radius:1px;-moz-border-radius:1px;border-radius:1px}.selectize-dropdown .optgroup-header,.selectize-dropdown [data-selectable]{padding:5px 8px}.selectize-dropdown .optgroup:first-child .optgroup-header{border-top:0 none}.selectize-dropdown .optgroup-header{color:#303030;background:#fff;cursor:default}.selectize-dropdown .active{background-color:#f5fafd;color:#495c68}.selectize-dropdown .active.create{color:#495c68}.selectize-dropdown .create{color:rgba(48,48,48,.5)}.selectize-dropdown-content{overflow-y:auto;overflow-x:hidden;max-height:200px}.customize-control-slider input[type=range]{-webkit-appearance:none;-webkit-transition:background .3s;-moz-transition:background .3s;transition:background .3s;background-color:rgba(0,0,0,.1);height:5px;width:calc(100% - 70px);padding:0}.customize-control-slider input[type=range]:focus{box-shadow:none;outline:0}.customize-control-slider input[type=range]:hover{background-color:rgba(0,0,0,.25)}.customize-control-slider input[type=range]::-webkit-slider-thumb{-webkit-border-radius:50%;-webkit-appearance:none;width:15px;height:15px;border:none;border-radius:50%;background-color:#3498D9}.customize-control-slider input[type=range]::-moz-range-thumb{width:15px;height:15px;border:none;border-radius:50%;background-color:#3498D9}.customize-control-slider input[type=range]::-ms-thumb{width:15px;height:15px;border-radius:50%;border:0;background-color:#3498D9}.customize-control-slider input[type=range]::-moz-range-track{border:inherit;background:0 0}.customize-control-slider input[type=range]::-ms-track{border:inherit;color:transparent;background:0 0}.customize-control-slider input[type=range]::-ms-fill-lower,.customize-control-slider input[type=range]::-ms-fill-upper{background:0 0}.customize-control-slider input[type=range]::-ms-tooltip{display:none}.customize-control-slider .kirki_range_value{display:inline-block;font-size:14px;padding:0 5px;font-weight:400;position:relative;top:2px}.customize-control-slider .kirki-slider-reset{color:rgba(0,0,0,.2);float:right;-webkit-transition:color .5s ease-in;-moz-transition:color .5s ease-in;-ms-transition:color .5s ease-in;-o-transition:color .5s ease-in;transition:color .5s ease-in}.customize-control-slider .kirki-slider-reset span{font-size:16px;line-height:22px}.customize-control-slider .kirki-slider-reset:hover{color:red}.customize-control-sortable ul.ui-sortable li{padding:5px 10px;border:1px solid #333;background:#fff}.customize-control-sortable ul.ui-sortable li .dashicons.dashicons-menu{float:right}.customize-control-sortable ul.ui-sortable li .dashicons.visibility{margin-right:10px}.customize-control-sortable ul.ui-sortable li.invisible{color:#aaa;border:1px dashed #aaa}.customize-control-sortable ul.ui-sortable li.invisible .dashicons.visibility{color:#aaa}.customize-control-spacing .wrapper{-webkit-box-shadow:inset 0 0 5px 2px rgba(0,0,0,.1);box-shadow:inset 0 0 5px 2px rgba(0,0,0,.1);width:96%;padding:3%}.customize-control-spacing .wrapper .control{display:flex;flex-wrap:wrap;justify-content:space-between}.customize-control-spacing .wrapper .control>div{width:48%}.customize-control-spacing .wrapper .control>div h5{margin:10px 0 7px}.customize-control-spacing .wrapper .control>div .inner{display:flex}.customize-control-spacing .wrapper .control>div .inner input[type=number]{width:50%;height:36px}.customize-control-spacing .wrapper .control>div .inner .selectize-control.single{width:50%}.customize-control-spacing .wrapper .control>div .inner .selectize-control.single>.selectize-input{height:36px}.customize-control-spacing .wrapper .input-wrapper .invalid-value{display:none;background:#D32F2F;font-size:.85em;color:#fff;float:left;padding:2px 0;border-radius:3px}.customize-control-spacing .wrapper .input-wrapper.invalid .invalid-value{display:block;width:98%;text-align:center}.customize-control-spacing .wrapper .input-wrapper.invalid input[type=text]:focus{border-color:#D32F2F}.customize-control-switch input[type=checkbox]{display:none}.customize-control-switch .switch{border:none;margin-bottom:1.5rem;outline:0;padding:0;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.customize-control-switch .switch label{background:rgba(0,0,0,.2);color:transparent;cursor:pointer;display:block;margin-bottom:1rem;position:relative;text-indent:100%;transition:left .15s ease-out;height:2rem;width:4rem}.customize-control-switch .switch label:after{background:#FFF;content:"";display:block;height:1.5rem;left:.25rem;position:absolute;top:.25rem;width:1.5rem;-webkit-transition:left .15s ease-out;-moz-transition:left .15s ease-out;-o-transition:translate3d(0,0,0);transition:left .15s ease-out;-webkit-transform:translate3d(0,0,0);-moz-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);-o-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.customize-control-switch .switch input{left:10px;opacity:0;padding:0;position:absolute;top:9px}.customize-control-switch .switch input+label{margin-left:0;margin-right:0}.customize-control-switch .switch input:checked+label{background:#3498DB}.customize-control-switch .switch input:checked+label:after{left:2.25rem;background:#fff}.customize-control-switch .switch.round{border-radius:1000px}.customize-control-switch .switch.round label,.customize-control-switch .switch.round label:after{border-radius:2rem}.customize-control-switch .switch-on{position:absolute;left:-55px;top:8px;color:#fff;font-weight:700;font-size:9px}.customize-control-switch .switch-off{position:absolute;left:-25px;top:8px;color:#fff;font-weight:700;font-size:9px}.customize-control-kirki-generic textarea{width:100%;border:1px solid rgba(0,0,0,.1);-webkit-box-shadow:none;box-shadow:none}.customize-control-toggle input[type=checkbox]{display:none}.customize-control-toggle .switch{border:1px solid rgba(0,0,0,.1);display:inline-block;width:35px;height:12px;border-radius:8px;background:#ccc;vertical-align:middle;position:relative;cursor:pointer;user-select:none;transition:background 350ms ease}.customize-control-toggle .switch:after,.customize-control-toggle .switch:before{content:"";display:block;width:20px;height:20px;border-radius:50%;position:absolute;top:50%;left:-3px;transition:all 350ms cubic-bezier(0,.95,.38,.98),background 150ms ease}.customize-control-toggle .switch:before{background:rgba(0,0,0,.2);transform:translate3d(0,-50%,0) scale(0)}.customize-control-toggle .switch:after{background:#999;border:1px solid rgba(0,0,0,.1);transform:translate3d(0,-50%,0)}.customize-control-toggle .switch:active:before{transform:translate3d(0,-50%,0) scale(3)}.customize-control-toggle input:checked+.switch{background:rgba(52,152,222,.3)}.customize-control-toggle input:checked+.switch:before{background:rgba(52,152,222,.075);transform:translate3d(100%,-50%,0) scale(1)}.customize-control-toggle input:checked+.switch:after{background:#3498DE;transform:translate3d(100%,-50%,0)}.customize-control-toggle input:checked+.switch:active:before{background:rgba(52,152,222,.075);transform:translate3d(100%,-50%,0) scale(3)}.customize-control-toggle .customize-control-title{width:calc(100% - 50px);float:left}.customize-control-typography .wrapper{-webkit-box-shadow:inset 0 0 10px 0 rgba(0,0,0,.1);box-shadow:inset 0 0 10px 0 rgba(0,0,0,.1);padding:10px;border-radius:3px;display:flex;flex-wrap:wrap;justify-content:space-between}.customize-control-typography .wrapper .color,.customize-control-typography .wrapper .font-family,.customize-control-typography .wrapper .font-size,.customize-control-typography .wrapper .letter-spacing,.customize-control-typography .wrapper .line-height,.customize-control-typography .wrapper .subset,.customize-control-typography .wrapper .variant{width:100%;float:none;clear:both}.customize-control-typography .wrapper .color h5,.customize-control-typography .wrapper .font-family h5,.customize-control-typography .wrapper .font-size h5,.customize-control-typography .wrapper .letter-spacing h5,.customize-control-typography .wrapper .line-height h5,.customize-control-typography .wrapper .subset h5,.customize-control-typography .wrapper .variant h5{margin:.67em 0 0}.customize-control-typography .wrapper .font-size,.customize-control-typography .wrapper .letter-spacing,.customize-control-typography .wrapper .line-height{width:50%}.customize-control-typography .wrapper .color{width:auto}
|
1 |
+
#customize-controls #customize-info .accordion-section-title{border-bottom:1px solid rgba(0,0,0,.3)}#customize-controls #customize-theme-controls .accordion-section>.accordion-section-title{border-bottom:1px solid rgba(0,0,0,.1)}#customize-controls #customize-theme-controls .accordion-section>.accordion-section-title:after{border-color:transparent!important}.hint,[data-hint]{position:relative;display:inline-block}.hint:after,.hint:before,[data-hint]:after,[data-hint]:before{position:absolute;-webkit-transform:translate3d(0,0,0);-moz-transform:translate3d(0,0,0);transform:translate3d(0,0,0);visibility:hidden;opacity:0;z-index:998;pointer-events:none;transition:.3s ease;transition-delay:250ms}.hint:focus:after,.hint:focus:before,.hint:hover:after,.hint:hover:before,[data-hint]:focus:after,[data-hint]:focus:before,[data-hint]:hover:after,[data-hint]:hover:before{visibility:visible;opacity:1}.hint:hover:after,.hint:hover:before,[data-hint]:hover:after,[data-hint]:hover:before{transition-delay:0}.hint:before,[data-hint]:before{content:'';position:absolute;background:0 0;border:none;z-index:999;width:0;height:0;border-top:5px solid transparent;border-bottom:5px solid transparent;border-left:5px solid #333;left:-5px;top:5px}.hint:after,[data-hint]:after{content:attr(data-hint);background:#333;color:#fff;padding:5px 10px;font-size:12px;line-height:14px;height:auto;margin-bottom:-14px;width:170px;max-width:170px;display:block;white-space:normal;text-align:right;position:relative;top:-22px;left:-195px}li.customize-control{position:relative}li.customize-control a.tooltip.hint--left{display:block;position:absolute;top:5px;right:-10px;border-radius:50%;color:#999;border:none;line-height:8px;width:20px;height:20px;z-index:10}.rtl li.customize-control a.tooltip.hint--left{right:auto;left:0}.rtl .hint:before,.rtl [data-hint]:before{left:20px;border-left:none;border-right:5px solid #333}.rtl .hint:after,.rtl [data-hint]:after{left:195px}customize-control-upload .current .container{border:1px solid rgba(0,0,0,.05)}#customize-controls .description{font-style:normal;font-weight:300;font-size:.9em}.customize-control-color-alpha .wp-picker-container{width:100%}.customize-control-color-alpha .wp-picker-container a.wp-color-result{width:auto;display:block;border:none;padding-left:40px}.customize-control-color-alpha .wp-picker-container a.wp-color-result:after{background:rgba(0,0,0,.25);color:#fff;border:none;-webkit-box-shadow:none;box-shadow:none}.customize-control-color-alpha .wp-picker-container a.wp-color-result:focus:after,.customize-control-color-alpha .wp-picker-container a.wp-color-result:hover:after{color:#fff}input{font-size:16px}input[type=text]{border:1px solid rgba(0,0,0,.1);background-image:none;background-position:0 0;background-repeat:repeat;border-radius:3px;padding:.5em}.wp-full-overlay.expanded #customize-footer-actions .kirki-footer-thanks{position:fixed;bottom:8px;left:150px;padding:0;width:90px;height:25px;background-image:url(../images/kirki-bottom.png);background-repeat:no-repeat;background-position:center center}#customize-theme-controls .control-panel.control-panel-kirki-expanded>ul.control-panel-content{position:relative;left:0;display:block!important;margin-top:0!important}#customize-theme-controls .control-panel.control-panel-kirki-expanded>ul.control-panel-content .accordion-section-title{margin-left:0}#customize-theme-controls .control-panel.control-panel-kirki-expanded>ul.control-panel-content>li.customize-info{margin-bottom:0;border-top:none}#customize-theme-controls .control-panel.control-panel-kirki-expanded>ul.control-panel-content>li.customize-info .accordion-section-title{border-bottom:none!important}#customize-theme-controls .control-section.control-section-kirki-expanded>ul.accordion-section-content{position:relative;left:0;display:block;margin-top:0!important}#customize-theme-controls .control-section.control-section-kirki-hover:active:not(.open)>ul.accordion-section-content,#customize-theme-controls .control-section.control-section-kirki-hover:focus:not(.open)>ul.accordion-section-content,#customize-theme-controls .control-section.control-section-kirki-hover:hover:not(.open)>ul.accordion-section-content{position:fixed;left:300px;width:300px;background:#eee;display:block;height:100%;max-height:100vh;overflow-y:scroll}#customize-theme-controls .control-section.control-section-kirki-hover:active:not(.open) .customize-section-title,#customize-theme-controls .control-section.control-section-kirki-hover:focus:not(.open) .customize-section-title,#customize-theme-controls .control-section.control-section-kirki-hover:hover:not(.open) .customize-section-title{display:none}.customize-control-kirki-checkbox input[type=checkbox],.customize-control-multicheck input[type=checkbox],.customize-control-repeater input[type=checkbox]{position:relative;margin:0 1rem 0 0;cursor:pointer;margin-bottom:5px;width:22px;height:22px;border-radius:3px;-webkit-border-radius:3px}.customize-control-kirki-checkbox input[type=checkbox]:before,.customize-control-multicheck input[type=checkbox]:before,.customize-control-repeater input[type=checkbox]:before{content:"";position:absolute;left:0;z-index:1;width:100%;height:100%;border:none}.customize-control-kirki-checkbox input[type=checkbox]:after,.customize-control-multicheck input[type=checkbox]:after,.customize-control-repeater input[type=checkbox]:after{content:"";position:absolute;left:0;top:0;width:100%;height:100%;background:#f2f2f2;cursor:pointer;border-radius:3px;-webkit-border-radius:3px}.customize-control-kirki-checkbox input[type=checkbox]:checked:before,.customize-control-multicheck input[type=checkbox]:checked:before,.customize-control-repeater input[type=checkbox]:checked:before{content:"\f147";font-family:dashicons;font-size:25px;left:0;top:2px}.customize-control-kirki-checkbox input[type=checkbox]:checked:after,.customize-control-multicheck input[type=checkbox]:checked:after,.customize-control-repeater input[type=checkbox]:checked:after{background:#fff}.CodeMirror{font-family:monospace;height:300px;color:#000}.CodeMirror-lines{padding:4px 0}.CodeMirror pre{padding:0 4px}.CodeMirror-gutter-filler,.CodeMirror-scrollbar-filler{background-color:#fff}.CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7;white-space:nowrap}.CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999;white-space:nowrap}.CodeMirror-guttermarker{color:#000}.CodeMirror-guttermarker-subtle{color:#999}.CodeMirror-cursor{border-left:1px solid #000;border-right:none;width:0}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.cm-fat-cursor .CodeMirror-cursor{width:auto;border:0;background:#7e7}.cm-fat-cursor div.CodeMirror-cursors{z-index:1}.cm-animate-fat-cursor{width:auto;border:0;-webkit-animation:blink 1.06s steps(1) infinite;-moz-animation:blink 1.06s steps(1) infinite;animation:blink 1.06s steps(1) infinite;background-color:#7e7}@-moz-keyframes blink{50%{background-color:transparent}}@-webkit-keyframes blink{50%{background-color:transparent}}@keyframes blink{50%{background-color:transparent}}.cm-tab{display:inline-block;text-decoration:inherit}.CodeMirror-ruler{border-left:1px solid #ccc;position:absolute}.cm-s-default .cm-header{color:#00f}.cm-s-default .cm-quote{color:#090}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:700}.cm-em{font-style:italic}.cm-link{text-decoration:underline}.cm-strikethrough{text-decoration:line-through}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:#00f}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-variable-3{color:#085}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta,.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-invalidchar,.cm-s-default .cm-error{color:red}.CodeMirror-composing{border-bottom:2px solid}div.CodeMirror span.CodeMirror-matchingbracket{color:#0f0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#f22}.CodeMirror-matchingtag{background:rgba(255,150,0,.3)}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{position:relative;overflow:hidden;background:#fff}.CodeMirror-scroll{overflow:scroll!important;margin-bottom:-30px;margin-right:-30px;padding-bottom:30px;height:100%;outline:0;position:relative}.CodeMirror-sizer{position:relative;border-right:30px solid transparent}.CodeMirror-gutter-filler,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-vscrollbar{position:absolute;z-index:6;display:none}.CodeMirror-vscrollbar{right:0;top:0;overflow-x:hidden;overflow-y:scroll}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-y:hidden;overflow-x:scroll}.CodeMirror-scrollbar-filler{right:0;bottom:0}.CodeMirror-gutter-filler{left:0;bottom:0}.CodeMirror-gutters{position:absolute;left:0;top:0;z-index:3}.CodeMirror-gutter{white-space:normal;height:100%;display:inline-block;margin-bottom:-30px}.CodeMirror-gutter-wrapper{position:absolute;z-index:4;background:0 0!important;border:none!important;-webkit-user-select:none;-moz-user-select:none;user-select:none}.CodeMirror-gutter-background{position:absolute;top:0;bottom:0;z-index:4}.CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}.CodeMirror-lines{cursor:text;min-height:1px}.CodeMirror pre{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border-width:0;background:0 0;font-family:inherit;font-size:inherit;margin:0;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;position:relative;overflow:visible;-webkit-tap-highlight-color:transparent}.CodeMirror-wrap pre{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-linebackground{position:absolute;left:0;right:0;top:0;bottom:0;z-index:0}.CodeMirror-linewidget{position:relative;z-index:2;overflow:auto}.CodeMirror-code{outline:0}.CodeMirror-gutter,.CodeMirror-gutters,.CodeMirror-linenumber,.CodeMirror-scroll,.CodeMirror-sizer{-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden}.CodeMirror-cursor{position:absolute}.CodeMirror-measure pre{position:static}div.CodeMirror-cursors{visibility:hidden;position:relative;z-index:3}.CodeMirror-focused div.CodeMirror-cursors,div.CodeMirror-dragcursors{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected,.CodeMirror-line::selection,.CodeMirror-line>span::selection,.CodeMirror-line>span>span::selection{background:#d7d4f0}.CodeMirror-crosshair{cursor:crosshair}.CodeMirror-line::-moz-selection,.CodeMirror-line>span::-moz-selection,.CodeMirror-line>span>span::-moz-selection{background:#d7d4f0}.cm-searching{background:#ffa;background:rgba(255,255,0,.4)}.cm-force-border{padding-right:.1px}@media print{.CodeMirror div.CodeMirror-cursors{visibility:hidden}}.cm-tab-wrap-hack:after{content:''}span.CodeMirror-selectedtext{background:0 0}.customize-control-dimension .input-wrapper .invalid-value{display:none;background:#D32F2F;font-size:.85em;color:#fff;float:left;padding:2px 0;border-radius:3px}.customize-control-dimension .input-wrapper.invalid .invalid-value{display:block;width:98%;text-align:center}.customize-control-number .ui-spinner.ui-widget-content .ui-spinner-button .ui-button-text,.customize-control-palette input[type=radio]{display:none}.customize-control-dimension .input-wrapper.invalid input[type=text]:focus{border-color:#D32F2F}.customize-control-number .ui-spinner.ui-widget-content{position:relative}.customize-control-number .ui-spinner.ui-widget-content .ui-spinner-button{position:absolute;right:0;color:rgba(0,0,0,.3);border:none;padding:0 5px;width:20px;height:calc(50% + .5em);border-radius:0;-webkit-border-radius:0;box-shadow:none;-webkit-box-shadow:none;background:0 0;margin:0}.customize-control-number .ui-spinner.ui-widget-content .ui-spinner-button.ui-spinner-down:before,.customize-control-number .ui-spinner.ui-widget-content .ui-spinner-button.ui-spinner-up:before{font-family:dashicons;position:absolute;left:0}.customize-control-number .ui-spinner.ui-widget-content .ui-spinner-button.ui-spinner-up{top:-50%}.customize-control-number .ui-spinner.ui-widget-content .ui-spinner-button.ui-spinner-up:before{content:"\f343"}.customize-control-number .ui-spinner.ui-widget-content .ui-spinner-button.ui-spinner-down{top:50%}.customize-control-number .ui-spinner.ui-widget-content .ui-spinner-button.ui-spinner-down:before{content:"\f347"}.customize-control-number .ui-spinner.ui-widget-content .ui-spinner-button:hover{color:rgba(0,0,0,.7)}.customize-control-palette input[type=radio]:checked+label{border:3px solid rgba(0,0,0,.4)}.customize-control-palette label{background:0 0;padding:0;border-top:3px solid transparent;border-bottom:3px solid transparent;margin-bottom:5px;display:flex}.customize-control-palette label span{padding:10px 0;flex-grow:1;font-size:0;line-height:10px;color:transparent;-webkit-transition:all .2s ease-in-out;-moz-transition:all .2s ease-in-out;-ms-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out;border-top:1px solid rgba(0,0,0,.1);border-bottom:1px solid rgba(0,0,0,.1)}.customize-control-palette label span:first-child{border-left:1px solid rgba(0,0,0,.1)}.customize-control-palette label span:last-child{border-right:1px solid rgba(0,0,0,.1)}.customize-control-palette label span:hover{padding:10px;flex-grow:3;min-width:60px;font-size:10px;line-height:10px;color:#000}.customize-control-kirki-radio input[type=radio]{width:18px;height:18px}.customize-control-kirki-radio input[type=radio]:checked:before{width:10px;height:10px;margin:3px}.customize-control-kirki-radio label{display:list-item;margin-bottom:7px}.customize-control-kirki-radio label .option-description{display:block;color:rgba(0,0,0,.35);font-size:.9em;padding-left:25px}.customize-control-radio-buttonset .buttonset .switch-label{background:rgba(0,0,0,.05);color:#555;border-right:1px solid rgba(0,0,0,.2);padding:4px 7px;margin:0;font-size:12px}.customize-control-radio-buttonset .buttonset .switch-label:last-child{border-right:none}.customize-control-radio-buttonset .buttonset .switch-input{display:none}.customize-control-radio-buttonset .buttonset .switch-input:checked+.switch-label{background-color:#3498DB;color:#fff}.customize-control-radio-image label{position:relative;display:inline-block}.customize-control-radio-image input,.customize-control-repeater .repeater-fields .repeater-row .repeater-field.repeater-field-radio-image input{display:none}.customize-control-radio-image input img{border:1px solid transparent}.customize-control-radio-image input:checked+label img{-webkit-box-shadow:0 0 5px 2px rgba(0,0,0,.25);box-shadow:0 0 5px 2px rgba(0,0,0,.25);border:1px solid #3498DB}.customize-control-radio-image input+label .image-clickable{position:absolute;top:0;bottom:0;left:0;right:0;width:100%;height:100%}.customize-control-repeater .repeater-fields .repeater-row{padding:.5rem;border:1px solid #999;margin-top:.5rem;background:#eee;position:relative;padding-top:48px}.customize-control-repeater .repeater-fields .repeater-row label{margin-bottom:12px;clear:both}.customize-control-repeater .repeater-fields .repeater-row .repeater-field.repeater-field-radio-image input img{border:1px solid transparent}.customize-control-repeater .repeater-fields .repeater-row .repeater-field.repeater-field-radio-image input:checked+label img{-webkit-box-shadow:0 0 5px 2px rgba(0,0,0,.25);box-shadow:0 0 5px 2px rgba(0,0,0,.25);border:1px solid #3498DB}.customize-control-repeater button.repeater-add{margin-top:1rem}.customize-control-repeater .repeater-field{margin-bottom:12px;width:100%;clear:both;padding-bottom:12px;border-bottom:1px dotted #CCC}.customize-control-repeater .repeater-row .repeater-field:last-child{border-bottom:none;padding-bottom:0}.customize-control-repeater .repeater-field-select select{margin-left:0}.customize-control-repeater .repeater-field-checkbox label{line-height:28px}.customize-control-repeater .repeater-field-checkbox input{line-height:28px;margin-right:5px}.customize-control-repeater .repeater-field-textarea textarea{width:100%;resize:vertical}.customize-control-repeater .repeater-row-header{background:#fff;position:absolute;top:0;left:0;right:0;height:36px;color:#555;border-bottom:1px solid #999;line-height:36px;font-size:15px}.customize-control-repeater .repeater-row-number{border-right:1px solid #ddd;display:inline-block;width:35px;text-align:center}.customize-control-repeater .repeater-row-minimize,.customize-control-repeater .repeater-row-move,.customize-control-repeater .repeater-row-remove{display:inline-block;float:right;border-left:1px solid #ddd;width:35px;height:36px;text-align:center}.customize-control-repeater .repeater-row-minimize:hover,.customize-control-repeater .repeater-row-move:hover,.customize-control-repeater .repeater-row-remove:hover{background:#ddd;cursor:pointer}.customize-control-repeater .repeater-row-move:hover{cursor:move}.customize-control-repeater .repeater-minimize,.customize-control-repeater .repeater-move,.customize-control-repeater .repeater-remove{line-height:36px}.customize-control-repeater .repeater-row.minimized{padding:0;height:36px;overflow:hidden}.customize-control-repeater .remove-button,.customize-control-repeater .upload-button{width:48%}.kirki-image-attachment{margin:0;text-align:center;margin-bottom:25px}.kirki-image-attachment img{display:inline-block}.limit{padding:3px;border-radius:3px}.limit.highlight{background:#D32F2F;color:#fff}.selectize-control{position:relative}.selectize-control.single .selectize-input,.selectize-control.single .selectize-input input{cursor:pointer}.selectize-control.single .selectize-input.input-active,.selectize-control.single .selectize-input.input-active input{cursor:text}.selectize-control.single .selectize-input:after{content:"\f347";display:block;position:absolute;top:0;right:0;margin-top:0;width:12px;height:36px;font-family:dashicons;border-left:1px solid rgba(0,0,0,.06);line-height:36px;padding:0 3px}.selectize-control.single .selectize-input.dropdown-active:after{content:"\f343";border-left:1px solid rgba(0,0,0,.1)}.selectize-control.single .selectize-input.disabled{opacity:.5;background-color:#fafafa}.selectize-control.single.rtl .selectize-input:after{left:15px;right:auto}.selectize-control.rtl .selectize-input>input{margin:0 4px 0 -2px!important}.selectize-control .plugin-drag_drop.multi>.selectize-input>div.ui-sortable-placeholder{visibility:visible!important;background:#f2f2f2!important;background:rgba(0,0,0,.06)!important;border:0!important;-webkit-box-shadow:inset 0 0 12px 4px #fff;box-shadow:inset 0 0 12px 4px #fff}.selectize-control .plugin-drag_drop .ui-sortable-placeholder::after{content:'!';visibility:hidden}.selectize-control .plugin-drag_drop .ui-sortable-helper{-webkit-box-shadow:0 2px 5px rgba(0,0,0,.2);box-shadow:0 2px 5px rgba(0,0,0,.2)}.selectize-control .plugin-remove_button [data-value]{position:relative;padding-right:24px!important}.selectize-control .plugin-remove_button [data-value] .remove{z-index:1;position:absolute;top:0;right:0;bottom:0;width:17px;text-align:center;font-weight:700;font-size:12px;color:inherit;text-decoration:none;vertical-align:middle;display:inline-block;padding:2px 0 0;border-left:1px solid #d0d0d0;-webkit-border-radius:0 2px 2px 0;-moz-border-radius:0 2px 2px 0;border-radius:0 2px 2px 0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.selectize-control .plugin-remove_button .remove:hover{background:rgba(0,0,0,.05)}.selectize-control .plugin-remove_button.active .remove{border-left-color:#cacaca}.selectize-control .plugin .disabled [data-value] .remove:hover{background:0 0}.selectize-control .plugin .disabled [data-value] .remove{border-left-color:#fff}.selectize-control.multi .selectize-input{min-height:36px}.selectize-control.multi .selectize-input.has-items{padding:6px 8px 3px}.selectize-control.multi .selectize-input>div{cursor:pointer;margin:0 3px 3px 0;padding:2px 6px;background:#f2f2f2;color:#303030;border:0 solid #d0d0d0}.selectize-control.multi .selectize-input>div.active{background:#e8e8e8;color:#303030;border:0 solid #cacaca}.selectize-control.multi .selectize-input.disabled>div,.selectize-control.multi .selectize-input.disabled>div.active{color:#7d7d7d;background:#fff;border:0 solid #fff}.selectize-dropdown{position:relative;top:-4px!important;border:1px solid #d0d0d0;background:#fff;margin:-1px 0 0;border-top:0 none;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-box-shadow:0 1px 3px rgba(0,0,0,.1);box-shadow:0 1px 3px rgba(0,0,0,.1);-webkit-border-radius:0 0 3px 3px;-moz-border-radius:0 0 3px 3px;border-radius:0 0 3px 3px;z-index:999}.selectize-dropdown-header{position:relative;padding:5px 8px;border-bottom:1px solid #d0d0d0;background:#f8f8f8;-webkit-border-radius:3px 3px 0 0;-moz-border-radius:3px 3px 0 0;border-radius:3px 3px 0 0}.selectize-dropdown-header-close{position:absolute;right:8px;top:50%;color:#303030;opacity:.4;margin-top:-12px;line-height:20px;font-size:20px!important}.selectize-dropdown-header-close:hover{color:#000}.selectize-dropdown.plugin-optgroup_columns .optgroup{border-right:1px solid #f2f2f2;border-top:0 none;float:left;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.selectize-dropdown.plugin-optgroup_columns .optgroup:last-child{border-right:0 none}.selectize-dropdown.plugin-optgroup_columns .optgroup:before{display:none}.selectize-dropdown.plugin-optgroup_columns .optgroup-header{border-top:0 none}.selectize-dropdown,.selectize-input,.selectize-input input{color:#303030;font-family:inherit;font-size:13px;line-height:18px;-webkit-font-smoothing:inherit}.selectize-control.single .selectize-input.input-active,.selectize-input{background:#fff;cursor:text;display:inline-block}.selectize-input{border:1px solid rgba(0,0,0,.1);padding:8px;display:inline-block;width:100%;overflow:hidden;position:relative;z-index:1;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.selectize-input.full{background-color:#fff}.selectize-input.disabled,.selectize-input.disabled *{cursor:default!important}.selectize-input.focus{-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.15);box-shadow:inset 0 1px 2px rgba(0,0,0,.15)}.selectize-input.dropdown-active{-webkit-border-radius:3px 3px 0 0;-moz-border-radius:3px 3px 0 0;border-radius:3px 3px 0 0}.selectize-input>*{vertical-align:baseline;display:-moz-inline-stack;display:inline-block;zoom:1}.selectize-input>input{display:inline-block!important;padding:0!important;min-height:0!important;max-height:none!important;max-width:100%!important;margin:0 2px 0 0!important;text-indent:0!important;border:0!important;background:0 0!important;line-height:inherit!important;-webkit-user-select:auto!important;-webkit-box-shadow:none!important;box-shadow:none!important}.selectize-input>input::-ms-clear{display:none}.selectize-input>input:focus{outline:0!important}.selectize-input::after{content:' ';display:block;clear:left}.selectize-input.dropdown-active::before{content:' ';display:block;position:absolute;background:#f0f0f0;height:1px;bottom:0;left:0;right:0}.selectize-dropdown [data-selectable]{cursor:pointer;overflow:hidden}.selectize-dropdown [data-selectable] .highlight{background:rgba(125,168,208,.2);-webkit-border-radius:1px;-moz-border-radius:1px;border-radius:1px}.selectize-dropdown .optgroup-header,.selectize-dropdown [data-selectable]{padding:5px 8px}.selectize-dropdown .optgroup:first-child .optgroup-header{border-top:0 none}.selectize-dropdown .optgroup-header{color:#303030;background:#fff;cursor:default}.selectize-dropdown .active{background-color:#f5fafd;color:#495c68}.selectize-dropdown .active.create{color:#495c68}.selectize-dropdown .create{color:rgba(48,48,48,.5)}.selectize-dropdown-content{overflow-y:auto;overflow-x:hidden;max-height:200px}.customize-control-slider input[type=range]{-webkit-appearance:none;-webkit-transition:background .3s;-moz-transition:background .3s;transition:background .3s;background-color:rgba(0,0,0,.1);height:5px;width:calc(100% - 70px);padding:0}.customize-control-slider input[type=range]:focus{box-shadow:none;outline:0}.customize-control-slider input[type=range]:hover{background-color:rgba(0,0,0,.25)}.customize-control-slider input[type=range]::-webkit-slider-thumb{-webkit-border-radius:50%;-webkit-appearance:none;width:15px;height:15px;border:none;border-radius:50%;background-color:#3498D9}.customize-control-slider input[type=range]::-moz-range-thumb{width:15px;height:15px;border:none;border-radius:50%;background-color:#3498D9}.customize-control-slider input[type=range]::-ms-thumb{width:15px;height:15px;border-radius:50%;border:0;background-color:#3498D9}.customize-control-slider input[type=range]::-moz-range-track{border:inherit;background:0 0}.customize-control-slider input[type=range]::-ms-track{border:inherit;color:transparent;background:0 0}.customize-control-slider input[type=range]::-ms-fill-lower,.customize-control-slider input[type=range]::-ms-fill-upper{background:0 0}.customize-control-slider input[type=range]::-ms-tooltip{display:none}.customize-control-slider .kirki_range_value{display:inline-block;font-size:14px;padding:0 5px;font-weight:400;position:relative;top:2px}.customize-control-slider .kirki-slider-reset{color:rgba(0,0,0,.2);float:right;-webkit-transition:color .5s ease-in;-moz-transition:color .5s ease-in;-ms-transition:color .5s ease-in;-o-transition:color .5s ease-in;transition:color .5s ease-in}.customize-control-slider .kirki-slider-reset span{font-size:16px;line-height:22px}.customize-control-slider .kirki-slider-reset:hover{color:red}.customize-control-sortable ul.ui-sortable li{padding:5px 10px;border:1px solid #333;background:#fff}.customize-control-sortable ul.ui-sortable li .dashicons.dashicons-menu{float:right}.customize-control-sortable ul.ui-sortable li .dashicons.visibility{margin-right:10px}.customize-control-sortable ul.ui-sortable li.invisible{color:#aaa;border:1px dashed #aaa}.customize-control-sortable ul.ui-sortable li.invisible .dashicons.visibility{color:#aaa}.customize-control-spacing .wrapper{-webkit-box-shadow:inset 0 0 5px 2px rgba(0,0,0,.1);box-shadow:inset 0 0 5px 2px rgba(0,0,0,.1);width:96%;padding:3%}.customize-control-spacing .wrapper .control{display:flex;flex-wrap:wrap;justify-content:space-between}.customize-control-spacing .wrapper .control>div{width:48%}.customize-control-spacing .wrapper .control>div h5{margin:10px 0 7px}.customize-control-spacing .wrapper .control>div .inner{display:flex}.customize-control-spacing .wrapper .control>div .inner input[type=number]{width:50%;height:36px}.customize-control-spacing .wrapper .control>div .inner .selectize-control.single{width:50%}.customize-control-spacing .wrapper .control>div .inner .selectize-control.single>.selectize-input{height:36px}.customize-control-spacing .wrapper .input-wrapper .invalid-value{display:none;background:#D32F2F;font-size:.85em;color:#fff;float:left;padding:2px 0;border-radius:3px}.customize-control-spacing .wrapper .input-wrapper.invalid .invalid-value{display:block;width:98%;text-align:center}.customize-control-spacing .wrapper .input-wrapper.invalid input[type=text]:focus{border-color:#D32F2F}.customize-control-switch input[type=checkbox]{display:none}.customize-control-switch .switch{border:none;margin-bottom:1.5rem;outline:0;padding:0;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.customize-control-switch .switch label{background:rgba(0,0,0,.2);color:transparent;cursor:pointer;display:block;margin-bottom:1rem;position:relative;text-indent:100%;transition:left .15s ease-out;height:2rem;width:4rem}.customize-control-switch .switch label:after{background:#FFF;content:"";display:block;height:1.5rem;left:.25rem;position:absolute;top:.25rem;width:1.5rem;-webkit-transition:left .15s ease-out;-moz-transition:left .15s ease-out;-o-transition:translate3d(0,0,0);transition:left .15s ease-out;-webkit-transform:translate3d(0,0,0);-moz-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);-o-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.customize-control-switch .switch input{left:10px;opacity:0;padding:0;position:absolute;top:9px}.customize-control-switch .switch input+label{margin-left:0;margin-right:0}.customize-control-switch .switch input:checked+label{background:#3498DB}.customize-control-switch .switch input:checked+label:after{left:2.25rem;background:#fff}.customize-control-switch .switch.round{border-radius:1000px}.customize-control-switch .switch.round label,.customize-control-switch .switch.round label:after{border-radius:2rem}.customize-control-switch .switch-on{position:absolute;left:-55px;top:8px;color:#fff;font-weight:700;font-size:9px}.customize-control-switch .switch-off{position:absolute;left:-25px;top:8px;color:#fff;font-weight:700;font-size:9px}.customize-control-kirki-generic textarea{width:100%;border:1px solid rgba(0,0,0,.1);-webkit-box-shadow:none;box-shadow:none}.customize-control-toggle input[type=checkbox]{display:none}.customize-control-toggle .switch{border:1px solid rgba(0,0,0,.1);display:inline-block;width:35px;height:12px;border-radius:8px;background:#ccc;vertical-align:middle;position:relative;cursor:pointer;user-select:none;transition:background 350ms ease}.customize-control-toggle .switch:after,.customize-control-toggle .switch:before{content:"";display:block;width:20px;height:20px;border-radius:50%;position:absolute;top:50%;left:-3px;transition:all 350ms cubic-bezier(0,.95,.38,.98),background 150ms ease}.customize-control-toggle .switch:before{background:rgba(0,0,0,.2);transform:translate3d(0,-50%,0) scale(0)}.customize-control-toggle .switch:after{background:#999;border:1px solid rgba(0,0,0,.1);transform:translate3d(0,-50%,0)}.customize-control-toggle .switch:active:before{transform:translate3d(0,-50%,0) scale(3)}.customize-control-toggle input:checked+.switch{background:rgba(52,152,222,.3)}.customize-control-toggle input:checked+.switch:before{background:rgba(52,152,222,.075);transform:translate3d(100%,-50%,0) scale(1)}.customize-control-toggle input:checked+.switch:after{background:#3498DE;transform:translate3d(100%,-50%,0)}.customize-control-toggle input:checked+.switch:active:before{background:rgba(52,152,222,.075);transform:translate3d(100%,-50%,0) scale(3)}.customize-control-toggle .customize-control-title{width:calc(100% - 50px);float:left}.customize-control-typography .wrapper{-webkit-box-shadow:inset 0 0 10px 0 rgba(0,0,0,.1);box-shadow:inset 0 0 10px 0 rgba(0,0,0,.1);padding:10px;border-radius:3px;display:flex;flex-wrap:wrap;justify-content:space-between}.customize-control-typography .wrapper .color,.customize-control-typography .wrapper .font-family,.customize-control-typography .wrapper .font-size,.customize-control-typography .wrapper .letter-spacing,.customize-control-typography .wrapper .line-height,.customize-control-typography .wrapper .subset,.customize-control-typography .wrapper .variant{width:100%;float:none;clear:both}.customize-control-typography .wrapper .color h5,.customize-control-typography .wrapper .font-family h5,.customize-control-typography .wrapper .font-size h5,.customize-control-typography .wrapper .letter-spacing h5,.customize-control-typography .wrapper .line-height h5,.customize-control-typography .wrapper .subset h5,.customize-control-typography .wrapper .variant h5{margin:.67em 0 0}.customize-control-typography .wrapper .font-size,.customize-control-typography .wrapper .letter-spacing,.customize-control-typography .wrapper .line-height{width:50%}.customize-control-typography .wrapper .color{width:auto}
|
assets/js/controls/repeater.js
CHANGED
@@ -106,10 +106,24 @@ wp.customize.controlConstructor['repeater'] = wp.customize.Control.extend({
|
|
106 |
// Save the rows objects
|
107 |
this.rows = [];
|
108 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
109 |
|
110 |
this.container.on('click', 'button.repeater-add', function (e) {
|
111 |
e.preventDefault();
|
112 |
-
control.
|
|
|
|
|
|
|
|
|
113 |
});
|
114 |
|
115 |
this.container.on('click keypress', '.repeater-field-image .upload-button', function (e) {
|
@@ -437,4 +451,4 @@ wp.customize.controlConstructor['repeater'] = wp.customize.Control.extend({
|
|
437 |
this.setValue( currentSettings, true );
|
438 |
|
439 |
}
|
440 |
-
});
|
106 |
// Save the rows objects
|
107 |
this.rows = [];
|
108 |
|
109 |
+
// Default limit choice
|
110 |
+
if ( this.params.choices.limit !== undefined ) {
|
111 |
+
if ( this.params.choices.limit <= 0 ) {
|
112 |
+
var limit = false;
|
113 |
+
} else {
|
114 |
+
var limit = parseInt(this.params.choices.limit);
|
115 |
+
}
|
116 |
+
} else {
|
117 |
+
var limit = false;
|
118 |
+
}
|
119 |
|
120 |
this.container.on('click', 'button.repeater-add', function (e) {
|
121 |
e.preventDefault();
|
122 |
+
if ( !limit || control.currentIndex < limit ) {
|
123 |
+
control.addRow();
|
124 |
+
} else {
|
125 |
+
jQuery( control.selector + ' .limit' ).toggleClass( 'highlight' );
|
126 |
+
}
|
127 |
});
|
128 |
|
129 |
this.container.on('click keypress', '.repeater-field-image .upload-button', function (e) {
|
451 |
this.setValue( currentSettings, true );
|
452 |
|
453 |
}
|
454 |
+
});
|
assets/js/customizer.js
CHANGED
@@ -668,10 +668,24 @@ wp.customize.controlConstructor['repeater'] = wp.customize.Control.extend({
|
|
668 |
// Save the rows objects
|
669 |
this.rows = [];
|
670 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
671 |
|
672 |
this.container.on('click', 'button.repeater-add', function (e) {
|
673 |
e.preventDefault();
|
674 |
-
control.
|
|
|
|
|
|
|
|
|
675 |
});
|
676 |
|
677 |
this.container.on('click keypress', '.repeater-field-image .upload-button', function (e) {
|
@@ -999,8 +1013,7 @@ wp.customize.controlConstructor['repeater'] = wp.customize.Control.extend({
|
|
999 |
this.setValue( currentSettings, true );
|
1000 |
|
1001 |
}
|
1002 |
-
})
|
1003 |
-
/**
|
1004 |
* KIRKI CONTROL: KIRKI-SELECT
|
1005 |
*/
|
1006 |
wp.customize.controlConstructor['kirki-select'] = wp.customize.Control.extend( {
|
668 |
// Save the rows objects
|
669 |
this.rows = [];
|
670 |
|
671 |
+
// Default limit choice
|
672 |
+
if ( this.params.choices.limit !== undefined ) {
|
673 |
+
if ( this.params.choices.limit <= 0 ) {
|
674 |
+
var limit = false;
|
675 |
+
} else {
|
676 |
+
var limit = parseInt(this.params.choices.limit);
|
677 |
+
}
|
678 |
+
} else {
|
679 |
+
var limit = false;
|
680 |
+
}
|
681 |
|
682 |
this.container.on('click', 'button.repeater-add', function (e) {
|
683 |
e.preventDefault();
|
684 |
+
if ( !limit || control.currentIndex < limit ) {
|
685 |
+
control.addRow();
|
686 |
+
} else {
|
687 |
+
jQuery( control.selector + ' .limit' ).toggleClass( 'highlight' );
|
688 |
+
}
|
689 |
});
|
690 |
|
691 |
this.container.on('click keypress', '.repeater-field-image .upload-button', function (e) {
|
1013 |
this.setValue( currentSettings, true );
|
1014 |
|
1015 |
}
|
1016 |
+
});/**
|
|
|
1017 |
* KIRKI CONTROL: KIRKI-SELECT
|
1018 |
*/
|
1019 |
wp.customize.controlConstructor['kirki-select'] = wp.customize.Control.extend( {
|
assets/js/customizer.min.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1 |
-
function kirkiArrayToObject(a){var b={};if(null!==a)for(var c=0;c<a.length;++c)void 0!==a[c]&&(b[c]=a[c]);return b}function kirkiObjectToArray(a){var b=[];if(null!==a)for(var c=0;c<a.length;++c)void 0!==a[c]&&b.push(a[c]);return b}function kirkiValidateCSSValue(a){var b=!0;if("0"==a)return!0;var c=["rem","em","ex","%","px","cm","mm","in","pt","pc","ch","vh","vw","vmin","vmax"],d=parseFloat(a),e=a.replace(d,"");return NaN===d&&(b=!1),-1===jQuery.inArray(e,c)&&(b=!1),b}function RepeaterRow(a,b){this.rowIndex=a,this.rowNumber=a+1,this.$el=b,this.$dragger=this.$el.find(".repeater-row-move"),this.$minimizer=this.$el.find(".repeater-row-minimize"),this.$remover=this.$el.find(".repeater-row-remove"),this.$number=this.$el.find(".repeater-row-number"),this.$fields=this.$el.find("input,select,textarea");var c=this;this.$minimizer.on("click",function(){c.toggleMinimize()}),this.$remover.on("click",function(){c.remove()}),this.$dragger.on("mousedown",function(){c.$el.trigger("row:start-dragging")}),this.$el.on("keyup change","input, select, textarea",function(a){c.$el.trigger("row:update",[c.getRowIndex(),jQuery(a.target).data("field"),a.target])}),this.renderNumber()}wp.customize.controlConstructor["kirki-checkbox"]=wp.customize.Control.extend({ready:function(){var a=this,b=a.setting._value;this.container.on("change","input",function(){b=!!jQuery(this).is(":checked"),a.setting.set(b)})}}),wp.customize.controlConstructor.code=wp.customize.Control.extend({ready:function(){var a=this,b=a.container.find("#kirki-codemirror-editor-"+a.id),c=CodeMirror.fromTextArea(b[0]);if("html"==a.params.choices.language)var d={name:"htmlmixed"};else d=a.params.choices.language;c.setOption("value",a.setting._value),c.setOption("mode",d),c.setOption("lineNumbers",!0),c.setOption("theme",a.params.choices.theme),c.setOption("height",a.params.choices.height+"px"),c.on("change",function(){a.setting.set(c.getValue())}),b.parents(".accordion-section").on("click",function(){c.refresh()})}}),wp.customize.controlConstructor["color-alpha"]=wp.customize.Control.extend({ready:function(){var a=this,b=this.container.find(".kirki-color-control");b.val();b.wpColorPicker({change:function(c,d){setTimeout(function(){a.setting.set(b.val())},100)}})}}),wp.customize.controlConstructor.dimension=wp.customize.Control.extend({ready:function(){var a=this;!1===kirkiValidateCSSValue(a.setting._value)?jQuery(a.selector+" .input-wrapper").addClass("invalid"):jQuery(a.selector+" .input-wrapper").removeClass("invalid"),this.container.on("change keyup paste","input",function(){var b=jQuery(this).val();!1===kirkiValidateCSSValue(b)?jQuery(a.selector+" .input-wrapper").addClass("invalid"):(jQuery(a.selector+" .input-wrapper").removeClass("invalid"),a.setting.set(b))})}}),function(a){wp.customizerCtrlEditor={init:function(){a(window).load(function(){a("textarea.wp-editor-area").each(function(){var b,c,d=a(this),e=d.attr("id"),f=tinyMCE.get(e);f&&f.onChange.add(function(a,e){a.save(),c=f.getContent(),clearTimeout(b),b=setTimeout(function(){d.val(c).trigger("change")},500)}),d.css({visibility:"visible"}).on("keyup",function(){c=d.val(),clearTimeout(b),b=setTimeout(function(){c.trigger("change")},500)})})})}},wp.customizerCtrlEditor.init()}(jQuery),wp.customize.controlConstructor["kirki-generic"]=wp.customize.Control.extend({ready:function(){var a=this;this.container.on("change keyup paste",a.params.choices.element,function(){a.setting.set(jQuery(this).val())})}}),wp.customize.controlConstructor.multicheck=wp.customize.Control.extend({ready:function(){var a=this;a.container.on("change","input",function(){var b=[],c=0;jQuery.each(a.params.choices,function(d,e){a.container.find('input[value="'+d+'"]').is(":checked")&&(b[c]=d,c++)}),a.setting.set(b),wp.customize.previewer.refresh()})}}),wp.customize.controlConstructor.number=wp.customize.Control.extend({ready:function(){var a=this,b=this.container.find("input");jQuery(b).spinner(),a.params.choices.min&&jQuery(b).spinner("option","min",a.params.choices.min),a.params.choices.max&&jQuery(b).spinner("option","max",a.params.choices.max),a.params.choices.step&&("any"==a.params.choices.step?jQuery(b).spinner("option","step","0.001"):jQuery(b).spinner("option","step",a.params.choices.step)),this.container.on("change click keyup paste","input",function(){a.setting.set(jQuery(this).val())})}}),wp.customize.controlConstructor.palette=wp.customize.Control.extend({ready:function(){var a=this;this.container.on("click","input",function(){a.setting.set(jQuery(this).val())})}}),wp.customize.controlConstructor.preset=wp.customize.Control.extend({ready:function(){var a=this,b=this.container.find("select");jQuery(b).selectize(),this.container.on("change","select",function(){var b=jQuery(this).val();a.setting.set(b),jQuery.each(a.params.choices,function(a,c){b==a&&jQuery.each(c.settings,function(a,b){var c=wp.customize.settings.controls[a];if(void 0===typeof c)return!0;var d=c.type;if("checkbox"==d||"switch"==d||"toggle"==d||"kirki-checkbox"==d){var e=wp.customize.control(a).container.find("input");1==b?(jQuery(e).prop("checked",!0),wp.customize.instance(a).set(!0)):(jQuery(e).prop("checked",!1),wp.customize.instance(a).set(!1))}else if("select"==d||"select2"==d||"select2-multiple"==d||"kirki-select"==d){var e=wp.customize.control(a).container.find("select"),f=jQuery(e).selectize(),g=f[0].selectize;g.setValue(b,!0),wp.customize.instance(a).set(b)}else if("slider"==d){var e=wp.customize.control(a).container.find("input");jQuery(e).prop("value",b);var h=wp.customize.control(a).container.find(".kirki_range_value .value");jQuery(h).html(b),wp.customize.instance(a).set(b)}else if("textarea"==d||"kirki-textarea"==d){var e=wp.customize.control(a).container.find("textarea");jQuery(e).prop("value",b),wp.customize(a).set(b)}else if("color-alpha"==d||"kirki-color"==d||"color"==d){var i=wp.customize.control(a).container.find(".kirki-color-control");i.attr("data-default-color",b).data("default-color",b).wpColorPicker("color",b),wp.customize.instance(a).set(b)}else if("dimension"==d){wp.customize.instance(a).set(b);var e=wp.customize.control(a).container.find("input[type=number]"),j=parseFloat(b);jQuery(e).prop("value",j);var k=wp.customize.control(a).container.find("select"),l=b.replace(parseFloat(b),"");jQuery(k).prop("value",l)}else if("multicheck"==d)for(wp.customize.instance(a).set(b),wp.customize.control(a).container.find("input").each(function(){jQuery(this).prop("checked",!1)}),index=0;index<b.length;index++){var e=wp.customize.control(a).container.find('input[value="'+b[index]+'"]');jQuery(e).prop("checked",!0)}else if("radio-buttonset"==d||"radio-image"==d||"radio"==d||"kirki-radio"==d){var e=wp.customize.control(a).container.find('input[value="'+b+'"]');jQuery(e).prop("checked",!0),wp.customize.instance(a).set(b)}else{var e=wp.customize.control(a).container.find("input");jQuery(e).prop("value",b),wp.customize.instance(a).set(b)}})}),wp.customize.previewer.refresh()})}}),wp.customize.controlConstructor["radio-buttonset"]=wp.customize.Control.extend({ready:function(){var a=this;this.container.on("click","input",function(){a.setting.set(jQuery(this).val())})}}),wp.customize.controlConstructor["radio-image"]=wp.customize.Control.extend({ready:function(){var a=this;this.container.on("click","input",function(){a.setting.set(jQuery(this).val())})}}),wp.customize.controlConstructor["kirki-radio"]=wp.customize.Control.extend({ready:function(){var a=this;this.container.on("change","input",function(){a.setting.set(jQuery(this).val())})}}),RepeaterRow.prototype.getRowIndex=function(){return this.rowIndex},RepeaterRow.prototype.getRowNumber=function(){return this.rowNumber},RepeaterRow.prototype.setRowNumber=function(a){this.rowNumber=a,this.renderNumber()},RepeaterRow.prototype.getElement=function(){return this.$el},RepeaterRow.prototype.setRowIndex=function(a){this.rowIndex=a,this.$el.attr("data-row",a),this.$el.data("row",a)},RepeaterRow.prototype.toggleMinimize=function(){this.$el.toggleClass("minimized"),this.$minimizer.find(".repeater-minimize").toggleClass("dashicons-arrow-up"),this.$minimizer.find(".repeater-minimize").toggleClass("dashicons-arrow-down")},RepeaterRow.prototype.minimize=function(){this.$el.addClass("minimized"),this.$minimizer.find(".repeater-minimize").removeClass("dashicons-arrow-up"),this.$minimizer.find(".repeater-minimize").addClass("dashicons-arrow-down")},RepeaterRow.prototype.remove=function(){confirm("Are you sure?")&&(this.$el.slideUp(300,function(){jQuery(this).detach()}),this.$el.trigger("row:remove",[this.getRowIndex()]))},RepeaterRow.prototype.renderNumber=function(){this.$number.text(this.getRowNumber())},wp.customize.controlConstructor.repeater=wp.customize.Control.extend({ready:function(){var a=this,b=this.params.value;if(this.settingField=this.container.find("[data-customize-setting-link]").first(),this.setValue([],!1),this.repeaterFieldsContainer=this.container.find(".repeater-fields").first(),this.currentIndex=0,this.rows=[],this.container.on("click","button.repeater-add",function(b){b.preventDefault(),a.addRow()}),this.container.on("click keypress",".repeater-field-image .upload-button",function(b){b.preventDefault(),a.$thisButton=jQuery(this),a.openFrame(b)}),this.container.on("click keypress",".repeater-field-image .remove-button",function(b){b.preventDefault(),a.$thisButton=jQuery(this),a.removeImage(b)}),this.repeaterTemplate=_.memoize(function(){var b,c={evaluate:/<#([\s\S]+?)#>/g,interpolate:/\{\{\{([\s\S]+?)\}\}\}/g,escape:/\{\{([^\}]+?)\}\}(?!\})/g,variable:"data"};return function(d){return(b=_.template(a.container.find(".customize-control-repeater-content").first().html(),null,c))(d)}}),b.length)for(var c=0;c<b.length;c++)a.addRow(b[c]);this.repeaterFieldsContainer.sortable({handle:".repeater-row-move",update:function(b,c){a.sort()}})},openFrame:function(a){wp.customize.utils.isKeydownButNotEnterEvent(a)||(this.frame||this.initFrame(),this.frame.open())},initFrame:function(){var a=this;this.frame=wp.media({states:[new wp.media.controller.Library({library:wp.media.query({type:"image"}),multiple:!1,date:!1})]}),this.frame.on("select",function(b){a.selectImage()})},selectImage:function(){var a=this.frame.state().get("selection").first().toJSON(),b=a.url,c=this.$thisButton.closest(".repeater-field-image");c.find(".kirki-image-attachment").html('<img src="'+b+'">').hide().slideDown("slow"),c.find(".hidden-field").val(b),this.$thisButton.text(this.$thisButton.data("alt-label")),c.find(".remove-button").show(),c.find("input, textarea, select").trigger("change")},removeImage:function(a){if(!wp.customize.utils.isKeydownButNotEnterEvent(a)){var b=this.$thisButton.closest(".repeater-field-image"),c=b.find(".upload-button");b.find(".kirki-image-attachment").slideUp("fast",function(){jQuery(this).show().html(jQuery(this).data("placeholder"))}),b.find(".hidden-field").val(""),c.text(c.data("label")),this.$thisButton.hide(),b.find("input, textarea, select").trigger("change")}},getValue:function(){return JSON.parse(decodeURI(this.setting.get()))},setValue:function(a,b){this.setting.set(encodeURI(JSON.stringify(a))),b&&this.settingField.trigger("change")},addRow:function(a){var b,c,d=this,e=d.repeaterTemplate(),f=this.getValue(),g={};if(e){if(c=jQuery.extend(!0,{},d.params.fields),a)for(b in a)a.hasOwnProperty(b)&&c.hasOwnProperty(b)&&(c[b]["default"]=a[b]);c.index=this.currentIndex,c.ControlId=this.id,e=e(c);var h=new RepeaterRow(d.currentIndex,jQuery(e).appendTo(d.repeaterFieldsContainer));h.getElement().one("row:remove",function(a,b){d.deleteRow(b)}),h.getElement().on("row:update",function(a,b,c,e){d.updateField.call(d,a,b,c,e)}),h.getElement().on("row:start-dragging",function(){for(b in d.rows)d.rows.hasOwnProperty(b)&&d.rows[b]&&d.rows[b].minimize()}),this.rows[this.currentIndex]=h;for(b in c)c.hasOwnProperty(b)&&(g[b]=c[b]["default"]);f[this.currentIndex]=g,this.setValue(f,!0),this.currentIndex++}},sort:function(){var a=this,b=this.repeaterFieldsContainer.find(".repeater-row"),c=[];b.each(function(a,b){c.push(jQuery(b).data("row"))});var d=a.getValue(),e=[],f=[];jQuery.each(c,function(b,c){e[b]=a.rows[c],e[b].setRowIndex(b),e[b].setRowNumber(b+1),f[b]=d[c]}),a.rows=e,a.setValue(f)},deleteRow:function(a){var b=this.getValue();if(b[a]){var c=this.rows[a];c&&(delete b[a],delete this.rows[a],this.setValue(b,!0))}var d=1;for(prop in this.rows)this.rows.hasOwnProperty(prop)&&this.rows[prop]&&(this.rows[prop].setRowNumber(d),d++)},updateField:function(a,b,c,d){if(this.rows[b]&&this.params.fields[c]){var e=this.params.fields[c].type,f=this.rows[b],g=this.getValue();d=jQuery(d),void 0!=typeof g[f.getRowIndex()][c]&&("checkbox"==e?g[f.getRowIndex()][c]=d.is(":checked"):g[f.getRowIndex()][c]=d.val(),this.setValue(g,!0))}}}),wp.customize.controlConstructor["kirki-select"]=wp.customize.Control.extend({ready:function(){var a=this,b=this.container.find("select"),c=parseInt(b.data("multiple"));c>1?jQuery(b).selectize({maxItems:c,plugins:["remove_button","drag_drop"]}):jQuery(b).selectize(),this.container.on("change","select",function(){if(c>1)var b=kirkiArrayToObject(jQuery(this).val());else var b=jQuery(this).val();a.setting.set(b)})}}),jQuery(document).ready(function(a){a("input[type=range]").on("mousedown",function(){value=a(this).attr("value"),a(this).mousemove(function(){value=a(this).attr("value"),a(this).closest("label").find(".kirki_range_value .value").text(value)})}),a(".kirki-slider-reset").click(function(){var b=a(this).closest("label").find("input"),c=(b.data("customize-setting-link"),b.data("reset_value"));b.val(c),b.change(),a(this).closest("label").find(".kirki_range_value .value").text(c)})}),wp.customize.controlConstructor.slider=wp.customize.Control.extend({ready:function(){var a=this;this.container.on("change","input",function(){a.setting.set(jQuery(this).val())})}}),wp.customize.controlConstructor.sortable=wp.customize.Control.extend({ready:function(){var a=this;this.settingField=this.container.find("[data-customize-setting-link]").first(),this.sortableContainer=this.container.find("ul.sortable").first(),this.setValue(this.setting.get(),!1),this.sortableContainer.sortable().disableSelection().on("sortstop",function(b,c){a.sort()}).find("li").each(function(){jQuery(this).find("i.visibility").click(function(){jQuery(this).toggleClass("dashicons-visibility-faint").parents("li:eq(0)").toggleClass("invisible")})}).click(function(){a.sort()})},sort:function(){var a=[];this.sortableContainer.find("li").each(function(){var b=jQuery(this);b.is(".invisible")||a.push(b.data("value"))}),this.setValue(a,!0)},getValue:function(){return unserialize(this.setting.get())},setValue:function(a,b){a=serialize(a),this.setting.set(a),this.settingField.val(a),b&&this.settingField.trigger("change")}}),wp.customize.controlConstructor.spacing=wp.customize.Control.extend({ready:function(){var a=this,b={};jQuery.each(["top","bottom","left","right"],function(c,d){a.container.has("."+d).size()&&(b[d]=a.setting._value[d],!1===kirkiValidateCSSValue(a.setting._value[d])?jQuery(a.selector+" ."+d+".input-wrapper").addClass("invalid"):jQuery(a.selector+" ."+d+".input-wrapper").removeClass("invalid")),a.container.has("."+d).size()&&a.container.on("change keyup paste","."+d+" input",function(){subValue=jQuery(this).val(),!1===kirkiValidateCSSValue(subValue)?jQuery(a.selector+" ."+d+".input-wrapper").addClass("invalid"):(jQuery(a.selector+" ."+d+".input-wrapper").removeClass("invalid"),b[d]=subValue,a.setting.set(b),wp.customize.previewer.refresh())})})}}),wp.customize.controlConstructor["switch"]=wp.customize.Control.extend({ready:function(){var a=this,b=a.setting._value;this.container.on("change","input",function(){b=!!jQuery(this).is(":checked"),a.setting.set(b)})}}),wp.customize.controlConstructor.toggle=wp.customize.Control.extend({ready:function(){var a=this,b=a.setting._value;this.container.on("change","input",function(){b=!!jQuery(this).is(":checked"),a.setting.set(b)})}}),wp.customize.controlConstructor.typography=wp.customize.Control.extend({ready:function(){var a=this,b=a.selector+" .font-family select",c=a.selector+" .variant select",d=a.selector+" .subset select",e={};e["font-family"]=void 0!==a.setting._value["font-family"]?a.setting._value["font-family"]:"",e["font-size"]=void 0!==a.setting._value["font-size"]?a.setting._value["font-size"]:"",e.variant=void 0!==a.setting._value.variant?a.setting._value.variant:"",e.subset=void 0!==a.setting._value.subset?a.setting._value.subset:"",e["line-height"]=void 0!==a.setting._value["line-height"]?a.setting._value["line-height"]:"",e["letter-spacing"]=void 0!==a.setting._value["letter-spacing"]?a.setting._value["letter-spacing"]:"",e.color=void 0!==a.setting._value.color?a.setting._value.color:"";var f=function(b,f,g){subSelector="variant"==f?c:d;var h=!1,i={};void 0!==jQuery(subSelector).selectize()[0]&&jQuery(subSelector).selectize()[0].selectize.destroy();for(var j=0,k=kirkiAllFonts.length;k>j;j++)b===kirkiAllFonts[j].family&&(void 0!==kirkiAllFonts[j].is_standard&&!0===kirkiAllFonts[j].is_standard&&(h=!0),i=kirkiAllFonts[j][f+"s"]);if(!1===h||"subset"!==f){if(null===g){if("variant"==f)for(var j=0,k=i.length;k>j;j++)if(void 0!==i[j].id)var l=e.variant;else{var m="regular";if(m==i[j].id)var n=!0;else if(void 0===o)var o=i[j].id}else if("subset"==f){for(var p={},j=0,k=i.length;k>j;j++)if(null!==e.subset)for(var q=0,k=e.subset.length;k>q;q++)void 0!==i[j]&&e.subset[q]==i[j].id&&(p[e.subset[q]]=e.subset[q]);if(0==p.length)l=["latin"];else{var r=jQuery.map(p,function(a,b){return[a]});l=r}}subValue=void 0!==l?l:void 0!==n?"regular":o}else subValue=g;var s;s=jQuery(subSelector).selectize({maxItems:"variant"==f?1:null,valueField:"id",labelField:"label",searchField:["label"],options:i,items:"variant"==f?[subValue]:subValue,create:!1,plugins:"variant"==f?"":["remove_button"],render:{item:function(a,b){return"<div>"+b(a.label)+"</div>"},option:function(a,b){return"<div>"+b(a.label)+"</div>"}}}).data("selectize")}"variant"==f?1===i.length||0===i.length?a.container.find(".kirki-variant-wrapper").css("display","none"):a.container.find(".kirki-variant-wrapper").css("display","block"):"subset"==f&&(0===i.length?a.container.find(".kirki-subset-wrapper").css("display","none"):a.container.find(".kirki-subset-wrapper").css("display","block")),!0===h?a.container.find(".hide-on-standard-fonts").css("display","none"):a.container.find(".hide-on-standard-fonts").css("display","block")};jQuery(b).selectize({options:kirkiAllFonts,items:[a.setting._value["font-family"]],persist:!1,maxItems:1,valueField:"family",labelField:"label",searchField:["family","label","subsets"],create:!1,render:{item:function(a,b){return"<div>"+b(a.label)+"</div>"},option:function(a,b){return"<div>"+b(a.label)+"</div>"}}}),f(e["font-family"],"variant",e.variant),f(e["font-family"],"subset",e.subset),this.container.on("change",".font-family select",function(){e["font-family"]=jQuery(this).val(),a.setting.set(e),f(jQuery(this).val(),"variant",null),f(jQuery(this).val(),"subset",null),wp.customize.previewer.refresh()}),this.container.on("change",".variant select",function(){e.variant=jQuery(this).val(),a.setting.set(e),wp.customize.previewer.refresh()}),this.container.on("change",".subset select",function(){e.subset=jQuery(this).val(),a.setting.set(e),wp.customize.previewer.refresh()}),this.container.on("change keyup paste",".font-size input",function(){e["font-size"]=jQuery(this).val(),a.setting.set(e),wp.customize.previewer.refresh()}),this.container.on("change keyup paste",".line-height input",function(){e["line-height"]=jQuery(this).val(),a.setting.set(e),wp.customize.previewer.refresh()}),this.container.on("change keyup paste",".letter-spacing input",function(){e["letter-spacing"]=jQuery(this).val(),a.setting.set(e),wp.customize.previewer.refresh()});var g=this.container.find(".kirki-color-control");g.wpColorPicker({change:function(){setTimeout(function(){compiled_value.color=g.val(),a.setting.set(compiled_value),wp.customize.previewer.refresh()},100)}})}});
|
2 |
//# sourceMappingURL=customizer.min.js.map
|
1 |
+
function kirkiArrayToObject(a){var b={};if(null!==a)for(var c=0;c<a.length;++c)void 0!==a[c]&&(b[c]=a[c]);return b}function kirkiObjectToArray(a){var b=[];if(null!==a)for(var c=0;c<a.length;++c)void 0!==a[c]&&b.push(a[c]);return b}function kirkiValidateCSSValue(a){var b=!0;if("0"==a)return!0;var c=["rem","em","ex","%","px","cm","mm","in","pt","pc","ch","vh","vw","vmin","vmax"],d=parseFloat(a),e=a.replace(d,"");return NaN===d&&(b=!1),-1===jQuery.inArray(e,c)&&(b=!1),b}function RepeaterRow(a,b){this.rowIndex=a,this.rowNumber=a+1,this.$el=b,this.$dragger=this.$el.find(".repeater-row-move"),this.$minimizer=this.$el.find(".repeater-row-minimize"),this.$remover=this.$el.find(".repeater-row-remove"),this.$number=this.$el.find(".repeater-row-number"),this.$fields=this.$el.find("input,select,textarea");var c=this;this.$minimizer.on("click",function(){c.toggleMinimize()}),this.$remover.on("click",function(){c.remove()}),this.$dragger.on("mousedown",function(){c.$el.trigger("row:start-dragging")}),this.$el.on("keyup change","input, select, textarea",function(a){c.$el.trigger("row:update",[c.getRowIndex(),jQuery(a.target).data("field"),a.target])}),this.renderNumber()}wp.customize.controlConstructor["kirki-checkbox"]=wp.customize.Control.extend({ready:function(){var a=this,b=a.setting._value;this.container.on("change","input",function(){b=!!jQuery(this).is(":checked"),a.setting.set(b)})}}),wp.customize.controlConstructor.code=wp.customize.Control.extend({ready:function(){var a=this,b=a.container.find("#kirki-codemirror-editor-"+a.id),c=CodeMirror.fromTextArea(b[0]);if("html"==a.params.choices.language)var d={name:"htmlmixed"};else d=a.params.choices.language;c.setOption("value",a.setting._value),c.setOption("mode",d),c.setOption("lineNumbers",!0),c.setOption("theme",a.params.choices.theme),c.setOption("height",a.params.choices.height+"px"),c.on("change",function(){a.setting.set(c.getValue())}),b.parents(".accordion-section").on("click",function(){c.refresh()})}}),wp.customize.controlConstructor["color-alpha"]=wp.customize.Control.extend({ready:function(){var a=this,b=this.container.find(".kirki-color-control");b.val();b.wpColorPicker({change:function(c,d){setTimeout(function(){a.setting.set(b.val())},100)}})}}),wp.customize.controlConstructor.dimension=wp.customize.Control.extend({ready:function(){var a=this;!1===kirkiValidateCSSValue(a.setting._value)?jQuery(a.selector+" .input-wrapper").addClass("invalid"):jQuery(a.selector+" .input-wrapper").removeClass("invalid"),this.container.on("change keyup paste","input",function(){var b=jQuery(this).val();!1===kirkiValidateCSSValue(b)?jQuery(a.selector+" .input-wrapper").addClass("invalid"):(jQuery(a.selector+" .input-wrapper").removeClass("invalid"),a.setting.set(b))})}}),function(a){wp.customizerCtrlEditor={init:function(){a(window).load(function(){a("textarea.wp-editor-area").each(function(){var b,c,d=a(this),e=d.attr("id"),f=tinyMCE.get(e);f&&f.onChange.add(function(a,e){a.save(),c=f.getContent(),clearTimeout(b),b=setTimeout(function(){d.val(c).trigger("change")},500)}),d.css({visibility:"visible"}).on("keyup",function(){c=d.val(),clearTimeout(b),b=setTimeout(function(){c.trigger("change")},500)})})})}},wp.customizerCtrlEditor.init()}(jQuery),wp.customize.controlConstructor["kirki-generic"]=wp.customize.Control.extend({ready:function(){var a=this;this.container.on("change keyup paste",a.params.choices.element,function(){a.setting.set(jQuery(this).val())})}}),wp.customize.controlConstructor.multicheck=wp.customize.Control.extend({ready:function(){var a=this;a.container.on("change","input",function(){var b=[],c=0;jQuery.each(a.params.choices,function(d,e){a.container.find('input[value="'+d+'"]').is(":checked")&&(b[c]=d,c++)}),a.setting.set(b),wp.customize.previewer.refresh()})}}),wp.customize.controlConstructor.number=wp.customize.Control.extend({ready:function(){var a=this,b=this.container.find("input");jQuery(b).spinner(),a.params.choices.min&&jQuery(b).spinner("option","min",a.params.choices.min),a.params.choices.max&&jQuery(b).spinner("option","max",a.params.choices.max),a.params.choices.step&&("any"==a.params.choices.step?jQuery(b).spinner("option","step","0.001"):jQuery(b).spinner("option","step",a.params.choices.step)),this.container.on("change click keyup paste","input",function(){a.setting.set(jQuery(this).val())})}}),wp.customize.controlConstructor.palette=wp.customize.Control.extend({ready:function(){var a=this;this.container.on("click","input",function(){a.setting.set(jQuery(this).val())})}}),wp.customize.controlConstructor.preset=wp.customize.Control.extend({ready:function(){var a=this,b=this.container.find("select");jQuery(b).selectize(),this.container.on("change","select",function(){var b=jQuery(this).val();a.setting.set(b),jQuery.each(a.params.choices,function(a,c){b==a&&jQuery.each(c.settings,function(a,b){var c=wp.customize.settings.controls[a];if(void 0===typeof c)return!0;var d=c.type;if("checkbox"==d||"switch"==d||"toggle"==d||"kirki-checkbox"==d){var e=wp.customize.control(a).container.find("input");1==b?(jQuery(e).prop("checked",!0),wp.customize.instance(a).set(!0)):(jQuery(e).prop("checked",!1),wp.customize.instance(a).set(!1))}else if("select"==d||"select2"==d||"select2-multiple"==d||"kirki-select"==d){var e=wp.customize.control(a).container.find("select"),f=jQuery(e).selectize(),g=f[0].selectize;g.setValue(b,!0),wp.customize.instance(a).set(b)}else if("slider"==d){var e=wp.customize.control(a).container.find("input");jQuery(e).prop("value",b);var h=wp.customize.control(a).container.find(".kirki_range_value .value");jQuery(h).html(b),wp.customize.instance(a).set(b)}else if("textarea"==d||"kirki-textarea"==d){var e=wp.customize.control(a).container.find("textarea");jQuery(e).prop("value",b),wp.customize(a).set(b)}else if("color-alpha"==d||"kirki-color"==d||"color"==d){var i=wp.customize.control(a).container.find(".kirki-color-control");i.attr("data-default-color",b).data("default-color",b).wpColorPicker("color",b),wp.customize.instance(a).set(b)}else if("dimension"==d){wp.customize.instance(a).set(b);var e=wp.customize.control(a).container.find("input[type=number]"),j=parseFloat(b);jQuery(e).prop("value",j);var k=wp.customize.control(a).container.find("select"),l=b.replace(parseFloat(b),"");jQuery(k).prop("value",l)}else if("multicheck"==d)for(wp.customize.instance(a).set(b),wp.customize.control(a).container.find("input").each(function(){jQuery(this).prop("checked",!1)}),index=0;index<b.length;index++){var e=wp.customize.control(a).container.find('input[value="'+b[index]+'"]');jQuery(e).prop("checked",!0)}else if("radio-buttonset"==d||"radio-image"==d||"radio"==d||"kirki-radio"==d){var e=wp.customize.control(a).container.find('input[value="'+b+'"]');jQuery(e).prop("checked",!0),wp.customize.instance(a).set(b)}else{var e=wp.customize.control(a).container.find("input");jQuery(e).prop("value",b),wp.customize.instance(a).set(b)}})}),wp.customize.previewer.refresh()})}}),wp.customize.controlConstructor["radio-buttonset"]=wp.customize.Control.extend({ready:function(){var a=this;this.container.on("click","input",function(){a.setting.set(jQuery(this).val())})}}),wp.customize.controlConstructor["radio-image"]=wp.customize.Control.extend({ready:function(){var a=this;this.container.on("click","input",function(){a.setting.set(jQuery(this).val())})}}),wp.customize.controlConstructor["kirki-radio"]=wp.customize.Control.extend({ready:function(){var a=this;this.container.on("change","input",function(){a.setting.set(jQuery(this).val())})}}),RepeaterRow.prototype.getRowIndex=function(){return this.rowIndex},RepeaterRow.prototype.getRowNumber=function(){return this.rowNumber},RepeaterRow.prototype.setRowNumber=function(a){this.rowNumber=a,this.renderNumber()},RepeaterRow.prototype.getElement=function(){return this.$el},RepeaterRow.prototype.setRowIndex=function(a){this.rowIndex=a,this.$el.attr("data-row",a),this.$el.data("row",a)},RepeaterRow.prototype.toggleMinimize=function(){this.$el.toggleClass("minimized"),this.$minimizer.find(".repeater-minimize").toggleClass("dashicons-arrow-up"),this.$minimizer.find(".repeater-minimize").toggleClass("dashicons-arrow-down")},RepeaterRow.prototype.minimize=function(){this.$el.addClass("minimized"),this.$minimizer.find(".repeater-minimize").removeClass("dashicons-arrow-up"),this.$minimizer.find(".repeater-minimize").addClass("dashicons-arrow-down")},RepeaterRow.prototype.remove=function(){confirm("Are you sure?")&&(this.$el.slideUp(300,function(){jQuery(this).detach()}),this.$el.trigger("row:remove",[this.getRowIndex()]))},RepeaterRow.prototype.renderNumber=function(){this.$number.text(this.getRowNumber())},wp.customize.controlConstructor.repeater=wp.customize.Control.extend({ready:function(){var a=this,b=this.params.value;if(this.settingField=this.container.find("[data-customize-setting-link]").first(),this.setValue([],!1),this.repeaterFieldsContainer=this.container.find(".repeater-fields").first(),this.currentIndex=0,this.rows=[],void 0!==this.params.choices.limit)if(this.params.choices.limit<=0)var c=!1;else var c=parseInt(this.params.choices.limit);else var c=!1;if(this.container.on("click","button.repeater-add",function(b){b.preventDefault(),!c||a.currentIndex<c?a.addRow():jQuery(a.selector+" .limit").toggleClass("highlight")}),this.container.on("click keypress",".repeater-field-image .upload-button",function(b){b.preventDefault(),a.$thisButton=jQuery(this),a.openFrame(b)}),this.container.on("click keypress",".repeater-field-image .remove-button",function(b){b.preventDefault(),a.$thisButton=jQuery(this),a.removeImage(b)}),this.repeaterTemplate=_.memoize(function(){var b,c={evaluate:/<#([\s\S]+?)#>/g,interpolate:/\{\{\{([\s\S]+?)\}\}\}/g,escape:/\{\{([^\}]+?)\}\}(?!\})/g,variable:"data"};return function(d){return(b=_.template(a.container.find(".customize-control-repeater-content").first().html(),null,c))(d)}}),b.length)for(var d=0;d<b.length;d++)a.addRow(b[d]);this.repeaterFieldsContainer.sortable({handle:".repeater-row-move",update:function(b,c){a.sort()}})},openFrame:function(a){wp.customize.utils.isKeydownButNotEnterEvent(a)||(this.frame||this.initFrame(),this.frame.open())},initFrame:function(){var a=this;this.frame=wp.media({states:[new wp.media.controller.Library({library:wp.media.query({type:"image"}),multiple:!1,date:!1})]}),this.frame.on("select",function(b){a.selectImage()})},selectImage:function(){var a=this.frame.state().get("selection").first().toJSON(),b=a.url,c=this.$thisButton.closest(".repeater-field-image");c.find(".kirki-image-attachment").html('<img src="'+b+'">').hide().slideDown("slow"),c.find(".hidden-field").val(b),this.$thisButton.text(this.$thisButton.data("alt-label")),c.find(".remove-button").show(),c.find("input, textarea, select").trigger("change")},removeImage:function(a){if(!wp.customize.utils.isKeydownButNotEnterEvent(a)){var b=this.$thisButton.closest(".repeater-field-image"),c=b.find(".upload-button");b.find(".kirki-image-attachment").slideUp("fast",function(){jQuery(this).show().html(jQuery(this).data("placeholder"))}),b.find(".hidden-field").val(""),c.text(c.data("label")),this.$thisButton.hide(),b.find("input, textarea, select").trigger("change")}},getValue:function(){return JSON.parse(decodeURI(this.setting.get()))},setValue:function(a,b){this.setting.set(encodeURI(JSON.stringify(a))),b&&this.settingField.trigger("change")},addRow:function(a){var b,c,d=this,e=d.repeaterTemplate(),f=this.getValue(),g={};if(e){if(c=jQuery.extend(!0,{},d.params.fields),a)for(b in a)a.hasOwnProperty(b)&&c.hasOwnProperty(b)&&(c[b]["default"]=a[b]);c.index=this.currentIndex,c.ControlId=this.id,e=e(c);var h=new RepeaterRow(d.currentIndex,jQuery(e).appendTo(d.repeaterFieldsContainer));h.getElement().one("row:remove",function(a,b){d.deleteRow(b)}),h.getElement().on("row:update",function(a,b,c,e){d.updateField.call(d,a,b,c,e)}),h.getElement().on("row:start-dragging",function(){for(b in d.rows)d.rows.hasOwnProperty(b)&&d.rows[b]&&d.rows[b].minimize()}),this.rows[this.currentIndex]=h;for(b in c)c.hasOwnProperty(b)&&(g[b]=c[b]["default"]);f[this.currentIndex]=g,this.setValue(f,!0),this.currentIndex++}},sort:function(){var a=this,b=this.repeaterFieldsContainer.find(".repeater-row"),c=[];b.each(function(a,b){c.push(jQuery(b).data("row"))});var d=a.getValue(),e=[],f=[];jQuery.each(c,function(b,c){e[b]=a.rows[c],e[b].setRowIndex(b),e[b].setRowNumber(b+1),f[b]=d[c]}),a.rows=e,a.setValue(f)},deleteRow:function(a){var b=this.getValue();if(b[a]){var c=this.rows[a];c&&(delete b[a],delete this.rows[a],this.setValue(b,!0))}var d=1;for(prop in this.rows)this.rows.hasOwnProperty(prop)&&this.rows[prop]&&(this.rows[prop].setRowNumber(d),d++)},updateField:function(a,b,c,d){if(this.rows[b]&&this.params.fields[c]){var e=this.params.fields[c].type,f=this.rows[b],g=this.getValue();d=jQuery(d),void 0!=typeof g[f.getRowIndex()][c]&&("checkbox"==e?g[f.getRowIndex()][c]=d.is(":checked"):g[f.getRowIndex()][c]=d.val(),this.setValue(g,!0))}}}),wp.customize.controlConstructor["kirki-select"]=wp.customize.Control.extend({ready:function(){var a=this,b=this.container.find("select"),c=parseInt(b.data("multiple"));c>1?jQuery(b).selectize({maxItems:c,plugins:["remove_button","drag_drop"]}):jQuery(b).selectize(),this.container.on("change","select",function(){if(c>1)var b=kirkiArrayToObject(jQuery(this).val());else var b=jQuery(this).val();a.setting.set(b)})}}),jQuery(document).ready(function(a){a("input[type=range]").on("mousedown",function(){value=a(this).attr("value"),a(this).mousemove(function(){value=a(this).attr("value"),a(this).closest("label").find(".kirki_range_value .value").text(value)})}),a(".kirki-slider-reset").click(function(){var b=a(this).closest("label").find("input"),c=(b.data("customize-setting-link"),b.data("reset_value"));b.val(c),b.change(),a(this).closest("label").find(".kirki_range_value .value").text(c)})}),wp.customize.controlConstructor.slider=wp.customize.Control.extend({ready:function(){var a=this;this.container.on("change","input",function(){a.setting.set(jQuery(this).val())})}}),wp.customize.controlConstructor.sortable=wp.customize.Control.extend({ready:function(){var a=this;this.settingField=this.container.find("[data-customize-setting-link]").first(),this.sortableContainer=this.container.find("ul.sortable").first(),this.setValue(this.setting.get(),!1),this.sortableContainer.sortable().disableSelection().on("sortstop",function(b,c){a.sort()}).find("li").each(function(){jQuery(this).find("i.visibility").click(function(){jQuery(this).toggleClass("dashicons-visibility-faint").parents("li:eq(0)").toggleClass("invisible")})}).click(function(){a.sort()})},sort:function(){var a=[];this.sortableContainer.find("li").each(function(){var b=jQuery(this);b.is(".invisible")||a.push(b.data("value"))}),this.setValue(a,!0)},getValue:function(){return unserialize(this.setting.get())},setValue:function(a,b){a=serialize(a),this.setting.set(a),this.settingField.val(a),b&&this.settingField.trigger("change")}}),wp.customize.controlConstructor.spacing=wp.customize.Control.extend({ready:function(){var a=this,b={};jQuery.each(["top","bottom","left","right"],function(c,d){a.container.has("."+d).size()&&(b[d]=a.setting._value[d],!1===kirkiValidateCSSValue(a.setting._value[d])?jQuery(a.selector+" ."+d+".input-wrapper").addClass("invalid"):jQuery(a.selector+" ."+d+".input-wrapper").removeClass("invalid")),a.container.has("."+d).size()&&a.container.on("change keyup paste","."+d+" input",function(){subValue=jQuery(this).val(),!1===kirkiValidateCSSValue(subValue)?jQuery(a.selector+" ."+d+".input-wrapper").addClass("invalid"):(jQuery(a.selector+" ."+d+".input-wrapper").removeClass("invalid"),b[d]=subValue,a.setting.set(b),wp.customize.previewer.refresh())})})}}),wp.customize.controlConstructor["switch"]=wp.customize.Control.extend({ready:function(){var a=this,b=a.setting._value;this.container.on("change","input",function(){b=!!jQuery(this).is(":checked"),a.setting.set(b)})}}),wp.customize.controlConstructor.toggle=wp.customize.Control.extend({ready:function(){var a=this,b=a.setting._value;this.container.on("change","input",function(){b=!!jQuery(this).is(":checked"),a.setting.set(b)})}}),wp.customize.controlConstructor.typography=wp.customize.Control.extend({ready:function(){var a=this,b=a.selector+" .font-family select",c=a.selector+" .variant select",d=a.selector+" .subset select",e={};e["font-family"]=void 0!==a.setting._value["font-family"]?a.setting._value["font-family"]:"",e["font-size"]=void 0!==a.setting._value["font-size"]?a.setting._value["font-size"]:"",e.variant=void 0!==a.setting._value.variant?a.setting._value.variant:"",e.subset=void 0!==a.setting._value.subset?a.setting._value.subset:"",e["line-height"]=void 0!==a.setting._value["line-height"]?a.setting._value["line-height"]:"",e["letter-spacing"]=void 0!==a.setting._value["letter-spacing"]?a.setting._value["letter-spacing"]:"",e.color=void 0!==a.setting._value.color?a.setting._value.color:"";var f=function(b,f,g){subSelector="variant"==f?c:d;var h=!1,i={};void 0!==jQuery(subSelector).selectize()[0]&&jQuery(subSelector).selectize()[0].selectize.destroy();for(var j=0,k=kirkiAllFonts.length;k>j;j++)b===kirkiAllFonts[j].family&&(void 0!==kirkiAllFonts[j].is_standard&&!0===kirkiAllFonts[j].is_standard&&(h=!0),i=kirkiAllFonts[j][f+"s"]);if(!1===h||"subset"!==f){if(null===g){if("variant"==f)for(var j=0,k=i.length;k>j;j++)if(void 0!==i[j].id)var l=e.variant;else{var m="regular";if(m==i[j].id)var n=!0;else if(void 0===o)var o=i[j].id}else if("subset"==f){for(var p={},j=0,k=i.length;k>j;j++)if(null!==e.subset)for(var q=0,k=e.subset.length;k>q;q++)void 0!==i[j]&&e.subset[q]==i[j].id&&(p[e.subset[q]]=e.subset[q]);if(0==p.length)l=["latin"];else{var r=jQuery.map(p,function(a,b){return[a]});l=r}}subValue=void 0!==l?l:void 0!==n?"regular":o}else subValue=g;var s;s=jQuery(subSelector).selectize({maxItems:"variant"==f?1:null,valueField:"id",labelField:"label",searchField:["label"],options:i,items:"variant"==f?[subValue]:subValue,create:!1,plugins:"variant"==f?"":["remove_button"],render:{item:function(a,b){return"<div>"+b(a.label)+"</div>"},option:function(a,b){return"<div>"+b(a.label)+"</div>"}}}).data("selectize")}"variant"==f?1===i.length||0===i.length?a.container.find(".kirki-variant-wrapper").css("display","none"):a.container.find(".kirki-variant-wrapper").css("display","block"):"subset"==f&&(0===i.length?a.container.find(".kirki-subset-wrapper").css("display","none"):a.container.find(".kirki-subset-wrapper").css("display","block")),!0===h?a.container.find(".hide-on-standard-fonts").css("display","none"):a.container.find(".hide-on-standard-fonts").css("display","block")};jQuery(b).selectize({options:kirkiAllFonts,items:[a.setting._value["font-family"]],persist:!1,maxItems:1,valueField:"family",labelField:"label",searchField:["family","label","subsets"],create:!1,render:{item:function(a,b){return"<div>"+b(a.label)+"</div>"},option:function(a,b){return"<div>"+b(a.label)+"</div>"}}}),f(e["font-family"],"variant",e.variant),f(e["font-family"],"subset",e.subset),this.container.on("change",".font-family select",function(){e["font-family"]=jQuery(this).val(),a.setting.set(e),f(jQuery(this).val(),"variant",null),f(jQuery(this).val(),"subset",null),wp.customize.previewer.refresh()}),this.container.on("change",".variant select",function(){e.variant=jQuery(this).val(),a.setting.set(e),wp.customize.previewer.refresh()}),this.container.on("change",".subset select",function(){e.subset=jQuery(this).val(),a.setting.set(e),wp.customize.previewer.refresh()}),this.container.on("change keyup paste",".font-size input",function(){e["font-size"]=jQuery(this).val(),a.setting.set(e),wp.customize.previewer.refresh()}),this.container.on("change keyup paste",".line-height input",function(){e["line-height"]=jQuery(this).val(),a.setting.set(e),wp.customize.previewer.refresh()}),this.container.on("change keyup paste",".letter-spacing input",function(){e["letter-spacing"]=jQuery(this).val(),a.setting.set(e),wp.customize.previewer.refresh()});var g=this.container.find(".kirki-color-control");g.wpColorPicker({change:function(){setTimeout(function(){compiled_value.color=g.val(),a.setting.set(compiled_value),wp.customize.previewer.refresh()},100)}})}});
|
2 |
//# sourceMappingURL=customizer.min.js.map
|
assets/js/customizer.min.js.map
CHANGED
@@ -1 +1 @@
|
|
1 |
-
{"version":3,"sources":["customizer.js"],"names":["kirkiArrayToObject","arr","obj","i","length","undefined","kirkiObjectToArray","push","kirkiValidateCSSValue","value","valueIsValid","validUnits","numericValue","parseFloat","unit","replace","NaN","jQuery","inArray","RepeaterRow","rowIndex","element","this","rowNumber","$el","$dragger","find","$minimizer","$remover","$number","$fields","self","on","toggleMinimize","remove","trigger","e","getRowIndex","target","data","renderNumber","wp","customize","controlConstructor","Control","extend","ready","control","checkbox_value","setting","_value","container","is","set","id","editor","CodeMirror","fromTextArea","params","choices","language","name","setOption","theme","height","getValue","parents","refresh","picker","val","wpColorPicker","change","event","ui","setTimeout","selector","addClass","removeClass","$","customizerCtrlEditor","init","window","load","each","setChange","content","tArea","attr","tinyMCE","get","onChange","add","ed","save","getContent","clearTimeout","css","visibility","compiled_value","key","previewer","spinner","min","max","step","selectize","select_value","preset_setting","preset_setting_value","sub_control","settings","controls","sub_control_type","input_element","prop","instance","$select","setValue","numeric_element","html","alphaColorControl","numeric_value","select_element","units_value","index","prototype","getRowNumber","setRowNumber","getElement","setRowIndex","toggleClass","minimize","confirm","slideUp","detach","text","settingValue","settingField","first","repeaterFieldsContainer","currentIndex","rows","preventDefault","addRow","$thisButton","openFrame","removeImage","repeaterTemplate","_","memoize","compiled","options","evaluate","interpolate","escape","variable","template","sortable","handle","update","sort","utils","isKeydownButNotEnterEvent","frame","initFrame","open","media","states","controller","Library","library","query","type","multiple","date","selectImage","attachment","state","toJSON","image_src","url","$targetDiv","closest","hide","slideDown","show","$uploadButton","JSON","parse","decodeURI","newValue","encodeURI","stringify","templateData","newRowSetting","fields","hasOwnProperty","newRow","appendTo","one","deleteRow","fieldName","updateField","call","$rows","newOrder","newRows","newSettings","newPosition","oldPosition","currentSettings","row","fieldId","parseInt","maxItems","plugins","document","mousemove","click","$this_input","input_default","sortableContainer","disableSelection","$this","unserialize","serialize","dimension","has","size","subValue","fontFamilySelector","variantSelector","subsetSelector","renderSubControl","fontFamily","sub","startValue","subSelector","is_standard","subList","destroy","len","kirkiAllFonts","activeItem","defaultValue","hasDefault","firstAvailable","subsetValues","s","subsetValuesArray","map","subSelectize","valueField","labelField","searchField","items","create","render","item","label","option","persist"],"mappings":"AAAA,QAASA,oBAAoBC,GAC5B,GAAIC,KACJ,IAAK,OAASD,EACb,IAAM,GAAIE,GAAI,EAAGA,EAAIF,EAAIG,SAAUD,EAC7BE,SAAcJ,EAAKE,KACvBD,EAAKC,GAAMF,EAAKE,GAInB,OAAOD,GAGR,QAASI,oBAAoBJ,GAC5B,GAAID,KACJ,IAAK,OAASC,EACb,IAAM,GAAIC,GAAI,EAAGA,EAAID,EAAIE,SAAUD,EAC7BE,SAAcH,EAAKC,IACvBF,EAAIM,KAAML,EAAKC,GAIlB,OAAOF,GAGR,QAASO,uBAAuBC,GAC/B,GAAIC,IAAe,CAEnB,IAAK,KAAOD,EACX,OAAO,CAGR,IAAIE,IAAgB,MAAO,KAAM,KAAM,IAAK,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,OAAQ,QAEtGC,EAAeC,WAAYJ,GAE3BK,EAAOL,EAAMM,QAASH,EAAc,GAUxC,OARKI,OAAQJ,IACZF,GAAe,GAGX,KAAOO,OAAOC,QAASJ,EAAMH,KACjCD,GAAe,GAGTA,EAwgBR,QAASS,aAAaC,EAAUC,GAC5BC,KAAKF,SAAWA,EAChBE,KAAKC,UAAYH,EAAW,EAC5BE,KAAKE,IAAMH,EACXC,KAAKG,SAAWH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,OAAQK,MAAO+C,MACpCtB,EAAQE,QAAQI,IAAK5C,GAErBgC,GAAGC,UAAU0D,UAAUjC,YAGxB7C,KAAK6B,UAAUnB,GAAI,qBAAsB,qBAAsB,WAE9DvB,EAAM,eAAiBQ,OAAQK,MAAO+C,MACtCtB,EAAQE,QAAQI,IAAK5C,GAErBgC,GAAGC,UAAU0D,UAAUjC,YAGxB7C,KAAK6B,UAAUnB,GAAI,qBAAsB,wBAAyB,WAEjEvB,EAAM,kBAAoBQ,OAAQK,MAAO+C,MACzCtB,EAAQE,QAAQI,IAAK5C,GAErBgC,GAAGC,UAAU0D,UAAUjC,WAGxB,IAAIC,GAAS9C,KAAK6B,UAAUzB,KAAO,uBACnC0C,GAAOE,eACNC,OAAQ,WACPG,WAAa,WAEZwB,eAAwB,MAAI9B,EAAOC,MACnCtB,EAAQE,QAAQI,IAAM6C,gBAEtBzD,GAAGC,UAAU0D,UAAUjC,WACrB","file":"customizer.min.js"}
|
1 |
+
{"version":3,"sources":["customizer.js"],"names":["kirkiArrayToObject","arr","obj","i","length","undefined","kirkiObjectToArray","push","kirkiValidateCSSValue","value","valueIsValid","validUnits","numericValue","parseFloat","unit","replace","NaN","jQuery","inArray","RepeaterRow","rowIndex","element","this","rowNumber","$el","$dragger","find","$minimizer","$remover","$number","$fields","self","on","toggleMinimize","remove","trigger","e","getRowIndex","target","data","renderNumber","wp","customize","controlConstructor","Control","extend","ready","control","checkbox_value","setting","_value","container","is","set","id","editor","CodeMirror","fromTextArea","params","choices","language","name","setOption","theme","height","getValue","parents","refresh","picker","val","wpColorPicker","change","event","ui","setTimeout","selector","addClass","removeClass","$","customizerCtrlEditor","init","window","load","each","setChange","content","tArea","attr","tinyMCE","get","onChange","add","ed","save","getContent","clearTimeout","css","visibility","compiled_value","key","previewer","spinner","min","max","step","selectize","select_value","preset_setting","preset_setting_value","sub_control","settings","controls","sub_control_type","input_element","prop","instance","$select","setValue","numeric_element","html","alphaColorControl","numeric_value","select_element","units_value","index","prototype","getRowNumber","setRowNumber","getElement","setRowIndex","toggleClass","minimize","confirm","slideUp","detach","text","settingValue","settingField","first","repeaterFieldsContainer","currentIndex","rows","limit","parseInt","preventDefault","addRow","$thisButton","openFrame","removeImage","repeaterTemplate","_","memoize","compiled","options","evaluate","interpolate","escape","variable","template","sortable","handle","update","sort","utils","isKeydownButNotEnterEvent","frame","initFrame","open","media","states","controller","Library","library","query","type","multiple","date","selectImage","attachment","state","toJSON","image_src","url","$targetDiv","closest","hide","slideDown","show","$uploadButton","JSON","parse","decodeURI","newValue","encodeURI","stringify","templateData","newRowSetting","fields","hasOwnProperty","newRow","appendTo","one","deleteRow","fieldName","updateField","call","$rows","newOrder","newRows","newSettings","newPosition","oldPosition","currentSettings","row","fieldId","maxItems","plugins","document","mousemove","click","$this_input","input_default","sortableContainer","disableSelection","$this","unserialize","serialize","dimension","has","size","subValue","fontFamilySelector","variantSelector","subsetSelector","renderSubControl","fontFamily","sub","startValue","subSelector","is_standard","subList","destroy","len","kirkiAllFonts","activeItem","defaultValue","hasDefault","firstAvailable","subsetValues","s","subsetValuesArray","map","subSelectize","valueField","labelField","searchField","items","create","render","item","label","option","persist"],"mappings":"AAAA,QAASA,oBAAoBC,GAC5B,GAAIC,KACJ,IAAK,OAASD,EACb,IAAM,GAAIE,GAAI,EAAGA,EAAIF,EAAIG,SAAUD,EAC7BE,SAAcJ,EAAKE,KACvBD,EAAKC,GAAMF,EAAKE,GAInB,OAAOD,GAGR,QAASI,oBAAoBJ,GAC5B,GAAID,KACJ,IAAK,OAASC,EACb,IAAM,GAAIC,GAAI,EAAGA,EAAID,EAAIE,SAAUD,EAC7BE,SAAcH,EAAKC,IACvBF,EAAIM,KAAML,EAAKC,GAIlB,OAAOF,GAGR,QAASO,uBAAuBC,GAC/B,GAAIC,IAAe,CAEnB,IAAK,KAAOD,EACX,OAAO,CAGR,IAAIE,IAAgB,MAAO,KAAM,KAAM,IAAK,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,K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) 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("apl", function() {
|
15 |
-
var builtInOps = {
|
16 |
-
".": "innerProduct",
|
17 |
-
"\\": "scan",
|
18 |
-
"/": "reduce",
|
19 |
-
"⌿": "reduce1Axis",
|
20 |
-
"⍀": "scan1Axis",
|
21 |
-
"¨": "each",
|
22 |
-
"⍣": "power"
|
23 |
-
};
|
24 |
-
var builtInFuncs = {
|
25 |
-
"+": ["conjugate", "add"],
|
26 |
-
"−": ["negate", "subtract"],
|
27 |
-
"×": ["signOf", "multiply"],
|
28 |
-
"÷": ["reciprocal", "divide"],
|
29 |
-
"⌈": ["ceiling", "greaterOf"],
|
30 |
-
"⌊": ["floor", "lesserOf"],
|
31 |
-
"∣": ["absolute", "residue"],
|
32 |
-
"⍳": ["indexGenerate", "indexOf"],
|
33 |
-
"?": ["roll", "deal"],
|
34 |
-
"⋆": ["exponentiate", "toThePowerOf"],
|
35 |
-
"⍟": ["naturalLog", "logToTheBase"],
|
36 |
-
"○": ["piTimes", "circularFuncs"],
|
37 |
-
"!": ["factorial", "binomial"],
|
38 |
-
"⌹": ["matrixInverse", "matrixDivide"],
|
39 |
-
"<": [null, "lessThan"],
|
40 |
-
"≤": [null, "lessThanOrEqual"],
|
41 |
-
"=": [null, "equals"],
|
42 |
-
">": [null, "greaterThan"],
|
43 |
-
"≥": [null, "greaterThanOrEqual"],
|
44 |
-
"≠": [null, "notEqual"],
|
45 |
-
"≡": ["depth", "match"],
|
46 |
-
"≢": [null, "notMatch"],
|
47 |
-
"∈": ["enlist", "membership"],
|
48 |
-
"⍷": [null, "find"],
|
49 |
-
"∪": ["unique", "union"],
|
50 |
-
"∩": [null, "intersection"],
|
51 |
-
"∼": ["not", "without"],
|
52 |
-
"∨": [null, "or"],
|
53 |
-
"∧": [null, "and"],
|
54 |
-
"⍱": [null, "nor"],
|
55 |
-
"⍲": [null, "nand"],
|
56 |
-
"⍴": ["shapeOf", "reshape"],
|
57 |
-
",": ["ravel", "catenate"],
|
58 |
-
"⍪": [null, "firstAxisCatenate"],
|
59 |
-
"⌽": ["reverse", "rotate"],
|
60 |
-
"⊖": ["axis1Reverse", "axis1Rotate"],
|
61 |
-
"⍉": ["transpose", null],
|
62 |
-
"↑": ["first", "take"],
|
63 |
-
"↓": [null, "drop"],
|
64 |
-
"⊂": ["enclose", "partitionWithAxis"],
|
65 |
-
"⊃": ["diclose", "pick"],
|
66 |
-
"⌷": [null, "index"],
|
67 |
-
"⍋": ["gradeUp", null],
|
68 |
-
"⍒": ["gradeDown", null],
|
69 |
-
"⊤": ["encode", null],
|
70 |
-
"⊥": ["decode", null],
|
71 |
-
"⍕": ["format", "formatByExample"],
|
72 |
-
"⍎": ["execute", null],
|
73 |
-
"⊣": ["stop", "left"],
|
74 |
-
"⊢": ["pass", "right"]
|
75 |
-
};
|
76 |
-
|
77 |
-
var isOperator = /[\.\/⌿⍀¨⍣]/;
|
78 |
-
var isNiladic = /⍬/;
|
79 |
-
var isFunction = /[\+−×÷⌈⌊∣⍳\?⋆⍟○!⌹<≤=>≥≠≡≢∈⍷∪∩∼∨∧⍱⍲⍴,⍪⌽⊖⍉↑↓⊂⊃⌷⍋⍒⊤⊥⍕⍎⊣⊢]/;
|
80 |
-
var isArrow = /←/;
|
81 |
-
var isComment = /[⍝#].*$/;
|
82 |
-
|
83 |
-
var stringEater = function(type) {
|
84 |
-
var prev;
|
85 |
-
prev = false;
|
86 |
-
return function(c) {
|
87 |
-
prev = c;
|
88 |
-
if (c === type) {
|
89 |
-
return prev === "\\";
|
90 |
-
}
|
91 |
-
return true;
|
92 |
-
};
|
93 |
-
};
|
94 |
-
return {
|
95 |
-
startState: function() {
|
96 |
-
return {
|
97 |
-
prev: false,
|
98 |
-
func: false,
|
99 |
-
op: false,
|
100 |
-
string: false,
|
101 |
-
escape: false
|
102 |
-
};
|
103 |
-
},
|
104 |
-
token: function(stream, state) {
|
105 |
-
var ch, funcName;
|
106 |
-
if (stream.eatSpace()) {
|
107 |
-
return null;
|
108 |
-
}
|
109 |
-
ch = stream.next();
|
110 |
-
if (ch === '"' || ch === "'") {
|
111 |
-
stream.eatWhile(stringEater(ch));
|
112 |
-
stream.next();
|
113 |
-
state.prev = true;
|
114 |
-
return "string";
|
115 |
-
}
|
116 |
-
if (/[\[{\(]/.test(ch)) {
|
117 |
-
state.prev = false;
|
118 |
-
return null;
|
119 |
-
}
|
120 |
-
if (/[\]}\)]/.test(ch)) {
|
121 |
-
state.prev = true;
|
122 |
-
return null;
|
123 |
-
}
|
124 |
-
if (isNiladic.test(ch)) {
|
125 |
-
state.prev = false;
|
126 |
-
return "niladic";
|
127 |
-
}
|
128 |
-
if (/[¯\d]/.test(ch)) {
|
129 |
-
if (state.func) {
|
130 |
-
state.func = false;
|
131 |
-
state.prev = false;
|
132 |
-
} else {
|
133 |
-
state.prev = true;
|
134 |
-
}
|
135 |
-
stream.eatWhile(/[\w\.]/);
|
136 |
-
return "number";
|
137 |
-
}
|
138 |
-
if (isOperator.test(ch)) {
|
139 |
-
return "operator apl-" + builtInOps[ch];
|
140 |
-
}
|
141 |
-
if (isArrow.test(ch)) {
|
142 |
-
return "apl-arrow";
|
143 |
-
}
|
144 |
-
if (isFunction.test(ch)) {
|
145 |
-
funcName = "apl-";
|
146 |
-
if (builtInFuncs[ch] != null) {
|
147 |
-
if (state.prev) {
|
148 |
-
funcName += builtInFuncs[ch][1];
|
149 |
-
} else {
|
150 |
-
funcName += builtInFuncs[ch][0];
|
151 |
-
}
|
152 |
-
}
|
153 |
-
state.func = true;
|
154 |
-
state.prev = false;
|
155 |
-
return "function " + funcName;
|
156 |
-
}
|
157 |
-
if (isComment.test(ch)) {
|
158 |
-
stream.skipToEnd();
|
159 |
-
return "comment";
|
160 |
-
}
|
161 |
-
if (ch === "∘" && stream.peek() === ".") {
|
162 |
-
stream.next();
|
163 |
-
return "function jot-dot";
|
164 |
-
}
|
165 |
-
stream.eatWhile(/[\w\$_]/);
|
166 |
-
state.prev = true;
|
167 |
-
return "keyword";
|
168 |
-
}
|
169 |
-
};
|
170 |
-
});
|
171 |
-
|
172 |
-
CodeMirror.defineMIME("text/apl", "apl");
|
173 |
-
|
174 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/apl/index.html
DELETED
@@ -1,72 +0,0 @@
|
|
1 |
-
<!doctype html>
|
2 |
-
|
3 |
-
<title>CodeMirror: APL mode</title>
|
4 |
-
<meta charset="utf-8"/>
|
5 |
-
<link rel=stylesheet href="../../doc/docs.css">
|
6 |
-
|
7 |
-
<link rel="stylesheet" href="../../lib/codemirror.css">
|
8 |
-
<script src="../../lib/codemirror.js"></script>
|
9 |
-
<script src="../../addon/edit/matchbrackets.js"></script>
|
10 |
-
<script src="./apl.js"></script>
|
11 |
-
<style>
|
12 |
-
.CodeMirror { border: 2px inset #dee; }
|
13 |
-
</style>
|
14 |
-
<div id=nav>
|
15 |
-
<a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
16 |
-
|
17 |
-
<ul>
|
18 |
-
<li><a href="../../index.html">Home</a>
|
19 |
-
<li><a href="../../doc/manual.html">Manual</a>
|
20 |
-
<li><a href="https://github.com/codemirror/codemirror">Code</a>
|
21 |
-
</ul>
|
22 |
-
<ul>
|
23 |
-
<li><a href="../index.html">Language modes</a>
|
24 |
-
<li><a class=active href="#">APL</a>
|
25 |
-
</ul>
|
26 |
-
</div>
|
27 |
-
|
28 |
-
<article>
|
29 |
-
<h2>APL mode</h2>
|
30 |
-
<form><textarea id="code" name="code">
|
31 |
-
⍝ Conway's game of life
|
32 |
-
|
33 |
-
⍝ This example was inspired by the impressive demo at
|
34 |
-
⍝ http://www.youtube.com/watch?v=a9xAKttWgP4
|
35 |
-
|
36 |
-
⍝ Create a matrix:
|
37 |
-
⍝ 0 1 1
|
38 |
-
⍝ 1 1 0
|
39 |
-
⍝ 0 1 0
|
40 |
-
creature ← (3 3 ⍴ ⍳ 9) ∈ 1 2 3 4 7 ⍝ Original creature from demo
|
41 |
-
creature ← (3 3 ⍴ ⍳ 9) ∈ 1 3 6 7 8 ⍝ Glider
|
42 |
-
|
43 |
-
⍝ Place the creature on a larger board, near the centre
|
44 |
-
board ← ¯1 ⊖ ¯2 ⌽ 5 7 ↑ creature
|
45 |
-
|
46 |
-
⍝ A function to move from one generation to the next
|
47 |
-
life ← {∨/ 1 ⍵ ∧ 3 4 = ⊂+/ +⌿ 1 0 ¯1 ∘.⊖ 1 0 ¯1 ⌽¨ ⊂⍵}
|
48 |
-
|
49 |
-
⍝ Compute n-th generation and format it as a
|
50 |
-
⍝ character matrix
|
51 |
-
gen ← {' #'[(life ⍣ ⍵) board]}
|
52 |
-
|
53 |
-
⍝ Show first three generations
|
54 |
-
(gen 1) (gen 2) (gen 3)
|
55 |
-
</textarea></form>
|
56 |
-
|
57 |
-
<script>
|
58 |
-
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
|
59 |
-
lineNumbers: true,
|
60 |
-
matchBrackets: true,
|
61 |
-
mode: "text/apl"
|
62 |
-
});
|
63 |
-
</script>
|
64 |
-
|
65 |
-
<p>Simple mode that tries to handle APL as well as it can.</p>
|
66 |
-
<p>It attempts to label functions/operators based upon
|
67 |
-
monadic/dyadic usage (but this is far from fully fleshed out).
|
68 |
-
This means there are meaningful classnames so hover states can
|
69 |
-
have popups etc.</p>
|
70 |
-
|
71 |
-
<p><strong>MIME types defined:</strong> <code>text/apl</code> (APL code)</p>
|
72 |
-
</article>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/asciiarmor/asciiarmor.js
DELETED
@@ -1,73 +0,0 @@
|
|
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 errorIfNotEmpty(stream) {
|
15 |
-
var nonWS = stream.match(/^\s*\S/);
|
16 |
-
stream.skipToEnd();
|
17 |
-
return nonWS ? "error" : null;
|
18 |
-
}
|
19 |
-
|
20 |
-
CodeMirror.defineMode("asciiarmor", function() {
|
21 |
-
return {
|
22 |
-
token: function(stream, state) {
|
23 |
-
var m;
|
24 |
-
if (state.state == "top") {
|
25 |
-
if (stream.sol() && (m = stream.match(/^-----BEGIN (.*)?-----\s*$/))) {
|
26 |
-
state.state = "headers";
|
27 |
-
state.type = m[1];
|
28 |
-
return "tag";
|
29 |
-
}
|
30 |
-
return errorIfNotEmpty(stream);
|
31 |
-
} else if (state.state == "headers") {
|
32 |
-
if (stream.sol() && stream.match(/^\w+:/)) {
|
33 |
-
state.state = "header";
|
34 |
-
return "atom";
|
35 |
-
} else {
|
36 |
-
var result = errorIfNotEmpty(stream);
|
37 |
-
if (result) state.state = "body";
|
38 |
-
return result;
|
39 |
-
}
|
40 |
-
} else if (state.state == "header") {
|
41 |
-
stream.skipToEnd();
|
42 |
-
state.state = "headers";
|
43 |
-
return "string";
|
44 |
-
} else if (state.state == "body") {
|
45 |
-
if (stream.sol() && (m = stream.match(/^-----END (.*)?-----\s*$/))) {
|
46 |
-
if (m[1] != state.type) return "error";
|
47 |
-
state.state = "end";
|
48 |
-
return "tag";
|
49 |
-
} else {
|
50 |
-
if (stream.eatWhile(/[A-Za-z0-9+\/=]/)) {
|
51 |
-
return null;
|
52 |
-
} else {
|
53 |
-
stream.next();
|
54 |
-
return "error";
|
55 |
-
}
|
56 |
-
}
|
57 |
-
} else if (state.state == "end") {
|
58 |
-
return errorIfNotEmpty(stream);
|
59 |
-
}
|
60 |
-
},
|
61 |
-
blankLine: function(state) {
|
62 |
-
if (state.state == "headers") state.state = "body";
|
63 |
-
},
|
64 |
-
startState: function() {
|
65 |
-
return {state: "top", type: null};
|
66 |
-
}
|
67 |
-
};
|
68 |
-
});
|
69 |
-
|
70 |
-
CodeMirror.defineMIME("application/pgp", "asciiarmor");
|
71 |
-
CodeMirror.defineMIME("application/pgp-keys", "asciiarmor");
|
72 |
-
CodeMirror.defineMIME("application/pgp-signature", "asciiarmor");
|
73 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/asciiarmor/index.html
DELETED
@@ -1,46 +0,0 @@
|
|
1 |
-
<!doctype html>
|
2 |
-
|
3 |
-
<title>CodeMirror: ASCII Armor (PGP) mode</title>
|
4 |
-
<meta charset="utf-8"/>
|
5 |
-
<link rel=stylesheet href="../../doc/docs.css">
|
6 |
-
|
7 |
-
<link rel="stylesheet" href="../../lib/codemirror.css">
|
8 |
-
<script src="../../lib/codemirror.js"></script>
|
9 |
-
<script src="asciiarmor.js"></script>
|
10 |
-
<style>.CodeMirror {background: #f8f8f8;}</style>
|
11 |
-
<div id=nav>
|
12 |
-
<a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
13 |
-
|
14 |
-
<ul>
|
15 |
-
<li><a href="../../index.html">Home</a>
|
16 |
-
<li><a href="../../doc/manual.html">Manual</a>
|
17 |
-
<li><a href="https://github.com/codemirror/codemirror">Code</a>
|
18 |
-
</ul>
|
19 |
-
<ul>
|
20 |
-
<li><a href="../index.html">Language modes</a>
|
21 |
-
<li><a class=active href="#">ASCII Armor</a>
|
22 |
-
</ul>
|
23 |
-
</div>
|
24 |
-
|
25 |
-
<article>
|
26 |
-
<h2>ASCII Armor (PGP) mode</h2>
|
27 |
-
<form><textarea id="code" name="code">
|
28 |
-
-----BEGIN PGP MESSAGE-----
|
29 |
-
Version: OpenPrivacy 0.99
|
30 |
-
|
31 |
-
yDgBO22WxBHv7O8X7O/jygAEzol56iUKiXmV+XmpCtmpqQUKiQrFqclFqUDBovzS
|
32 |
-
vBSFjNSiVHsuAA==
|
33 |
-
=njUN
|
34 |
-
-----END PGP MESSAGE-----
|
35 |
-
</textarea></form>
|
36 |
-
|
37 |
-
<script>
|
38 |
-
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
|
39 |
-
lineNumbers: true
|
40 |
-
});
|
41 |
-
</script>
|
42 |
-
|
43 |
-
<p><strong>MIME types
|
44 |
-
defined:</strong> <code>application/pgp</code>, <code>application/pgp-keys</code>, <code>application/pgp-signature</code></p>
|
45 |
-
|
46 |
-
</article>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/asn.1/asn.1.js
DELETED
@@ -1,204 +0,0 @@
|
|
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("asn.1", function(config, parserConfig) {
|
15 |
-
var indentUnit = config.indentUnit,
|
16 |
-
keywords = parserConfig.keywords || {},
|
17 |
-
cmipVerbs = parserConfig.cmipVerbs || {},
|
18 |
-
compareTypes = parserConfig.compareTypes || {},
|
19 |
-
status = parserConfig.status || {},
|
20 |
-
tags = parserConfig.tags || {},
|
21 |
-
storage = parserConfig.storage || {},
|
22 |
-
modifier = parserConfig.modifier || {},
|
23 |
-
accessTypes = parserConfig.accessTypes|| {},
|
24 |
-
multiLineStrings = parserConfig.multiLineStrings,
|
25 |
-
indentStatements = parserConfig.indentStatements !== false;
|
26 |
-
var isOperatorChar = /[\|\^]/;
|
27 |
-
var curPunc;
|
28 |
-
|
29 |
-
function tokenBase(stream, state) {
|
30 |
-
var ch = stream.next();
|
31 |
-
if (ch == '"' || ch == "'") {
|
32 |
-
state.tokenize = tokenString(ch);
|
33 |
-
return state.tokenize(stream, state);
|
34 |
-
}
|
35 |
-
if (/[\[\]\(\){}:=,;]/.test(ch)) {
|
36 |
-
curPunc = ch;
|
37 |
-
return "punctuation";
|
38 |
-
}
|
39 |
-
if (ch == "-"){
|
40 |
-
if (stream.eat("-")) {
|
41 |
-
stream.skipToEnd();
|
42 |
-
return "comment";
|
43 |
-
}
|
44 |
-
}
|
45 |
-
if (/\d/.test(ch)) {
|
46 |
-
stream.eatWhile(/[\w\.]/);
|
47 |
-
return "number";
|
48 |
-
}
|
49 |
-
if (isOperatorChar.test(ch)) {
|
50 |
-
stream.eatWhile(isOperatorChar);
|
51 |
-
return "operator";
|
52 |
-
}
|
53 |
-
|
54 |
-
stream.eatWhile(/[\w\-]/);
|
55 |
-
var cur = stream.current();
|
56 |
-
if (keywords.propertyIsEnumerable(cur)) return "keyword";
|
57 |
-
if (cmipVerbs.propertyIsEnumerable(cur)) return "variable cmipVerbs";
|
58 |
-
if (compareTypes.propertyIsEnumerable(cur)) return "atom compareTypes";
|
59 |
-
if (status.propertyIsEnumerable(cur)) return "comment status";
|
60 |
-
if (tags.propertyIsEnumerable(cur)) return "variable-3 tags";
|
61 |
-
if (storage.propertyIsEnumerable(cur)) return "builtin storage";
|
62 |
-
if (modifier.propertyIsEnumerable(cur)) return "string-2 modifier";
|
63 |
-
if (accessTypes.propertyIsEnumerable(cur)) return "atom accessTypes";
|
64 |
-
|
65 |
-
return "variable";
|
66 |
-
}
|
67 |
-
|
68 |
-
function tokenString(quote) {
|
69 |
-
return function(stream, state) {
|
70 |
-
var escaped = false, next, end = false;
|
71 |
-
while ((next = stream.next()) != null) {
|
72 |
-
if (next == quote && !escaped){
|
73 |
-
var afterNext = stream.peek();
|
74 |
-
//look if the character if the quote is like the B in '10100010'B
|
75 |
-
if (afterNext){
|
76 |
-
afterNext = afterNext.toLowerCase();
|
77 |
-
if(afterNext == "b" || afterNext == "h" || afterNext == "o")
|
78 |
-
stream.next();
|
79 |
-
}
|
80 |
-
end = true; break;
|
81 |
-
}
|
82 |
-
escaped = !escaped && next == "\\";
|
83 |
-
}
|
84 |
-
if (end || !(escaped || multiLineStrings))
|
85 |
-
state.tokenize = null;
|
86 |
-
return "string";
|
87 |
-
};
|
88 |
-
}
|
89 |
-
|
90 |
-
function Context(indented, column, type, align, prev) {
|
91 |
-
this.indented = indented;
|
92 |
-
this.column = column;
|
93 |
-
this.type = type;
|
94 |
-
this.align = align;
|
95 |
-
this.prev = prev;
|
96 |
-
}
|
97 |
-
function pushContext(state, col, type) {
|
98 |
-
var indent = state.indented;
|
99 |
-
if (state.context && state.context.type == "statement")
|
100 |
-
indent = state.context.indented;
|
101 |
-
return state.context = new Context(indent, col, type, null, state.context);
|
102 |
-
}
|
103 |
-
function popContext(state) {
|
104 |
-
var t = state.context.type;
|
105 |
-
if (t == ")" || t == "]" || t == "}")
|
106 |
-
state.indented = state.context.indented;
|
107 |
-
return state.context = state.context.prev;
|
108 |
-
}
|
109 |
-
|
110 |
-
//Interface
|
111 |
-
return {
|
112 |
-
startState: function(basecolumn) {
|
113 |
-
return {
|
114 |
-
tokenize: null,
|
115 |
-
context: new Context((basecolumn || 0) - indentUnit, 0, "top", false),
|
116 |
-
indented: 0,
|
117 |
-
startOfLine: true
|
118 |
-
};
|
119 |
-
},
|
120 |
-
|
121 |
-
token: function(stream, state) {
|
122 |
-
var ctx = state.context;
|
123 |
-
if (stream.sol()) {
|
124 |
-
if (ctx.align == null) ctx.align = false;
|
125 |
-
state.indented = stream.indentation();
|
126 |
-
state.startOfLine = true;
|
127 |
-
}
|
128 |
-
if (stream.eatSpace()) return null;
|
129 |
-
curPunc = null;
|
130 |
-
var style = (state.tokenize || tokenBase)(stream, state);
|
131 |
-
if (style == "comment") return style;
|
132 |
-
if (ctx.align == null) ctx.align = true;
|
133 |
-
|
134 |
-
if ((curPunc == ";" || curPunc == ":" || curPunc == ",")
|
135 |
-
&& ctx.type == "statement"){
|
136 |
-
popContext(state);
|
137 |
-
}
|
138 |
-
else if (curPunc == "{") pushContext(state, stream.column(), "}");
|
139 |
-
else if (curPunc == "[") pushContext(state, stream.column(), "]");
|
140 |
-
else if (curPunc == "(") pushContext(state, stream.column(), ")");
|
141 |
-
else if (curPunc == "}") {
|
142 |
-
while (ctx.type == "statement") ctx = popContext(state);
|
143 |
-
if (ctx.type == "}") ctx = popContext(state);
|
144 |
-
while (ctx.type == "statement") ctx = popContext(state);
|
145 |
-
}
|
146 |
-
else if (curPunc == ctx.type) popContext(state);
|
147 |
-
else if (indentStatements && (((ctx.type == "}" || ctx.type == "top")
|
148 |
-
&& curPunc != ';') || (ctx.type == "statement"
|
149 |
-
&& curPunc == "newstatement")))
|
150 |
-
pushContext(state, stream.column(), "statement");
|
151 |
-
|
152 |
-
state.startOfLine = false;
|
153 |
-
return style;
|
154 |
-
},
|
155 |
-
|
156 |
-
electricChars: "{}",
|
157 |
-
lineComment: "--",
|
158 |
-
fold: "brace"
|
159 |
-
};
|
160 |
-
});
|
161 |
-
|
162 |
-
function words(str) {
|
163 |
-
var obj = {}, words = str.split(" ");
|
164 |
-
for (var i = 0; i < words.length; ++i) obj[words[i]] = true;
|
165 |
-
return obj;
|
166 |
-
}
|
167 |
-
|
168 |
-
CodeMirror.defineMIME("text/x-ttcn-asn", {
|
169 |
-
name: "asn.1",
|
170 |
-
keywords: words("DEFINITIONS OBJECTS IF DERIVED INFORMATION ACTION" +
|
171 |
-
" REPLY ANY NAMED CHARACTERIZED BEHAVIOUR REGISTERED" +
|
172 |
-
" WITH AS IDENTIFIED CONSTRAINED BY PRESENT BEGIN" +
|
173 |
-
" IMPORTS FROM UNITS SYNTAX MIN-ACCESS MAX-ACCESS" +
|
174 |
-
" MINACCESS MAXACCESS REVISION STATUS DESCRIPTION" +
|
175 |
-
" SEQUENCE SET COMPONENTS OF CHOICE DistinguishedName" +
|
176 |
-
" ENUMERATED SIZE MODULE END INDEX AUGMENTS EXTENSIBILITY" +
|
177 |
-
" IMPLIED EXPORTS"),
|
178 |
-
cmipVerbs: words("ACTIONS ADD GET NOTIFICATIONS REPLACE REMOVE"),
|
179 |
-
compareTypes: words("OPTIONAL DEFAULT MANAGED MODULE-TYPE MODULE_IDENTITY" +
|
180 |
-
" MODULE-COMPLIANCE OBJECT-TYPE OBJECT-IDENTITY" +
|
181 |
-
" OBJECT-COMPLIANCE MODE CONFIRMED CONDITIONAL" +
|
182 |
-
" SUBORDINATE SUPERIOR CLASS TRUE FALSE NULL" +
|
183 |
-
" TEXTUAL-CONVENTION"),
|
184 |
-
status: words("current deprecated mandatory obsolete"),
|
185 |
-
tags: words("APPLICATION AUTOMATIC EXPLICIT IMPLICIT PRIVATE TAGS" +
|
186 |
-
" UNIVERSAL"),
|
187 |
-
storage: words("BOOLEAN INTEGER OBJECT IDENTIFIER BIT OCTET STRING" +
|
188 |
-
" UTCTime InterfaceIndex IANAifType CMIP-Attribute" +
|
189 |
-
" REAL PACKAGE PACKAGES IpAddress PhysAddress" +
|
190 |
-
" NetworkAddress BITS BMPString TimeStamp TimeTicks" +
|
191 |
-
" TruthValue RowStatus DisplayString GeneralString" +
|
192 |
-
" GraphicString IA5String NumericString" +
|
193 |
-
" PrintableString SnmpAdminAtring TeletexString" +
|
194 |
-
" UTF8String VideotexString VisibleString StringStore" +
|
195 |
-
" ISO646String T61String UniversalString Unsigned32" +
|
196 |
-
" Integer32 Gauge Gauge32 Counter Counter32 Counter64"),
|
197 |
-
modifier: words("ATTRIBUTE ATTRIBUTES MANDATORY-GROUP MANDATORY-GROUPS" +
|
198 |
-
" GROUP GROUPS ELEMENTS EQUALITY ORDERING SUBSTRINGS" +
|
199 |
-
" DEFINED"),
|
200 |
-
accessTypes: words("not-accessible accessible-for-notify read-only" +
|
201 |
-
" read-create read-write"),
|
202 |
-
multiLineStrings: true
|
203 |
-
});
|
204 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/asn.1/index.html
DELETED
@@ -1,78 +0,0 @@
|
|
1 |
-
<!doctype html>
|
2 |
-
|
3 |
-
<title>CodeMirror: ASN.1 mode</title>
|
4 |
-
<meta charset="utf-8"/>
|
5 |
-
<link rel=stylesheet href="../../doc/docs.css">
|
6 |
-
|
7 |
-
<link rel="stylesheet" href="../../lib/codemirror.css">
|
8 |
-
<script src="../../lib/codemirror.js"></script>
|
9 |
-
<script src="asn.1.js"></script>
|
10 |
-
<style type="text/css">
|
11 |
-
.CodeMirror {
|
12 |
-
border-top: 1px solid black;
|
13 |
-
border-bottom: 1px solid black;
|
14 |
-
}
|
15 |
-
</style>
|
16 |
-
<div id=nav>
|
17 |
-
<a href="http://codemirror.net"><h1>CodeMirror</h1>
|
18 |
-
<img id=logo src="../../doc/logo.png">
|
19 |
-
</a>
|
20 |
-
|
21 |
-
<ul>
|
22 |
-
<li><a href="../../index.html">Home</a>
|
23 |
-
<li><a href="../../doc/manual.html">Manual</a>
|
24 |
-
<li><a href="https://github.com/codemirror/codemirror">Code</a>
|
25 |
-
</ul>
|
26 |
-
<ul>
|
27 |
-
<li><a href="../index.html">Language modes</a>
|
28 |
-
<li><a class=active href="http://en.wikipedia.org/wiki/Abstract_Syntax_Notation_One">ASN.1</a>
|
29 |
-
</ul>
|
30 |
-
</div>
|
31 |
-
<article>
|
32 |
-
<h2>ASN.1 example</h2>
|
33 |
-
<div>
|
34 |
-
<textarea id="ttcn-asn-code">
|
35 |
-
--
|
36 |
-
-- Sample ASN.1 Code
|
37 |
-
--
|
38 |
-
MyModule DEFINITIONS ::=
|
39 |
-
BEGIN
|
40 |
-
|
41 |
-
MyTypes ::= SEQUENCE {
|
42 |
-
myObjectId OBJECT IDENTIFIER,
|
43 |
-
mySeqOf SEQUENCE OF MyInt,
|
44 |
-
myBitString BIT STRING {
|
45 |
-
muxToken(0),
|
46 |
-
modemToken(1)
|
47 |
-
}
|
48 |
-
}
|
49 |
-
|
50 |
-
MyInt ::= INTEGER (0..65535)
|
51 |
-
|
52 |
-
END
|
53 |
-
</textarea>
|
54 |
-
</div>
|
55 |
-
|
56 |
-
<script>
|
57 |
-
var ttcnEditor = CodeMirror.fromTextArea(document.getElementById("ttcn-asn-code"), {
|
58 |
-
lineNumbers: true,
|
59 |
-
matchBrackets: true,
|
60 |
-
mode: "text/x-ttcn-asn"
|
61 |
-
});
|
62 |
-
ttcnEditor.setSize(400, 400);
|
63 |
-
var mac = CodeMirror.keyMap.default == CodeMirror.keyMap.macDefault;
|
64 |
-
CodeMirror.keyMap.default[(mac ? "Cmd" : "Ctrl") + "-Space"] = "autocomplete";
|
65 |
-
</script>
|
66 |
-
<br/>
|
67 |
-
<p><strong>Language:</strong> Abstract Syntax Notation One
|
68 |
-
(<a href="http://www.itu.int/en/ITU-T/asn1/Pages/introduction.aspx">ASN.1</a>)
|
69 |
-
</p>
|
70 |
-
<p><strong>MIME types defined:</strong> <code>text/x-ttcn-asn</code></p>
|
71 |
-
|
72 |
-
<br/>
|
73 |
-
<p>The development of this mode has been sponsored by <a href="http://www.ericsson.com/">Ericsson
|
74 |
-
</a>.</p>
|
75 |
-
<p>Coded by Asmelash Tsegay Gebretsadkan </p>
|
76 |
-
</article>
|
77 |
-
</article>
|
78 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/asterisk/asterisk.js
DELETED
@@ -1,196 +0,0 @@
|
|
1 |
-
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
2 |
-
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
3 |
-
|
4 |
-
/*
|
5 |
-
* =====================================================================================
|
6 |
-
*
|
7 |
-
* Filename: mode/asterisk/asterisk.js
|
8 |
-
*
|
9 |
-
* Description: CodeMirror mode for Asterisk dialplan
|
10 |
-
*
|
11 |
-
* Created: 05/17/2012 09:20:25 PM
|
12 |
-
* Revision: none
|
13 |
-
*
|
14 |
-
* Author: Stas Kobzar (stas@modulis.ca),
|
15 |
-
* Company: Modulis.ca Inc.
|
16 |
-
*
|
17 |
-
* =====================================================================================
|
18 |
-
*/
|
19 |
-
|
20 |
-
(function(mod) {
|
21 |
-
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
22 |
-
mod(require("../../lib/codemirror"));
|
23 |
-
else if (typeof define == "function" && define.amd) // AMD
|
24 |
-
define(["../../lib/codemirror"], mod);
|
25 |
-
else // Plain browser env
|
26 |
-
mod(CodeMirror);
|
27 |
-
})(function(CodeMirror) {
|
28 |
-
"use strict";
|
29 |
-
|
30 |
-
CodeMirror.defineMode("asterisk", function() {
|
31 |
-
var atoms = ["exten", "same", "include","ignorepat","switch"],
|
32 |
-
dpcmd = ["#include","#exec"],
|
33 |
-
apps = [
|
34 |
-
"addqueuemember","adsiprog","aelsub","agentlogin","agentmonitoroutgoing","agi",
|
35 |
-
"alarmreceiver","amd","answer","authenticate","background","backgrounddetect",
|
36 |
-
"bridge","busy","callcompletioncancel","callcompletionrequest","celgenuserevent",
|
37 |
-
"changemonitor","chanisavail","channelredirect","chanspy","clearhash","confbridge",
|
38 |
-
"congestion","continuewhile","controlplayback","dahdiacceptr2call","dahdibarge",
|
39 |
-
"dahdiras","dahdiscan","dahdisendcallreroutingfacility","dahdisendkeypadfacility",
|
40 |
-
"datetime","dbdel","dbdeltree","deadagi","dial","dictate","directory","disa",
|
41 |
-
"dumpchan","eagi","echo","endwhile","exec","execif","execiftime","exitwhile","extenspy",
|
42 |
-
"externalivr","festival","flash","followme","forkcdr","getcpeid","gosub","gosubif",
|
43 |
-
"goto","gotoif","gotoiftime","hangup","iax2provision","ices","importvar","incomplete",
|
44 |
-
"ivrdemo","jabberjoin","jabberleave","jabbersend","jabbersendgroup","jabberstatus",
|
45 |
-
"jack","log","macro","macroexclusive","macroexit","macroif","mailboxexists","meetme",
|
46 |
-
"meetmeadmin","meetmechanneladmin","meetmecount","milliwatt","minivmaccmess","minivmdelete",
|
47 |
-
"minivmgreet","minivmmwi","minivmnotify","minivmrecord","mixmonitor","monitor","morsecode",
|
48 |
-
"mp3player","mset","musiconhold","nbscat","nocdr","noop","odbc","odbc","odbcfinish",
|
49 |
-
"originate","ospauth","ospfinish","osplookup","ospnext","page","park","parkandannounce",
|
50 |
-
"parkedcall","pausemonitor","pausequeuemember","pickup","pickupchan","playback","playtones",
|
51 |
-
"privacymanager","proceeding","progress","queue","queuelog","raiseexception","read","readexten",
|
52 |
-
"readfile","receivefax","receivefax","receivefax","record","removequeuemember",
|
53 |
-
"resetcdr","retrydial","return","ringing","sayalpha","saycountedadj","saycountednoun",
|
54 |
-
"saycountpl","saydigits","saynumber","sayphonetic","sayunixtime","senddtmf","sendfax",
|
55 |
-
"sendfax","sendfax","sendimage","sendtext","sendurl","set","setamaflags",
|
56 |
-
"setcallerpres","setmusiconhold","sipaddheader","sipdtmfmode","sipremoveheader","skel",
|
57 |
-
"slastation","slatrunk","sms","softhangup","speechactivategrammar","speechbackground",
|
58 |
-
"speechcreate","speechdeactivategrammar","speechdestroy","speechloadgrammar","speechprocessingsound",
|
59 |
-
"speechstart","speechunloadgrammar","stackpop","startmusiconhold","stopmixmonitor","stopmonitor",
|
60 |
-
"stopmusiconhold","stopplaytones","system","testclient","testserver","transfer","tryexec",
|
61 |
-
"trysystem","unpausemonitor","unpausequeuemember","userevent","verbose","vmauthenticate",
|
62 |
-
"vmsayname","voicemail","voicemailmain","wait","waitexten","waitfornoise","waitforring",
|
63 |
-
"waitforsilence","waitmusiconhold","waituntil","while","zapateller"
|
64 |
-
];
|
65 |
-
|
66 |
-
function basicToken(stream,state){
|
67 |
-
var cur = '';
|
68 |
-
var ch = stream.next();
|
69 |
-
// comment
|
70 |
-
if(ch == ";") {
|
71 |
-
stream.skipToEnd();
|
72 |
-
return "comment";
|
73 |
-
}
|
74 |
-
// context
|
75 |
-
if(ch == '[') {
|
76 |
-
stream.skipTo(']');
|
77 |
-
stream.eat(']');
|
78 |
-
return "header";
|
79 |
-
}
|
80 |
-
// string
|
81 |
-
if(ch == '"') {
|
82 |
-
stream.skipTo('"');
|
83 |
-
return "string";
|
84 |
-
}
|
85 |
-
if(ch == "'") {
|
86 |
-
stream.skipTo("'");
|
87 |
-
return "string-2";
|
88 |
-
}
|
89 |
-
// dialplan commands
|
90 |
-
if(ch == '#') {
|
91 |
-
stream.eatWhile(/\w/);
|
92 |
-
cur = stream.current();
|
93 |
-
if(dpcmd.indexOf(cur) !== -1) {
|
94 |
-
stream.skipToEnd();
|
95 |
-
return "strong";
|
96 |
-
}
|
97 |
-
}
|
98 |
-
// application args
|
99 |
-
if(ch == '$'){
|
100 |
-
var ch1 = stream.peek();
|
101 |
-
if(ch1 == '{'){
|
102 |
-
stream.skipTo('}');
|
103 |
-
stream.eat('}');
|
104 |
-
return "variable-3";
|
105 |
-
}
|
106 |
-
}
|
107 |
-
// extension
|
108 |
-
stream.eatWhile(/\w/);
|
109 |
-
cur = stream.current();
|
110 |
-
if(atoms.indexOf(cur) !== -1) {
|
111 |
-
state.extenStart = true;
|
112 |
-
switch(cur) {
|
113 |
-
case 'same': state.extenSame = true; break;
|
114 |
-
case 'include':
|
115 |
-
case 'switch':
|
116 |
-
case 'ignorepat':
|
117 |
-
state.extenInclude = true;break;
|
118 |
-
default:break;
|
119 |
-
}
|
120 |
-
return "atom";
|
121 |
-
}
|
122 |
-
}
|
123 |
-
|
124 |
-
return {
|
125 |
-
startState: function() {
|
126 |
-
return {
|
127 |
-
extenStart: false,
|
128 |
-
extenSame: false,
|
129 |
-
extenInclude: false,
|
130 |
-
extenExten: false,
|
131 |
-
extenPriority: false,
|
132 |
-
extenApplication: false
|
133 |
-
};
|
134 |
-
},
|
135 |
-
token: function(stream, state) {
|
136 |
-
|
137 |
-
var cur = '';
|
138 |
-
if(stream.eatSpace()) return null;
|
139 |
-
// extension started
|
140 |
-
if(state.extenStart){
|
141 |
-
stream.eatWhile(/[^\s]/);
|
142 |
-
cur = stream.current();
|
143 |
-
if(/^=>?$/.test(cur)){
|
144 |
-
state.extenExten = true;
|
145 |
-
state.extenStart = false;
|
146 |
-
return "strong";
|
147 |
-
} else {
|
148 |
-
state.extenStart = false;
|
149 |
-
stream.skipToEnd();
|
150 |
-
return "error";
|
151 |
-
}
|
152 |
-
} else if(state.extenExten) {
|
153 |
-
// set exten and priority
|
154 |
-
state.extenExten = false;
|
155 |
-
state.extenPriority = true;
|
156 |
-
stream.eatWhile(/[^,]/);
|
157 |
-
if(state.extenInclude) {
|
158 |
-
stream.skipToEnd();
|
159 |
-
state.extenPriority = false;
|
160 |
-
state.extenInclude = false;
|
161 |
-
}
|
162 |
-
if(state.extenSame) {
|
163 |
-
state.extenPriority = false;
|
164 |
-
state.extenSame = false;
|
165 |
-
state.extenApplication = true;
|
166 |
-
}
|
167 |
-
return "tag";
|
168 |
-
} else if(state.extenPriority) {
|
169 |
-
state.extenPriority = false;
|
170 |
-
state.extenApplication = true;
|
171 |
-
stream.next(); // get comma
|
172 |
-
if(state.extenSame) return null;
|
173 |
-
stream.eatWhile(/[^,]/);
|
174 |
-
return "number";
|
175 |
-
} else if(state.extenApplication) {
|
176 |
-
stream.eatWhile(/,/);
|
177 |
-
cur = stream.current();
|
178 |
-
if(cur === ',') return null;
|
179 |
-
stream.eatWhile(/\w/);
|
180 |
-
cur = stream.current().toLowerCase();
|
181 |
-
state.extenApplication = false;
|
182 |
-
if(apps.indexOf(cur) !== -1){
|
183 |
-
return "def strong";
|
184 |
-
}
|
185 |
-
} else{
|
186 |
-
return basicToken(stream,state);
|
187 |
-
}
|
188 |
-
|
189 |
-
return null;
|
190 |
-
}
|
191 |
-
};
|
192 |
-
});
|
193 |
-
|
194 |
-
CodeMirror.defineMIME("text/x-asterisk", "asterisk");
|
195 |
-
|
196 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/asterisk/index.html
DELETED
@@ -1,154 +0,0 @@
|
|
1 |
-
<!doctype html>
|
2 |
-
|
3 |
-
<title>CodeMirror: Asterisk dialplan mode</title>
|
4 |
-
<meta charset="utf-8"/>
|
5 |
-
<link rel=stylesheet href="../../doc/docs.css">
|
6 |
-
|
7 |
-
<link rel="stylesheet" href="../../lib/codemirror.css">
|
8 |
-
<script src="../../lib/codemirror.js"></script>
|
9 |
-
<script src="asterisk.js"></script>
|
10 |
-
<style>
|
11 |
-
.CodeMirror {border: 1px solid #999;}
|
12 |
-
.cm-s-default span.cm-arrow { color: red; }
|
13 |
-
</style>
|
14 |
-
<div id=nav>
|
15 |
-
<a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
16 |
-
|
17 |
-
<ul>
|
18 |
-
<li><a href="../../index.html">Home</a>
|
19 |
-
<li><a href="../../doc/manual.html">Manual</a>
|
20 |
-
<li><a href="https://github.com/codemirror/codemirror">Code</a>
|
21 |
-
</ul>
|
22 |
-
<ul>
|
23 |
-
<li><a href="../index.html">Language modes</a>
|
24 |
-
<li><a class=active href="#">Asterisk dialplan</a>
|
25 |
-
</ul>
|
26 |
-
</div>
|
27 |
-
|
28 |
-
<article>
|
29 |
-
<h2>Asterisk dialplan mode</h2>
|
30 |
-
<form><textarea id="code" name="code">
|
31 |
-
; extensions.conf - the Asterisk dial plan
|
32 |
-
;
|
33 |
-
|
34 |
-
[general]
|
35 |
-
;
|
36 |
-
; If static is set to no, or omitted, then the pbx_config will rewrite
|
37 |
-
; this file when extensions are modified. Remember that all comments
|
38 |
-
; made in the file will be lost when that happens.
|
39 |
-
static=yes
|
40 |
-
|
41 |
-
#include "/etc/asterisk/additional_general.conf
|
42 |
-
|
43 |
-
[iaxprovider]
|
44 |
-
switch => IAX2/user:[key]@myserver/mycontext
|
45 |
-
|
46 |
-
[dynamic]
|
47 |
-
#exec /usr/bin/dynamic-peers.pl
|
48 |
-
|
49 |
-
[trunkint]
|
50 |
-
;
|
51 |
-
; International long distance through trunk
|
52 |
-
;
|
53 |
-
exten => _9011.,1,Macro(dundi-e164,${EXTEN:4})
|
54 |
-
exten => _9011.,n,Dial(${GLOBAL(TRUNK)}/${FILTER(0-9,${EXTEN:${GLOBAL(TRUNKMSD)}})})
|
55 |
-
|
56 |
-
[local]
|
57 |
-
;
|
58 |
-
; Master context for local, toll-free, and iaxtel calls only
|
59 |
-
;
|
60 |
-
ignorepat => 9
|
61 |
-
include => default
|
62 |
-
|
63 |
-
[demo]
|
64 |
-
include => stdexten
|
65 |
-
;
|
66 |
-
; We start with what to do when a call first comes in.
|
67 |
-
;
|
68 |
-
exten => s,1,Wait(1) ; Wait a second, just for fun
|
69 |
-
same => n,Answer ; Answer the line
|
70 |
-
same => n,Set(TIMEOUT(digit)=5) ; Set Digit Timeout to 5 seconds
|
71 |
-
same => n,Set(TIMEOUT(response)=10) ; Set Response Timeout to 10 seconds
|
72 |
-
same => n(restart),BackGround(demo-congrats) ; Play a congratulatory message
|
73 |
-
same => n(instruct),BackGround(demo-instruct) ; Play some instructions
|
74 |
-
same => n,WaitExten ; Wait for an extension to be dialed.
|
75 |
-
|
76 |
-
exten => 2,1,BackGround(demo-moreinfo) ; Give some more information.
|
77 |
-
exten => 2,n,Goto(s,instruct)
|
78 |
-
|
79 |
-
exten => 3,1,Set(LANGUAGE()=fr) ; Set language to french
|
80 |
-
exten => 3,n,Goto(s,restart) ; Start with the congratulations
|
81 |
-
|
82 |
-
exten => 1000,1,Goto(default,s,1)
|
83 |
-
;
|
84 |
-
; We also create an example user, 1234, who is on the console and has
|
85 |
-
; voicemail, etc.
|
86 |
-
;
|
87 |
-
exten => 1234,1,Playback(transfer,skip) ; "Please hold while..."
|
88 |
-
; (but skip if channel is not up)
|
89 |
-
exten => 1234,n,Gosub(${EXTEN},stdexten(${GLOBAL(CONSOLE)}))
|
90 |
-
exten => 1234,n,Goto(default,s,1) ; exited Voicemail
|
91 |
-
|
92 |
-
exten => 1235,1,Voicemail(1234,u) ; Right to voicemail
|
93 |
-
|
94 |
-
exten => 1236,1,Dial(Console/dsp) ; Ring forever
|
95 |
-
exten => 1236,n,Voicemail(1234,b) ; Unless busy
|
96 |
-
|
97 |
-
;
|
98 |
-
; # for when they're done with the demo
|
99 |
-
;
|
100 |
-
exten => #,1,Playback(demo-thanks) ; "Thanks for trying the demo"
|
101 |
-
exten => #,n,Hangup ; Hang them up.
|
102 |
-
|
103 |
-
;
|
104 |
-
; A timeout and "invalid extension rule"
|
105 |
-
;
|
106 |
-
exten => t,1,Goto(#,1) ; If they take too long, give up
|
107 |
-
exten => i,1,Playback(invalid) ; "That's not valid, try again"
|
108 |
-
|
109 |
-
;
|
110 |
-
; Create an extension, 500, for dialing the
|
111 |
-
; Asterisk demo.
|
112 |
-
;
|
113 |
-
exten => 500,1,Playback(demo-abouttotry); Let them know what's going on
|
114 |
-
exten => 500,n,Dial(IAX2/guest@pbx.digium.com/s@default) ; Call the Asterisk demo
|
115 |
-
exten => 500,n,Playback(demo-nogo) ; Couldn't connect to the demo site
|
116 |
-
exten => 500,n,Goto(s,6) ; Return to the start over message.
|
117 |
-
|
118 |
-
;
|
119 |
-
; Create an extension, 600, for evaluating echo latency.
|
120 |
-
;
|
121 |
-
exten => 600,1,Playback(demo-echotest) ; Let them know what's going on
|
122 |
-
exten => 600,n,Echo ; Do the echo test
|
123 |
-
exten => 600,n,Playback(demo-echodone) ; Let them know it's over
|
124 |
-
exten => 600,n,Goto(s,6) ; Start over
|
125 |
-
|
126 |
-
;
|
127 |
-
; You can use the Macro Page to intercom a individual user
|
128 |
-
exten => 76245,1,Macro(page,SIP/Grandstream1)
|
129 |
-
; or if your peernames are the same as extensions
|
130 |
-
exten => _7XXX,1,Macro(page,SIP/${EXTEN})
|
131 |
-
;
|
132 |
-
;
|
133 |
-
; System Wide Page at extension 7999
|
134 |
-
;
|
135 |
-
exten => 7999,1,Set(TIMEOUT(absolute)=60)
|
136 |
-
exten => 7999,2,Page(Local/Grandstream1@page&Local/Xlite1@page&Local/1234@page/n,d)
|
137 |
-
|
138 |
-
; Give voicemail at extension 8500
|
139 |
-
;
|
140 |
-
exten => 8500,1,VoicemailMain
|
141 |
-
exten => 8500,n,Goto(s,6)
|
142 |
-
|
143 |
-
</textarea></form>
|
144 |
-
<script>
|
145 |
-
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
|
146 |
-
mode: "text/x-asterisk",
|
147 |
-
matchBrackets: true,
|
148 |
-
lineNumber: true
|
149 |
-
});
|
150 |
-
</script>
|
151 |
-
|
152 |
-
<p><strong>MIME types defined:</strong> <code>text/x-asterisk</code>.</p>
|
153 |
-
|
154 |
-
</article>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/brainfuck/brainfuck.js
DELETED
@@ -1,85 +0,0 @@
|
|
1 |
-
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
2 |
-
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
3 |
-
|
4 |
-
// Brainfuck mode created by Michael Kaminsky https://github.com/mkaminsky11
|
5 |
-
|
6 |
-
(function(mod) {
|
7 |
-
if (typeof exports == "object" && typeof module == "object")
|
8 |
-
mod(require("../../lib/codemirror"))
|
9 |
-
else if (typeof define == "function" && define.amd)
|
10 |
-
define(["../../lib/codemirror"], mod)
|
11 |
-
else
|
12 |
-
mod(CodeMirror)
|
13 |
-
})(function(CodeMirror) {
|
14 |
-
"use strict"
|
15 |
-
var reserve = "><+-.,[]".split("");
|
16 |
-
/*
|
17 |
-
comments can be either:
|
18 |
-
placed behind lines
|
19 |
-
|
20 |
-
+++ this is a comment
|
21 |
-
|
22 |
-
where reserved characters cannot be used
|
23 |
-
or in a loop
|
24 |
-
[
|
25 |
-
this is ok to use [ ] and stuff
|
26 |
-
]
|
27 |
-
or preceded by #
|
28 |
-
*/
|
29 |
-
CodeMirror.defineMode("brainfuck", function() {
|
30 |
-
return {
|
31 |
-
startState: function() {
|
32 |
-
return {
|
33 |
-
commentLine: false,
|
34 |
-
left: 0,
|
35 |
-
right: 0,
|
36 |
-
commentLoop: false
|
37 |
-
}
|
38 |
-
},
|
39 |
-
token: function(stream, state) {
|
40 |
-
if (stream.eatSpace()) return null
|
41 |
-
if(stream.sol()){
|
42 |
-
state.commentLine = false;
|
43 |
-
}
|
44 |
-
var ch = stream.next().toString();
|
45 |
-
if(reserve.indexOf(ch) !== -1){
|
46 |
-
if(state.commentLine === true){
|
47 |
-
if(stream.eol()){
|
48 |
-
state.commentLine = false;
|
49 |
-
}
|
50 |
-
return "comment";
|
51 |
-
}
|
52 |
-
if(ch === "]" || ch === "["){
|
53 |
-
if(ch === "["){
|
54 |
-
state.left++;
|
55 |
-
}
|
56 |
-
else{
|
57 |
-
state.right++;
|
58 |
-
}
|
59 |
-
return "bracket";
|
60 |
-
}
|
61 |
-
else if(ch === "+" || ch === "-"){
|
62 |
-
return "keyword";
|
63 |
-
}
|
64 |
-
else if(ch === "<" || ch === ">"){
|
65 |
-
return "atom";
|
66 |
-
}
|
67 |
-
else if(ch === "." || ch === ","){
|
68 |
-
return "def";
|
69 |
-
}
|
70 |
-
}
|
71 |
-
else{
|
72 |
-
state.commentLine = true;
|
73 |
-
if(stream.eol()){
|
74 |
-
state.commentLine = false;
|
75 |
-
}
|
76 |
-
return "comment";
|
77 |
-
}
|
78 |
-
if(stream.eol()){
|
79 |
-
state.commentLine = false;
|
80 |
-
}
|
81 |
-
}
|
82 |
-
};
|
83 |
-
});
|
84 |
-
CodeMirror.defineMIME("text/x-brainfuck","brainfuck")
|
85 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/brainfuck/index.html
DELETED
@@ -1,85 +0,0 @@
|
|
1 |
-
<!doctype html>
|
2 |
-
|
3 |
-
<title>CodeMirror: Brainfuck mode</title>
|
4 |
-
<meta charset="utf-8"/>
|
5 |
-
<link rel=stylesheet href="../../doc/docs.css">
|
6 |
-
|
7 |
-
<link rel="stylesheet" href="../../lib/codemirror.css">
|
8 |
-
<script src="../../lib/codemirror.js"></script>
|
9 |
-
<script src="../../addon/edit/matchbrackets.js"></script>
|
10 |
-
<script src="./brainfuck.js"></script>
|
11 |
-
<style>
|
12 |
-
.CodeMirror { border: 2px inset #dee; }
|
13 |
-
</style>
|
14 |
-
<div id=nav>
|
15 |
-
<a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
16 |
-
|
17 |
-
<ul>
|
18 |
-
<li><a href="../../index.html">Home</a>
|
19 |
-
<li><a href="../../doc/manual.html">Manual</a>
|
20 |
-
<li><a href="https://github.com/codemirror/codemirror">Code</a>
|
21 |
-
</ul>
|
22 |
-
<ul>
|
23 |
-
<li><a href="../index.html">Language modes</a>
|
24 |
-
<li><a class=active href="#"></a>
|
25 |
-
</ul>
|
26 |
-
</div>
|
27 |
-
|
28 |
-
<article>
|
29 |
-
<h2>Brainfuck mode</h2>
|
30 |
-
<form><textarea id="code" name="code">
|
31 |
-
[ This program prints "Hello World!" and a newline to the screen, its
|
32 |
-
length is 106 active command characters [it is not the shortest.]
|
33 |
-
|
34 |
-
This loop is a "comment loop", it's a simple way of adding a comment
|
35 |
-
to a BF program such that you don't have to worry about any command
|
36 |
-
characters. Any ".", ",", "+", "-", "<" and ">" characters are simply
|
37 |
-
ignored, the "[" and "]" characters just have to be balanced.
|
38 |
-
]
|
39 |
-
+++++ +++ Set Cell #0 to 8
|
40 |
-
[
|
41 |
-
>++++ Add 4 to Cell #1; this will always set Cell #1 to 4
|
42 |
-
[ as the cell will be cleared by the loop
|
43 |
-
>++ Add 2 to Cell #2
|
44 |
-
>+++ Add 3 to Cell #3
|
45 |
-
>+++ Add 3 to Cell #4
|
46 |
-
>+ Add 1 to Cell #5
|
47 |
-
<<<<- Decrement the loop counter in Cell #1
|
48 |
-
] Loop till Cell #1 is zero; number of iterations is 4
|
49 |
-
>+ Add 1 to Cell #2
|
50 |
-
>+ Add 1 to Cell #3
|
51 |
-
>- Subtract 1 from Cell #4
|
52 |
-
>>+ Add 1 to Cell #6
|
53 |
-
[<] Move back to the first zero cell you find; this will
|
54 |
-
be Cell #1 which was cleared by the previous loop
|
55 |
-
<- Decrement the loop Counter in Cell #0
|
56 |
-
] Loop till Cell #0 is zero; number of iterations is 8
|
57 |
-
|
58 |
-
The result of this is:
|
59 |
-
Cell No : 0 1 2 3 4 5 6
|
60 |
-
Contents: 0 0 72 104 88 32 8
|
61 |
-
Pointer : ^
|
62 |
-
|
63 |
-
>>. Cell #2 has value 72 which is 'H'
|
64 |
-
>---. Subtract 3 from Cell #3 to get 101 which is 'e'
|
65 |
-
+++++++..+++. Likewise for 'llo' from Cell #3
|
66 |
-
>>. Cell #5 is 32 for the space
|
67 |
-
<-. Subtract 1 from Cell #4 for 87 to give a 'W'
|
68 |
-
<. Cell #3 was set to 'o' from the end of 'Hello'
|
69 |
-
+++.------.--------. Cell #3 for 'rl' and 'd'
|
70 |
-
>>+. Add 1 to Cell #5 gives us an exclamation point
|
71 |
-
>++. And finally a newline from Cell #6
|
72 |
-
</textarea></form>
|
73 |
-
|
74 |
-
<script>
|
75 |
-
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
|
76 |
-
lineNumbers: true,
|
77 |
-
matchBrackets: true,
|
78 |
-
mode: "text/x-brainfuck"
|
79 |
-
});
|
80 |
-
</script>
|
81 |
-
|
82 |
-
<p>A mode for Brainfuck</p>
|
83 |
-
|
84 |
-
<p><strong>MIME types defined:</strong> <code>text/x-brainfuck</code></p>
|
85 |
-
</article>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/clike/clike.js
DELETED
@@ -1,775 +0,0 @@
|
|
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("clike", function(config, parserConfig) {
|
15 |
-
var indentUnit = config.indentUnit,
|
16 |
-
statementIndentUnit = parserConfig.statementIndentUnit || indentUnit,
|
17 |
-
dontAlignCalls = parserConfig.dontAlignCalls,
|
18 |
-
keywords = parserConfig.keywords || {},
|
19 |
-
types = parserConfig.types || {},
|
20 |
-
builtin = parserConfig.builtin || {},
|
21 |
-
blockKeywords = parserConfig.blockKeywords || {},
|
22 |
-
defKeywords = parserConfig.defKeywords || {},
|
23 |
-
atoms = parserConfig.atoms || {},
|
24 |
-
hooks = parserConfig.hooks || {},
|
25 |
-
multiLineStrings = parserConfig.multiLineStrings,
|
26 |
-
indentStatements = parserConfig.indentStatements !== false,
|
27 |
-
indentSwitch = parserConfig.indentSwitch !== false,
|
28 |
-
namespaceSeparator = parserConfig.namespaceSeparator,
|
29 |
-
isPunctuationChar = parserConfig.isPunctuationChar || /[\[\]{}\(\),;\:\.]/,
|
30 |
-
numberStart = parserConfig.numberStart || /[\d\.]/,
|
31 |
-
number = parserConfig.number || /^(?:0x[a-f\d]+|0b[01]+|(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?)(u|ll?|l|f)?/i,
|
32 |
-
isOperatorChar = parserConfig.isOperatorChar || /[+\-*&%=<>!?|\/]/,
|
33 |
-
endStatement = parserConfig.endStatement || /^[;:,]$/;
|
34 |
-
|
35 |
-
var curPunc, isDefKeyword;
|
36 |
-
|
37 |
-
function tokenBase(stream, state) {
|
38 |
-
var ch = stream.next();
|
39 |
-
if (hooks[ch]) {
|
40 |
-
var result = hooks[ch](stream, state);
|
41 |
-
if (result !== false) return result;
|
42 |
-
}
|
43 |
-
if (ch == '"' || ch == "'") {
|
44 |
-
state.tokenize = tokenString(ch);
|
45 |
-
return state.tokenize(stream, state);
|
46 |
-
}
|
47 |
-
if (isPunctuationChar.test(ch)) {
|
48 |
-
curPunc = ch;
|
49 |
-
return null;
|
50 |
-
}
|
51 |
-
if (numberStart.test(ch)) {
|
52 |
-
stream.backUp(1)
|
53 |
-
if (stream.match(number)) return "number"
|
54 |
-
stream.next()
|
55 |
-
}
|
56 |
-
if (ch == "/") {
|
57 |
-
if (stream.eat("*")) {
|
58 |
-
state.tokenize = tokenComment;
|
59 |
-
return tokenComment(stream, state);
|
60 |
-
}
|
61 |
-
if (stream.eat("/")) {
|
62 |
-
stream.skipToEnd();
|
63 |
-
return "comment";
|
64 |
-
}
|
65 |
-
}
|
66 |
-
if (isOperatorChar.test(ch)) {
|
67 |
-
stream.eatWhile(isOperatorChar);
|
68 |
-
return "operator";
|
69 |
-
}
|
70 |
-
stream.eatWhile(/[\w\$_\xa1-\uffff]/);
|
71 |
-
if (namespaceSeparator) while (stream.match(namespaceSeparator))
|
72 |
-
stream.eatWhile(/[\w\$_\xa1-\uffff]/);
|
73 |
-
|
74 |
-
var cur = stream.current();
|
75 |
-
if (contains(keywords, cur)) {
|
76 |
-
if (contains(blockKeywords, cur)) curPunc = "newstatement";
|
77 |
-
if (contains(defKeywords, cur)) isDefKeyword = true;
|
78 |
-
return "keyword";
|
79 |
-
}
|
80 |
-
if (contains(types, cur)) return "variable-3";
|
81 |
-
if (contains(builtin, cur)) {
|
82 |
-
if (contains(blockKeywords, cur)) curPunc = "newstatement";
|
83 |
-
return "builtin";
|
84 |
-
}
|
85 |
-
if (contains(atoms, cur)) return "atom";
|
86 |
-
return "variable";
|
87 |
-
}
|
88 |
-
|
89 |
-
function tokenString(quote) {
|
90 |
-
return function(stream, state) {
|
91 |
-
var escaped = false, next, end = false;
|
92 |
-
while ((next = stream.next()) != null) {
|
93 |
-
if (next == quote && !escaped) {end = true; break;}
|
94 |
-
escaped = !escaped && next == "\\";
|
95 |
-
}
|
96 |
-
if (end || !(escaped || multiLineStrings))
|
97 |
-
state.tokenize = null;
|
98 |
-
return "string";
|
99 |
-
};
|
100 |
-
}
|
101 |
-
|
102 |
-
function tokenComment(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 isStatement(type) {
|
122 |
-
return type == "statement" || type == "switchstatement" || type == "namespace";
|
123 |
-
}
|
124 |
-
function pushContext(state, col, type) {
|
125 |
-
var indent = state.indented;
|
126 |
-
if (state.context && isStatement(state.context.type) && !isStatement(type))
|
127 |
-
indent = state.context.indented;
|
128 |
-
return state.context = new Context(indent, col, type, null, state.context);
|
129 |
-
}
|
130 |
-
function popContext(state) {
|
131 |
-
var t = state.context.type;
|
132 |
-
if (t == ")" || t == "]" || t == "}")
|
133 |
-
state.indented = state.context.indented;
|
134 |
-
return state.context = state.context.prev;
|
135 |
-
}
|
136 |
-
|
137 |
-
function typeBefore(stream, state) {
|
138 |
-
if (state.prevToken == "variable" || state.prevToken == "variable-3") return true;
|
139 |
-
if (/\S(?:[^- ]>|[*\]])\s*$|\*$/.test(stream.string.slice(0, stream.start))) return true;
|
140 |
-
}
|
141 |
-
|
142 |
-
function isTopScope(context) {
|
143 |
-
for (;;) {
|
144 |
-
if (!context || context.type == "top") return true;
|
145 |
-
if (context.type == "}" && context.prev.type != "namespace") return false;
|
146 |
-
context = context.prev;
|
147 |
-
}
|
148 |
-
}
|
149 |
-
|
150 |
-
// Interface
|
151 |
-
|
152 |
-
return {
|
153 |
-
startState: function(basecolumn) {
|
154 |
-
return {
|
155 |
-
tokenize: null,
|
156 |
-
context: new Context((basecolumn || 0) - indentUnit, 0, "top", false),
|
157 |
-
indented: 0,
|
158 |
-
startOfLine: true,
|
159 |
-
prevToken: null
|
160 |
-
};
|
161 |
-
},
|
162 |
-
|
163 |
-
token: function(stream, state) {
|
164 |
-
var ctx = state.context;
|
165 |
-
if (stream.sol()) {
|
166 |
-
if (ctx.align == null) ctx.align = false;
|
167 |
-
state.indented = stream.indentation();
|
168 |
-
state.startOfLine = true;
|
169 |
-
}
|
170 |
-
if (stream.eatSpace()) return null;
|
171 |
-
curPunc = isDefKeyword = null;
|
172 |
-
var style = (state.tokenize || tokenBase)(stream, state);
|
173 |
-
if (style == "comment" || style == "meta") return style;
|
174 |
-
if (ctx.align == null) ctx.align = true;
|
175 |
-
|
176 |
-
if (endStatement.test(curPunc)) while (isStatement(state.context.type)) popContext(state);
|
177 |
-
else if (curPunc == "{") pushContext(state, stream.column(), "}");
|
178 |
-
else if (curPunc == "[") pushContext(state, stream.column(), "]");
|
179 |
-
else if (curPunc == "(") pushContext(state, stream.column(), ")");
|
180 |
-
else if (curPunc == "}") {
|
181 |
-
while (isStatement(ctx.type)) ctx = popContext(state);
|
182 |
-
if (ctx.type == "}") ctx = popContext(state);
|
183 |
-
while (isStatement(ctx.type)) ctx = popContext(state);
|
184 |
-
}
|
185 |
-
else if (curPunc == ctx.type) popContext(state);
|
186 |
-
else if (indentStatements &&
|
187 |
-
(((ctx.type == "}" || ctx.type == "top") && curPunc != ";") ||
|
188 |
-
(isStatement(ctx.type) && curPunc == "newstatement"))) {
|
189 |
-
var type = "statement";
|
190 |
-
if (curPunc == "newstatement" && indentSwitch && stream.current() == "switch")
|
191 |
-
type = "switchstatement";
|
192 |
-
else if (style == "keyword" && stream.current() == "namespace")
|
193 |
-
type = "namespace";
|
194 |
-
pushContext(state, stream.column(), type);
|
195 |
-
}
|
196 |
-
|
197 |
-
if (style == "variable" &&
|
198 |
-
((state.prevToken == "def" ||
|
199 |
-
(parserConfig.typeFirstDefinitions && typeBefore(stream, state) &&
|
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 |
-
return style;
|
213 |
-
},
|
214 |
-
|
215 |
-
indent: function(state, textAfter) {
|
216 |
-
if (state.tokenize != tokenBase && state.tokenize != null) return CodeMirror.Pass;
|
217 |
-
var ctx = state.context, firstChar = textAfter && textAfter.charAt(0);
|
218 |
-
if (isStatement(ctx.type) && firstChar == "}") ctx = ctx.prev;
|
219 |
-
if (hooks.indent) {
|
220 |
-
var hook = hooks.indent(state, ctx, textAfter);
|
221 |
-
if (typeof hook == "number") return hook
|
222 |
-
}
|
223 |
-
var closing = firstChar == ctx.type;
|
224 |
-
var switchBlock = ctx.prev && ctx.prev.type == "switchstatement";
|
225 |
-
if (parserConfig.allmanIndentation && /[{(]/.test(firstChar)) {
|
226 |
-
while (ctx.type != "top" && ctx.type != "}") ctx = ctx.prev
|
227 |
-
return ctx.indented
|
228 |
-
}
|
229 |
-
if (isStatement(ctx.type))
|
230 |
-
return ctx.indented + (firstChar == "{" ? 0 : statementIndentUnit);
|
231 |
-
if (ctx.align && (!dontAlignCalls || ctx.type != ")"))
|
232 |
-
return ctx.column + (closing ? 0 : 1);
|
233 |
-
if (ctx.type == ")" && !closing)
|
234 |
-
return ctx.indented + statementIndentUnit;
|
235 |
-
|
236 |
-
return ctx.indented + (closing ? 0 : indentUnit) +
|
237 |
-
(!closing && switchBlock && !/^(?:case|default)\b/.test(textAfter) ? indentUnit : 0);
|
238 |
-
},
|
239 |
-
|
240 |
-
electricInput: indentSwitch ? /^\s*(?:case .*?:|default:|\{\}?|\})$/ : /^\s*[{}]$/,
|
241 |
-
blockCommentStart: "/*",
|
242 |
-
blockCommentEnd: "*/",
|
243 |
-
lineComment: "//",
|
244 |
-
fold: "brace"
|
245 |
-
};
|
246 |
-
});
|
247 |
-
|
248 |
-
function words(str) {
|
249 |
-
var obj = {}, words = str.split(" ");
|
250 |
-
for (var i = 0; i < words.length; ++i) obj[words[i]] = true;
|
251 |
-
return obj;
|
252 |
-
}
|
253 |
-
function contains(words, word) {
|
254 |
-
if (typeof words === "function") {
|
255 |
-
return words(word);
|
256 |
-
} else {
|
257 |
-
return words.propertyIsEnumerable(word);
|
258 |
-
}
|
259 |
-
}
|
260 |
-
var cKeywords = "auto if break case register continue return default do sizeof " +
|
261 |
-
"static else struct switch extern typedef union for goto while enum const volatile";
|
262 |
-
var cTypes = "int long char short double float unsigned signed void size_t ptrdiff_t";
|
263 |
-
|
264 |
-
function cppHook(stream, state) {
|
265 |
-
if (!state.startOfLine) return false;
|
266 |
-
for (;;) {
|
267 |
-
if (stream.skipTo("\\")) {
|
268 |
-
stream.next();
|
269 |
-
if (stream.eol()) {
|
270 |
-
state.tokenize = cppHook;
|
271 |
-
break;
|
272 |
-
}
|
273 |
-
} else {
|
274 |
-
stream.skipToEnd();
|
275 |
-
state.tokenize = null;
|
276 |
-
break;
|
277 |
-
}
|
278 |
-
}
|
279 |
-
return "meta";
|
280 |
-
}
|
281 |
-
|
282 |
-
function pointerHook(_stream, state) {
|
283 |
-
if (state.prevToken == "variable-3") return "variable-3";
|
284 |
-
return false;
|
285 |
-
}
|
286 |
-
|
287 |
-
function cpp14Literal(stream) {
|
288 |
-
stream.eatWhile(/[\w\.']/);
|
289 |
-
return "number";
|
290 |
-
}
|
291 |
-
|
292 |
-
function cpp11StringHook(stream, state) {
|
293 |
-
stream.backUp(1);
|
294 |
-
// Raw strings.
|
295 |
-
if (stream.match(/(R|u8R|uR|UR|LR)/)) {
|
296 |
-
var match = stream.match(/"([^\s\\()]{0,16})\(/);
|
297 |
-
if (!match) {
|
298 |
-
return false;
|
299 |
-
}
|
300 |
-
state.cpp11RawStringDelim = match[1];
|
301 |
-
state.tokenize = tokenRawString;
|
302 |
-
return tokenRawString(stream, state);
|
303 |
-
}
|
304 |
-
// Unicode strings/chars.
|
305 |
-
if (stream.match(/(u8|u|U|L)/)) {
|
306 |
-
if (stream.match(/["']/, /* eat */ false)) {
|
307 |
-
return "string";
|
308 |
-
}
|
309 |
-
return false;
|
310 |
-
}
|
311 |
-
// Ignore this hook.
|
312 |
-
stream.next();
|
313 |
-
return false;
|
314 |
-
}
|
315 |
-
|
316 |
-
function cppLooksLikeConstructor(word) {
|
317 |
-
var lastTwo = /(\w+)::(\w+)$/.exec(word);
|
318 |
-
return lastTwo && lastTwo[1] == lastTwo[2];
|
319 |
-
}
|
320 |
-
|
321 |
-
// C#-style strings where "" escapes a quote.
|
322 |
-
function tokenAtString(stream, state) {
|
323 |
-
var next;
|
324 |
-
while ((next = stream.next()) != null) {
|
325 |
-
if (next == '"' && !stream.eat('"')) {
|
326 |
-
state.tokenize = null;
|
327 |
-
break;
|
328 |
-
}
|
329 |
-
}
|
330 |
-
return "string";
|
331 |
-
}
|
332 |
-
|
333 |
-
// C++11 raw string literal is <prefix>"<delim>( anything )<delim>", where
|
334 |
-
// <delim> can be a string up to 16 characters long.
|
335 |
-
function tokenRawString(stream, state) {
|
336 |
-
// Escape characters that have special regex meanings.
|
337 |
-
var delim = state.cpp11RawStringDelim.replace(/[^\w\s]/g, '\\$&');
|
338 |
-
var match = stream.match(new RegExp(".*?\\)" + delim + '"'));
|
339 |
-
if (match)
|
340 |
-
state.tokenize = null;
|
341 |
-
else
|
342 |
-
stream.skipToEnd();
|
343 |
-
return "string";
|
344 |
-
}
|
345 |
-
|
346 |
-
function def(mimes, mode) {
|
347 |
-
if (typeof mimes == "string") mimes = [mimes];
|
348 |
-
var words = [];
|
349 |
-
function add(obj) {
|
350 |
-
if (obj) for (var prop in obj) if (obj.hasOwnProperty(prop))
|
351 |
-
words.push(prop);
|
352 |
-
}
|
353 |
-
add(mode.keywords);
|
354 |
-
add(mode.types);
|
355 |
-
add(mode.builtin);
|
356 |
-
add(mode.atoms);
|
357 |
-
if (words.length) {
|
358 |
-
mode.helperType = mimes[0];
|
359 |
-
CodeMirror.registerHelper("hintWords", mimes[0], words);
|
360 |
-
}
|
361 |
-
|
362 |
-
for (var i = 0; i < mimes.length; ++i)
|
363 |
-
CodeMirror.defineMIME(mimes[i], mode);
|
364 |
-
}
|
365 |
-
|
366 |
-
def(["text/x-csrc", "text/x-c", "text/x-chdr"], {
|
367 |
-
name: "clike",
|
368 |
-
keywords: words(cKeywords),
|
369 |
-
types: words(cTypes + " bool _Complex _Bool float_t double_t intptr_t intmax_t " +
|
370 |
-
"int8_t int16_t int32_t int64_t uintptr_t uintmax_t uint8_t uint16_t " +
|
371 |
-
"uint32_t uint64_t"),
|
372 |
-
blockKeywords: words("case do else for if switch while struct"),
|
373 |
-
defKeywords: words("struct"),
|
374 |
-
typeFirstDefinitions: true,
|
375 |
-
atoms: words("null true false"),
|
376 |
-
hooks: {"#": cppHook, "*": pointerHook},
|
377 |
-
modeProps: {fold: ["brace", "include"]}
|
378 |
-
});
|
379 |
-
|
380 |
-
def(["text/x-c++src", "text/x-c++hdr"], {
|
381 |
-
name: "clike",
|
382 |
-
keywords: words(cKeywords + " asm dynamic_cast namespace reinterpret_cast try explicit new " +
|
383 |
-
"static_cast typeid catch operator template typename class friend private " +
|
384 |
-
"this using const_cast inline public throw virtual delete mutable protected " +
|
385 |
-
"alignas alignof constexpr decltype nullptr noexcept thread_local final " +
|
386 |
-
"static_assert override"),
|
387 |
-
types: words(cTypes + " bool wchar_t"),
|
388 |
-
blockKeywords: words("catch class do else finally for if struct switch try while"),
|
389 |
-
defKeywords: words("class namespace struct enum union"),
|
390 |
-
typeFirstDefinitions: true,
|
391 |
-
atoms: words("true false null"),
|
392 |
-
hooks: {
|
393 |
-
"#": cppHook,
|
394 |
-
"*": pointerHook,
|
395 |
-
"u": cpp11StringHook,
|
396 |
-
"U": cpp11StringHook,
|
397 |
-
"L": cpp11StringHook,
|
398 |
-
"R": cpp11StringHook,
|
399 |
-
"0": cpp14Literal,
|
400 |
-
"1": cpp14Literal,
|
401 |
-
"2": cpp14Literal,
|
402 |
-
"3": cpp14Literal,
|
403 |
-
"4": cpp14Literal,
|
404 |
-
"5": cpp14Literal,
|
405 |
-
"6": cpp14Literal,
|
406 |
-
"7": cpp14Literal,
|
407 |
-
"8": cpp14Literal,
|
408 |
-
"9": cpp14Literal,
|
409 |
-
token: function(stream, state, style) {
|
410 |
-
if (style == "variable" && stream.peek() == "(" &&
|
411 |
-
(state.prevToken == ";" || state.prevToken == null ||
|
412 |
-
state.prevToken == "}") &&
|
413 |
-
cppLooksLikeConstructor(stream.current()))
|
414 |
-
return "def";
|
415 |
-
}
|
416 |
-
},
|
417 |
-
namespaceSeparator: "::",
|
418 |
-
modeProps: {fold: ["brace", "include"]}
|
419 |
-
});
|
420 |
-
|
421 |
-
def("text/x-java", {
|
422 |
-
name: "clike",
|
423 |
-
keywords: words("abstract assert break case catch class const continue default " +
|
424 |
-
"do else enum extends final finally float for goto if implements import " +
|
425 |
-
"instanceof interface native new package private protected public " +
|
426 |
-
"return static strictfp super switch synchronized this throw throws transient " +
|
427 |
-
"try volatile while"),
|
428 |
-
types: words("byte short int long float double boolean char void Boolean Byte Character Double Float " +
|
429 |
-
"Integer Long Number Object Short String StringBuffer StringBuilder Void"),
|
430 |
-
blockKeywords: words("catch class do else finally for if switch try while"),
|
431 |
-
defKeywords: words("class interface package enum"),
|
432 |
-
typeFirstDefinitions: true,
|
433 |
-
atoms: words("true false null"),
|
434 |
-
endStatement: /^[;:]$/,
|
435 |
-
hooks: {
|
436 |
-
"@": function(stream) {
|
437 |
-
stream.eatWhile(/[\w\$_]/);
|
438 |
-
return "meta";
|
439 |
-
}
|
440 |
-
},
|
441 |
-
modeProps: {fold: ["brace", "import"]}
|
442 |
-
});
|
443 |
-
|
444 |
-
def("text/x-csharp", {
|
445 |
-
name: "clike",
|
446 |
-
keywords: words("abstract as async await base break case catch checked class const continue" +
|
447 |
-
" default delegate do else enum event explicit extern finally fixed for" +
|
448 |
-
" foreach goto if implicit in interface internal is lock namespace new" +
|
449 |
-
" operator out override params private protected public readonly ref return sealed" +
|
450 |
-
" sizeof stackalloc static struct switch this throw try typeof unchecked" +
|
451 |
-
" unsafe using virtual void volatile while add alias ascending descending dynamic from get" +
|
452 |
-
" global group into join let orderby partial remove select set value var yield"),
|
453 |
-
types: words("Action Boolean Byte Char DateTime DateTimeOffset Decimal Double Func" +
|
454 |
-
" Guid Int16 Int32 Int64 Object SByte Single String Task TimeSpan UInt16 UInt32" +
|
455 |
-
" UInt64 bool byte char decimal double short int long object" +
|
456 |
-
" sbyte float string ushort uint ulong"),
|
457 |
-
blockKeywords: words("catch class do else finally for foreach if struct switch try while"),
|
458 |
-
defKeywords: words("class interface namespace struct var"),
|
459 |
-
typeFirstDefinitions: true,
|
460 |
-
atoms: words("true false null"),
|
461 |
-
hooks: {
|
462 |
-
"@": function(stream, state) {
|
463 |
-
if (stream.eat('"')) {
|
464 |
-
state.tokenize = tokenAtString;
|
465 |
-
return tokenAtString(stream, state);
|
466 |
-
}
|
467 |
-
stream.eatWhile(/[\w\$_]/);
|
468 |
-
return "meta";
|
469 |
-
}
|
470 |
-
}
|
471 |
-
});
|
472 |
-
|
473 |
-
function tokenTripleString(stream, state) {
|
474 |
-
var escaped = false;
|
475 |
-
while (!stream.eol()) {
|
476 |
-
if (!escaped && stream.match('"""')) {
|
477 |
-
state.tokenize = null;
|
478 |
-
break;
|
479 |
-
}
|
480 |
-
escaped = stream.next() == "\\" && !escaped;
|
481 |
-
}
|
482 |
-
return "string";
|
483 |
-
}
|
484 |
-
|
485 |
-
def("text/x-scala", {
|
486 |
-
name: "clike",
|
487 |
-
keywords: words(
|
488 |
-
|
489 |
-
/* scala */
|
490 |
-
"abstract case catch class def do else extends final finally for forSome if " +
|
491 |
-
"implicit import lazy match new null object override package private protected return " +
|
492 |
-
"sealed super this throw trait try type val var while with yield _ : = => <- <: " +
|
493 |
-
"<% >: # @ " +
|
494 |
-
|
495 |
-
/* package scala */
|
496 |
-
"assert assume require print println printf readLine readBoolean readByte readShort " +
|
497 |
-
"readChar readInt readLong readFloat readDouble " +
|
498 |
-
|
499 |
-
":: #:: "
|
500 |
-
),
|
501 |
-
types: words(
|
502 |
-
"AnyVal App Application Array BufferedIterator BigDecimal BigInt Char Console Either " +
|
503 |
-
"Enumeration Equiv Error Exception Fractional Function IndexedSeq Integral Iterable " +
|
504 |
-
"Iterator List Map Numeric Nil NotNull Option Ordered Ordering PartialFunction PartialOrdering " +
|
505 |
-
"Product Proxy Range Responder Seq Serializable Set Specializable Stream StringBuilder " +
|
506 |
-
"StringContext Symbol Throwable Traversable TraversableOnce Tuple Unit Vector " +
|
507 |
-
|
508 |
-
/* package java.lang */
|
509 |
-
"Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable " +
|
510 |
-
"Compiler Double Exception Float Integer Long Math Number Object Package Pair Process " +
|
511 |
-
"Runtime Runnable SecurityManager Short StackTraceElement StrictMath String " +
|
512 |
-
"StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void"
|
513 |
-
),
|
514 |
-
multiLineStrings: true,
|
515 |
-
blockKeywords: words("catch class do else finally for forSome if match switch try while"),
|
516 |
-
defKeywords: words("class def object package trait type val var"),
|
517 |
-
atoms: words("true false null"),
|
518 |
-
indentStatements: false,
|
519 |
-
indentSwitch: false,
|
520 |
-
hooks: {
|
521 |
-
"@": function(stream) {
|
522 |
-
stream.eatWhile(/[\w\$_]/);
|
523 |
-
return "meta";
|
524 |
-
},
|
525 |
-
'"': function(stream, state) {
|
526 |
-
if (!stream.match('""')) return false;
|
527 |
-
state.tokenize = tokenTripleString;
|
528 |
-
return state.tokenize(stream, state);
|
529 |
-
},
|
530 |
-
"'": function(stream) {
|
531 |
-
stream.eatWhile(/[\w\$_\xa1-\uffff]/);
|
532 |
-
return "atom";
|
533 |
-
}
|
534 |
-
},
|
535 |
-
modeProps: {closeBrackets: {triples: '"'}}
|
536 |
-
});
|
537 |
-
|
538 |
-
function tokenKotlinString(tripleString){
|
539 |
-
return function (stream, state) {
|
540 |
-
var escaped = false, next, end = false;
|
541 |
-
while (!stream.eol()) {
|
542 |
-
if (!tripleString && !escaped && stream.match('"') ) {end = true; break;}
|
543 |
-
if (tripleString && stream.match('"""')) {end = true; break;}
|
544 |
-
next = stream.next();
|
545 |
-
if(!escaped && next == "$" && stream.match('{'))
|
546 |
-
stream.skipTo("}");
|
547 |
-
escaped = !escaped && next == "\\" && !tripleString;
|
548 |
-
}
|
549 |
-
if (end || !tripleString)
|
550 |
-
state.tokenize = null;
|
551 |
-
return "string";
|
552 |
-
}
|
553 |
-
}
|
554 |
-
|
555 |
-
def("text/x-kotlin", {
|
556 |
-
name: "clike",
|
557 |
-
keywords: words(
|
558 |
-
/*keywords*/
|
559 |
-
"package as typealias class interface this super val " +
|
560 |
-
"var fun for is in This throw return " +
|
561 |
-
"break continue object if else while do try when !in !is as? " +
|
562 |
-
|
563 |
-
/*soft keywords*/
|
564 |
-
"file import where by get set abstract enum open inner override private public internal " +
|
565 |
-
"protected catch finally out final vararg reified dynamic companion constructor init " +
|
566 |
-
"sealed field property receiver param sparam lateinit data inline noinline tailrec " +
|
567 |
-
"external annotation crossinline const operator infix"
|
568 |
-
),
|
569 |
-
types: words(
|
570 |
-
/* package java.lang */
|
571 |
-
"Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable " +
|
572 |
-
"Compiler Double Exception Float Integer Long Math Number Object Package Pair Process " +
|
573 |
-
"Runtime Runnable SecurityManager Short StackTraceElement StrictMath String " +
|
574 |
-
"StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void"
|
575 |
-
),
|
576 |
-
intendSwitch: false,
|
577 |
-
indentStatements: false,
|
578 |
-
multiLineStrings: true,
|
579 |
-
blockKeywords: words("catch class do else finally for if where try while enum"),
|
580 |
-
defKeywords: words("class val var object package interface fun"),
|
581 |
-
atoms: words("true false null this"),
|
582 |
-
hooks: {
|
583 |
-
'"': function(stream, state) {
|
584 |
-
state.tokenize = tokenKotlinString(stream.match('""'));
|
585 |
-
return state.tokenize(stream, state);
|
586 |
-
}
|
587 |
-
},
|
588 |
-
modeProps: {closeBrackets: {triples: '"'}}
|
589 |
-
});
|
590 |
-
|
591 |
-
def(["x-shader/x-vertex", "x-shader/x-fragment"], {
|
592 |
-
name: "clike",
|
593 |
-
keywords: words("sampler1D sampler2D sampler3D samplerCube " +
|
594 |
-
"sampler1DShadow sampler2DShadow " +
|
595 |
-
"const attribute uniform varying " +
|
596 |
-
"break continue discard return " +
|
597 |
-
"for while do if else struct " +
|
598 |
-
"in out inout"),
|
599 |
-
types: words("float int bool void " +
|
600 |
-
"vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 " +
|
601 |
-
"mat2 mat3 mat4"),
|
602 |
-
blockKeywords: words("for while do if else struct"),
|
603 |
-
builtin: words("radians degrees sin cos tan asin acos atan " +
|
604 |
-
"pow exp log exp2 sqrt inversesqrt " +
|
605 |
-
"abs sign floor ceil fract mod min max clamp mix step smoothstep " +
|
606 |
-
"length distance dot cross normalize ftransform faceforward " +
|
607 |
-
"reflect refract matrixCompMult " +
|
608 |
-
"lessThan lessThanEqual greaterThan greaterThanEqual " +
|
609 |
-
"equal notEqual any all not " +
|
610 |
-
"texture1D texture1DProj texture1DLod texture1DProjLod " +
|
611 |
-
"texture2D texture2DProj texture2DLod texture2DProjLod " +
|
612 |
-
"texture3D texture3DProj texture3DLod texture3DProjLod " +
|
613 |
-
"textureCube textureCubeLod " +
|
614 |
-
"shadow1D shadow2D shadow1DProj shadow2DProj " +
|
615 |
-
"shadow1DLod shadow2DLod shadow1DProjLod shadow2DProjLod " +
|
616 |
-
"dFdx dFdy fwidth " +
|
617 |
-
"noise1 noise2 noise3 noise4"),
|
618 |
-
atoms: words("true false " +
|
619 |
-
"gl_FragColor gl_SecondaryColor gl_Normal gl_Vertex " +
|
620 |
-
"gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord3 " +
|
621 |
-
"gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 " +
|
622 |
-
"gl_FogCoord gl_PointCoord " +
|
623 |
-
"gl_Position gl_PointSize gl_ClipVertex " +
|
624 |
-
"gl_FrontColor gl_BackColor gl_FrontSecondaryColor gl_BackSecondaryColor " +
|
625 |
-
"gl_TexCoord gl_FogFragCoord " +
|
626 |
-
"gl_FragCoord gl_FrontFacing " +
|
627 |
-
"gl_FragData gl_FragDepth " +
|
628 |
-
"gl_ModelViewMatrix gl_ProjectionMatrix gl_ModelViewProjectionMatrix " +
|
629 |
-
"gl_TextureMatrix gl_NormalMatrix gl_ModelViewMatrixInverse " +
|
630 |
-
"gl_ProjectionMatrixInverse gl_ModelViewProjectionMatrixInverse " +
|
631 |
-
"gl_TexureMatrixTranspose gl_ModelViewMatrixInverseTranspose " +
|
632 |
-
"gl_ProjectionMatrixInverseTranspose " +
|
633 |
-
"gl_ModelViewProjectionMatrixInverseTranspose " +
|
634 |
-
"gl_TextureMatrixInverseTranspose " +
|
635 |
-
"gl_NormalScale gl_DepthRange gl_ClipPlane " +
|
636 |
-
"gl_Point gl_FrontMaterial gl_BackMaterial gl_LightSource gl_LightModel " +
|
637 |
-
"gl_FrontLightModelProduct gl_BackLightModelProduct " +
|
638 |
-
"gl_TextureColor gl_EyePlaneS gl_EyePlaneT gl_EyePlaneR gl_EyePlaneQ " +
|
639 |
-
"gl_FogParameters " +
|
640 |
-
"gl_MaxLights gl_MaxClipPlanes gl_MaxTextureUnits gl_MaxTextureCoords " +
|
641 |
-
"gl_MaxVertexAttribs gl_MaxVertexUniformComponents gl_MaxVaryingFloats " +
|
642 |
-
"gl_MaxVertexTextureImageUnits gl_MaxTextureImageUnits " +
|
643 |
-
"gl_MaxFragmentUniformComponents gl_MaxCombineTextureImageUnits " +
|
644 |
-
"gl_MaxDrawBuffers"),
|
645 |
-
indentSwitch: false,
|
646 |
-
hooks: {"#": cppHook},
|
647 |
-
modeProps: {fold: ["brace", "include"]}
|
648 |
-
});
|
649 |
-
|
650 |
-
def("text/x-nesc", {
|
651 |
-
name: "clike",
|
652 |
-
keywords: words(cKeywords + "as atomic async call command component components configuration event generic " +
|
653 |
-
"implementation includes interface module new norace nx_struct nx_union post provides " +
|
654 |
-
"signal task uses abstract extends"),
|
655 |
-
types: words(cTypes),
|
656 |
-
blockKeywords: words("case do else for if switch while struct"),
|
657 |
-
atoms: words("null true false"),
|
658 |
-
hooks: {"#": cppHook},
|
659 |
-
modeProps: {fold: ["brace", "include"]}
|
660 |
-
});
|
661 |
-
|
662 |
-
def("text/x-objectivec", {
|
663 |
-
name: "clike",
|
664 |
-
keywords: words(cKeywords + "inline restrict _Bool _Complex _Imaginery BOOL Class bycopy byref id IMP in " +
|
665 |
-
"inout nil oneway out Protocol SEL self super atomic nonatomic retain copy readwrite readonly"),
|
666 |
-
types: words(cTypes),
|
667 |
-
atoms: words("YES NO NULL NILL ON OFF true false"),
|
668 |
-
hooks: {
|
669 |
-
"@": function(stream) {
|
670 |
-
stream.eatWhile(/[\w\$]/);
|
671 |
-
return "keyword";
|
672 |
-
},
|
673 |
-
"#": cppHook,
|
674 |
-
indent: function(_state, ctx, textAfter) {
|
675 |
-
if (ctx.type == "statement" && /^@\w/.test(textAfter)) return ctx.indented
|
676 |
-
}
|
677 |
-
},
|
678 |
-
modeProps: {fold: "brace"}
|
679 |
-
});
|
680 |
-
|
681 |
-
def("text/x-squirrel", {
|
682 |
-
name: "clike",
|
683 |
-
keywords: words("base break clone continue const default delete enum extends function in class" +
|
684 |
-
" foreach local resume return this throw typeof yield constructor instanceof static"),
|
685 |
-
types: words(cTypes),
|
686 |
-
blockKeywords: words("case catch class else for foreach if switch try while"),
|
687 |
-
defKeywords: words("function local class"),
|
688 |
-
typeFirstDefinitions: true,
|
689 |
-
atoms: words("true false null"),
|
690 |
-
hooks: {"#": cppHook},
|
691 |
-
modeProps: {fold: ["brace", "include"]}
|
692 |
-
});
|
693 |
-
|
694 |
-
// Ceylon Strings need to deal with interpolation
|
695 |
-
var stringTokenizer = null;
|
696 |
-
function tokenCeylonString(type) {
|
697 |
-
return function(stream, state) {
|
698 |
-
var escaped = false, next, end = false;
|
699 |
-
while (!stream.eol()) {
|
700 |
-
if (!escaped && stream.match('"') &&
|
701 |
-
(type == "single" || stream.match('""'))) {
|
702 |
-
end = true;
|
703 |
-
break;
|
704 |
-
}
|
705 |
-
if (!escaped && stream.match('``')) {
|
706 |
-
stringTokenizer = tokenCeylonString(type);
|
707 |
-
end = true;
|
708 |
-
break;
|
709 |
-
}
|
710 |
-
next = stream.next();
|
711 |
-
escaped = type == "single" && !escaped && next == "\\";
|
712 |
-
}
|
713 |
-
if (end)
|
714 |
-
state.tokenize = null;
|
715 |
-
return "string";
|
716 |
-
}
|
717 |
-
}
|
718 |
-
|
719 |
-
def("text/x-ceylon", {
|
720 |
-
name: "clike",
|
721 |
-
keywords: words("abstracts alias assembly assert assign break case catch class continue dynamic else" +
|
722 |
-
" exists extends finally for function given if import in interface is let module new" +
|
723 |
-
" nonempty object of out outer package return satisfies super switch then this throw" +
|
724 |
-
" try value void while"),
|
725 |
-
types: function(word) {
|
726 |
-
// In Ceylon all identifiers that start with an uppercase are types
|
727 |
-
var first = word.charAt(0);
|
728 |
-
return (first === first.toUpperCase() && first !== first.toLowerCase());
|
729 |
-
},
|
730 |
-
blockKeywords: words("case catch class dynamic else finally for function if interface module new object switch try while"),
|
731 |
-
defKeywords: words("class dynamic function interface module object package value"),
|
732 |
-
builtin: words("abstract actual aliased annotation by default deprecated doc final formal late license" +
|
733 |
-
" native optional sealed see serializable shared suppressWarnings tagged throws variable"),
|
734 |
-
isPunctuationChar: /[\[\]{}\(\),;\:\.`]/,
|
735 |
-
isOperatorChar: /[+\-*&%=<>!?|^~:\/]/,
|
736 |
-
numberStart: /[\d#$]/,
|
737 |
-
number: /^(?:#[\da-fA-F_]+|\$[01_]+|[\d_]+[kMGTPmunpf]?|[\d_]+\.[\d_]+(?:[eE][-+]?\d+|[kMGTPmunpf]|)|)/i,
|
738 |
-
multiLineStrings: true,
|
739 |
-
typeFirstDefinitions: true,
|
740 |
-
atoms: words("true false null larger smaller equal empty finished"),
|
741 |
-
indentSwitch: false,
|
742 |
-
styleDefs: false,
|
743 |
-
hooks: {
|
744 |
-
"@": function(stream) {
|
745 |
-
stream.eatWhile(/[\w\$_]/);
|
746 |
-
return "meta";
|
747 |
-
},
|
748 |
-
'"': function(stream, state) {
|
749 |
-
state.tokenize = tokenCeylonString(stream.match('""') ? "triple" : "single");
|
750 |
-
return state.tokenize(stream, state);
|
751 |
-
},
|
752 |
-
'`': function(stream, state) {
|
753 |
-
if (!stringTokenizer || !stream.match('`')) return false;
|
754 |
-
state.tokenize = stringTokenizer;
|
755 |
-
stringTokenizer = null;
|
756 |
-
return state.tokenize(stream, state);
|
757 |
-
},
|
758 |
-
"'": function(stream) {
|
759 |
-
stream.eatWhile(/[\w\$_\xa1-\uffff]/);
|
760 |
-
return "atom";
|
761 |
-
},
|
762 |
-
token: function(_stream, state, style) {
|
763 |
-
if ((style == "variable" || style == "variable-3") &&
|
764 |
-
state.prevToken == ".") {
|
765 |
-
return "variable-2";
|
766 |
-
}
|
767 |
-
}
|
768 |
-
},
|
769 |
-
modeProps: {
|
770 |
-
fold: ["brace", "import"],
|
771 |
-
closeBrackets: {triples: '"'}
|
772 |
-
}
|
773 |
-
});
|
774 |
-
|
775 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/clike/index.html
DELETED
@@ -1,360 +0,0 @@
|
|
1 |
-
<!doctype html>
|
2 |
-
|
3 |
-
<title>CodeMirror: C-like mode</title>
|
4 |
-
<meta charset="utf-8"/>
|
5 |
-
<link rel=stylesheet href="../../doc/docs.css">
|
6 |
-
|
7 |
-
<link rel="stylesheet" href="../../lib/codemirror.css">
|
8 |
-
<script src="../../lib/codemirror.js"></script>
|
9 |
-
<script src="../../addon/edit/matchbrackets.js"></script>
|
10 |
-
<link rel="stylesheet" href="../../addon/hint/show-hint.css">
|
11 |
-
<script src="../../addon/hint/show-hint.js"></script>
|
12 |
-
<script src="clike.js"></script>
|
13 |
-
<style>.CodeMirror {border: 2px inset #dee;}</style>
|
14 |
-
<div id=nav>
|
15 |
-
<a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
16 |
-
|
17 |
-
<ul>
|
18 |
-
<li><a href="../../index.html">Home</a>
|
19 |
-
<li><a href="../../doc/manual.html">Manual</a>
|
20 |
-
<li><a href="https://github.com/codemirror/codemirror">Code</a>
|
21 |
-
</ul>
|
22 |
-
<ul>
|
23 |
-
<li><a href="../index.html">Language modes</a>
|
24 |
-
<li><a class=active href="#">C-like</a>
|
25 |
-
</ul>
|
26 |
-
</div>
|
27 |
-
|
28 |
-
<article>
|
29 |
-
<h2>C-like mode</h2>
|
30 |
-
|
31 |
-
<div><textarea id="c-code">
|
32 |
-
/* C demo code */
|
33 |
-
|
34 |
-
#include <zmq.h>
|
35 |
-
#include <pthread.h>
|
36 |
-
#include <semaphore.h>
|
37 |
-
#include <time.h>
|
38 |
-
#include <stdio.h>
|
39 |
-
#include <fcntl.h>
|
40 |
-
#include <malloc.h>
|
41 |
-
|
42 |
-
typedef struct {
|
43 |
-
void* arg_socket;
|
44 |
-
zmq_msg_t* arg_msg;
|
45 |
-
char* arg_string;
|
46 |
-
unsigned long arg_len;
|
47 |
-
int arg_int, arg_command;
|
48 |
-
|
49 |
-
int signal_fd;
|
50 |
-
int pad;
|
51 |
-
void* context;
|
52 |
-
sem_t sem;
|
53 |
-
} acl_zmq_context;
|
54 |
-
|
55 |
-
#define p(X) (context->arg_##X)
|
56 |
-
|
57 |
-
void* zmq_thread(void* context_pointer) {
|
58 |
-
acl_zmq_context* context = (acl_zmq_context*)context_pointer;
|
59 |
-
char ok = 'K', err = 'X';
|
60 |
-
int res;
|
61 |
-
|
62 |
-
while (1) {
|
63 |
-
while ((res = sem_wait(&context->sem)) == EINTR);
|
64 |
-
if (res) {write(context->signal_fd, &err, 1); goto cleanup;}
|
65 |
-
switch(p(command)) {
|
66 |
-
case 0: goto cleanup;
|
67 |
-
case 1: p(socket) = zmq_socket(context->context, p(int)); break;
|
68 |
-
case 2: p(int) = zmq_close(p(socket)); break;
|
69 |
-
case 3: p(int) = zmq_bind(p(socket), p(string)); break;
|
70 |
-
case 4: p(int) = zmq_connect(p(socket), p(string)); break;
|
71 |
-
case 5: p(int) = zmq_getsockopt(p(socket), p(int), (void*)p(string), &p(len)); break;
|
72 |
-
case 6: p(int) = zmq_setsockopt(p(socket), p(int), (void*)p(string), p(len)); break;
|
73 |
-
case 7: p(int) = zmq_send(p(socket), p(msg), p(int)); break;
|
74 |
-
case 8: p(int) = zmq_recv(p(socket), p(msg), p(int)); break;
|
75 |
-
case 9: p(int) = zmq_poll(p(socket), p(int), p(len)); break;
|
76 |
-
}
|
77 |
-
p(command) = errno;
|
78 |
-
write(context->signal_fd, &ok, 1);
|
79 |
-
}
|
80 |
-
cleanup:
|
81 |
-
close(context->signal_fd);
|
82 |
-
free(context_pointer);
|
83 |
-
return 0;
|
84 |
-
}
|
85 |
-
|
86 |
-
void* zmq_thread_init(void* zmq_context, int signal_fd) {
|
87 |
-
acl_zmq_context* context = malloc(sizeof(acl_zmq_context));
|
88 |
-
pthread_t thread;
|
89 |
-
|
90 |
-
context->context = zmq_context;
|
91 |
-
context->signal_fd = signal_fd;
|
92 |
-
sem_init(&context->sem, 1, 0);
|
93 |
-
pthread_create(&thread, 0, &zmq_thread, context);
|
94 |
-
pthread_detach(thread);
|
95 |
-
return context;
|
96 |
-
}
|
97 |
-
</textarea></div>
|
98 |
-
|
99 |
-
<h2>C++ example</h2>
|
100 |
-
|
101 |
-
<div><textarea id="cpp-code">
|
102 |
-
#include <iostream>
|
103 |
-
#include "mystuff/util.h"
|
104 |
-
|
105 |
-
namespace {
|
106 |
-
enum Enum {
|
107 |
-
VAL1, VAL2, VAL3
|
108 |
-
};
|
109 |
-
|
110 |
-
char32_t unicode_string = U"\U0010FFFF";
|
111 |
-
string raw_string = R"delim(anything
|
112 |
-
you
|
113 |
-
want)delim";
|
114 |
-
|
115 |
-
int Helper(const MyType& param) {
|
116 |
-
return 0;
|
117 |
-
}
|
118 |
-
} // namespace
|
119 |
-
|
120 |
-
class ForwardDec;
|
121 |
-
|
122 |
-
template <class T, class V>
|
123 |
-
class Class : public BaseClass {
|
124 |
-
const MyType<T, V> member_;
|
125 |
-
|
126 |
-
public:
|
127 |
-
const MyType<T, V>& Method() const {
|
128 |
-
return member_;
|
129 |
-
}
|
130 |
-
|
131 |
-
void Method2(MyType<T, V>* value);
|
132 |
-
}
|
133 |
-
|
134 |
-
template <class T, class V>
|
135 |
-
void Class::Method2(MyType<T, V>* value) {
|
136 |
-
std::out << 1 >> method();
|
137 |
-
value->Method3(member_);
|
138 |
-
member_ = value;
|
139 |
-
}
|
140 |
-
</textarea></div>
|
141 |
-
|
142 |
-
<h2>Objective-C example</h2>
|
143 |
-
|
144 |
-
<div><textarea id="objectivec-code">
|
145 |
-
/*
|
146 |
-
This is a longer comment
|
147 |
-
That spans two lines
|
148 |
-
*/
|
149 |
-
|
150 |
-
#import <Test/Test.h>
|
151 |
-
@implementation YourAppDelegate
|
152 |
-
|
153 |
-
// This is a one-line comment
|
154 |
-
|
155 |
-
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{
|
156 |
-
char myString[] = "This is a C character array";
|
157 |
-
int test = 5;
|
158 |
-
return YES;
|
159 |
-
}
|
160 |
-
</textarea></div>
|
161 |
-
|
162 |
-
<h2>Java example</h2>
|
163 |
-
|
164 |
-
<div><textarea id="java-code">
|
165 |
-
import com.demo.util.MyType;
|
166 |
-
import com.demo.util.MyInterface;
|
167 |
-
|
168 |
-
public enum Enum {
|
169 |
-
VAL1, VAL2, VAL3
|
170 |
-
}
|
171 |
-
|
172 |
-
public class Class<T, V> implements MyInterface {
|
173 |
-
public static final MyType<T, V> member;
|
174 |
-
|
175 |
-
private class InnerClass {
|
176 |
-
public int zero() {
|
177 |
-
return 0;
|
178 |
-
}
|
179 |
-
}
|
180 |
-
|
181 |
-
@Override
|
182 |
-
public MyType method() {
|
183 |
-
return member;
|
184 |
-
}
|
185 |
-
|
186 |
-
public void method2(MyType<T, V> value) {
|
187 |
-
method();
|
188 |
-
value.method3();
|
189 |
-
member = value;
|
190 |
-
}
|
191 |
-
}
|
192 |
-
</textarea></div>
|
193 |
-
|
194 |
-
<h2>Scala example</h2>
|
195 |
-
|
196 |
-
<div><textarea id="scala-code">
|
197 |
-
object FilterTest extends App {
|
198 |
-
def filter(xs: List[Int], threshold: Int) = {
|
199 |
-
def process(ys: List[Int]): List[Int] =
|
200 |
-
if (ys.isEmpty) ys
|
201 |
-
else if (ys.head < threshold) ys.head :: process(ys.tail)
|
202 |
-
else process(ys.tail)
|
203 |
-
process(xs)
|
204 |
-
}
|
205 |
-
println(filter(List(1, 9, 2, 8, 3, 7, 4), 5))
|
206 |
-
}
|
207 |
-
</textarea></div>
|
208 |
-
|
209 |
-
<h2>Kotlin mode</h2>
|
210 |
-
|
211 |
-
<div><textarea id="kotlin-code">
|
212 |
-
package org.wasabi.http
|
213 |
-
|
214 |
-
import java.util.concurrent.Executors
|
215 |
-
import java.net.InetSocketAddress
|
216 |
-
import org.wasabi.app.AppConfiguration
|
217 |
-
import io.netty.bootstrap.ServerBootstrap
|
218 |
-
import io.netty.channel.nio.NioEventLoopGroup
|
219 |
-
import io.netty.channel.socket.nio.NioServerSocketChannel
|
220 |
-
import org.wasabi.app.AppServer
|
221 |
-
|
222 |
-
public class HttpServer(private val appServer: AppServer) {
|
223 |
-
|
224 |
-
val bootstrap: ServerBootstrap
|
225 |
-
val primaryGroup: NioEventLoopGroup
|
226 |
-
val workerGroup: NioEventLoopGroup
|
227 |
-
|
228 |
-
init {
|
229 |
-
// Define worker groups
|
230 |
-
primaryGroup = NioEventLoopGroup()
|
231 |
-
workerGroup = NioEventLoopGroup()
|
232 |
-
|
233 |
-
// Initialize bootstrap of server
|
234 |
-
bootstrap = ServerBootstrap()
|
235 |
-
|
236 |
-
bootstrap.group(primaryGroup, workerGroup)
|
237 |
-
bootstrap.channel(javaClass<NioServerSocketChannel>())
|
238 |
-
bootstrap.childHandler(NettyPipelineInitializer(appServer))
|
239 |
-
}
|
240 |
-
|
241 |
-
public fun start(wait: Boolean = true) {
|
242 |
-
val channel = bootstrap.bind(appServer.configuration.port)?.sync()?.channel()
|
243 |
-
|
244 |
-
if (wait) {
|
245 |
-
channel?.closeFuture()?.sync()
|
246 |
-
}
|
247 |
-
}
|
248 |
-
|
249 |
-
public fun stop() {
|
250 |
-
// Shutdown all event loops
|
251 |
-
primaryGroup.shutdownGracefully()
|
252 |
-
workerGroup.shutdownGracefully()
|
253 |
-
|
254 |
-
// Wait till all threads are terminated
|
255 |
-
primaryGroup.terminationFuture().sync()
|
256 |
-
workerGroup.terminationFuture().sync()
|
257 |
-
}
|
258 |
-
}
|
259 |
-
</textarea></div>
|
260 |
-
|
261 |
-
<h2>Ceylon mode</h2>
|
262 |
-
|
263 |
-
<div><textarea id="ceylon-code">
|
264 |
-
"Produces the [[stream|Iterable]] that results from repeated
|
265 |
-
application of the given [[function|next]] to the given
|
266 |
-
[[first]] element of the stream, until the function first
|
267 |
-
returns [[finished]]. If the given function never returns
|
268 |
-
`finished`, the resulting stream is infinite.
|
269 |
-
|
270 |
-
For example:
|
271 |
-
|
272 |
-
loop(0)(2.plus).takeWhile(10.largerThan)
|
273 |
-
|
274 |
-
produces the stream `{ 0, 2, 4, 6, 8 }`."
|
275 |
-
tagged("Streams")
|
276 |
-
shared {Element+} loop<Element>(
|
277 |
-
"The first element of the resulting stream."
|
278 |
-
Element first)(
|
279 |
-
"The function that produces the next element of the
|
280 |
-
stream, given the current element. The function may
|
281 |
-
return [[finished]] to indicate the end of the
|
282 |
-
stream."
|
283 |
-
Element|Finished next(Element element))
|
284 |
-
=> let (start = first)
|
285 |
-
object satisfies {Element+} {
|
286 |
-
first => start;
|
287 |
-
empty => false;
|
288 |
-
function nextElement(Element element)
|
289 |
-
=> next(element);
|
290 |
-
iterator()
|
291 |
-
=> object satisfies Iterator<Element> {
|
292 |
-
variable Element|Finished current = start;
|
293 |
-
shared actual Element|Finished next() {
|
294 |
-
if (!is Finished result = current) {
|
295 |
-
current = nextElement(result);
|
296 |
-
return result;
|
297 |
-
}
|
298 |
-
else {
|
299 |
-
return finished;
|
300 |
-
}
|
301 |
-
}
|
302 |
-
};
|
303 |
-
};
|
304 |
-
</textarea></div>
|
305 |
-
|
306 |
-
<script>
|
307 |
-
var cEditor = CodeMirror.fromTextArea(document.getElementById("c-code"), {
|
308 |
-
lineNumbers: true,
|
309 |
-
matchBrackets: true,
|
310 |
-
mode: "text/x-csrc"
|
311 |
-
});
|
312 |
-
var cppEditor = CodeMirror.fromTextArea(document.getElementById("cpp-code"), {
|
313 |
-
lineNumbers: true,
|
314 |
-
matchBrackets: true,
|
315 |
-
mode: "text/x-c++src"
|
316 |
-
});
|
317 |
-
var javaEditor = CodeMirror.fromTextArea(document.getElementById("java-code"), {
|
318 |
-
lineNumbers: true,
|
319 |
-
matchBrackets: true,
|
320 |
-
mode: "text/x-java"
|
321 |
-
});
|
322 |
-
var objectivecEditor = CodeMirror.fromTextArea(document.getElementById("objectivec-code"), {
|
323 |
-
lineNumbers: true,
|
324 |
-
matchBrackets: true,
|
325 |
-
mode: "text/x-objectivec"
|
326 |
-
});
|
327 |
-
var scalaEditor = CodeMirror.fromTextArea(document.getElementById("scala-code"), {
|
328 |
-
lineNumbers: true,
|
329 |
-
matchBrackets: true,
|
330 |
-
mode: "text/x-scala"
|
331 |
-
});
|
332 |
-
var kotlinEditor = CodeMirror.fromTextArea(document.getElementById("kotlin-code"), {
|
333 |
-
lineNumbers: true,
|
334 |
-
matchBrackets: true,
|
335 |
-
mode: "text/x-kotlin"
|
336 |
-
});
|
337 |
-
var ceylonEditor = CodeMirror.fromTextArea(document.getElementById("ceylon-code"), {
|
338 |
-
lineNumbers: true,
|
339 |
-
matchBrackets: true,
|
340 |
-
mode: "text/x-ceylon"
|
341 |
-
});
|
342 |
-
var mac = CodeMirror.keyMap.default == CodeMirror.keyMap.macDefault;
|
343 |
-
CodeMirror.keyMap.default[(mac ? "Cmd" : "Ctrl") + "-Space"] = "autocomplete";
|
344 |
-
</script>
|
345 |
-
|
346 |
-
<p>Simple mode that tries to handle C-like languages as well as it
|
347 |
-
can. Takes two configuration parameters: <code>keywords</code>, an
|
348 |
-
object whose property names are the keywords in the language,
|
349 |
-
and <code>useCPP</code>, which determines whether C preprocessor
|
350 |
-
directives are recognized.</p>
|
351 |
-
|
352 |
-
<p><strong>MIME types defined:</strong> <code>text/x-csrc</code>
|
353 |
-
(C), <code>text/x-c++src</code> (C++), <code>text/x-java</code>
|
354 |
-
(Java), <code>text/x-csharp</code> (C#),
|
355 |
-
<code>text/x-objectivec</code> (Objective-C),
|
356 |
-
<code>text/x-scala</code> (Scala), <code>text/x-vertex</code>
|
357 |
-
<code>x-shader/x-fragment</code> (shader programs),
|
358 |
-
<code>text/x-squirrel</code> (Squirrel) and
|
359 |
-
<code>text/x-ceylon</code> (Ceylon)</p>
|
360 |
-
</article>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/clike/scala.html
DELETED
@@ -1,767 +0,0 @@
|
|
1 |
-
<!doctype html>
|
2 |
-
|
3 |
-
<title>CodeMirror: Scala mode</title>
|
4 |
-
<meta charset="utf-8"/>
|
5 |
-
<link rel=stylesheet href="../../doc/docs.css">
|
6 |
-
|
7 |
-
<link rel="stylesheet" href="../../lib/codemirror.css">
|
8 |
-
<link rel="stylesheet" href="../../theme/ambiance.css">
|
9 |
-
<script src="../../lib/codemirror.js"></script>
|
10 |
-
<script src="../../addon/edit/matchbrackets.js"></script>
|
11 |
-
<script src="clike.js"></script>
|
12 |
-
<div id=nav>
|
13 |
-
<a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
14 |
-
|
15 |
-
<ul>
|
16 |
-
<li><a href="../../index.html">Home</a>
|
17 |
-
<li><a href="../../doc/manual.html">Manual</a>
|
18 |
-
<li><a href="https://github.com/codemirror/codemirror">Code</a>
|
19 |
-
</ul>
|
20 |
-
<ul>
|
21 |
-
<li><a href="../index.html">Language modes</a>
|
22 |
-
<li><a class=active href="#">Scala</a>
|
23 |
-
</ul>
|
24 |
-
</div>
|
25 |
-
|
26 |
-
<article>
|
27 |
-
<h2>Scala mode</h2>
|
28 |
-
<form>
|
29 |
-
<textarea id="code" name="code">
|
30 |
-
|
31 |
-
/* __ *\
|
32 |
-
** ________ ___ / / ___ Scala API **
|
33 |
-
** / __/ __// _ | / / / _ | (c) 2003-2011, LAMP/EPFL **
|
34 |
-
** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
|
35 |
-
** /____/\___/_/ |_/____/_/ | | **
|
36 |
-
** |/ **
|
37 |
-
\* */
|
38 |
-
|
39 |
-
package scala.collection
|
40 |
-
|
41 |
-
import generic._
|
42 |
-
import mutable.{ Builder, ListBuffer }
|
43 |
-
import annotation.{tailrec, migration, bridge}
|
44 |
-
import annotation.unchecked.{ uncheckedVariance => uV }
|
45 |
-
import parallel.ParIterable
|
46 |
-
|
47 |
-
/** A template trait for traversable collections of type `Traversable[A]`.
|
48 |
-
*
|
49 |
-
* $traversableInfo
|
50 |
-
* @define mutability
|
51 |
-
* @define traversableInfo
|
52 |
-
* This is a base trait of all kinds of $mutability Scala collections. It
|
53 |
-
* implements the behavior common to all collections, in terms of a method
|
54 |
-
* `foreach` with signature:
|
55 |
-
* {{{
|
56 |
-
* def foreach[U](f: Elem => U): Unit
|
57 |
-
* }}}
|
58 |
-
* Collection classes mixing in this trait provide a concrete
|
59 |
-
* `foreach` method which traverses all the
|
60 |
-
* elements contained in the collection, applying a given function to each.
|
61 |
-
* They also need to provide a method `newBuilder`
|
62 |
-
* which creates a builder for collections of the same kind.
|
63 |
-
*
|
64 |
-
* A traversable class might or might not have two properties: strictness
|
65 |
-
* and orderedness. Neither is represented as a type.
|
66 |
-
*
|
67 |
-
* The instances of a strict collection class have all their elements
|
68 |
-
* computed before they can be used as values. By contrast, instances of
|
69 |
-
* a non-strict collection class may defer computation of some of their
|
70 |
-
* elements until after the instance is available as a value.
|
71 |
-
* A typical example of a non-strict collection class is a
|
72 |
-
* <a href="../immutable/Stream.html" target="ContentFrame">
|
73 |
-
* `scala.collection.immutable.Stream`</a>.
|
74 |
-
* A more general class of examples are `TraversableViews`.
|
75 |
-
*
|
76 |
-
* If a collection is an instance of an ordered collection class, traversing
|
77 |
-
* its elements with `foreach` will always visit elements in the
|
78 |
-
* same order, even for different runs of the program. If the class is not
|
79 |
-
* ordered, `foreach` can visit elements in different orders for
|
80 |
-
* different runs (but it will keep the same order in the same run).'
|
81 |
-
*
|
82 |
-
* A typical example of a collection class which is not ordered is a
|
83 |
-
* `HashMap` of objects. The traversal order for hash maps will
|
84 |
-
* depend on the hash codes of its elements, and these hash codes might
|
85 |
-
* differ from one run to the next. By contrast, a `LinkedHashMap`
|
86 |
-
* is ordered because it's `foreach` method visits elements in the
|
87 |
-
* order they were inserted into the `HashMap`.
|
88 |
-
*
|
89 |
-
* @author Martin Odersky
|
90 |
-
* @version 2.8
|
91 |
-
* @since 2.8
|
92 |
-
* @tparam A the element type of the collection
|
93 |
-
* @tparam Repr the type of the actual collection containing the elements.
|
94 |
-
*
|
95 |
-
* @define Coll Traversable
|
96 |
-
* @define coll traversable collection
|
97 |
-
*/
|
98 |
-
trait TraversableLike[+A, +Repr] extends HasNewBuilder[A, Repr]
|
99 |
-
with FilterMonadic[A, Repr]
|
100 |
-
with TraversableOnce[A]
|
101 |
-
with GenTraversableLike[A, Repr]
|
102 |
-
with Parallelizable[A, ParIterable[A]]
|
103 |
-
{
|
104 |
-
self =>
|
105 |
-
|
106 |
-
import Traversable.breaks._
|
107 |
-
|
108 |
-
/** The type implementing this traversable */
|
109 |
-
protected type Self = Repr
|
110 |
-
|
111 |
-
/** The collection of type $coll underlying this `TraversableLike` object.
|
112 |
-
* By default this is implemented as the `TraversableLike` object itself,
|
113 |
-
* but this can be overridden.
|
114 |
-
*/
|
115 |
-
def repr: Repr = this.asInstanceOf[Repr]
|
116 |
-
|
117 |
-
/** The underlying collection seen as an instance of `$Coll`.
|
118 |
-
* By default this is implemented as the current collection object itself,
|
119 |
-
* but this can be overridden.
|
120 |
-
*/
|
121 |
-
protected[this] def thisCollection: Traversable[A] = this.asInstanceOf[Traversable[A]]
|
122 |
-
|
123 |
-
/** A conversion from collections of type `Repr` to `$Coll` objects.
|
124 |
-
* By default this is implemented as just a cast, but this can be overridden.
|
125 |
-
*/
|
126 |
-
protected[this] def toCollection(repr: Repr): Traversable[A] = repr.asInstanceOf[Traversable[A]]
|
127 |
-
|
128 |
-
/** Creates a new builder for this collection type.
|
129 |
-
*/
|
130 |
-
protected[this] def newBuilder: Builder[A, Repr]
|
131 |
-
|
132 |
-
protected[this] def parCombiner = ParIterable.newCombiner[A]
|
133 |
-
|
134 |
-
/** Applies a function `f` to all elements of this $coll.
|
135 |
-
*
|
136 |
-
* Note: this method underlies the implementation of most other bulk operations.
|
137 |
-
* It's important to implement this method in an efficient way.
|
138 |
-
*
|
139 |
-
*
|
140 |
-
* @param f the function that is applied for its side-effect to every element.
|
141 |
-
* The result of function `f` is discarded.
|
142 |
-
*
|
143 |
-
* @tparam U the type parameter describing the result of function `f`.
|
144 |
-
* This result will always be ignored. Typically `U` is `Unit`,
|
145 |
-
* but this is not necessary.
|
146 |
-
*
|
147 |
-
* @usecase def foreach(f: A => Unit): Unit
|
148 |
-
*/
|
149 |
-
def foreach[U](f: A => U): Unit
|
150 |
-
|
151 |
-
/** Tests whether this $coll is empty.
|
152 |
-
*
|
153 |
-
* @return `true` if the $coll contain no elements, `false` otherwise.
|
154 |
-
*/
|
155 |
-
def isEmpty: Boolean = {
|
156 |
-
var result = true
|
157 |
-
breakable {
|
158 |
-
for (x <- this) {
|
159 |
-
result = false
|
160 |
-
break
|
161 |
-
}
|
162 |
-
}
|
163 |
-
result
|
164 |
-
}
|
165 |
-
|
166 |
-
/** Tests whether this $coll is known to have a finite size.
|
167 |
-
* All strict collections are known to have finite size. For a non-strict collection
|
168 |
-
* such as `Stream`, the predicate returns `true` if all elements have been computed.
|
169 |
-
* It returns `false` if the stream is not yet evaluated to the end.
|
170 |
-
*
|
171 |
-
* Note: many collection methods will not work on collections of infinite sizes.
|
172 |
-
*
|
173 |
-
* @return `true` if this collection is known to have finite size, `false` otherwise.
|
174 |
-
*/
|
175 |
-
def hasDefiniteSize = true
|
176 |
-
|
177 |
-
def ++[B >: A, That](that: GenTraversableOnce[B])(implicit bf: CanBuildFrom[Repr, B, That]): That = {
|
178 |
-
val b = bf(repr)
|
179 |
-
if (that.isInstanceOf[IndexedSeqLike[_, _]]) b.sizeHint(this, that.seq.size)
|
180 |
-
b ++= thisCollection
|
181 |
-
b ++= that.seq
|
182 |
-
b.result
|
183 |
-
}
|
184 |
-
|
185 |
-
@bridge
|
186 |
-
def ++[B >: A, That](that: TraversableOnce[B])(implicit bf: CanBuildFrom[Repr, B, That]): That =
|
187 |
-
++(that: GenTraversableOnce[B])(bf)
|
188 |
-
|
189 |
-
/** Concatenates this $coll with the elements of a traversable collection.
|
190 |
-
* It differs from ++ in that the right operand determines the type of the
|
191 |
-
* resulting collection rather than the left one.
|
192 |
-
*
|
193 |
-
* @param that the traversable to append.
|
194 |
-
* @tparam B the element type of the returned collection.
|
195 |
-
* @tparam That $thatinfo
|
196 |
-
* @param bf $bfinfo
|
197 |
-
* @return a new collection of type `That` which contains all elements
|
198 |
-
* of this $coll followed by all elements of `that`.
|
199 |
-
*
|
200 |
-
* @usecase def ++:[B](that: TraversableOnce[B]): $Coll[B]
|
201 |
-
*
|
202 |
-
* @return a new $coll which contains all elements of this $coll
|
203 |
-
* followed by all elements of `that`.
|
204 |
-
*/
|
205 |
-
def ++:[B >: A, That](that: TraversableOnce[B])(implicit bf: CanBuildFrom[Repr, B, That]): That = {
|
206 |
-
val b = bf(repr)
|
207 |
-
if (that.isInstanceOf[IndexedSeqLike[_, _]]) b.sizeHint(this, that.size)
|
208 |
-
b ++= that
|
209 |
-
b ++= thisCollection
|
210 |
-
b.result
|
211 |
-
}
|
212 |
-
|
213 |
-
/** This overload exists because: for the implementation of ++: we should reuse
|
214 |
-
* that of ++ because many collections override it with more efficient versions.
|
215 |
-
* Since TraversableOnce has no '++' method, we have to implement that directly,
|
216 |
-
* but Traversable and down can use the overload.
|
217 |
-
*/
|
218 |
-
def ++:[B >: A, That](that: Traversable[B])(implicit bf: CanBuildFrom[Repr, B, That]): That =
|
219 |
-
(that ++ seq)(breakOut)
|
220 |
-
|
221 |
-
def map[B, That](f: A => B)(implicit bf: CanBuildFrom[Repr, B, That]): That = {
|
222 |
-
val b = bf(repr)
|
223 |
-
b.sizeHint(this)
|
224 |
-
for (x <- this) b += f(x)
|
225 |
-
b.result
|
226 |
-
}
|
227 |
-
|
228 |
-
def flatMap[B, That](f: A => GenTraversableOnce[B])(implicit bf: CanBuildFrom[Repr, B, That]): That = {
|
229 |
-
val b = bf(repr)
|
230 |
-
for (x <- this) b ++= f(x).seq
|
231 |
-
b.result
|
232 |
-
}
|
233 |
-
|
234 |
-
/** Selects all elements of this $coll which satisfy a predicate.
|
235 |
-
*
|
236 |
-
* @param p the predicate used to test elements.
|
237 |
-
* @return a new $coll consisting of all elements of this $coll that satisfy the given
|
238 |
-
* predicate `p`. The order of the elements is preserved.
|
239 |
-
*/
|
240 |
-
def filter(p: A => Boolean): Repr = {
|
241 |
-
val b = newBuilder
|
242 |
-
for (x <- this)
|
243 |
-
if (p(x)) b += x
|
244 |
-
b.result
|
245 |
-
}
|
246 |
-
|
247 |
-
/** Selects all elements of this $coll which do not satisfy a predicate.
|
248 |
-
*
|
249 |
-
* @param p the predicate used to test elements.
|
250 |
-
* @return a new $coll consisting of all elements of this $coll that do not satisfy the given
|
251 |
-
* predicate `p`. The order of the elements is preserved.
|
252 |
-
*/
|
253 |
-
def filterNot(p: A => Boolean): Repr = filter(!p(_))
|
254 |
-
|
255 |
-
def collect[B, That](pf: PartialFunction[A, B])(implicit bf: CanBuildFrom[Repr, B, That]): That = {
|
256 |
-
val b = bf(repr)
|
257 |
-
for (x <- this) if (pf.isDefinedAt(x)) b += pf(x)
|
258 |
-
b.result
|
259 |
-
}
|
260 |
-
|
261 |
-
/** Builds a new collection by applying an option-valued function to all
|
262 |
-
* elements of this $coll on which the function is defined.
|
263 |
-
*
|
264 |
-
* @param f the option-valued function which filters and maps the $coll.
|
265 |
-
* @tparam B the element type of the returned collection.
|
266 |
-
* @tparam That $thatinfo
|
267 |
-
* @param bf $bfinfo
|
268 |
-
* @return a new collection of type `That` resulting from applying the option-valued function
|
269 |
-
* `f` to each element and collecting all defined results.
|
270 |
-
* The order of the elements is preserved.
|
271 |
-
*
|
272 |
-
* @usecase def filterMap[B](f: A => Option[B]): $Coll[B]
|
273 |
-
*
|
274 |
-
* @param pf the partial function which filters and maps the $coll.
|
275 |
-
* @return a new $coll resulting from applying the given option-valued function
|
276 |
-
* `f` to each element and collecting all defined results.
|
277 |
-
* The order of the elements is preserved.
|
278 |
-
def filterMap[B, That](f: A => Option[B])(implicit bf: CanBuildFrom[Repr, B, That]): That = {
|
279 |
-
val b = bf(repr)
|
280 |
-
for (x <- this)
|
281 |
-
f(x) match {
|
282 |
-
case Some(y) => b += y
|
283 |
-
case _ =>
|
284 |
-
}
|
285 |
-
b.result
|
286 |
-
}
|
287 |
-
*/
|
288 |
-
|
289 |
-
/** Partitions this $coll in two ${coll}s according to a predicate.
|
290 |
-
*
|
291 |
-
* @param p the predicate on which to partition.
|
292 |
-
* @return a pair of ${coll}s: the first $coll consists of all elements that
|
293 |
-
* satisfy the predicate `p` and the second $coll consists of all elements
|
294 |
-
* that don't. The relative order of the elements in the resulting ${coll}s
|
295 |
-
* is the same as in the original $coll.
|
296 |
-
*/
|
297 |
-
def partition(p: A => Boolean): (Repr, Repr) = {
|
298 |
-
val l, r = newBuilder
|
299 |
-
for (x <- this) (if (p(x)) l else r) += x
|
300 |
-
(l.result, r.result)
|
301 |
-
}
|
302 |
-
|
303 |
-
def groupBy[K](f: A => K): immutable.Map[K, Repr] = {
|
304 |
-
val m = mutable.Map.empty[K, Builder[A, Repr]]
|
305 |
-
for (elem <- this) {
|
306 |
-
val key = f(elem)
|
307 |
-
val bldr = m.getOrElseUpdate(key, newBuilder)
|
308 |
-
bldr += elem
|
309 |
-
}
|
310 |
-
val b = immutable.Map.newBuilder[K, Repr]
|
311 |
-
for ((k, v) <- m)
|
312 |
-
b += ((k, v.result))
|
313 |
-
|
314 |
-
b.result
|
315 |
-
}
|
316 |
-
|
317 |
-
/** Tests whether a predicate holds for all elements of this $coll.
|
318 |
-
*
|
319 |
-
* $mayNotTerminateInf
|
320 |
-
*
|
321 |
-
* @param p the predicate used to test elements.
|
322 |
-
* @return `true` if the given predicate `p` holds for all elements
|
323 |
-
* of this $coll, otherwise `false`.
|
324 |
-
*/
|
325 |
-
def forall(p: A => Boolean): Boolean = {
|
326 |
-
var result = true
|
327 |
-
breakable {
|
328 |
-
for (x <- this)
|
329 |
-
if (!p(x)) { result = false; break }
|
330 |
-
}
|
331 |
-
result
|
332 |
-
}
|
333 |
-
|
334 |
-
/** Tests whether a predicate holds for some of the elements of this $coll.
|
335 |
-
*
|
336 |
-
* $mayNotTerminateInf
|
337 |
-
*
|
338 |
-
* @param p the predicate used to test elements.
|
339 |
-
* @return `true` if the given predicate `p` holds for some of the
|
340 |
-
* elements of this $coll, otherwise `false`.
|
341 |
-
*/
|
342 |
-
def exists(p: A => Boolean): Boolean = {
|
343 |
-
var result = false
|
344 |
-
breakable {
|
345 |
-
for (x <- this)
|
346 |
-
if (p(x)) { result = true; break }
|
347 |
-
}
|
348 |
-
result
|
349 |
-
}
|
350 |
-
|
351 |
-
/** Finds the first element of the $coll satisfying a predicate, if any.
|
352 |
-
*
|
353 |
-
* $mayNotTerminateInf
|
354 |
-
* $orderDependent
|
355 |
-
*
|
356 |
-
* @param p the predicate used to test elements.
|
357 |
-
* @return an option value containing the first element in the $coll
|
358 |
-
* that satisfies `p`, or `None` if none exists.
|
359 |
-
*/
|
360 |
-
def find(p: A => Boolean): Option[A] = {
|
361 |
-
var result: Option[A] = None
|
362 |
-
breakable {
|
363 |
-
for (x <- this)
|
364 |
-
if (p(x)) { result = Some(x); break }
|
365 |
-
}
|
366 |
-
result
|
367 |
-
}
|
368 |
-
|
369 |
-
def scan[B >: A, That](z: B)(op: (B, B) => B)(implicit cbf: CanBuildFrom[Repr, B, That]): That = scanLeft(z)(op)
|
370 |
-
|
371 |
-
def scanLeft[B, That](z: B)(op: (B, A) => B)(implicit bf: CanBuildFrom[Repr, B, That]): That = {
|
372 |
-
val b = bf(repr)
|
373 |
-
b.sizeHint(this, 1)
|
374 |
-
var acc = z
|
375 |
-
b += acc
|
376 |
-
for (x <- this) { acc = op(acc, x); b += acc }
|
377 |
-
b.result
|
378 |
-
}
|
379 |
-
|
380 |
-
@migration(2, 9,
|
381 |
-
"This scanRight definition has changed in 2.9.\n" +
|
382 |
-
"The previous behavior can be reproduced with scanRight.reverse."
|
383 |
-
)
|
384 |
-
def scanRight[B, That](z: B)(op: (A, B) => B)(implicit bf: CanBuildFrom[Repr, B, That]): That = {
|
385 |
-
var scanned = List(z)
|
386 |
-
var acc = z
|
387 |
-
for (x <- reversed) {
|
388 |
-
acc = op(x, acc)
|
389 |
-
scanned ::= acc
|
390 |
-
}
|
391 |
-
val b = bf(repr)
|
392 |
-
for (elem <- scanned) b += elem
|
393 |
-
b.result
|
394 |
-
}
|
395 |
-
|
396 |
-
/** Selects the first element of this $coll.
|
397 |
-
* $orderDependent
|
398 |
-
* @return the first element of this $coll.
|
399 |
-
* @throws `NoSuchElementException` if the $coll is empty.
|
400 |
-
*/
|
401 |
-
def head: A = {
|
402 |
-
var result: () => A = () => throw new NoSuchElementException
|
403 |
-
breakable {
|
404 |
-
for (x <- this) {
|
405 |
-
result = () => x
|
406 |
-
break
|
407 |
-
}
|
408 |
-
}
|
409 |
-
result()
|
410 |
-
}
|
411 |
-
|
412 |
-
/** Optionally selects the first element.
|
413 |
-
* $orderDependent
|
414 |
-
* @return the first element of this $coll if it is nonempty, `None` if it is empty.
|
415 |
-
*/
|
416 |
-
def headOption: Option[A] = if (isEmpty) None else Some(head)
|
417 |
-
|
418 |
-
/** Selects all elements except the first.
|
419 |
-
* $orderDependent
|
420 |
-
* @return a $coll consisting of all elements of this $coll
|
421 |
-
* except the first one.
|
422 |
-
* @throws `UnsupportedOperationException` if the $coll is empty.
|
423 |
-
*/
|
424 |
-
override def tail: Repr = {
|
425 |
-
if (isEmpty) throw new UnsupportedOperationException("empty.tail")
|
426 |
-
drop(1)
|
427 |
-
}
|
428 |
-
|
429 |
-
/** Selects the last element.
|
430 |
-
* $orderDependent
|
431 |
-
* @return The last element of this $coll.
|
432 |
-
* @throws NoSuchElementException If the $coll is empty.
|
433 |
-
*/
|
434 |
-
def last: A = {
|
435 |
-
var lst = head
|
436 |
-
for (x <- this)
|
437 |
-
lst = x
|
438 |
-
lst
|
439 |
-
}
|
440 |
-
|
441 |
-
/** Optionally selects the last element.
|
442 |
-
* $orderDependent
|
443 |
-
* @return the last element of this $coll$ if it is nonempty, `None` if it is empty.
|
444 |
-
*/
|
445 |
-
def lastOption: Option[A] = if (isEmpty) None else Some(last)
|
446 |
-
|
447 |
-
/** Selects all elements except the last.
|
448 |
-
* $orderDependent
|
449 |
-
* @return a $coll consisting of all elements of this $coll
|
450 |
-
* except the last one.
|
451 |
-
* @throws `UnsupportedOperationException` if the $coll is empty.
|
452 |
-
*/
|
453 |
-
def init: Repr = {
|
454 |
-
if (isEmpty) throw new UnsupportedOperationException("empty.init")
|
455 |
-
var lst = head
|
456 |
-
var follow = false
|
457 |
-
val b = newBuilder
|
458 |
-
b.sizeHint(this, -1)
|
459 |
-
for (x <- this.seq) {
|
460 |
-
if (follow) b += lst
|
461 |
-
else follow = true
|
462 |
-
lst = x
|
463 |
-
}
|
464 |
-
b.result
|
465 |
-
}
|
466 |
-
|
467 |
-
def take(n: Int): Repr = slice(0, n)
|
468 |
-
|
469 |
-
def drop(n: Int): Repr =
|
470 |
-
if (n <= 0) {
|
471 |
-
val b = newBuilder
|
472 |
-
b.sizeHint(this)
|
473 |
-
b ++= thisCollection result
|
474 |
-
}
|
475 |
-
else sliceWithKnownDelta(n, Int.MaxValue, -n)
|
476 |
-
|
477 |
-
def slice(from: Int, until: Int): Repr = sliceWithKnownBound(math.max(from, 0), until)
|
478 |
-
|
479 |
-
// Precondition: from >= 0, until > 0, builder already configured for building.
|
480 |
-
private[this] def sliceInternal(from: Int, until: Int, b: Builder[A, Repr]): Repr = {
|
481 |
-
var i = 0
|
482 |
-
breakable {
|
483 |
-
for (x <- this.seq) {
|
484 |
-
if (i >= from) b += x
|
485 |
-
i += 1
|
486 |
-
if (i >= until) break
|
487 |
-
}
|
488 |
-
}
|
489 |
-
b.result
|
490 |
-
}
|
491 |
-
// Precondition: from >= 0
|
492 |
-
private[scala] def sliceWithKnownDelta(from: Int, until: Int, delta: Int): Repr = {
|
493 |
-
val b = newBuilder
|
494 |
-
if (until <= from) b.result
|
495 |
-
else {
|
496 |
-
b.sizeHint(this, delta)
|
497 |
-
sliceInternal(from, until, b)
|
498 |
-
}
|
499 |
-
}
|
500 |
-
// Precondition: from >= 0
|
501 |
-
private[scala] def sliceWithKnownBound(from: Int, until: Int): Repr = {
|
502 |
-
val b = newBuilder
|
503 |
-
if (until <= from) b.result
|
504 |
-
else {
|
505 |
-
b.sizeHintBounded(until - from, this)
|
506 |
-
sliceInternal(from, until, b)
|
507 |
-
}
|
508 |
-
}
|
509 |
-
|
510 |
-
def takeWhile(p: A => Boolean): Repr = {
|
511 |
-
val b = newBuilder
|
512 |
-
breakable {
|
513 |
-
for (x <- this) {
|
514 |
-
if (!p(x)) break
|
515 |
-
b += x
|
516 |
-
}
|
517 |
-
}
|
518 |
-
b.result
|
519 |
-
}
|
520 |
-
|
521 |
-
def dropWhile(p: A => Boolean): Repr = {
|
522 |
-
val b = newBuilder
|
523 |
-
var go = false
|
524 |
-
for (x <- this) {
|
525 |
-
if (!p(x)) go = true
|
526 |
-
if (go) b += x
|
527 |
-
}
|
528 |
-
b.result
|
529 |
-
}
|
530 |
-
|
531 |
-
def span(p: A => Boolean): (Repr, Repr) = {
|
532 |
-
val l, r = newBuilder
|
533 |
-
var toLeft = true
|
534 |
-
for (x <- this) {
|
535 |
-
toLeft = toLeft && p(x)
|
536 |
-
(if (toLeft) l else r) += x
|
537 |
-
}
|
538 |
-
(l.result, r.result)
|
539 |
-
}
|
540 |
-
|
541 |
-
def splitAt(n: Int): (Repr, Repr) = {
|
542 |
-
val l, r = newBuilder
|
543 |
-
l.sizeHintBounded(n, this)
|
544 |
-
if (n >= 0) r.sizeHint(this, -n)
|
545 |
-
var i = 0
|
546 |
-
for (x <- this) {
|
547 |
-
(if (i < n) l else r) += x
|
548 |
-
i += 1
|
549 |
-
}
|
550 |
-
(l.result, r.result)
|
551 |
-
}
|
552 |
-
|
553 |
-
/** Iterates over the tails of this $coll. The first value will be this
|
554 |
-
* $coll and the final one will be an empty $coll, with the intervening
|
555 |
-
* values the results of successive applications of `tail`.
|
556 |
-
*
|
557 |
-
* @return an iterator over all the tails of this $coll
|
558 |
-
* @example `List(1,2,3).tails = Iterator(List(1,2,3), List(2,3), List(3), Nil)`
|
559 |
-
*/
|
560 |
-
def tails: Iterator[Repr] = iterateUntilEmpty(_.tail)
|
561 |
-
|
562 |
-
/** Iterates over the inits of this $coll. The first value will be this
|
563 |
-
* $coll and the final one will be an empty $coll, with the intervening
|
564 |
-
* values the results of successive applications of `init`.
|
565 |
-
*
|
566 |
-
* @return an iterator over all the inits of this $coll
|
567 |
-
* @example `List(1,2,3).inits = Iterator(List(1,2,3), List(1,2), List(1), Nil)`
|
568 |
-
*/
|
569 |
-
def inits: Iterator[Repr] = iterateUntilEmpty(_.init)
|
570 |
-
|
571 |
-
/** Copies elements of this $coll to an array.
|
572 |
-
* Fills the given array `xs` with at most `len` elements of
|
573 |
-
* this $coll, starting at position `start`.
|
574 |
-
* Copying will stop once either the end of the current $coll is reached,
|
575 |
-
* or the end of the array is reached, or `len` elements have been copied.
|
576 |
-
*
|
577 |
-
* $willNotTerminateInf
|
578 |
-
*
|
579 |
-
* @param xs the array to fill.
|
580 |
-
* @param start the starting index.
|
581 |
-
* @param len the maximal number of elements to copy.
|
582 |
-
* @tparam B the type of the elements of the array.
|
583 |
-
*
|
584 |
-
*
|
585 |
-
* @usecase def copyToArray(xs: Array[A], start: Int, len: Int): Unit
|
586 |
-
*/
|
587 |
-
def copyToArray[B >: A](xs: Array[B], start: Int, len: Int) {
|
588 |
-
var i = start
|
589 |
-
val end = (start + len) min xs.length
|
590 |
-
breakable {
|
591 |
-
for (x <- this) {
|
592 |
-
if (i >= end) break
|
593 |
-
xs(i) = x
|
594 |
-
i += 1
|
595 |
-
}
|
596 |
-
}
|
597 |
-
}
|
598 |
-
|
599 |
-
def toTraversable: Traversable[A] = thisCollection
|
600 |
-
def toIterator: Iterator[A] = toStream.iterator
|
601 |
-
def toStream: Stream[A] = toBuffer.toStream
|
602 |
-
|
603 |
-
/** Converts this $coll to a string.
|
604 |
-
*
|
605 |
-
* @return a string representation of this collection. By default this
|
606 |
-
* string consists of the `stringPrefix` of this $coll,
|
607 |
-
* followed by all elements separated by commas and enclosed in parentheses.
|
608 |
-
*/
|
609 |
-
override def toString = mkString(stringPrefix + "(", ", ", ")")
|
610 |
-
|
611 |
-
/** Defines the prefix of this object's `toString` representation.
|
612 |
-
*
|
613 |
-
* @return a string representation which starts the result of `toString`
|
614 |
-
* applied to this $coll. By default the string prefix is the
|
615 |
-
* simple name of the collection class $coll.
|
616 |
-
*/
|
617 |
-
def stringPrefix : String = {
|
618 |
-
var string = repr.asInstanceOf[AnyRef].getClass.getName
|
619 |
-
val idx1 = string.lastIndexOf('.' : Int)
|
620 |
-
if (idx1 != -1) string = string.substring(idx1 + 1)
|
621 |
-
val idx2 = string.indexOf('$')
|
622 |
-
if (idx2 != -1) string = string.substring(0, idx2)
|
623 |
-
string
|
624 |
-
}
|
625 |
-
|
626 |
-
/** Creates a non-strict view of this $coll.
|
627 |
-
*
|
628 |
-
* @return a non-strict view of this $coll.
|
629 |
-
*/
|
630 |
-
def view = new TraversableView[A, Repr] {
|
631 |
-
protected lazy val underlying = self.repr
|
632 |
-
override def foreach[U](f: A => U) = self foreach f
|
633 |
-
}
|
634 |
-
|
635 |
-
/** Creates a non-strict view of a slice of this $coll.
|
636 |
-
*
|
637 |
-
* Note: the difference between `view` and `slice` is that `view` produces
|
638 |
-
* a view of the current $coll, whereas `slice` produces a new $coll.
|
639 |
-
*
|
640 |
-
* Note: `view(from, to)` is equivalent to `view.slice(from, to)`
|
641 |
-
* $orderDependent
|
642 |
-
*
|
643 |
-
* @param from the index of the first element of the view
|
644 |
-
* @param until the index of the element following the view
|
645 |
-
* @return a non-strict view of a slice of this $coll, starting at index `from`
|
646 |
-
* and extending up to (but not including) index `until`.
|
647 |
-
*/
|
648 |
-
def view(from: Int, until: Int): TraversableView[A, Repr] = view.slice(from, until)
|
649 |
-
|
650 |
-
/** Creates a non-strict filter of this $coll.
|
651 |
-
*
|
652 |
-
* Note: the difference between `c filter p` and `c withFilter p` is that
|
653 |
-
* the former creates a new collection, whereas the latter only
|
654 |
-
* restricts the domain of subsequent `map`, `flatMap`, `foreach`,
|
655 |
-
* and `withFilter` operations.
|
656 |
-
* $orderDependent
|
657 |
-
*
|
658 |
-
* @param p the predicate used to test elements.
|
659 |
-
* @return an object of class `WithFilter`, which supports
|
660 |
-
* `map`, `flatMap`, `foreach`, and `withFilter` operations.
|
661 |
-
* All these operations apply to those elements of this $coll which
|
662 |
-
* satisfy the predicate `p`.
|
663 |
-
*/
|
664 |
-
def withFilter(p: A => Boolean): FilterMonadic[A, Repr] = new WithFilter(p)
|
665 |
-
|
666 |
-
/** A class supporting filtered operations. Instances of this class are
|
667 |
-
* returned by method `withFilter`.
|
668 |
-
*/
|
669 |
-
class WithFilter(p: A => Boolean) extends FilterMonadic[A, Repr] {
|
670 |
-
|
671 |
-
/** Builds a new collection by applying a function to all elements of the
|
672 |
-
* outer $coll containing this `WithFilter` instance that satisfy predicate `p`.
|
673 |
-
*
|
674 |
-
* @param f the function to apply to each element.
|
675 |
-
* @tparam B the element type of the returned collection.
|
676 |
-
* @tparam That $thatinfo
|
677 |
-
* @param bf $bfinfo
|
678 |
-
* @return a new collection of type `That` resulting from applying
|
679 |
-
* the given function `f` to each element of the outer $coll
|
680 |
-
* that satisfies predicate `p` and collecting the results.
|
681 |
-
*
|
682 |
-
* @usecase def map[B](f: A => B): $Coll[B]
|
683 |
-
*
|
684 |
-
* @return a new $coll resulting from applying the given function
|
685 |
-
* `f` to each element of the outer $coll that satisfies
|
686 |
-
* predicate `p` and collecting the results.
|
687 |
-
*/
|
688 |
-
def map[B, That](f: A => B)(implicit bf: CanBuildFrom[Repr, B, That]): That = {
|
689 |
-
val b = bf(repr)
|
690 |
-
for (x <- self)
|
691 |
-
if (p(x)) b += f(x)
|
692 |
-
b.result
|
693 |
-
}
|
694 |
-
|
695 |
-
/** Builds a new collection by applying a function to all elements of the
|
696 |
-
* outer $coll containing this `WithFilter` instance that satisfy
|
697 |
-
* predicate `p` and concatenating the results.
|
698 |
-
*
|
699 |
-
* @param f the function to apply to each element.
|
700 |
-
* @tparam B the element type of the returned collection.
|
701 |
-
* @tparam That $thatinfo
|
702 |
-
* @param bf $bfinfo
|
703 |
-
* @return a new collection of type `That` resulting from applying
|
704 |
-
* the given collection-valued function `f` to each element
|
705 |
-
* of the outer $coll that satisfies predicate `p` and
|
706 |
-
* concatenating the results.
|
707 |
-
*
|
708 |
-
* @usecase def flatMap[B](f: A => TraversableOnce[B]): $Coll[B]
|
709 |
-
*
|
710 |
-
* @return a new $coll resulting from applying the given collection-valued function
|
711 |
-
* `f` to each element of the outer $coll that satisfies predicate `p` and concatenating the results.
|
712 |
-
*/
|
713 |
-
def flatMap[B, That](f: A => GenTraversableOnce[B])(implicit bf: CanBuildFrom[Repr, B, That]): That = {
|
714 |
-
val b = bf(repr)
|
715 |
-
for (x <- self)
|
716 |
-
if (p(x)) b ++= f(x).seq
|
717 |
-
b.result
|
718 |
-
}
|
719 |
-
|
720 |
-
/** Applies a function `f` to all elements of the outer $coll containing
|
721 |
-
* this `WithFilter` instance that satisfy predicate `p`.
|
722 |
-
*
|
723 |
-
* @param f the function that is applied for its side-effect to every element.
|
724 |
-
* The result of function `f` is discarded.
|
725 |
-
*
|
726 |
-
* @tparam U the type parameter describing the result of function `f`.
|
727 |
-
* This result will always be ignored. Typically `U` is `Unit`,
|
728 |
-
* but this is not necessary.
|
729 |
-
*
|
730 |
-
* @usecase def foreach(f: A => Unit): Unit
|
731 |
-
*/
|
732 |
-
def foreach[U](f: A => U): Unit =
|
733 |
-
for (x <- self)
|
734 |
-
if (p(x)) f(x)
|
735 |
-
|
736 |
-
/** Further refines the filter for this $coll.
|
737 |
-
*
|
738 |
-
* @param q the predicate used to test elements.
|
739 |
-
* @return an object of class `WithFilter`, which supports
|
740 |
-
* `map`, `flatMap`, `foreach`, and `withFilter` operations.
|
741 |
-
* All these operations apply to those elements of this $coll which
|
742 |
-
* satisfy the predicate `q` in addition to the predicate `p`.
|
743 |
-
*/
|
744 |
-
def withFilter(q: A => Boolean): WithFilter =
|
745 |
-
new WithFilter(x => p(x) && q(x))
|
746 |
-
}
|
747 |
-
|
748 |
-
// A helper for tails and inits.
|
749 |
-
private def iterateUntilEmpty(f: Traversable[A @uV] => Traversable[A @uV]): Iterator[Repr] = {
|
750 |
-
val it = Iterator.iterate(thisCollection)(f) takeWhile (x => !x.isEmpty)
|
751 |
-
it ++ Iterator(Nil) map (newBuilder ++= _ result)
|
752 |
-
}
|
753 |
-
}
|
754 |
-
|
755 |
-
|
756 |
-
</textarea>
|
757 |
-
</form>
|
758 |
-
|
759 |
-
<script>
|
760 |
-
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
|
761 |
-
lineNumbers: true,
|
762 |
-
matchBrackets: true,
|
763 |
-
theme: "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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/clike/test.js
DELETED
@@ -1,42 +0,0 @@
|
|
1 |
-
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
2 |
-
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
3 |
-
|
4 |
-
(function() {
|
5 |
-
var mode = CodeMirror.getMode({indentUnit: 2}, "text/x-c");
|
6 |
-
function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); }
|
7 |
-
|
8 |
-
MT("indent",
|
9 |
-
"[variable-3 void] [def foo]([variable-3 void*] [variable a], [variable-3 int] [variable b]) {",
|
10 |
-
" [variable-3 int] [variable c] [operator =] [variable b] [operator +]",
|
11 |
-
" [number 1];",
|
12 |
-
" [keyword return] [operator *][variable a];",
|
13 |
-
"}");
|
14 |
-
|
15 |
-
MT("indent_switch",
|
16 |
-
"[keyword switch] ([variable x]) {",
|
17 |
-
" [keyword case] [number 10]:",
|
18 |
-
" [keyword return] [number 20];",
|
19 |
-
" [keyword default]:",
|
20 |
-
" [variable printf]([string \"foo %c\"], [variable x]);",
|
21 |
-
"}");
|
22 |
-
|
23 |
-
MT("def",
|
24 |
-
"[variable-3 void] [def foo]() {}",
|
25 |
-
"[keyword struct] [def bar]{}",
|
26 |
-
"[variable-3 int] [variable-3 *][def baz]() {}");
|
27 |
-
|
28 |
-
MT("double_block",
|
29 |
-
"[keyword for] (;;)",
|
30 |
-
" [keyword for] (;;)",
|
31 |
-
" [variable x][operator ++];",
|
32 |
-
"[keyword return];");
|
33 |
-
|
34 |
-
var mode_cpp = CodeMirror.getMode({indentUnit: 2}, "text/x-c++src");
|
35 |
-
function MTCPP(name) { test.mode(name, mode_cpp, Array.prototype.slice.call(arguments, 1)); }
|
36 |
-
|
37 |
-
MTCPP("cpp14_literal",
|
38 |
-
"[number 10'000];",
|
39 |
-
"[number 0b10'000];",
|
40 |
-
"[number 0x10'000];",
|
41 |
-
"[string '100000'];");
|
42 |
-
})();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/clojure/clojure.js
DELETED
@@ -1,244 +0,0 @@
|
|
1 |
-
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
2 |
-
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
3 |
-
|
4 |
-
/**
|
5 |
-
* Author: Hans Engel
|
6 |
-
* Branched from CodeMirror's Scheme mode (by Koh Zi Han, based on implementation by Koh Zi Chun)
|
7 |
-
*/
|
8 |
-
|
9 |
-
(function(mod) {
|
10 |
-
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
11 |
-
mod(require("../../lib/codemirror"));
|
12 |
-
else if (typeof define == "function" && define.amd) // AMD
|
13 |
-
define(["../../lib/codemirror"], mod);
|
14 |
-
else // Plain browser env
|
15 |
-
mod(CodeMirror);
|
16 |
-
})(function(CodeMirror) {
|
17 |
-
"use strict";
|
18 |
-
|
19 |
-
CodeMirror.defineMode("clojure", function (options) {
|
20 |
-
var BUILTIN = "builtin", COMMENT = "comment", STRING = "string", CHARACTER = "string-2",
|
21 |
-
ATOM = "atom", NUMBER = "number", BRACKET = "bracket", KEYWORD = "keyword", VAR = "variable";
|
22 |
-
var INDENT_WORD_SKIP = options.indentUnit || 2;
|
23 |
-
var NORMAL_INDENT_UNIT = options.indentUnit || 2;
|
24 |
-
|
25 |
-
function makeKeywords(str) {
|
26 |
-
var obj = {}, words = str.split(" ");
|
27 |
-
for (var i = 0; i < words.length; ++i) obj[words[i]] = true;
|
28 |
-
return obj;
|
29 |
-
}
|
30 |
-
|
31 |
-
var atoms = makeKeywords("true false nil");
|
32 |
-
|
33 |
-
var keywords = makeKeywords(
|
34 |
-
"defn defn- def def- defonce defmulti defmethod defmacro defstruct deftype defprotocol defrecord defproject deftest slice defalias defhinted defmacro- defn-memo defnk defnk defonce- defunbound defunbound- defvar defvar- let letfn do case cond condp for loop recur when when-not when-let when-first if if-let if-not . .. -> ->> doto and or dosync doseq dotimes dorun doall load import unimport ns in-ns refer try catch finally throw with-open with-local-vars binding gen-class gen-and-load-class gen-and-save-class handler-case handle");
|
35 |
-
|
36 |
-
var builtins = makeKeywords(
|
37 |
-
"* *' *1 *2 *3 *agent* *allow-unresolved-vars* *assert* *clojure-version* *command-line-args* *compile-files* *compile-path* *compiler-options* *data-readers* *e *err* *file* *flush-on-newline* *fn-loader* *in* *math-context* *ns* *out* *print-dup* *print-length* *print-level* *print-meta* *print-readably* *read-eval* *source-path* *unchecked-math* *use-context-classloader* *verbose-defrecords* *warn-on-reflection* + +' - -' -> ->> ->ArrayChunk ->Vec ->VecNode ->VecSeq -cache-protocol-fn -reset-methods .. / < <= = == > >= EMPTY-NODE accessor aclone add-classpath add-watch agent agent-error agent-errors aget alength alias all-ns alter alter-meta! alter-var-root amap ancestors and apply areduce array-map aset aset-boolean aset-byte aset-char aset-double aset-float aset-int aset-long aset-short assert assoc assoc! assoc-in associative? atom await await-for await1 bases bean bigdec bigint biginteger binding bit-and bit-and-not bit-clear bit-flip bit-not bit-or bit-set bit-shift-left bit-shift-right bit-test bit-xor boolean boolean-array booleans bound-fn bound-fn* bound? butlast byte byte-array bytes case cast char char-array char-escape-string char-name-string char? chars chunk chunk-append chunk-buffer chunk-cons chunk-first chunk-next chunk-rest chunked-seq? class class? clear-agent-errors clojure-version coll? comment commute comp comparator compare compare-and-set! compile complement concat cond condp conj conj! cons constantly construct-proxy contains? count counted? create-ns create-struct cycle dec dec' decimal? declare default-data-readers definline definterface defmacro defmethod defmulti defn defn- defonce defprotocol defrecord defstruct deftype delay delay? deliver denominator deref derive descendants destructure disj disj! dissoc dissoc! distinct distinct? doall dorun doseq dosync dotimes doto double double-array doubles drop drop-last drop-while empty empty? ensure enumeration-seq error-handler error-mode eval even? every-pred every? ex-data ex-info extend extend-protocol extend-type extenders extends? false? ffirst file-seq filter filterv find find-keyword find-ns find-protocol-impl find-protocol-method find-var first flatten float float-array float? floats flush fn fn? fnext fnil for force format frequencies future future-call future-cancel future-cancelled? future-done? future? gen-class gen-interface gensym get get-in get-method get-proxy-class get-thread-bindings get-validator group-by hash hash-combine hash-map hash-set identical? identity if-let if-not ifn? import in-ns inc inc' init-proxy instance? int int-array integer? interleave intern interpose into into-array ints io! isa? iterate iterator-seq juxt keep keep-indexed key keys keyword keyword? last lazy-cat lazy-seq let letfn line-seq list list* list? load load-file load-reader load-string loaded-libs locking long long-array longs loop macroexpand macroexpand-1 make-array make-hierarchy map map-indexed map? mapcat mapv max max-key memfn memoize merge merge-with meta method-sig methods min min-key mod munge name namespace namespace-munge neg? newline next nfirst nil? nnext not not-any? not-empty not-every? not= ns ns-aliases ns-imports ns-interns ns-map ns-name ns-publics ns-refers ns-resolve ns-unalias ns-unmap nth nthnext nthrest num number? numerator object-array odd? or parents partial partition partition-all partition-by pcalls peek persistent! pmap pop pop! pop-thread-bindings pos? pr pr-str prefer-method prefers primitives-classnames print print-ctor print-dup print-method print-simple print-str printf println println-str prn prn-str promise proxy proxy-call-with-super proxy-mappings proxy-name proxy-super push-thread-bindings pvalues quot rand rand-int rand-nth range ratio? rational? rationalize re-find re-groups re-matcher re-matches re-pattern re-seq read read-line read-string realized? reduce reduce-kv reductions ref ref-history-count ref-max-history ref-min-history ref-set refer refer-clojure reify release-pending-sends rem remove remove-all-methods remove-method remove-ns remove-watch repeat repeatedly replace replicate require reset! reset-meta! resolve rest restart-agent resultset-seq reverse reversible? rseq rsubseq satisfies? second select-keys send send-off seq seq? seque sequence sequential? set set-error-handler! set-error-mode! set-validator! set? short short-array shorts shuffle shutdown-agents slurp some some-fn sort sort-by sorted-map sorted-map-by sorted-set sorted-set-by sorted? special-symbol? spit split-at split-with str string? struct struct-map subs subseq subvec supers swap! symbol symbol? sync take take-last take-nth take-while test the-ns thread-bound? time to-array to-array-2d trampoline transient tree-seq true? type unchecked-add unchecked-add-int unchecked-byte unchecked-char unchecked-dec unchecked-dec-int unchecked-divide-int unchecked-double unchecked-float unchecked-inc unchecked-inc-int unchecked-int unchecked-long unchecked-multiply unchecked-multiply-int unchecked-negate unchecked-negate-int unchecked-remainder-int unchecked-short unchecked-subtract unchecked-subtract-int underive unquote unquote-splicing update-in update-proxy use val vals var-get var-set var? vary-meta vec vector vector-of vector? when when-first when-let when-not while with-bindings with-bindings* with-in-str with-loading-context with-local-vars with-meta with-open with-out-str with-precision with-redefs with-redefs-fn xml-seq zero? zipmap *default-data-reader-fn* as-> cond-> cond->> reduced reduced? send-via set-agent-send-executor! set-agent-send-off-executor! some-> some->>");
|
38 |
-
|
39 |
-
var indentKeys = makeKeywords(
|
40 |
-
// Built-ins
|
41 |
-
"ns fn def defn defmethod bound-fn if if-not case condp when while when-not when-first do future comment doto locking proxy with-open with-precision reify deftype defrecord defprotocol extend extend-protocol extend-type try catch " +
|
42 |
-
|
43 |
-
// Binding forms
|
44 |
-
"let letfn binding loop for doseq dotimes when-let if-let " +
|
45 |
-
|
46 |
-
// Data structures
|
47 |
-
"defstruct struct-map assoc " +
|
48 |
-
|
49 |
-
// clojure.test
|
50 |
-
"testing deftest " +
|
51 |
-
|
52 |
-
// contrib
|
53 |
-
"handler-case handle dotrace deftrace");
|
54 |
-
|
55 |
-
var tests = {
|
56 |
-
digit: /\d/,
|
57 |
-
digit_or_colon: /[\d:]/,
|
58 |
-
hex: /[0-9a-f]/i,
|
59 |
-
sign: /[+-]/,
|
60 |
-
exponent: /e/i,
|
61 |
-
keyword_char: /[^\s\(\[\;\)\]]/,
|
62 |
-
symbol: /[\w*+!\-\._?:<>\/\xa1-\uffff]/
|
63 |
-
};
|
64 |
-
|
65 |
-
function stateStack(indent, type, prev) { // represents a state stack object
|
66 |
-
this.indent = indent;
|
67 |
-
this.type = type;
|
68 |
-
this.prev = prev;
|
69 |
-
}
|
70 |
-
|
71 |
-
function pushStack(state, indent, type) {
|
72 |
-
state.indentStack = new stateStack(indent, type, state.indentStack);
|
73 |
-
}
|
74 |
-
|
75 |
-
function popStack(state) {
|
76 |
-
state.indentStack = state.indentStack.prev;
|
77 |
-
}
|
78 |
-
|
79 |
-
function isNumber(ch, stream){
|
80 |
-
// hex
|
81 |
-
if ( ch === '0' && stream.eat(/x/i) ) {
|
82 |
-
stream.eatWhile(tests.hex);
|
83 |
-
return true;
|
84 |
-
}
|
85 |
-
|
86 |
-
// leading sign
|
87 |
-
if ( ( ch == '+' || ch == '-' ) && ( tests.digit.test(stream.peek()) ) ) {
|
88 |
-
stream.eat(tests.sign);
|
89 |
-
ch = stream.next();
|
90 |
-
}
|
91 |
-
|
92 |
-
if ( tests.digit.test(ch) ) {
|
93 |
-
stream.eat(ch);
|
94 |
-
stream.eatWhile(tests.digit);
|
95 |
-
|
96 |
-
if ( '.' == stream.peek() ) {
|
97 |
-
stream.eat('.');
|
98 |
-
stream.eatWhile(tests.digit);
|
99 |
-
}
|
100 |
-
|
101 |
-
if ( stream.eat(tests.exponent) ) {
|
102 |
-
stream.eat(tests.sign);
|
103 |
-
stream.eatWhile(tests.digit);
|
104 |
-
}
|
105 |
-
|
106 |
-
return true;
|
107 |
-
}
|
108 |
-
|
109 |
-
return false;
|
110 |
-
}
|
111 |
-
|
112 |
-
// Eat character that starts after backslash \
|
113 |
-
function eatCharacter(stream) {
|
114 |
-
var first = stream.next();
|
115 |
-
// Read special literals: backspace, newline, space, return.
|
116 |
-
// Just read all lowercase letters.
|
117 |
-
if (first && first.match(/[a-z]/) && stream.match(/[a-z]+/, true)) {
|
118 |
-
return;
|
119 |
-
}
|
120 |
-
// Read unicode character: \u1000 \uA0a1
|
121 |
-
if (first === "u") {
|
122 |
-
stream.match(/[0-9a-z]{4}/i, true);
|
123 |
-
}
|
124 |
-
}
|
125 |
-
|
126 |
-
return {
|
127 |
-
startState: function () {
|
128 |
-
return {
|
129 |
-
indentStack: null,
|
130 |
-
indentation: 0,
|
131 |
-
mode: false
|
132 |
-
};
|
133 |
-
},
|
134 |
-
|
135 |
-
token: function (stream, state) {
|
136 |
-
if (state.indentStack == null && stream.sol()) {
|
137 |
-
// update indentation, but only if indentStack is empty
|
138 |
-
state.indentation = stream.indentation();
|
139 |
-
}
|
140 |
-
|
141 |
-
// skip spaces
|
142 |
-
if (stream.eatSpace()) {
|
143 |
-
return null;
|
144 |
-
}
|
145 |
-
var returnType = null;
|
146 |
-
|
147 |
-
switch(state.mode){
|
148 |
-
case "string": // multi-line string parsing mode
|
149 |
-
var next, escaped = false;
|
150 |
-
while ((next = stream.next()) != null) {
|
151 |
-
if (next == "\"" && !escaped) {
|
152 |
-
|
153 |
-
state.mode = false;
|
154 |
-
break;
|
155 |
-
}
|
156 |
-
escaped = !escaped && next == "\\";
|
157 |
-
}
|
158 |
-
returnType = STRING; // continue on in string mode
|
159 |
-
break;
|
160 |
-
default: // default parsing mode
|
161 |
-
var ch = stream.next();
|
162 |
-
|
163 |
-
if (ch == "\"") {
|
164 |
-
state.mode = "string";
|
165 |
-
returnType = STRING;
|
166 |
-
} else if (ch == "\\") {
|
167 |
-
eatCharacter(stream);
|
168 |
-
returnType = CHARACTER;
|
169 |
-
} else if (ch == "'" && !( tests.digit_or_colon.test(stream.peek()) )) {
|
170 |
-
returnType = ATOM;
|
171 |
-
} else if (ch == ";") { // comment
|
172 |
-
stream.skipToEnd(); // rest of the line is a comment
|
173 |
-
returnType = COMMENT;
|
174 |
-
} else if (isNumber(ch,stream)){
|
175 |
-
returnType = NUMBER;
|
176 |
-
} else if (ch == "(" || ch == "[" || ch == "{" ) {
|
177 |
-
var keyWord = '', indentTemp = stream.column(), letter;
|
178 |
-
/**
|
179 |
-
Either
|
180 |
-
(indent-word ..
|
181 |
-
(non-indent-word ..
|
182 |
-
(;something else, bracket, etc.
|
183 |
-
*/
|
184 |
-
|
185 |
-
if (ch == "(") while ((letter = stream.eat(tests.keyword_char)) != null) {
|
186 |
-
keyWord += letter;
|
187 |
-
}
|
188 |
-
|
189 |
-
if (keyWord.length > 0 && (indentKeys.propertyIsEnumerable(keyWord) ||
|
190 |
-
/^(?:def|with)/.test(keyWord))) { // indent-word
|
191 |
-
pushStack(state, indentTemp + INDENT_WORD_SKIP, ch);
|
192 |
-
} else { // non-indent word
|
193 |
-
// we continue eating the spaces
|
194 |
-
stream.eatSpace();
|
195 |
-
if (stream.eol() || stream.peek() == ";") {
|
196 |
-
// nothing significant after
|
197 |
-
// we restart indentation the user defined spaces after
|
198 |
-
pushStack(state, indentTemp + NORMAL_INDENT_UNIT, ch);
|
199 |
-
} else {
|
200 |
-
pushStack(state, indentTemp + stream.current().length, ch); // else we match
|
201 |
-
}
|
202 |
-
}
|
203 |
-
stream.backUp(stream.current().length - 1); // undo all the eating
|
204 |
-
|
205 |
-
returnType = BRACKET;
|
206 |
-
} else if (ch == ")" || ch == "]" || ch == "}") {
|
207 |
-
returnType = BRACKET;
|
208 |
-
if (state.indentStack != null && state.indentStack.type == (ch == ")" ? "(" : (ch == "]" ? "[" :"{"))) {
|
209 |
-
popStack(state);
|
210 |
-
}
|
211 |
-
} else if ( ch == ":" ) {
|
212 |
-
stream.eatWhile(tests.symbol);
|
213 |
-
return ATOM;
|
214 |
-
} else {
|
215 |
-
stream.eatWhile(tests.symbol);
|
216 |
-
|
217 |
-
if (keywords && keywords.propertyIsEnumerable(stream.current())) {
|
218 |
-
returnType = KEYWORD;
|
219 |
-
} else if (builtins && builtins.propertyIsEnumerable(stream.current())) {
|
220 |
-
returnType = BUILTIN;
|
221 |
-
} else if (atoms && atoms.propertyIsEnumerable(stream.current())) {
|
222 |
-
returnType = ATOM;
|
223 |
-
} else {
|
224 |
-
returnType = VAR;
|
225 |
-
}
|
226 |
-
}
|
227 |
-
}
|
228 |
-
|
229 |
-
return returnType;
|
230 |
-
},
|
231 |
-
|
232 |
-
indent: function (state) {
|
233 |
-
if (state.indentStack == null) return state.ind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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/clojure/index.html
DELETED
@@ -1,88 +0,0 @@
|
|
1 |
-
<!doctype html>
|
2 |
-
|
3 |
-
<title>CodeMirror: Clojure mode</title>
|
4 |
-
<meta charset="utf-8"/>
|
5 |
-
<link rel=stylesheet href="../../doc/docs.css">
|
6 |
-
|
7 |
-
<link rel="stylesheet" href="../../lib/codemirror.css">
|
8 |
-
<script src="../../lib/codemirror.js"></script>
|
9 |
-
<script src="clojure.js"></script>
|
10 |
-
<style>.CodeMirror {background: #f8f8f8;}</style>
|
11 |
-
<div id=nav>
|
12 |
-
<a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
13 |
-
|
14 |
-
<ul>
|
15 |
-
<li><a href="../../index.html">Home</a>
|
16 |
-
<li><a href="../../doc/manual.html">Manual</a>
|
17 |
-
<li><a href="https://github.com/codemirror/codemirror">Code</a>
|
18 |
-
</ul>
|
19 |
-
<ul>
|
20 |
-
<li><a href="../index.html">Language modes</a>
|
21 |
-
<li><a class=active href="#">Clojure</a>
|
22 |
-
</ul>
|
23 |
-
</div>
|
24 |
-
|
25 |
-
<article>
|
26 |
-
<h2>Clojure mode</h2>
|
27 |
-
<form><textarea id="code" name="code">
|
28 |
-
; Conway's Game of Life, based on the work of:
|
29 |
-
;; Laurent Petit https://gist.github.com/1200343
|
30 |
-
;; Christophe Grand http://clj-me.cgrand.net/2011/08/19/conways-game-of-life
|
31 |
-
|
32 |
-
(ns ^{:doc "Conway's Game of Life."}
|
33 |
-
game-of-life)
|
34 |
-
|
35 |
-
;; Core game of life's algorithm functions
|
36 |
-
|
37 |
-
(defn neighbours
|
38 |
-
"Given a cell's coordinates, returns the coordinates of its neighbours."
|
39 |
-
[[x y]]
|
40 |
-
(for [dx [-1 0 1] dy (if (zero? dx) [-1 1] [-1 0 1])]
|
41 |
-
[(+ dx x) (+ dy y)]))
|
42 |
-
|
43 |
-
(defn step
|
44 |
-
"Given a set of living cells, computes the new set of living cells."
|
45 |
-
[cells]
|
46 |
-
(set (for [[cell n] (frequencies (mapcat neighbours cells))
|
47 |
-
:when (or (= n 3) (and (= n 2) (cells cell)))]
|
48 |
-
cell)))
|
49 |
-
|
50 |
-
;; Utility methods for displaying game on a text terminal
|
51 |
-
|
52 |
-
(defn print-board
|
53 |
-
"Prints a board on *out*, representing a step in the game."
|
54 |
-
[board w h]
|
55 |
-
(doseq [x (range (inc w)) y (range (inc h))]
|
56 |
-
(if (= y 0) (print "\n"))
|
57 |
-
(print (if (board [x y]) "[X]" " . "))))
|
58 |
-
|
59 |
-
(defn display-grids
|
60 |
-
"Prints a squence of boards on *out*, representing several steps."
|
61 |
-
[grids w h]
|
62 |
-
(doseq [board grids]
|
63 |
-
(print-board board w h)
|
64 |
-
(print "\n")))
|
65 |
-
|
66 |
-
;; Launches an example board
|
67 |
-
|
68 |
-
(def
|
69 |
-
^{:doc "board represents the initial set of living cells"}
|
70 |
-
board #{[2 1] [2 2] [2 3]})
|
71 |
-
|
72 |
-
(display-grids (take 3 (iterate step board)) 5 5)
|
73 |
-
|
74 |
-
;; Let's play with characters
|
75 |
-
(println \1 \a \# \\
|
76 |
-
\" \( \newline
|
77 |
-
\} \" \space
|
78 |
-
\tab \return \backspace
|
79 |
-
\u1000 \uAaAa \u9F9F)
|
80 |
-
|
81 |
-
</textarea></form>
|
82 |
-
<script>
|
83 |
-
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {});
|
84 |
-
</script>
|
85 |
-
|
86 |
-
<p><strong>MIME types defined:</strong> <code>text/x-clojure</code>.</p>
|
87 |
-
|
88 |
-
</article>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/cmake/cmake.js
DELETED
@@ -1,97 +0,0 @@
|
|
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")
|
6 |
-
mod(require("../../lib/codemirror"));
|
7 |
-
else if (typeof define == "function" && define.amd)
|
8 |
-
define(["../../lib/codemirror"], mod);
|
9 |
-
else
|
10 |
-
mod(CodeMirror);
|
11 |
-
})(function(CodeMirror) {
|
12 |
-
"use strict";
|
13 |
-
|
14 |
-
CodeMirror.defineMode("cmake", function () {
|
15 |
-
var variable_regex = /({)?[a-zA-Z0-9_]+(})?/;
|
16 |
-
|
17 |
-
function tokenString(stream, state) {
|
18 |
-
var current, prev, found_var = false;
|
19 |
-
while (!stream.eol() && (current = stream.next()) != state.pending) {
|
20 |
-
if (current === '$' && prev != '\\' && state.pending == '"') {
|
21 |
-
found_var = true;
|
22 |
-
break;
|
23 |
-
}
|
24 |
-
prev = current;
|
25 |
-
}
|
26 |
-
if (found_var) {
|
27 |
-
stream.backUp(1);
|
28 |
-
}
|
29 |
-
if (current == state.pending) {
|
30 |
-
state.continueString = false;
|
31 |
-
} else {
|
32 |
-
state.continueString = true;
|
33 |
-
}
|
34 |
-
return "string";
|
35 |
-
}
|
36 |
-
|
37 |
-
function tokenize(stream, state) {
|
38 |
-
var ch = stream.next();
|
39 |
-
|
40 |
-
// Have we found a variable?
|
41 |
-
if (ch === '$') {
|
42 |
-
if (stream.match(variable_regex)) {
|
43 |
-
return 'variable-2';
|
44 |
-
}
|
45 |
-
return 'variable';
|
46 |
-
}
|
47 |
-
// Should we still be looking for the end of a string?
|
48 |
-
if (state.continueString) {
|
49 |
-
// If so, go through the loop again
|
50 |
-
stream.backUp(1);
|
51 |
-
return tokenString(stream, state);
|
52 |
-
}
|
53 |
-
// Do we just have a function on our hands?
|
54 |
-
// In 'cmake_minimum_required (VERSION 2.8.8)', 'cmake_minimum_required' is matched
|
55 |
-
if (stream.match(/(\s+)?\w+\(/) || stream.match(/(\s+)?\w+\ \(/)) {
|
56 |
-
stream.backUp(1);
|
57 |
-
return 'def';
|
58 |
-
}
|
59 |
-
if (ch == "#") {
|
60 |
-
stream.skipToEnd();
|
61 |
-
return "comment";
|
62 |
-
}
|
63 |
-
// Have we found a string?
|
64 |
-
if (ch == "'" || ch == '"') {
|
65 |
-
// Store the type (single or double)
|
66 |
-
state.pending = ch;
|
67 |
-
// Perform the looping function to find the end
|
68 |
-
return tokenString(stream, state);
|
69 |
-
}
|
70 |
-
if (ch == '(' || ch == ')') {
|
71 |
-
return 'bracket';
|
72 |
-
}
|
73 |
-
if (ch.match(/[0-9]/)) {
|
74 |
-
return 'number';
|
75 |
-
}
|
76 |
-
stream.eatWhile(/[\w-]/);
|
77 |
-
return null;
|
78 |
-
}
|
79 |
-
return {
|
80 |
-
startState: function () {
|
81 |
-
var state = {};
|
82 |
-
state.inDefinition = false;
|
83 |
-
state.inInclude = false;
|
84 |
-
state.continueString = false;
|
85 |
-
state.pending = false;
|
86 |
-
return state;
|
87 |
-
},
|
88 |
-
token: function (stream, state) {
|
89 |
-
if (stream.eatSpace()) return null;
|
90 |
-
return tokenize(stream, state);
|
91 |
-
}
|
92 |
-
};
|
93 |
-
});
|
94 |
-
|
95 |
-
CodeMirror.defineMIME("text/x-cmake", "cmake");
|
96 |
-
|
97 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/cmake/index.html
DELETED
@@ -1,129 +0,0 @@
|
|
1 |
-
<!doctype html>
|
2 |
-
|
3 |
-
<title>CodeMirror: CMake mode</title>
|
4 |
-
<meta charset="utf-8"/>
|
5 |
-
<link rel=stylesheet href="../../doc/docs.css">
|
6 |
-
|
7 |
-
<link rel="stylesheet" href="../../lib/codemirror.css">
|
8 |
-
<script src="../../lib/codemirror.js"></script>
|
9 |
-
<script src="../../addon/edit/matchbrackets.js"></script>
|
10 |
-
<script src="cmake.js"></script>
|
11 |
-
<style>
|
12 |
-
.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}
|
13 |
-
.cm-s-default span.cm-arrow { color: red; }
|
14 |
-
</style>
|
15 |
-
<div id=nav>
|
16 |
-
<a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
17 |
-
|
18 |
-
<ul>
|
19 |
-
<li><a href="../../index.html">Home</a>
|
20 |
-
<li><a href="../../doc/manual.html">Manual</a>
|
21 |
-
<li><a href="https://github.com/codemirror/codemirror">Code</a>
|
22 |
-
</ul>
|
23 |
-
<ul>
|
24 |
-
<li><a href="../index.html">Language modes</a>
|
25 |
-
<li><a class=active href="#">CMake</a>
|
26 |
-
</ul>
|
27 |
-
</div>
|
28 |
-
|
29 |
-
<article>
|
30 |
-
<h2>CMake mode</h2>
|
31 |
-
<form><textarea id="code" name="code">
|
32 |
-
# vim: syntax=cmake
|
33 |
-
if(NOT CMAKE_BUILD_TYPE)
|
34 |
-
# default to Release build for GCC builds
|
35 |
-
set(CMAKE_BUILD_TYPE Release CACHE STRING
|
36 |
-
"Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel."
|
37 |
-
FORCE)
|
38 |
-
endif()
|
39 |
-
message(STATUS "cmake version ${CMAKE_VERSION}")
|
40 |
-
if(POLICY CMP0025)
|
41 |
-
cmake_policy(SET CMP0025 OLD) # report Apple's Clang as just Clang
|
42 |
-
endif()
|
43 |
-
if(POLICY CMP0042)
|
44 |
-
cmake_policy(SET CMP0042 NEW) # MACOSX_RPATH
|
45 |
-
endif()
|
46 |
-
|
47 |
-
project (x265)
|
48 |
-
cmake_minimum_required (VERSION 2.8.8) # OBJECT libraries require 2.8.8
|
49 |
-
include(CheckIncludeFiles)
|
50 |
-
include(CheckFunctionExists)
|
51 |
-
include(CheckSymbolExists)
|
52 |
-
include(CheckCXXCompilerFlag)
|
53 |
-
|
54 |
-
# X265_BUILD must be incremented each time the public API is changed
|
55 |
-
set(X265_BUILD 48)
|
56 |
-
configure_file("${PROJECT_SOURCE_DIR}/x265.def.in"
|
57 |
-
"${PROJECT_BINARY_DIR}/x265.def")
|
58 |
-
configure_file("${PROJECT_SOURCE_DIR}/x265_config.h.in"
|
59 |
-
"${PROJECT_BINARY_DIR}/x265_config.h")
|
60 |
-
|
61 |
-
SET(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake" "${CMAKE_MODULE_PATH}")
|
62 |
-
|
63 |
-
# System architecture detection
|
64 |
-
string(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" SYSPROC)
|
65 |
-
set(X86_ALIASES x86 i386 i686 x86_64 amd64)
|
66 |
-
list(FIND X86_ALIASES "${SYSPROC}" X86MATCH)
|
67 |
-
if("${SYSPROC}" STREQUAL "" OR X86MATCH GREATER "-1")
|
68 |
-
message(STATUS "Detected x86 target processor")
|
69 |
-
set(X86 1)
|
70 |
-
add_definitions(-DX265_ARCH_X86=1)
|
71 |
-
if("${CMAKE_SIZEOF_VOID_P}" MATCHES 8)
|
72 |
-
set(X64 1)
|
73 |
-
add_definitions(-DX86_64=1)
|
74 |
-
endif()
|
75 |
-
elseif(${SYSPROC} STREQUAL "armv6l")
|
76 |
-
message(STATUS "Detected ARM target processor")
|
77 |
-
set(ARM 1)
|
78 |
-
add_definitions(-DX265_ARCH_ARM=1 -DHAVE_ARMV6=1)
|
79 |
-
else()
|
80 |
-
message(STATUS "CMAKE_SYSTEM_PROCESSOR value `${CMAKE_SYSTEM_PROCESSOR}` is unknown")
|
81 |
-
message(STATUS "Please add this value near ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE}")
|
82 |
-
endif()
|
83 |
-
|
84 |
-
if(UNIX)
|
85 |
-
list(APPEND PLATFORM_LIBS pthread)
|
86 |
-
find_library(LIBRT rt)
|
87 |
-
if(LIBRT)
|
88 |
-
list(APPEND PLATFORM_LIBS rt)
|
89 |
-
endif()
|
90 |
-
find_package(Numa)
|
91 |
-
if(NUMA_FOUND)
|
92 |
-
list(APPEND CMAKE_REQUIRED_LIBRARIES ${NUMA_LIBRARY})
|
93 |
-
check_symbol_exists(numa_node_of_cpu numa.h NUMA_V2)
|
94 |
-
if(NUMA_V2)
|
95 |
-
add_definitions(-DHAVE_LIBNUMA)
|
96 |
-
message(STATUS "libnuma found, building with support for NUMA nodes")
|
97 |
-
list(APPEND PLATFORM_LIBS ${NUMA_LIBRARY})
|
98 |
-
link_directories(${NUMA_LIBRARY_DIR})
|
99 |
-
include_directories(${NUMA_INCLUDE_DIR})
|
100 |
-
endif()
|
101 |
-
endif()
|
102 |
-
mark_as_advanced(LIBRT NUMA_FOUND)
|
103 |
-
endif(UNIX)
|
104 |
-
|
105 |
-
if(X64 AND NOT WIN32)
|
106 |
-
option(ENABLE_PIC "Enable Position Independent Code" ON)
|
107 |
-
else()
|
108 |
-
option(ENABLE_PIC "Enable Position Independent Code" OFF)
|
109 |
-
endif(X64 AND NOT WIN32)
|
110 |
-
|
111 |
-
# Compiler detection
|
112 |
-
if(CMAKE_GENERATOR STREQUAL "Xcode")
|
113 |
-
set(XCODE 1)
|
114 |
-
endif()
|
115 |
-
if (APPLE)
|
116 |
-
add_definitions(-DMACOS)
|
117 |
-
endif()
|
118 |
-
</textarea></form>
|
119 |
-
<script>
|
120 |
-
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
|
121 |
-
mode: "text/x-cmake",
|
122 |
-
matchBrackets: true,
|
123 |
-
indentUnit: 4
|
124 |
-
});
|
125 |
-
</script>
|
126 |
-
|
127 |
-
<p><strong>MIME types defined:</strong> <code>text/x-cmake</code>.</p>
|
128 |
-
|
129 |
-
</article>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/cobol/cobol.js
DELETED
@@ -1,255 +0,0 @@
|
|
1 |
-
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
2 |
-
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
3 |
-
|
4 |
-
/**
|
5 |
-
* Author: Gautam Mehta
|
6 |
-
* Branched from CodeMirror's Scheme mode
|
7 |
-
*/
|
8 |
-
(function(mod) {
|
9 |
-
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
10 |
-
mod(require("../../lib/codemirror"));
|
11 |
-
else if (typeof define == "function" && define.amd) // AMD
|
12 |
-
define(["../../lib/codemirror"], mod);
|
13 |
-
else // Plain browser env
|
14 |
-
mod(CodeMirror);
|
15 |
-
})(function(CodeMirror) {
|
16 |
-
"use strict";
|
17 |
-
|
18 |
-
CodeMirror.defineMode("cobol", function () {
|
19 |
-
var BUILTIN = "builtin", COMMENT = "comment", STRING = "string",
|
20 |
-
ATOM = "atom", NUMBER = "number", KEYWORD = "keyword", MODTAG = "header",
|
21 |
-
COBOLLINENUM = "def", PERIOD = "link";
|
22 |
-
function makeKeywords(str) {
|
23 |
-
var obj = {}, words = str.split(" ");
|
24 |
-
for (var i = 0; i < words.length; ++i) obj[words[i]] = true;
|
25 |
-
return obj;
|
26 |
-
}
|
27 |
-
var atoms = makeKeywords("TRUE FALSE ZEROES ZEROS ZERO SPACES SPACE LOW-VALUE LOW-VALUES ");
|
28 |
-
var keywords = makeKeywords(
|
29 |
-
"ACCEPT ACCESS ACQUIRE ADD ADDRESS " +
|
30 |
-
"ADVANCING AFTER ALIAS ALL ALPHABET " +
|
31 |
-
"ALPHABETIC ALPHABETIC-LOWER ALPHABETIC-UPPER ALPHANUMERIC ALPHANUMERIC-EDITED " +
|
32 |
-
"ALSO ALTER ALTERNATE AND ANY " +
|
33 |
-
"ARE AREA AREAS ARITHMETIC ASCENDING " +
|
34 |
-
"ASSIGN AT ATTRIBUTE AUTHOR AUTO " +
|
35 |
-
"AUTO-SKIP AUTOMATIC B-AND B-EXOR B-LESS " +
|
36 |
-
"B-NOT B-OR BACKGROUND-COLOR BACKGROUND-COLOUR BEEP " +
|
37 |
-
"BEFORE BELL BINARY BIT BITS " +
|
38 |
-
"BLANK BLINK BLOCK BOOLEAN BOTTOM " +
|
39 |
-
"BY CALL CANCEL CD CF " +
|
40 |
-
"CH CHARACTER CHARACTERS CLASS CLOCK-UNITS " +
|
41 |
-
"CLOSE COBOL CODE CODE-SET COL " +
|
42 |
-
"COLLATING COLUMN COMMA COMMIT COMMITMENT " +
|
43 |
-
"COMMON COMMUNICATION COMP COMP-0 COMP-1 " +
|
44 |
-
"COMP-2 COMP-3 COMP-4 COMP-5 COMP-6 " +
|
45 |
-
"COMP-7 COMP-8 COMP-9 COMPUTATIONAL COMPUTATIONAL-0 " +
|
46 |
-
"COMPUTATIONAL-1 COMPUTATIONAL-2 COMPUTATIONAL-3 COMPUTATIONAL-4 COMPUTATIONAL-5 " +
|
47 |
-
"COMPUTATIONAL-6 COMPUTATIONAL-7 COMPUTATIONAL-8 COMPUTATIONAL-9 COMPUTE " +
|
48 |
-
"CONFIGURATION CONNECT CONSOLE CONTAINED CONTAINS " +
|
49 |
-
"CONTENT CONTINUE CONTROL CONTROL-AREA CONTROLS " +
|
50 |
-
"CONVERTING COPY CORR CORRESPONDING COUNT " +
|
51 |
-
"CRT CRT-UNDER CURRENCY CURRENT CURSOR " +
|
52 |
-
"DATA DATE DATE-COMPILED DATE-WRITTEN DAY " +
|
53 |
-
"DAY-OF-WEEK DB DB-ACCESS-CONTROL-KEY DB-DATA-NAME DB-EXCEPTION " +
|
54 |
-
"DB-FORMAT-NAME DB-RECORD-NAME DB-SET-NAME DB-STATUS DBCS " +
|
55 |
-
"DBCS-EDITED DE DEBUG-CONTENTS DEBUG-ITEM DEBUG-LINE " +
|
56 |
-
"DEBUG-NAME DEBUG-SUB-1 DEBUG-SUB-2 DEBUG-SUB-3 DEBUGGING " +
|
57 |
-
"DECIMAL-POINT DECLARATIVES DEFAULT DELETE DELIMITED " +
|
58 |
-
"DELIMITER DEPENDING DESCENDING DESCRIBED DESTINATION " +
|
59 |
-
"DETAIL DISABLE DISCONNECT DISPLAY DISPLAY-1 " +
|
60 |
-
"DISPLAY-2 DISPLAY-3 DISPLAY-4 DISPLAY-5 DISPLAY-6 " +
|
61 |
-
"DISPLAY-7 DISPLAY-8 DISPLAY-9 DIVIDE DIVISION " +
|
62 |
-
"DOWN DROP DUPLICATE DUPLICATES DYNAMIC " +
|
63 |
-
"EBCDIC EGI EJECT ELSE EMI " +
|
64 |
-
"EMPTY EMPTY-CHECK ENABLE END END. END-ACCEPT END-ACCEPT. " +
|
65 |
-
"END-ADD END-CALL END-COMPUTE END-DELETE END-DISPLAY " +
|
66 |
-
"END-DIVIDE END-EVALUATE END-IF END-INVOKE END-MULTIPLY " +
|
67 |
-
"END-OF-PAGE END-PERFORM END-READ END-RECEIVE END-RETURN " +
|
68 |
-
"END-REWRITE END-SEARCH END-START END-STRING END-SUBTRACT " +
|
69 |
-
"END-UNSTRING END-WRITE END-XML ENTER ENTRY " +
|
70 |
-
"ENVIRONMENT EOP EQUAL EQUALS ERASE " +
|
71 |
-
"ERROR ESI EVALUATE EVERY EXCEEDS " +
|
72 |
-
"EXCEPTION EXCLUSIVE EXIT EXTEND EXTERNAL " +
|
73 |
-
"EXTERNALLY-DESCRIBED-KEY FD FETCH FILE FILE-CONTROL " +
|
74 |
-
"FILE-STREAM FILES FILLER FINAL FIND " +
|
75 |
-
"FINISH FIRST FOOTING FOR FOREGROUND-COLOR " +
|
76 |
-
"FOREGROUND-COLOUR FORMAT FREE FROM FULL " +
|
77 |
-
"FUNCTION GENERATE GET GIVING GLOBAL " +
|
78 |
-
"GO GOBACK GREATER GROUP HEADING " +
|
79 |
-
"HIGH-VALUE HIGH-VALUES HIGHLIGHT I-O I-O-CONTROL " +
|
80 |
-
"ID IDENTIFICATION IF IN INDEX " +
|
81 |
-
"INDEX-1 INDEX-2 INDEX-3 INDEX-4 INDEX-5 " +
|
82 |
-
"INDEX-6 INDEX-7 INDEX-8 INDEX-9 INDEXED " +
|
83 |
-
"INDIC INDICATE INDICATOR INDICATORS INITIAL " +
|
84 |
-
"INITIALIZE INITIATE INPUT INPUT-OUTPUT INSPECT " +
|
85 |
-
"INSTALLATION INTO INVALID INVOKE IS " +
|
86 |
-
"JUST JUSTIFIED KANJI KEEP KEY " +
|
87 |
-
"LABEL LAST LD LEADING LEFT " +
|
88 |
-
"LEFT-JUSTIFY LENGTH LENGTH-CHECK LESS LIBRARY " +
|
89 |
-
"LIKE LIMIT LIMITS LINAGE LINAGE-COUNTER " +
|
90 |
-
"LINE LINE-COUNTER LINES LINKAGE LOCAL-STORAGE " +
|
91 |
-
"LOCALE LOCALLY LOCK " +
|
92 |
-
"MEMBER MEMORY MERGE MESSAGE METACLASS " +
|
93 |
-
"MODE MODIFIED MODIFY MODULES MOVE " +
|
94 |
-
"MULTIPLE MULTIPLY NATIONAL NATIVE NEGATIVE " +
|
95 |
-
"NEXT NO NO-ECHO NONE NOT " +
|
96 |
-
"NULL NULL-KEY-MAP NULL-MAP NULLS NUMBER " +
|
97 |
-
"NUMERIC NUMERIC-EDITED OBJECT OBJECT-COMPUTER OCCURS " +
|
98 |
-
"OF OFF OMITTED ON ONLY " +
|
99 |
-
"OPEN OPTIONAL OR ORDER ORGANIZATION " +
|
100 |
-
"OTHER OUTPUT OVERFLOW OWNER PACKED-DECIMAL " +
|
101 |
-
"PADDING PAGE PAGE-COUNTER PARSE PERFORM " +
|
102 |
-
"PF PH PIC PICTURE PLUS " +
|
103 |
-
"POINTER POSITION POSITIVE PREFIX PRESENT " +
|
104 |
-
"PRINTING PRIOR PROCEDURE PROCEDURE-POINTER PROCEDURES " +
|
105 |
-
"PROCEED PROCESS PROCESSING PROGRAM PROGRAM-ID " +
|
106 |
-
"PROMPT PROTECTED PURGE QUEUE QUOTE " +
|
107 |
-
"QUOTES RANDOM RD READ READY " +
|
108 |
-
"REALM RECEIVE RECONNECT RECORD RECORD-NAME " +
|
109 |
-
"RECORDS RECURSIVE REDEFINES REEL REFERENCE " +
|
110 |
-
"REFERENCE-MONITOR REFERENCES RELATION RELATIVE RELEASE " +
|
111 |
-
"REMAINDER REMOVAL RENAMES REPEATED REPLACE " +
|
112 |
-
"REPLACING REPORT REPORTING REPORTS REPOSITORY " +
|
113 |
-
"REQUIRED RERUN RESERVE RESET RETAINING " +
|
114 |
-
"RETRIEVAL RETURN RETURN-CODE RETURNING REVERSE-VIDEO " +
|
115 |
-
"REVERSED REWIND REWRITE RF RH " +
|
116 |
-
"RIGHT RIGHT-JUSTIFY ROLLBACK ROLLING ROUNDED " +
|
117 |
-
"RUN SAME SCREEN SD SEARCH " +
|
118 |
-
"SECTION SECURE SECURITY SEGMENT SEGMENT-LIMIT " +
|
119 |
-
"SELECT SEND SENTENCE SEPARATE SEQUENCE " +
|
120 |
-
"SEQUENTIAL SET SHARED SIGN SIZE " +
|
121 |
-
"SKIP1 SKIP2 SKIP3 SORT SORT-MERGE " +
|
122 |
-
"SORT-RETURN SOURCE SOURCE-COMPUTER SPACE-FILL " +
|
123 |
-
"SPECIAL-NAMES STANDARD STANDARD-1 STANDARD-2 " +
|
124 |
-
"START STARTING STATUS STOP STORE " +
|
125 |
-
"STRING SUB-QUEUE-1 SUB-QUEUE-2 SUB-QUEUE-3 SUB-SCHEMA " +
|
126 |
-
"SUBFILE SUBSTITUTE SUBTRACT SUM SUPPRESS " +
|
127 |
-
"SYMBOLIC SYNC SYNCHRONIZED SYSIN SYSOUT " +
|
128 |
-
"TABLE TALLYING TAPE TENANT TERMINAL " +
|
129 |
-
"TERMINATE TEST TEXT THAN THEN " +
|
130 |
-
"THROUGH THRU TIME TIMES TITLE " +
|
131 |
-
"TO TOP TRAILING TRAILING-SIGN TRANSACTION " +
|
132 |
-
"TYPE TYPEDEF UNDERLINE UNEQUAL UNIT " +
|
133 |
-
"UNSTRING UNTIL UP UPDATE UPON " +
|
134 |
-
"USAGE USAGE-MODE USE USING VALID " +
|
135 |
-
"VALIDATE VALUE VALUES VARYING VLR " +
|
136 |
-
"WAIT WHEN WHEN-COMPILED WITH WITHIN " +
|
137 |
-
"WORDS WORKING-STORAGE WRITE XML XML-CODE " +
|
138 |
-
"XML-EVENT XML-NTEXT XML-TEXT ZERO ZERO-FILL " );
|
139 |
-
|
140 |
-
var builtins = makeKeywords("- * ** / + < <= = > >= ");
|
141 |
-
var tests = {
|
142 |
-
digit: /\d/,
|
143 |
-
digit_or_colon: /[\d:]/,
|
144 |
-
hex: /[0-9a-f]/i,
|
145 |
-
sign: /[+-]/,
|
146 |
-
exponent: /e/i,
|
147 |
-
keyword_char: /[^\s\(\[\;\)\]]/,
|
148 |
-
symbol: /[\w*+\-]/
|
149 |
-
};
|
150 |
-
function isNumber(ch, stream){
|
151 |
-
// hex
|
152 |
-
if ( ch === '0' && stream.eat(/x/i) ) {
|
153 |
-
stream.eatWhile(tests.hex);
|
154 |
-
return true;
|
155 |
-
}
|
156 |
-
// leading sign
|
157 |
-
if ( ( ch == '+' || ch == '-' ) && ( tests.digit.test(stream.peek()) ) ) {
|
158 |
-
stream.eat(tests.sign);
|
159 |
-
ch = stream.next();
|
160 |
-
}
|
161 |
-
if ( tests.digit.test(ch) ) {
|
162 |
-
stream.eat(ch);
|
163 |
-
stream.eatWhile(tests.digit);
|
164 |
-
if ( '.' == stream.peek()) {
|
165 |
-
stream.eat('.');
|
166 |
-
stream.eatWhile(tests.digit);
|
167 |
-
}
|
168 |
-
if ( stream.eat(tests.exponent) ) {
|
169 |
-
stream.eat(tests.sign);
|
170 |
-
stream.eatWhile(tests.digit);
|
171 |
-
}
|
172 |
-
return true;
|
173 |
-
}
|
174 |
-
return false;
|
175 |
-
}
|
176 |
-
return {
|
177 |
-
startState: function () {
|
178 |
-
return {
|
179 |
-
indentStack: null,
|
180 |
-
indentation: 0,
|
181 |
-
mode: false
|
182 |
-
};
|
183 |
-
},
|
184 |
-
token: function (stream, state) {
|
185 |
-
if (state.indentStack == null && stream.sol()) {
|
186 |
-
// update indentation, but only if indentStack is empty
|
187 |
-
state.indentation = 6 ; //stream.indentation();
|
188 |
-
}
|
189 |
-
// skip spaces
|
190 |
-
if (stream.eatSpace()) {
|
191 |
-
return null;
|
192 |
-
}
|
193 |
-
var returnType = null;
|
194 |
-
switch(state.mode){
|
195 |
-
case "string": // multi-line string parsing mode
|
196 |
-
var next = false;
|
197 |
-
while ((next = stream.next()) != null) {
|
198 |
-
if (next == "\"" || next == "\'") {
|
199 |
-
state.mode = false;
|
200 |
-
break;
|
201 |
-
}
|
202 |
-
}
|
203 |
-
returnType = STRING; // continue on in string mode
|
204 |
-
break;
|
205 |
-
default: // default parsing mode
|
206 |
-
var ch = stream.next();
|
207 |
-
var col = stream.column();
|
208 |
-
if (col >= 0 && col <= 5) {
|
209 |
-
returnType = COBOLLINENUM;
|
210 |
-
} else if (col >= 72 && col <= 79) {
|
211 |
-
stream.skipToEnd();
|
212 |
-
returnType = MODTAG;
|
213 |
-
} else if (ch == "*" && col == 6) { // comment
|
214 |
-
stream.skipToEnd(); // rest of the line is a comment
|
215 |
-
returnType = COMMENT;
|
216 |
-
} else if (ch == "\"" || ch == "\'") {
|
217 |
-
state.mode = "string";
|
218 |
-
returnType = STRING;
|
219 |
-
} else if (ch == "'" && !( tests.digit_or_colon.test(stream.peek()) )) {
|
220 |
-
returnType = ATOM;
|
221 |
-
} else if (ch == ".") {
|
222 |
-
returnType = PERIOD;
|
223 |
-
} else if (isNumber(ch,stream)){
|
224 |
-
returnType = NUMBER;
|
225 |
-
} else {
|
226 |
-
if (stream.current().match(tests.symbol)) {
|
227 |
-
while (col < 71) {
|
228 |
-
if (stream.eat(tests.symbol) === undefined) {
|
229 |
-
break;
|
230 |
-
} else {
|
231 |
-
col++;
|
232 |
-
}
|
233 |
-
}
|
234 |
-
}
|
235 |
-
if (keywords && keywords.propertyIsEnumerable(stream.current().toUpperCase())) {
|
236 |
-
returnType = KEYWORD;
|
237 |
-
} else if (builtins && builtins.propertyIsEnumerable(stream.current().toUpperCase())) {
|
238 |
-
returnType = BUILTIN;
|
239 |
-
} else if (atoms && atoms.propertyIsEnumerable(stream.current().toUpperCase())) {
|
240 |
-
returnType = ATOM;
|
241 |
-
} else returnType = null;
|
242 |
-
}
|
243 |
-
}
|
244 |
-
return returnType;
|
245 |
-
},
|
246 |
-
indent: function (state) {
|
247 |
-
if (state.indentStack == null) return state.indentation;
|
248 |
-
return state.indentStack.indent;
|
249 |
-
}
|
250 |
-
};
|
251 |
-
});
|
252 |
-
|
253 |
-
CodeMirror.defineMIME("text/x-cobol", "cobol");
|
254 |
-
|
255 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/cobol/index.html
DELETED
@@ -1,210 +0,0 @@
|
|
1 |
-
<!doctype html>
|
2 |
-
|
3 |
-
<title>CodeMirror: COBOL mode</title>
|
4 |
-
<meta charset="utf-8"/>
|
5 |
-
<link rel=stylesheet href="../../doc/docs.css">
|
6 |
-
|
7 |
-
<link rel="stylesheet" href="../../lib/codemirror.css">
|
8 |
-
<link rel="stylesheet" href="../../theme/neat.css">
|
9 |
-
<link rel="stylesheet" href="../../theme/elegant.css">
|
10 |
-
<link rel="stylesheet" href="../../theme/erlang-dark.css">
|
11 |
-
<link rel="stylesheet" href="../../theme/night.css">
|
12 |
-
<link rel="stylesheet" href="../../theme/monokai.css">
|
13 |
-
<link rel="stylesheet" href="../../theme/cobalt.css">
|
14 |
-
<link rel="stylesheet" href="../../theme/eclipse.css">
|
15 |
-
<link rel="stylesheet" href="../../theme/rubyblue.css">
|
16 |
-
<link rel="stylesheet" href="../../theme/lesser-dark.css">
|
17 |
-
<link rel="stylesheet" href="../../theme/xq-dark.css">
|
18 |
-
<link rel="stylesheet" href="../../theme/xq-light.css">
|
19 |
-
<link rel="stylesheet" href="../../theme/ambiance.css">
|
20 |
-
<link rel="stylesheet" href="../../theme/blackboard.css">
|
21 |
-
<link rel="stylesheet" href="../../theme/vibrant-ink.css">
|
22 |
-
<link rel="stylesheet" href="../../theme/solarized.css">
|
23 |
-
<link rel="stylesheet" href="../../theme/twilight.css">
|
24 |
-
<link rel="stylesheet" href="../../theme/midnight.css">
|
25 |
-
<link rel="stylesheet" href="../../addon/dialog/dialog.css">
|
26 |
-
<script src="../../lib/codemirror.js"></script>
|
27 |
-
<script src="../../addon/edit/matchbrackets.js"></script>
|
28 |
-
<script src="cobol.js"></script>
|
29 |
-
<script src="../../addon/selection/active-line.js"></script>
|
30 |
-
<script src="../../addon/search/search.js"></script>
|
31 |
-
<script src="../../addon/dialog/dialog.js"></script>
|
32 |
-
<script src="../../addon/search/searchcursor.js"></script>
|
33 |
-
<style>
|
34 |
-
.CodeMirror {
|
35 |
-
border: 1px solid #eee;
|
36 |
-
font-size : 20px;
|
37 |
-
height : auto !important;
|
38 |
-
}
|
39 |
-
.CodeMirror-activeline-background {background: #555555 !important;}
|
40 |
-
</style>
|
41 |
-
<div id=nav>
|
42 |
-
<a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
43 |
-
|
44 |
-
<ul>
|
45 |
-
<li><a href="../../index.html">Home</a>
|
46 |
-
<li><a href="../../doc/manual.html">Manual</a>
|
47 |
-
<li><a href="https://github.com/codemirror/codemirror">Code</a>
|
48 |
-
</ul>
|
49 |
-
<ul>
|
50 |
-
<li><a href="../index.html">Language modes</a>
|
51 |
-
<li><a class=active href="#">COBOL</a>
|
52 |
-
</ul>
|
53 |
-
</div>
|
54 |
-
|
55 |
-
<article>
|
56 |
-
<h2>COBOL mode</h2>
|
57 |
-
|
58 |
-
<p> Select Theme <select onchange="selectTheme()" id="selectTheme">
|
59 |
-
<option>default</option>
|
60 |
-
<option>ambiance</option>
|
61 |
-
<option>blackboard</option>
|
62 |
-
<option>cobalt</option>
|
63 |
-
<option>eclipse</option>
|
64 |
-
<option>elegant</option>
|
65 |
-
<option>erlang-dark</option>
|
66 |
-
<option>lesser-dark</option>
|
67 |
-
<option>midnight</option>
|
68 |
-
<option>monokai</option>
|
69 |
-
<option>neat</option>
|
70 |
-
<option>night</option>
|
71 |
-
<option>rubyblue</option>
|
72 |
-
<option>solarized dark</option>
|
73 |
-
<option>solarized light</option>
|
74 |
-
<option selected>twilight</option>
|
75 |
-
<option>vibrant-ink</option>
|
76 |
-
<option>xq-dark</option>
|
77 |
-
<option>xq-light</option>
|
78 |
-
</select> Select Font Size <select onchange="selectFontsize()" id="selectFontSize">
|
79 |
-
<option value="13px">13px</option>
|
80 |
-
<option value="14px">14px</option>
|
81 |
-
<option value="16px">16px</option>
|
82 |
-
<option value="18px">18px</option>
|
83 |
-
<option value="20px" selected="selected">20px</option>
|
84 |
-
<option value="24px">24px</option>
|
85 |
-
<option value="26px">26px</option>
|
86 |
-
<option value="28px">28px</option>
|
87 |
-
<option value="30px">30px</option>
|
88 |
-
<option value="32px">32px</option>
|
89 |
-
<option value="34px">34px</option>
|
90 |
-
<option value="36px">36px</option>
|
91 |
-
</select>
|
92 |
-
<label for="checkBoxReadOnly">Read-only</label>
|
93 |
-
<input type="checkbox" id="checkBoxReadOnly" onchange="selectReadOnly()">
|
94 |
-
<label for="id_tabToIndentSpace">Insert Spaces on Tab</label>
|
95 |
-
<input type="checkbox" id="id_tabToIndentSpace" onchange="tabToIndentSpace()">
|
96 |
-
</p>
|
97 |
-
<textarea id="code" name="code">
|
98 |
-
---------1---------2---------3---------4---------5---------6---------7---------8
|
99 |
-
12345678911234567892123456789312345678941234567895123456789612345678971234567898
|
100 |
-
000010 IDENTIFICATION DIVISION. MODTGHERE
|
101 |
-
000020 PROGRAM-ID. SAMPLE.
|
102 |
-
000030 AUTHOR. TEST SAM.
|
103 |
-
000040 DATE-WRITTEN. 5 February 2013
|
104 |
-
000041
|
105 |
-
000042* A sample program just to show the form.
|
106 |
-
000043* The program copies its input to the output,
|
107 |
-
000044* and counts the number of records.
|
108 |
-
000045* At the end this number is printed.
|
109 |
-
000046
|
110 |
-
000050 ENVIRONMENT DIVISION.
|
111 |
-
000060 INPUT-OUTPUT SECTION.
|
112 |
-
000070 FILE-CONTROL.
|
113 |
-
000080 SELECT STUDENT-FILE ASSIGN TO SYSIN
|
114 |
-
000090 ORGANIZATION IS LINE SEQUENTIAL.
|
115 |
-
000100 SELECT PRINT-FILE ASSIGN TO SYSOUT
|
116 |
-
000110 ORGANIZATION IS LINE SEQUENTIAL.
|
117 |
-
000120
|
118 |
-
000130 DATA DIVISION.
|
119 |
-
000140 FILE SECTION.
|
120 |
-
000150 FD STUDENT-FILE
|
121 |
-
000160 RECORD CONTAINS 43 CHARACTERS
|
122 |
-
000170 DATA RECORD IS STUDENT-IN.
|
123 |
-
000180 01 STUDENT-IN PIC X(43).
|
124 |
-
000190
|
125 |
-
000200 FD PRINT-FILE
|
126 |
-
000210 RECORD CONTAINS 80 CHARACTERS
|
127 |
-
000220 DATA RECORD IS PRINT-LINE.
|
128 |
-
000230 01 PRINT-LINE PIC X(80).
|
129 |
-
000240
|
130 |
-
000250 WORKING-STORAGE SECTION.
|
131 |
-
000260 01 DATA-REMAINS-SWITCH PIC X(2) VALUE SPACES.
|
132 |
-
000261 01 RECORDS-WRITTEN PIC 99.
|
133 |
-
000270
|
134 |
-
000280 01 DETAIL-LINE.
|
135 |
-
000290 05 FILLER PIC X(7) VALUE SPACES.
|
136 |
-
000300 05 RECORD-IMAGE PIC X(43).
|
137 |
-
000310 05 FILLER PIC X(30) VALUE SPACES.
|
138 |
-
000311
|
139 |
-
000312 01 SUMMARY-LINE.
|
140 |
-
000313 05 FILLER PIC X(7) VALUE SPACES.
|
141 |
-
000314 05 TOTAL-READ PIC 99.
|
142 |
-
000315 05 FILLER PIC X VALUE SPACE.
|
143 |
-
000316 05 FILLER PIC X(17)
|
144 |
-
000317 VALUE 'Records were read'.
|
145 |
-
000318 05 FILLER PIC X(53) VALUE SPACES.
|
146 |
-
000319
|
147 |
-
000320 PROCEDURE DIVISION.
|
148 |
-
000321
|
149 |
-
000330 PREPARE-SENIOR-REPORT.
|
150 |
-
000340 OPEN INPUT STUDENT-FILE
|
151 |
-
000350 OUTPUT PRINT-FILE.
|
152 |
-
000351 MOVE ZERO TO RECORDS-WRITTEN.
|
153 |
-
000360 READ STUDENT-FILE
|
154 |
-
000370 AT END MOVE 'NO' TO DATA-REMAINS-SWITCH
|
155 |
-
000380 END-READ.
|
156 |
-
000390 PERFORM PROCESS-RECORDS
|
157 |
-
000410 UNTIL DATA-REMAINS-SWITCH = 'NO'.
|
158 |
-
000411 PERFORM PRINT-SUMMARY.
|
159 |
-
000420 CLOSE STUDENT-FILE
|
160 |
-
000430 PRINT-FILE.
|
161 |
-
000440 STOP RUN.
|
162 |
-
000450
|
163 |
-
000460 PROCESS-RECORDS.
|
164 |
-
000470 MOVE STUDENT-IN TO RECORD-IMAGE.
|
165 |
-
000480 MOVE DETAIL-LINE TO PRINT-LINE.
|
166 |
-
000490 WRITE PRINT-LINE.
|
167 |
-
000500 ADD 1 TO RECORDS-WRITTEN.
|
168 |
-
000510 READ STUDENT-FILE
|
169 |
-
000520 AT END MOVE 'NO' TO DATA-REMAINS-SWITCH
|
170 |
-
000530 END-READ.
|
171 |
-
000540
|
172 |
-
000550 PRINT-SUMMARY.
|
173 |
-
000560 MOVE RECORDS-WRITTEN TO TOTAL-READ.
|
174 |
-
000570 MOVE SUMMARY-LINE TO PRINT-LINE.
|
175 |
-
000571 WRITE PRINT-LINE.
|
176 |
-
000572
|
177 |
-
000580
|
178 |
-
</textarea>
|
179 |
-
<script>
|
180 |
-
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
|
181 |
-
lineNumbers: true,
|
182 |
-
matchBrackets: true,
|
183 |
-
mode: "text/x-cobol",
|
184 |
-
theme : "twilight",
|
185 |
-
styleActiveLine: true,
|
186 |
-
showCursorWhenSelecting : true,
|
187 |
-
});
|
188 |
-
function selectTheme() {
|
189 |
-
var themeInput = document.getElementById("selectTheme");
|
190 |
-
var theme = themeInput.options[themeInput.selectedIndex].innerHTML;
|
191 |
-
editor.setOption("theme", theme);
|
192 |
-
}
|
193 |
-
function selectFontsize() {
|
194 |
-
var fontSizeInput = document.getElementById("selectFontSize");
|
195 |
-
var fontSize = fontSizeInput.options[fontSizeInput.selectedIndex].innerHTML;
|
196 |
-
editor.getWrapperElement().style.fontSize = fontSize;
|
197 |
-
editor.refresh();
|
198 |
-
}
|
199 |
-
function selectReadOnly() {
|
200 |
-
editor.setOption("readOnly", document.getElementById("checkBoxReadOnly").checked);
|
201 |
-
}
|
202 |
-
function tabToIndentSpace() {
|
203 |
-
if (document.getElementById("id_tabToIndentSpace").checked) {
|
204 |
-
editor.setOption("extraKeys", {Tab: function(cm) { cm.replaceSelection(" ", "end"); }});
|
205 |
-
} else {
|
206 |
-
editor.setOption("extraKeys", {Tab: function(cm) { cm.replaceSelection(" ", "end"); }});
|
207 |
-
}
|
208 |
-
}
|
209 |
-
</script>
|
210 |
-
</article>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/commonlisp/commonlisp.js
DELETED
@@ -1,123 +0,0 @@
|
|
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("commonlisp", function (config) {
|
15 |
-
var specialForm = /^(block|let*|return-from|catch|load-time-value|setq|eval-when|locally|symbol-macrolet|flet|macrolet|tagbody|function|multiple-value-call|the|go|multiple-value-prog1|throw|if|progn|unwind-protect|labels|progv|let|quote)$/;
|
16 |
-
var assumeBody = /^with|^def|^do|^prog|case$|^cond$|bind$|when$|unless$/;
|
17 |
-
var numLiteral = /^(?:[+\-]?(?:\d+|\d*\.\d+)(?:[efd][+\-]?\d+)?|[+\-]?\d+(?:\/[+\-]?\d+)?|#b[+\-]?[01]+|#o[+\-]?[0-7]+|#x[+\-]?[\da-f]+)/;
|
18 |
-
var symbol = /[^\s'`,@()\[\]";]/;
|
19 |
-
var type;
|
20 |
-
|
21 |
-
function readSym(stream) {
|
22 |
-
var ch;
|
23 |
-
while (ch = stream.next()) {
|
24 |
-
if (ch == "\\") stream.next();
|
25 |
-
else if (!symbol.test(ch)) { stream.backUp(1); break; }
|
26 |
-
}
|
27 |
-
return stream.current();
|
28 |
-
}
|
29 |
-
|
30 |
-
function base(stream, state) {
|
31 |
-
if (stream.eatSpace()) {type = "ws"; return null;}
|
32 |
-
if (stream.match(numLiteral)) return "number";
|
33 |
-
var ch = stream.next();
|
34 |
-
if (ch == "\\") ch = stream.next();
|
35 |
-
|
36 |
-
if (ch == '"') return (state.tokenize = inString)(stream, state);
|
37 |
-
else if (ch == "(") { type = "open"; return "bracket"; }
|
38 |
-
else if (ch == ")" || ch == "]") { type = "close"; return "bracket"; }
|
39 |
-
else if (ch == ";") { stream.skipToEnd(); type = "ws"; return "comment"; }
|
40 |
-
else if (/['`,@]/.test(ch)) return null;
|
41 |
-
else if (ch == "|") {
|
42 |
-
if (stream.skipTo("|")) { stream.next(); return "symbol"; }
|
43 |
-
else { stream.skipToEnd(); return "error"; }
|
44 |
-
} else if (ch == "#") {
|
45 |
-
var ch = stream.next();
|
46 |
-
if (ch == "[") { type = "open"; return "bracket"; }
|
47 |
-
else if (/[+\-=\.']/.test(ch)) return null;
|
48 |
-
else if (/\d/.test(ch) && stream.match(/^\d*#/)) return null;
|
49 |
-
else if (ch == "|") return (state.tokenize = inComment)(stream, state);
|
50 |
-
else if (ch == ":") { readSym(stream); return "meta"; }
|
51 |
-
else return "error";
|
52 |
-
} else {
|
53 |
-
var name = readSym(stream);
|
54 |
-
if (name == ".") return null;
|
55 |
-
type = "symbol";
|
56 |
-
if (name == "nil" || name == "t" || name.charAt(0) == ":") return "atom";
|
57 |
-
if (state.lastType == "open" && (specialForm.test(name) || assumeBody.test(name))) return "keyword";
|
58 |
-
if (name.charAt(0) == "&") return "variable-2";
|
59 |
-
return "variable";
|
60 |
-
}
|
61 |
-
}
|
62 |
-
|
63 |
-
function inString(stream, state) {
|
64 |
-
var escaped = false, next;
|
65 |
-
while (next = stream.next()) {
|
66 |
-
if (next == '"' && !escaped) { state.tokenize = base; break; }
|
67 |
-
escaped = !escaped && next == "\\";
|
68 |
-
}
|
69 |
-
return "string";
|
70 |
-
}
|
71 |
-
|
72 |
-
function inComment(stream, state) {
|
73 |
-
var next, last;
|
74 |
-
while (next = stream.next()) {
|
75 |
-
if (next == "#" && last == "|") { state.tokenize = base; break; }
|
76 |
-
last = next;
|
77 |
-
}
|
78 |
-
type = "ws";
|
79 |
-
return "comment";
|
80 |
-
}
|
81 |
-
|
82 |
-
return {
|
83 |
-
startState: function () {
|
84 |
-
return {ctx: {prev: null, start: 0, indentTo: 0}, lastType: null, tokenize: base};
|
85 |
-
},
|
86 |
-
|
87 |
-
token: function (stream, state) {
|
88 |
-
if (stream.sol() && typeof state.ctx.indentTo != "number")
|
89 |
-
state.ctx.indentTo = state.ctx.start + 1;
|
90 |
-
|
91 |
-
type = null;
|
92 |
-
var style = state.tokenize(stream, state);
|
93 |
-
if (type != "ws") {
|
94 |
-
if (state.ctx.indentTo == null) {
|
95 |
-
if (type == "symbol" && assumeBody.test(stream.current()))
|
96 |
-
state.ctx.indentTo = state.ctx.start + config.indentUnit;
|
97 |
-
else
|
98 |
-
state.ctx.indentTo = "next";
|
99 |
-
} else if (state.ctx.indentTo == "next") {
|
100 |
-
state.ctx.indentTo = stream.column();
|
101 |
-
}
|
102 |
-
state.lastType = type;
|
103 |
-
}
|
104 |
-
if (type == "open") state.ctx = {prev: state.ctx, start: stream.column(), indentTo: null};
|
105 |
-
else if (type == "close") state.ctx = state.ctx.prev || state.ctx;
|
106 |
-
return style;
|
107 |
-
},
|
108 |
-
|
109 |
-
indent: function (state, _textAfter) {
|
110 |
-
var i = state.ctx.indentTo;
|
111 |
-
return typeof i == "number" ? i : state.ctx.start + 1;
|
112 |
-
},
|
113 |
-
|
114 |
-
closeBrackets: {pairs: "()[]{}\"\""},
|
115 |
-
lineComment: ";;",
|
116 |
-
blockCommentStart: "#|",
|
117 |
-
blockCommentEnd: "|#"
|
118 |
-
};
|
119 |
-
});
|
120 |
-
|
121 |
-
CodeMirror.defineMIME("text/x-common-lisp", "commonlisp");
|
122 |
-
|
123 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/commonlisp/index.html
DELETED
@@ -1,177 +0,0 @@
|
|
1 |
-
<!doctype html>
|
2 |
-
|
3 |
-
<title>CodeMirror: Common Lisp mode</title>
|
4 |
-
<meta charset="utf-8"/>
|
5 |
-
<link rel=stylesheet href="../../doc/docs.css">
|
6 |
-
|
7 |
-
<link rel="stylesheet" href="../../lib/codemirror.css">
|
8 |
-
<script src="../../lib/codemirror.js"></script>
|
9 |
-
<script src="commonlisp.js"></script>
|
10 |
-
<style>.CodeMirror {background: #f8f8f8;}</style>
|
11 |
-
<div id=nav>
|
12 |
-
<a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
13 |
-
|
14 |
-
<ul>
|
15 |
-
<li><a href="../../index.html">Home</a>
|
16 |
-
<li><a href="../../doc/manual.html">Manual</a>
|
17 |
-
<li><a href="https://github.com/codemirror/codemirror">Code</a>
|
18 |
-
</ul>
|
19 |
-
<ul>
|
20 |
-
<li><a href="../index.html">Language modes</a>
|
21 |
-
<li><a class=active href="#">Common Lisp</a>
|
22 |
-
</ul>
|
23 |
-
</div>
|
24 |
-
|
25 |
-
<article>
|
26 |
-
<h2>Common Lisp mode</h2>
|
27 |
-
<form><textarea id="code" name="code">(in-package :cl-postgres)
|
28 |
-
|
29 |
-
;; These are used to synthesize reader and writer names for integer
|
30 |
-
;; reading/writing functions when the amount of bytes and the
|
31 |
-
;; signedness is known. Both the macro that creates the functions and
|
32 |
-
;; some macros that use them create names this way.
|
33 |
-
(eval-when (:compile-toplevel :load-toplevel :execute)
|
34 |
-
(defun integer-reader-name (bytes signed)
|
35 |
-
(intern (with-standard-io-syntax
|
36 |
-
(format nil "~a~a~a~a" '#:read- (if signed "" '#:u) '#:int bytes))))
|
37 |
-
(defun integer-writer-name (bytes signed)
|
38 |
-
(intern (with-standard-io-syntax
|
39 |
-
(format nil "~a~a~a~a" '#:write- (if signed "" '#:u) '#:int bytes)))))
|
40 |
-
|
41 |
-
(defmacro integer-reader (bytes)
|
42 |
-
"Create a function to read integers from a binary stream."
|
43 |
-
(let ((bits (* bytes 8)))
|
44 |
-
(labels ((return-form (signed)
|
45 |
-
(if signed
|
46 |
-
`(if (logbitp ,(1- bits) result)
|
47 |
-
(dpb result (byte ,(1- bits) 0) -1)
|
48 |
-
result)
|
49 |
-
`result))
|
50 |
-
(generate-reader (signed)
|
51 |
-
`(defun ,(integer-reader-name bytes signed) (socket)
|
52 |
-
(declare (type stream socket)
|
53 |
-
#.*optimize*)
|
54 |
-
,(if (= bytes 1)
|
55 |
-
`(let ((result (the (unsigned-byte 8) (read-byte socket))))
|
56 |
-
(declare (type (unsigned-byte 8) result))
|
57 |
-
,(return-form signed))
|
58 |
-
`(let ((result 0))
|
59 |
-
(declare (type (unsigned-byte ,bits) result))
|
60 |
-
,@(loop :for byte :from (1- bytes) :downto 0
|
61 |
-
:collect `(setf (ldb (byte 8 ,(* 8 byte)) result)
|
62 |
-
(the (unsigned-byte 8) (read-byte socket))))
|
63 |
-
,(return-form signed))))))
|
64 |
-
`(progn
|
65 |
-
;; This causes weird errors on SBCL in some circumstances. Disabled for now.
|
66 |
-
;; (declaim (inline ,(integer-reader-name bytes t)
|
67 |
-
;; ,(integer-reader-name bytes nil)))
|
68 |
-
(declaim (ftype (function (t) (signed-byte ,bits))
|
69 |
-
,(integer-reader-name bytes t)))
|
70 |
-
,(generate-reader t)
|
71 |
-
(declaim (ftype (function (t) (unsigned-byte ,bits))
|
72 |
-
,(integer-reader-name bytes nil)))
|
73 |
-
,(generate-reader nil)))))
|
74 |
-
|
75 |
-
(defmacro integer-writer (bytes)
|
76 |
-
"Create a function to write integers to a binary stream."
|
77 |
-
(let ((bits (* 8 bytes)))
|
78 |
-
`(progn
|
79 |
-
(declaim (inline ,(integer-writer-name bytes t)
|
80 |
-
,(integer-writer-name bytes nil)))
|
81 |
-
(defun ,(integer-writer-name bytes nil) (socket value)
|
82 |
-
(declare (type stream socket)
|
83 |
-
(type (unsigned-byte ,bits) value)
|
84 |
-
#.*optimize*)
|
85 |
-
,@(if (= bytes 1)
|
86 |
-
`((write-byte value socket))
|
87 |
-
(loop :for byte :from (1- bytes) :downto 0
|
88 |
-
:collect `(write-byte (ldb (byte 8 ,(* byte 8)) value)
|
89 |
-
socket)))
|
90 |
-
(values))
|
91 |
-
(defun ,(integer-writer-name bytes t) (socket value)
|
92 |
-
(declare (type stream socket)
|
93 |
-
(type (signed-byte ,bits) value)
|
94 |
-
#.*optimize*)
|
95 |
-
,@(if (= bytes 1)
|
96 |
-
`((write-byte (ldb (byte 8 0) value) socket))
|
97 |
-
(loop :for byte :from (1- bytes) :downto 0
|
98 |
-
:collect `(write-byte (ldb (byte 8 ,(* byte 8)) value)
|
99 |
-
socket)))
|
100 |
-
(values)))))
|
101 |
-
|
102 |
-
;; All the instances of the above that we need.
|
103 |
-
|
104 |
-
(integer-reader 1)
|
105 |
-
(integer-reader 2)
|
106 |
-
(integer-reader 4)
|
107 |
-
(integer-reader 8)
|
108 |
-
|
109 |
-
(integer-writer 1)
|
110 |
-
(integer-writer 2)
|
111 |
-
(integer-writer 4)
|
112 |
-
|
113 |
-
(defun write-bytes (socket bytes)
|
114 |
-
"Write a byte-array to a stream."
|
115 |
-
(declare (type stream socket)
|
116 |
-
(type (simple-array (unsigned-byte 8)) bytes)
|
117 |
-
#.*optimize*)
|
118 |
-
(write-sequence bytes socket))
|
119 |
-
|
120 |
-
(defun write-str (socket string)
|
121 |
-
"Write a null-terminated string to a stream \(encoding it when UTF-8
|
122 |
-
support is enabled.)."
|
123 |
-
(declare (type stream socket)
|
124 |
-
(type string string)
|
125 |
-
#.*optimize*)
|
126 |
-
(enc-write-string string socket)
|
127 |
-
(write-uint1 socket 0))
|
128 |
-
|
129 |
-
(declaim (ftype (function (t unsigned-byte)
|
130 |
-
(simple-array (unsigned-byte 8) (*)))
|
131 |
-
read-bytes))
|
132 |
-
(defun read-bytes (socket length)
|
133 |
-
"Read a byte array of the given length from a stream."
|
134 |
-
(declare (type stream socket)
|
135 |
-
(type fixnum length)
|
136 |
-
#.*optimize*)
|
137 |
-
(let ((result (make-array length :element-type '(unsigned-byte 8))))
|
138 |
-
(read-sequence result socket)
|
139 |
-
result))
|
140 |
-
|
141 |
-
(declaim (ftype (function (t) string) read-str))
|
142 |
-
(defun read-str (socket)
|
143 |
-
"Read a null-terminated string from a stream. Takes care of encoding
|
144 |
-
when UTF-8 support is enabled."
|
145 |
-
(declare (type stream socket)
|
146 |
-
#.*optimize*)
|
147 |
-
(enc-read-string socket :null-terminated t))
|
148 |
-
|
149 |
-
(defun skip-bytes (socket length)
|
150 |
-
"Skip a given number of bytes in a binary stream."
|
151 |
-
(declare (type stream socket)
|
152 |
-
(type (unsigned-byte 32) length)
|
153 |
-
#.*optimize*)
|
154 |
-
(dotimes (i length)
|
155 |
-
(read-byte socket)))
|
156 |
-
|
157 |
-
(defun skip-str (socket)
|
158 |
-
"Skip a null-terminated string."
|
159 |
-
(declare (type stream socket)
|
160 |
-
#.*optimize*)
|
161 |
-
(loop :for char :of-type fixnum = (read-byte socket)
|
162 |
-
:until (zerop char)))
|
163 |
-
|
164 |
-
(defun ensure-socket-is-closed (socket &key abort)
|
165 |
-
(when (open-stream-p socket)
|
166 |
-
(handler-case
|
167 |
-
(close socket :abort abort)
|
168 |
-
(error (error)
|
169 |
-
(warn "Ignoring the error which happened while trying to close PostgreSQL socket: ~A" error)))))
|
170 |
-
</textarea></form>
|
171 |
-
<script>
|
172 |
-
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {lineNumbers: true});
|
173 |
-
</script>
|
174 |
-
|
175 |
-
<p><strong>MIME types defined:</strong> <code>text/x-common-lisp</code>.</p>
|
176 |
-
|
177 |
-
</article>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/cypher/cypher.js
DELETED
@@ -1,146 +0,0 @@
|
|
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 === "\"" || ch === "'") {
|
24 |
-
stream.match(/.+?["']/);
|
25 |
-
return "string";
|
26 |
-
}
|
27 |
-
if (/[{}\(\),\.;\[\]]/.test(ch)) {
|
28 |
-
curPunc = ch;
|
29 |
-
return "node";
|
30 |
-
} else if (ch === "/" && stream.eat("/")) {
|
31 |
-
stream.skipToEnd();
|
32 |
-
return "comment";
|
33 |
-
} else if (operatorChars.test(ch)) {
|
34 |
-
stream.eatWhile(operatorChars);
|
35 |
-
return null;
|
36 |
-
} else {
|
37 |
-
stream.eatWhile(/[_\w\d]/);
|
38 |
-
if (stream.eat(":")) {
|
39 |
-
stream.eatWhile(/[\w\d_\-]/);
|
40 |
-
return "atom";
|
41 |
-
}
|
42 |
-
var word = stream.current();
|
43 |
-
if (funcs.test(word)) return "builtin";
|
44 |
-
if (preds.test(word)) return "def";
|
45 |
-
if (keywords.test(word)) return "keyword";
|
46 |
-
return "variable";
|
47 |
-
}
|
48 |
-
};
|
49 |
-
var pushContext = function(state, type, col) {
|
50 |
-
return state.context = {
|
51 |
-
prev: state.context,
|
52 |
-
indent: state.indent,
|
53 |
-
col: col,
|
54 |
-
type: type
|
55 |
-
};
|
56 |
-
};
|
57 |
-
var popContext = function(state) {
|
58 |
-
state.indent = state.context.indent;
|
59 |
-
return state.context = state.context.prev;
|
60 |
-
};
|
61 |
-
var indentUnit = config.indentUnit;
|
62 |
-
var curPunc;
|
63 |
-
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"]);
|
64 |
-
var preds = wordRegexp(["all", "and", "any", "contains", "exists", "has", "in", "none", "not", "or", "single", "xor"]);
|
65 |
-
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"]);
|
66 |
-
var operatorChars = /[*+\-<>=&|~%^]/;
|
67 |
-
|
68 |
-
return {
|
69 |
-
startState: function(/*base*/) {
|
70 |
-
return {
|
71 |
-
tokenize: tokenBase,
|
72 |
-
context: null,
|
73 |
-
indent: 0,
|
74 |
-
col: 0
|
75 |
-
};
|
76 |
-
},
|
77 |
-
token: function(stream, state) {
|
78 |
-
if (stream.sol()) {
|
79 |
-
if (state.context && (state.context.align == null)) {
|
80 |
-
state.context.align = false;
|
81 |
-
}
|
82 |
-
state.indent = stream.indentation();
|
83 |
-
}
|
84 |
-
if (stream.eatSpace()) {
|
85 |
-
return null;
|
86 |
-
}
|
87 |
-
var style = state.tokenize(stream, state);
|
88 |
-
if (style !== "comment" && state.context && (state.context.align == null) && state.context.type !== "pattern") {
|
89 |
-
state.context.align = true;
|
90 |
-
}
|
91 |
-
if (curPunc === "(") {
|
92 |
-
pushContext(state, ")", stream.column());
|
93 |
-
} else if (curPunc === "[") {
|
94 |
-
pushContext(state, "]", stream.column());
|
95 |
-
} else if (curPunc === "{") {
|
96 |
-
pushContext(state, "}", stream.column());
|
97 |
-
} else if (/[\]\}\)]/.test(curPunc)) {
|
98 |
-
while (state.context && state.context.type === "pattern") {
|
99 |
-
popContext(state);
|
100 |
-
}
|
101 |
-
if (state.context && curPunc === state.context.type) {
|
102 |
-
popContext(state);
|
103 |
-
}
|
104 |
-
} else if (curPunc === "." && state.context && state.context.type === "pattern") {
|
105 |
-
popContext(state);
|
106 |
-
} else if (/atom|string|variable/.test(style) && state.context) {
|
107 |
-
if (/[\}\]]/.test(state.context.type)) {
|
108 |
-
pushContext(state, "pattern", stream.column());
|
109 |
-
} else if (state.context.type === "pattern" && !state.context.align) {
|
110 |
-
state.context.align = true;
|
111 |
-
state.context.col = stream.column();
|
112 |
-
}
|
113 |
-
}
|
114 |
-
return style;
|
115 |
-
},
|
116 |
-
indent: function(state, textAfter) {
|
117 |
-
var firstChar = textAfter && textAfter.charAt(0);
|
118 |
-
var context = state.context;
|
119 |
-
if (/[\]\}]/.test(firstChar)) {
|
120 |
-
while (context && context.type === "pattern") {
|
121 |
-
context = context.prev;
|
122 |
-
}
|
123 |
-
}
|
124 |
-
var closing = context && firstChar === context.type;
|
125 |
-
if (!context) return 0;
|
126 |
-
if (context.type === "keywords") return CodeMirror.commands.newlineAndIndent;
|
127 |
-
if (context.align) return context.col + (closing ? 0 : 1);
|
128 |
-
return context.indent + (closing ? 0 : indentUnit);
|
129 |
-
}
|
130 |
-
};
|
131 |
-
});
|
132 |
-
|
133 |
-
CodeMirror.modeExtensions["cypher"] = {
|
134 |
-
autoFormatLineBreaks: function(text) {
|
135 |
-
var i, lines, reProcessedPortion;
|
136 |
-
var lines = text.split("\n");
|
137 |
-
var reProcessedPortion = /\s+\b(return|where|order by|match|with|skip|limit|create|delete|set)\b\s/g;
|
138 |
-
for (var i = 0; i < lines.length; i++)
|
139 |
-
lines[i] = lines[i].replace(reProcessedPortion, " \n$1 ").trim();
|
140 |
-
return lines.join("\n");
|
141 |
-
}
|
142 |
-
};
|
143 |
-
|
144 |
-
CodeMirror.defineMIME("application/x-cypher-query", "cypher");
|
145 |
-
|
146 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/cypher/index.html
DELETED
@@ -1,63 +0,0 @@
|
|
1 |
-
<!doctype html>
|
2 |
-
|
3 |
-
<title>CodeMirror: Cypher Mode for CodeMirror</title>
|
4 |
-
<meta charset="utf-8"/>
|
5 |
-
<link rel=stylesheet href="../../doc/docs.css">
|
6 |
-
|
7 |
-
<link rel="stylesheet" href="../../lib/codemirror.css" />
|
8 |
-
<link rel="stylesheet" href="../../theme/neo.css" />
|
9 |
-
<script src="../../lib/codemirror.js"></script>
|
10 |
-
<script src="cypher.js"></script>
|
11 |
-
<style>
|
12 |
-
.CodeMirror {
|
13 |
-
border-top: 1px solid black;
|
14 |
-
border-bottom: 1px solid black;
|
15 |
-
}
|
16 |
-
</style>
|
17 |
-
<div id=nav>
|
18 |
-
<a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
19 |
-
|
20 |
-
<ul>
|
21 |
-
<li><a href="../../index.html">Home</a>
|
22 |
-
<li><a href="../../doc/manual.html">Manual</a>
|
23 |
-
<li><a href="https://github.com/codemirror/codemirror">Code</a>
|
24 |
-
</ul>
|
25 |
-
<ul>
|
26 |
-
<li><a href="../index.html">Language modes</a>
|
27 |
-
<li><a class=active href="#">Cypher Mode for CodeMirror</a>
|
28 |
-
</ul>
|
29 |
-
</div>
|
30 |
-
|
31 |
-
<article>
|
32 |
-
<h2>Cypher Mode for CodeMirror</h2>
|
33 |
-
<form>
|
34 |
-
<textarea id="code" name="code">// Cypher Mode for CodeMirror, using the neo theme
|
35 |
-
MATCH (joe { name: 'Joe' })-[:knows*2..2]-(friend_of_friend)
|
36 |
-
WHERE NOT (joe)-[:knows]-(friend_of_friend)
|
37 |
-
RETURN friend_of_friend.name, COUNT(*)
|
38 |
-
ORDER BY COUNT(*) DESC , friend_of_friend.name
|
39 |
-
</textarea>
|
40 |
-
</form>
|
41 |
-
<p><strong>MIME types defined:</strong>
|
42 |
-
<code><a href="?mime=application/x-cypher-query">application/x-cypher-query</a></code>
|
43 |
-
</p>
|
44 |
-
<script>
|
45 |
-
window.onload = function() {
|
46 |
-
var mime = 'application/x-cypher-query';
|
47 |
-
// get mime type
|
48 |
-
if (window.location.href.indexOf('mime=') > -1) {
|
49 |
-
mime = window.location.href.substr(window.location.href.indexOf('mime=') + 5);
|
50 |
-
}
|
51 |
-
window.editor = CodeMirror.fromTextArea(document.getElementById('code'), {
|
52 |
-
mode: mime,
|
53 |
-
indentWithTabs: true,
|
54 |
-
smartIndent: true,
|
55 |
-
lineNumbers: true,
|
56 |
-
matchBrackets : true,
|
57 |
-
autofocus: true,
|
58 |
-
theme: 'neo'
|
59 |
-
});
|
60 |
-
};
|
61 |
-
</script>
|
62 |
-
|
63 |
-
</article>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/d/d.js
DELETED
@@ -1,218 +0,0 @@
|
|
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 = tokenComment;
|
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 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/d/index.html
DELETED
@@ -1,273 +0,0 @@
|
|
1 |
-
<!doctype html>
|
2 |
-
|
3 |
-
<title>CodeMirror: D mode</title>
|
4 |
-
<meta charset="utf-8"/>
|
5 |
-
<link rel=stylesheet href="../../doc/docs.css">
|
6 |
-
|
7 |
-
<link rel="stylesheet" href="../../lib/codemirror.css">
|
8 |
-
<script src="../../lib/codemirror.js"></script>
|
9 |
-
<script src="../../addon/edit/matchbrackets.js"></script>
|
10 |
-
<script src="d.js"></script>
|
11 |
-
<style>.CodeMirror {border: 2px inset #dee;}</style>
|
12 |
-
<div id=nav>
|
13 |
-
<a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
14 |
-
|
15 |
-
<ul>
|
16 |
-
<li><a href="../../index.html">Home</a>
|
17 |
-
<li><a href="../../doc/manual.html">Manual</a>
|
18 |
-
<li><a href="https://github.com/codemirror/codemirror">Code</a>
|
19 |
-
</ul>
|
20 |
-
<ul>
|
21 |
-
<li><a href="../index.html">Language modes</a>
|
22 |
-
<li><a class=active href="#">D</a>
|
23 |
-
</ul>
|
24 |
-
</div>
|
25 |
-
|
26 |
-
<article>
|
27 |
-
<h2>D mode</h2>
|
28 |
-
<form><textarea id="code" name="code">
|
29 |
-
/* D demo code // copied from phobos/sd/metastrings.d */
|
30 |
-
// Written in the D programming language.
|
31 |
-
|
32 |
-
/**
|
33 |
-
Templates with which to do compile-time manipulation of strings.
|
34 |
-
|
35 |
-
Macros:
|
36 |
-
WIKI = Phobos/StdMetastrings
|
37 |
-
|
38 |
-
Copyright: Copyright Digital Mars 2007 - 2009.
|
39 |
-
License: <a href="http://www.boost.org/LICENSE_1_0.txt">Boost License 1.0</a>.
|
40 |
-
Authors: $(WEB digitalmars.com, Walter Bright),
|
41 |
-
Don Clugston
|
42 |
-
Source: $(PHOBOSSRC std/_metastrings.d)
|
43 |
-
*/
|
44 |
-
/*
|
45 |
-
Copyright Digital Mars 2007 - 2009.
|
46 |
-
Distributed under the Boost Software License, Version 1.0.
|
47 |
-
(See accompanying file LICENSE_1_0.txt or copy at
|
48 |
-
http://www.boost.org/LICENSE_1_0.txt)
|
49 |
-
*/
|
50 |
-
module std.metastrings;
|
51 |
-
|
52 |
-
/**
|
53 |
-
Formats constants into a string at compile time. Analogous to $(XREF
|
54 |
-
string,format).
|
55 |
-
|
56 |
-
Parameters:
|
57 |
-
|
58 |
-
A = tuple of constants, which can be strings, characters, or integral
|
59 |
-
values.
|
60 |
-
|
61 |
-
Formats:
|
62 |
-
* The formats supported are %s for strings, and %%
|
63 |
-
* for the % character.
|
64 |
-
Example:
|
65 |
-
---
|
66 |
-
import std.metastrings;
|
67 |
-
import std.stdio;
|
68 |
-
|
69 |
-
void main()
|
70 |
-
{
|
71 |
-
string s = Format!("Arg %s = %s", "foo", 27);
|
72 |
-
writefln(s); // "Arg foo = 27"
|
73 |
-
}
|
74 |
-
* ---
|
75 |
-
*/
|
76 |
-
|
77 |
-
template Format(A...)
|
78 |
-
{
|
79 |
-
static if (A.length == 0)
|
80 |
-
enum Format = "";
|
81 |
-
else static if (is(typeof(A[0]) : const(char)[]))
|
82 |
-
enum Format = FormatString!(A[0], A[1..$]);
|
83 |
-
else
|
84 |
-
enum Format = toStringNow!(A[0]) ~ Format!(A[1..$]);
|
85 |
-
}
|
86 |
-
|
87 |
-
template FormatString(const(char)[] F, A...)
|
88 |
-
{
|
89 |
-
static if (F.length == 0)
|
90 |
-
enum FormatString = Format!(A);
|
91 |
-
else static if (F.length == 1)
|
92 |
-
enum FormatString = F[0] ~ Format!(A);
|
93 |
-
else static if (F[0..2] == "%s")
|
94 |
-
enum FormatString
|
95 |
-
= toStringNow!(A[0]) ~ FormatString!(F[2..$],A[1..$]);
|
96 |
-
else static if (F[0..2] == "%%")
|
97 |
-
enum FormatString = "%" ~ FormatString!(F[2..$],A);
|
98 |
-
else
|
99 |
-
{
|
100 |
-
static assert(F[0] != '%', "unrecognized format %" ~ F[1]);
|
101 |
-
enum FormatString = F[0] ~ FormatString!(F[1..$],A);
|
102 |
-
}
|
103 |
-
}
|
104 |
-
|
105 |
-
unittest
|
106 |
-
{
|
107 |
-
auto s = Format!("hel%slo", "world", -138, 'c', true);
|
108 |
-
assert(s == "helworldlo-138ctrue", "[" ~ s ~ "]");
|
109 |
-
}
|
110 |
-
|
111 |
-
/**
|
112 |
-
* Convert constant argument to a string.
|
113 |
-
*/
|
114 |
-
|
115 |
-
template toStringNow(ulong v)
|
116 |
-
{
|
117 |
-
static if (v < 10)
|
118 |
-
enum toStringNow = "" ~ cast(char)(v + '0');
|
119 |
-
else
|
120 |
-
enum toStringNow = toStringNow!(v / 10) ~ toStringNow!(v % 10);
|
121 |
-
}
|
122 |
-
|
123 |
-
unittest
|
124 |
-
{
|
125 |
-
static assert(toStringNow!(1uL << 62) == "4611686018427387904");
|
126 |
-
}
|
127 |
-
|
128 |
-
/// ditto
|
129 |
-
template toStringNow(long v)
|
130 |
-
{
|
131 |
-
static if (v < 0)
|
132 |
-
enum toStringNow = "-" ~ toStringNow!(cast(ulong) -v);
|
133 |
-
else
|
134 |
-
enum toStringNow = toStringNow!(cast(ulong) v);
|
135 |
-
}
|
136 |
-
|
137 |
-
unittest
|
138 |
-
{
|
139 |
-
static assert(toStringNow!(0x100000000) == "4294967296");
|
140 |
-
static assert(toStringNow!(-138L) == "-138");
|
141 |
-
}
|
142 |
-
|
143 |
-
/// ditto
|
144 |
-
template toStringNow(uint U)
|
145 |
-
{
|
146 |
-
enum toStringNow = toStringNow!(cast(ulong)U);
|
147 |
-
}
|
148 |
-
|
149 |
-
/// ditto
|
150 |
-
template toStringNow(int I)
|
151 |
-
{
|
152 |
-
enum toStringNow = toStringNow!(cast(long)I);
|
153 |
-
}
|
154 |
-
|
155 |
-
/// ditto
|
156 |
-
template toStringNow(bool B)
|
157 |
-
{
|
158 |
-
enum toStringNow = B ? "true" : "false";
|
159 |
-
}
|
160 |
-
|
161 |
-
/// ditto
|
162 |
-
template toStringNow(string S)
|
163 |
-
{
|
164 |
-
enum toStringNow = S;
|
165 |
-
}
|
166 |
-
|
167 |
-
/// ditto
|
168 |
-
template toStringNow(char C)
|
169 |
-
{
|
170 |
-
enum toStringNow = "" ~ C;
|
171 |
-
}
|
172 |
-
|
173 |
-
|
174 |
-
/********
|
175 |
-
* Parse unsigned integer literal from the start of string s.
|
176 |
-
* returns:
|
177 |
-
* .value = the integer literal as a string,
|
178 |
-
* .rest = the string following the integer literal
|
179 |
-
* Otherwise:
|
180 |
-
* .value = null,
|
181 |
-
* .rest = s
|
182 |
-
*/
|
183 |
-
|
184 |
-
template parseUinteger(const(char)[] s)
|
185 |
-
{
|
186 |
-
static if (s.length == 0)
|
187 |
-
{
|
188 |
-
enum value = "";
|
189 |
-
enum rest = "";
|
190 |
-
}
|
191 |
-
else static if (s[0] >= '0' && s[0] <= '9')
|
192 |
-
{
|
193 |
-
enum value = s[0] ~ parseUinteger!(s[1..$]).value;
|
194 |
-
enum rest = parseUinteger!(s[1..$]).rest;
|
195 |
-
}
|
196 |
-
else
|
197 |
-
{
|
198 |
-
enum value = "";
|
199 |
-
enum rest = s;
|
200 |
-
}
|
201 |
-
}
|
202 |
-
|
203 |
-
/********
|
204 |
-
Parse integer literal optionally preceded by $(D '-') from the start
|
205 |
-
of string $(D s).
|
206 |
-
|
207 |
-
Returns:
|
208 |
-
.value = the integer literal as a string,
|
209 |
-
.rest = the string following the integer literal
|
210 |
-
|
211 |
-
Otherwise:
|
212 |
-
.value = null,
|
213 |
-
.rest = s
|
214 |
-
*/
|
215 |
-
|
216 |
-
template parseInteger(const(char)[] s)
|
217 |
-
{
|
218 |
-
static if (s.length == 0)
|
219 |
-
{
|
220 |
-
enum value = "";
|
221 |
-
enum rest = "";
|
222 |
-
}
|
223 |
-
else static if (s[0] >= '0' && s[0] <= '9')
|
224 |
-
{
|
225 |
-
enum value = s[0] ~ parseUinteger!(s[1..$]).value;
|
226 |
-
enum rest = parseUinteger!(s[1..$]).rest;
|
227 |
-
}
|
228 |
-
else static if (s.length >= 2 &&
|
229 |
-
s[0] == '-' && s[1] >= '0' && s[1] <= '9')
|
230 |
-
{
|
231 |
-
enum value = s[0..2] ~ parseUinteger!(s[2..$]).value;
|
232 |
-
enum rest = parseUinteger!(s[2..$]).rest;
|
233 |
-
}
|
234 |
-
else
|
235 |
-
{
|
236 |
-
enum value = "";
|
237 |
-
enum rest = s;
|
238 |
-
}
|
239 |
-
}
|
240 |
-
|
241 |
-
unittest
|
242 |
-
{
|
243 |
-
assert(parseUinteger!("1234abc").value == "1234");
|
244 |
-
assert(parseUinteger!("1234abc").rest == "abc");
|
245 |
-
assert(parseInteger!("-1234abc").value == "-1234");
|
246 |
-
assert(parseInteger!("-1234abc").rest == "abc");
|
247 |
-
}
|
248 |
-
|
249 |
-
/**
|
250 |
-
Deprecated aliases held for backward compatibility.
|
251 |
-
*/
|
252 |
-
deprecated alias toStringNow ToString;
|
253 |
-
/// Ditto
|
254 |
-
deprecated alias parseUinteger ParseUinteger;
|
255 |
-
/// Ditto
|
256 |
-
deprecated alias parseUinteger ParseInteger;
|
257 |
-
|
258 |
-
</textarea></form>
|
259 |
-
|
260 |
-
<script>
|
261 |
-
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
|
262 |
-
lineNumbers: true,
|
263 |
-
matchBrackets: true,
|
264 |
-
indentUnit: 4,
|
265 |
-
mode: "text/x-d"
|
266 |
-
});
|
267 |
-
</script>
|
268 |
-
|
269 |
-
<p>Simple mode that handle D-Syntax (<a href="http://www.dlang.org">DLang Homepage</a>).</p>
|
270 |
-
|
271 |
-
<p><strong>MIME types defined:</strong> <code>text/x-d</code>
|
272 |
-
.</p>
|
273 |
-
</article>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
assets/js/vendor/codemirror/mode/dart/dart.js
DELETED
@@ -1,130 +0,0 @@
|
|
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 " +
|
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 |
-
});
|
78 |
-
|
79 |
-
function tokenString(quote, stream, state, raw) {
|
80 |
-
var tripleQuoted = false;
|
81 |
-
if (stream.eat(quote)) {
|
82 |
-
if (stream.eat(quote)) tripleQuoted = true;
|
83 |
-
else return "string"; //empty string
|
84 |
-
}
|
85 |
-
function tokenStringHelper(stream, state) {
|
86 |
-
var escaped = false;
|
87 |
-
while (!stream.eol()) {
|
88 |
-
if (!raw && !escaped && stream.peek() == "$") {
|
89 |
-
pushInterpolationStack(state);
|
90 |
-
state.tokenize = tokenInterpolation;
|
91 |
-
return "string";
|
92 |
-
}
|
93 |
-
var next = stream.next();
|
94 |
-
if (next == quote && !escaped && (!tripleQuoted || stream.match(quote + quote))) {
|
95 |
-
state.tokenize = null;
|
96 |
-
break;
|
97 |
-
}
|
98 |
-
escaped = !raw && !escaped && next == "\\";
|
99 |
-
}
|
100 |
-
return "string";
|
101 |
-
}
|
102 |
-
state.tokenize = tokenStringHelper;
|
103 |
-
return tokenStringHelper(stream, state);
|
104 |
-
}
|
105 |
-
|
106 |
-
function tokenInterpolation(stream, state) {
|
107 |
-
stream.eat("$");
|
108 |
-
if (stream.eat("{")) {
|
109 |
-
// let clike handle the content of ${...},
|
110 |
-
// we take over again when "}" appears (see hooks).
|
111 |
-
state.tokenize = null;
|
112 |
-
} else {
|
113 |
-
state.tokenize = tokenInterpolationIdentifier;
|
114 |
-
}
|
115 |
-
return null;
|
116 |
-
}
|
117 |
-
|
118 |
-
function tokenInterpolationIdentifier(stream, state) {
|
119 |
-
stream.eatWhile(/[\w_]/);
|
120 |
-
state.tokenize = popInterpolationStack(state);
|
121 |
-
return "variable";
|
122 |
-
}
|
123 |
-
|
124 |
-
CodeMirror.registerHelper("hintWords", "application/dart", keywords.concat(atoms).concat(builtins));
|
125 |
-
|
126 |
-
// This is needed to make loading through meta.js work.
|
127 |
-
CodeMirror.defineMode("dart", function(conf) {
|
128 |
-
return CodeMirror.getMode(conf, "application/dart");
|
129 |
-
}, "clike");
|
130 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/dart/index.html
DELETED
@@ -1,71 +0,0 @@
|
|
1 |
-
<!doctype html>
|
2 |
-
|
3 |
-
<title>CodeMirror: Dart mode</title>
|
4 |
-
<meta charset="utf-8"/>
|
5 |
-
<link rel=stylesheet href="../../doc/docs.css">
|
6 |
-
<link rel="stylesheet" href="../../lib/codemirror.css">
|
7 |
-
<script src="../../lib/codemirror.js"></script>
|
8 |
-
<script src="../clike/clike.js"></script>
|
9 |
-
<script src="dart.js"></script>
|
10 |
-
<style>.CodeMirror {border: 1px solid #dee;}</style>
|
11 |
-
<div id=nav>
|
12 |
-
<a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
13 |
-
|
14 |
-
<ul>
|
15 |
-
<li><a href="../../index.html">Home</a>
|
16 |
-
<li><a href="../../doc/manual.html">Manual</a>
|
17 |
-
<li><a href="https://github.com/codemirror/codemirror">Code</a>
|
18 |
-
</ul>
|
19 |
-
<ul>
|
20 |
-
<li><a href="../index.html">Language modes</a>
|
21 |
-
<li><a class=active href="#">Dart</a>
|
22 |
-
</ul>
|
23 |
-
</div>
|
24 |
-
|
25 |
-
<article>
|
26 |
-
<h2>Dart mode</h2>
|
27 |
-
<form>
|
28 |
-
<textarea id="code" name="code">
|
29 |
-
import 'dart:math' show Random;
|
30 |
-
|
31 |
-
void main() {
|
32 |
-
print(new Die(n: 12).roll());
|
33 |
-
}
|
34 |
-
|
35 |
-
// Define a class.
|
36 |
-
class Die {
|
37 |
-
// Define a class variable.
|
38 |
-
static Random shaker = new Random();
|
39 |
-
|
40 |
-
// Define instance variables.
|
41 |
-
int sides, value;
|
42 |
-
|
43 |
-
// Define a method using shorthand syntax.
|
44 |
-
String toString() => '$value';
|
45 |
-
|
46 |
-
// Define a constructor.
|
47 |
-
Die({int n: 6}) {
|
48 |
-
if (4 <= n && n <= 20) {
|
49 |
-
sides = n;
|
50 |
-
} else {
|
51 |
-
// Support for errors and exceptions.
|
52 |
-
throw new ArgumentError(/* */);
|
53 |
-
}
|
54 |
-
}
|
55 |
-
|
56 |
-
// Define an instance method.
|
57 |
-
int roll() {
|
58 |
-
return value = shaker.nextInt(sides) + 1;
|
59 |
-
}
|
60 |
-
}
|
61 |
-
</textarea>
|
62 |
-
</form>
|
63 |
-
|
64 |
-
<script>
|
65 |
-
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
|
66 |
-
lineNumbers: true,
|
67 |
-
mode: "application/dart"
|
68 |
-
});
|
69 |
-
</script>
|
70 |
-
|
71 |
-
</article>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/diff/diff.js
DELETED
@@ -1,47 +0,0 @@
|
|
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("diff", function() {
|
15 |
-
|
16 |
-
var TOKEN_NAMES = {
|
17 |
-
'+': 'positive',
|
18 |
-
'-': 'negative',
|
19 |
-
'@': 'meta'
|
20 |
-
};
|
21 |
-
|
22 |
-
return {
|
23 |
-
token: function(stream) {
|
24 |
-
var tw_pos = stream.string.search(/[\t ]+?$/);
|
25 |
-
|
26 |
-
if (!stream.sol() || tw_pos === 0) {
|
27 |
-
stream.skipToEnd();
|
28 |
-
return ("error " + (
|
29 |
-
TOKEN_NAMES[stream.string.charAt(0)] || '')).replace(/ $/, '');
|
30 |
-
}
|
31 |
-
|
32 |
-
var token_name = TOKEN_NAMES[stream.peek()] || stream.skipToEnd();
|
33 |
-
|
34 |
-
if (tw_pos === -1) {
|
35 |
-
stream.skipToEnd();
|
36 |
-
} else {
|
37 |
-
stream.pos = tw_pos;
|
38 |
-
}
|
39 |
-
|
40 |
-
return token_name;
|
41 |
-
}
|
42 |
-
};
|
43 |
-
});
|
44 |
-
|
45 |
-
CodeMirror.defineMIME("text/x-diff", "diff");
|
46 |
-
|
47 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/diff/index.html
DELETED
@@ -1,117 +0,0 @@
|
|
1 |
-
<!doctype html>
|
2 |
-
|
3 |
-
<title>CodeMirror: Diff mode</title>
|
4 |
-
<meta charset="utf-8"/>
|
5 |
-
<link rel=stylesheet href="../../doc/docs.css">
|
6 |
-
|
7 |
-
<link rel="stylesheet" href="../../lib/codemirror.css">
|
8 |
-
<script src="../../lib/codemirror.js"></script>
|
9 |
-
<script src="diff.js"></script>
|
10 |
-
<style>
|
11 |
-
.CodeMirror {border-top: 1px solid #ddd; border-bottom: 1px solid #ddd;}
|
12 |
-
span.cm-meta {color: #a0b !important;}
|
13 |
-
span.cm-error { background-color: black; opacity: 0.4;}
|
14 |
-
span.cm-error.cm-string { background-color: red; }
|
15 |
-
span.cm-error.cm-tag { background-color: #2b2; }
|
16 |
-
</style>
|
17 |
-
<div id=nav>
|
18 |
-
<a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
19 |
-
|
20 |
-
<ul>
|
21 |
-
<li><a href="../../index.html">Home</a>
|
22 |
-
<li><a href="../../doc/manual.html">Manual</a>
|
23 |
-
<li><a href="https://github.com/codemirror/codemirror">Code</a>
|
24 |
-
</ul>
|
25 |
-
<ul>
|
26 |
-
<li><a href="../index.html">Language modes</a>
|
27 |
-
<li><a class=active href="#">Diff</a>
|
28 |
-
</ul>
|
29 |
-
</div>
|
30 |
-
|
31 |
-
<article>
|
32 |
-
<h2>Diff mode</h2>
|
33 |
-
<form><textarea id="code" name="code">
|
34 |
-
diff --git a/index.html b/index.html
|
35 |
-
index c1d9156..7764744 100644
|
36 |
-
--- a/index.html
|
37 |
-
+++ b/index.html
|
38 |
-
@@ -95,7 +95,8 @@ StringStream.prototype = {
|
39 |
-
<script>
|
40 |
-
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
|
41 |
-
lineNumbers: true,
|
42 |
-
- autoMatchBrackets: true
|
43 |
-
+ autoMatchBrackets: true,
|
44 |
-
+ onGutterClick: function(x){console.log(x);}
|
45 |
-
});
|
46 |
-
</script>
|
47 |
-
</body>
|
48 |
-
diff --git a/lib/codemirror.js b/lib/codemirror.js
|
49 |
-
index 04646a9..9a39cc7 100644
|
50 |
-
--- a/lib/codemirror.js
|
51 |
-
+++ b/lib/codemirror.js
|
52 |
-
@@ -399,10 +399,16 @@ var CodeMirror = (function() {
|
53 |
-
}
|
54 |
-
|
55 |
-
function onMouseDown(e) {
|
56 |
-
- var start = posFromMouse(e), last = start;
|
57 |
-
+ var start = posFromMouse(e), last = start, target = e.target();
|
58 |
-
if (!start) return;
|
59 |
-
setCursor(start.line, start.ch, false);
|
60 |
-
if (e.button() != 1) return;
|
61 |
-
+ if (target.parentNode == gutter) {
|
62 |
-
+ if (options.onGutterClick)
|
63 |
-
+ options.onGutterClick(indexOf(gutter.childNodes, target) + showingFrom);
|
64 |
-
+ return;
|
65 |
-
+ }
|
66 |
-
+
|
67 |
-
if (!focused) onFocus();
|
68 |
-
|
69 |
-
e.stop();
|
70 |
-
@@ -808,7 +814,7 @@ var CodeMirror = (function() {
|
71 |
-
for (var i = showingFrom; i < showingTo; ++i) {
|
72 |
-
var marker = lines[i].gutterMarker;
|
73 |
-
if (marker) html.push('<div class="' + marker.style + '">' + htmlEscape(marker.text) + '</div>');
|
74 |
-
- else html.push("<div>" + (options.lineNumbers ? i + 1 : "\u00a0") + "</div>");
|
75 |
-
+ else html.push("<div>" + (options.lineNumbers ? i + options.firstLineNumber : "\u00a0") + "</div>");
|
76 |
-
}
|
77 |
-
gutter.style.display = "none"; // TODO test whether this actually helps
|
78 |
-
gutter.innerHTML = html.join("");
|
79 |
-
@@ -1371,10 +1377,8 @@ var CodeMirror = (function() {
|
80 |
-
if (option == "parser") setParser(value);
|
81 |
-
else if (option === "lineNumbers") setLineNumbers(value);
|
82 |
-
else if (option === "gutter") setGutter(value);
|
83 |
-
- else if (option === "readOnly") options.readOnly = value;
|
84 |
-
- else if (option === "indentUnit") {options.indentUnit = indentUnit = value; setParser(options.parser);}
|
85 |
-
- else if (/^(?:enterMode|tabMode|indentWithTabs|readOnly|autoMatchBrackets|undoDepth)$/.test(option)) options[option] = value;
|
86 |
-
- else throw new Error("Can't set option " + option);
|
87 |
-
+ else if (option === "indentUnit") {options.indentUnit = value; setParser(options.parser);}
|
88 |
-
+ else options[option] = value;
|
89 |
-
},
|
90 |
-
cursorCoords: cursorCoords,
|
91 |
-
undo: operation(undo),
|
92 |
-
@@ -1402,7 +1406,8 @@ var CodeMirror = (function() {
|
93 |
-
replaceRange: operation(replaceRange),
|
94 |
-
|
95 |
-
operation: function(f){return operation(f)();},
|
96 |
-
- refresh: function(){updateDisplay([{from: 0, to: lines.length}]);}
|
97 |
-
+ refresh: function(){updateDisplay([{from: 0, to: lines.length}]);},
|
98 |
-
+ getInputField: function(){return input;}
|
99 |
-
};
|
100 |
-
return instance;
|
101 |
-
}
|
102 |
-
@@ -1420,6 +1425,7 @@ var CodeMirror = (function() {
|
103 |
-
readOnly: false,
|
104 |
-
onChange: null,
|
105 |
-
onCursorActivity: null,
|
106 |
-
+ onGutterClick: null,
|
107 |
-
autoMatchBrackets: false,
|
108 |
-
workTime: 200,
|
109 |
-
workDelay: 300,
|
110 |
-
</textarea></form>
|
111 |
-
<script>
|
112 |
-
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {});
|
113 |
-
</script>
|
114 |
-
|
115 |
-
<p><strong>MIME types defined:</strong> <code>text/x-diff</code>.</p>
|
116 |
-
|
117 |
-
</article>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/django/django.js
DELETED
@@ -1,350 +0,0 @@
|
|
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("../htmlmixed/htmlmixed"),
|
7 |
-
require("../../addon/mode/overlay"));
|
8 |
-
else if (typeof define == "function" && define.amd) // AMD
|
9 |
-
define(["../../lib/codemirror", "../htmlmixed/htmlmixed",
|
10 |
-
"../../addon/mode/overlay"], mod);
|
11 |
-
else // Plain browser env
|
12 |
-
mod(CodeMirror);
|
13 |
-
})(function(CodeMirror) {
|
14 |
-
"use strict";
|
15 |
-
|
16 |
-
CodeMirror.defineMode("django:inner", function() {
|
17 |
-
var keywords = ["block", "endblock", "for", "endfor", "true", "false", "filter", "endfilter",
|
18 |
-
"loop", "none", "self", "super", "if", "elif", "endif", "as", "else", "import",
|
19 |
-
"with", "endwith", "without", "context", "ifequal", "endifequal", "ifnotequal",
|
20 |
-
"endifnotequal", "extends", "include", "load", "comment", "endcomment",
|
21 |
-
"empty", "url", "static", "trans", "blocktrans", "endblocktrans", "now",
|
22 |
-
"regroup", "lorem", "ifchanged", "endifchanged", "firstof", "debug", "cycle",
|
23 |
-
"csrf_token", "autoescape", "endautoescape", "spaceless", "endspaceless",
|
24 |
-
"ssi", "templatetag", "verbatim", "endverbatim", "widthratio"],
|
25 |
-
filters = ["add", "addslashes", "capfirst", "center", "cut", "date",
|
26 |
-
"default", "default_if_none", "dictsort",
|
27 |
-
"dictsortreversed", "divisibleby", "escape", "escapejs",
|
28 |
-
"filesizeformat", "first", "floatformat", "force_escape",
|
29 |
-
"get_digit", "iriencode", "join", "last", "length",
|
30 |
-
"length_is", "linebreaks", "linebreaksbr", "linenumbers",
|
31 |
-
"ljust", "lower", "make_list", "phone2numeric", "pluralize",
|
32 |
-
"pprint", "random", "removetags", "rjust", "safe",
|
33 |
-
"safeseq", "slice", "slugify", "stringformat", "striptags",
|
34 |
-
"time", "timesince", "timeuntil", "title", "truncatechars",
|
35 |
-
"truncatechars_html", "truncatewords", "truncatewords_html",
|
36 |
-
"unordered_list", "upper", "urlencode", "urlize",
|
37 |
-
"urlizetrunc", "wordcount", "wordwrap", "yesno"],
|
38 |
-
operators = ["==", "!=", "<", ">", "<=", ">=", "in", "not", "or", "and"];
|
39 |
-
|
40 |
-
keywords = new RegExp("^\\b(" + keywords.join("|") + ")\\b");
|
41 |
-
filters = new RegExp("^\\b(" + filters.join("|") + ")\\b");
|
42 |
-
operators = new RegExp("^\\b(" + operators.join("|") + ")\\b");
|
43 |
-
|
44 |
-
// We have to return "null" instead of null, in order to avoid string
|
45 |
-
// styling as the default, when using Django templates inside HTML
|
46 |
-
// element attributes
|
47 |
-
function tokenBase (stream, state) {
|
48 |
-
// Attempt to identify a variable, template or comment tag respectively
|
49 |
-
if (stream.match("{{")) {
|
50 |
-
state.tokenize = inVariable;
|
51 |
-
return "tag";
|
52 |
-
} else if (stream.match("{%")) {
|
53 |
-
state.tokenize = inTag;
|
54 |
-
return "tag";
|
55 |
-
} else if (stream.match("{#")) {
|
56 |
-
state.tokenize = inComment;
|
57 |
-
return "comment";
|
58 |
-
}
|
59 |
-
|
60 |
-
// Ignore completely any stream series that do not match the
|
61 |
-
// Django template opening tags.
|
62 |
-
while (stream.next() != null && !stream.match("{{", false) && !stream.match("{%", false)) {}
|
63 |
-
return null;
|
64 |
-
}
|
65 |
-
|
66 |
-
// A string can be included in either single or double quotes (this is
|
67 |
-
// the delimeter). Mark everything as a string until the start delimeter
|
68 |
-
// occurs again.
|
69 |
-
function inString (delimeter, previousTokenizer) {
|
70 |
-
return function (stream, state) {
|
71 |
-
if (!state.escapeNext && stream.eat(delimeter)) {
|
72 |
-
state.tokenize = previousTokenizer;
|
73 |
-
} else {
|
74 |
-
if (state.escapeNext) {
|
75 |
-
state.escapeNext = false;
|
76 |
-
}
|
77 |
-
|
78 |
-
var ch = stream.next();
|
79 |
-
|
80 |
-
// Take into account the backslash for escaping characters, such as
|
81 |
-
// the string delimeter.
|
82 |
-
if (ch == "\\") {
|
83 |
-
state.escapeNext = true;
|
84 |
-
}
|
85 |
-
}
|
86 |
-
|
87 |
-
return "string";
|
88 |
-
};
|
89 |
-
}
|
90 |
-
|
91 |
-
// Apply Django template variable syntax highlighting
|
92 |
-
function inVariable (stream, state) {
|
93 |
-
// Attempt to match a dot that precedes a property
|
94 |
-
if (state.waitDot) {
|
95 |
-
state.waitDot = false;
|
96 |
-
|
97 |
-
if (stream.peek() != ".") {
|
98 |
-
return "null";
|
99 |
-
}
|
100 |
-
|
101 |
-
// Dot folowed by a non-word character should be considered an error.
|
102 |
-
if (stream.match(/\.\W+/)) {
|
103 |
-
return "error";
|
104 |
-
} else if (stream.eat(".")) {
|
105 |
-
state.waitProperty = true;
|
106 |
-
return "null";
|
107 |
-
} else {
|
108 |
-
throw Error ("Unexpected error while waiting for property.");
|
109 |
-
}
|
110 |
-
}
|
111 |
-
|
112 |
-
// Attempt to match a pipe that precedes a filter
|
113 |
-
if (state.waitPipe) {
|
114 |
-
state.waitPipe = false;
|
115 |
-
|
116 |
-
if (stream.peek() != "|") {
|
117 |
-
return "null";
|
118 |
-
}
|
119 |
-
|
120 |
-
// Pipe folowed by a non-word character should be considered an error.
|
121 |
-
if (stream.match(/\.\W+/)) {
|
122 |
-
return "error";
|
123 |
-
} else if (stream.eat("|")) {
|
124 |
-
state.waitFilter = true;
|
125 |
-
return "null";
|
126 |
-
} else {
|
127 |
-
throw Error ("Unexpected error while waiting for filter.");
|
128 |
-
}
|
129 |
-
}
|
130 |
-
|
131 |
-
// Highlight properties
|
132 |
-
if (state.waitProperty) {
|
133 |
-
state.waitProperty = false;
|
134 |
-
if (stream.match(/\b(\w+)\b/)) {
|
135 |
-
state.waitDot = true; // A property can be followed by another property
|
136 |
-
state.waitPipe = true; // A property can be followed by a filter
|
137 |
-
return "property";
|
138 |
-
}
|
139 |
-
}
|
140 |
-
|
141 |
-
// Highlight filters
|
142 |
-
if (state.waitFilter) {
|
143 |
-
state.waitFilter = false;
|
144 |
-
if (stream.match(filters)) {
|
145 |
-
return "variable-2";
|
146 |
-
}
|
147 |
-
}
|
148 |
-
|
149 |
-
// Ignore all white spaces
|
150 |
-
if (stream.eatSpace()) {
|
151 |
-
state.waitProperty = false;
|
152 |
-
return "null";
|
153 |
-
}
|
154 |
-
|
155 |
-
// Identify numbers
|
156 |
-
if (stream.match(/\b\d+(\.\d+)?\b/)) {
|
157 |
-
return "number";
|
158 |
-
}
|
159 |
-
|
160 |
-
// Identify strings
|
161 |
-
if (stream.match("'")) {
|
162 |
-
state.tokenize = inString("'", state.tokenize);
|
163 |
-
return "string";
|
164 |
-
} else if (stream.match('"')) {
|
165 |
-
state.tokenize = inString('"', state.tokenize);
|
166 |
-
return "string";
|
167 |
-
}
|
168 |
-
|
169 |
-
// Attempt to find the variable
|
170 |
-
if (stream.match(/\b(\w+)\b/) && !state.foundVariable) {
|
171 |
-
state.waitDot = true;
|
172 |
-
state.waitPipe = true; // A property can be followed by a filter
|
173 |
-
return "variable";
|
174 |
-
}
|
175 |
-
|
176 |
-
// If found closing tag reset
|
177 |
-
if (stream.match("}}")) {
|
178 |
-
state.waitProperty = null;
|
179 |
-
state.waitFilter = null;
|
180 |
-
state.waitDot = null;
|
181 |
-
state.waitPipe = null;
|
182 |
-
state.tokenize = tokenBase;
|
183 |
-
return "tag";
|
184 |
-
}
|
185 |
-
|
186 |
-
// If nothing was found, advance to the next character
|
187 |
-
stream.next();
|
188 |
-
return "null";
|
189 |
-
}
|
190 |
-
|
191 |
-
function inTag (stream, state) {
|
192 |
-
// Attempt to match a dot that precedes a property
|
193 |
-
if (state.waitDot) {
|
194 |
-
state.waitDot = false;
|
195 |
-
|
196 |
-
if (stream.peek() != ".") {
|
197 |
-
return "null";
|
198 |
-
}
|
199 |
-
|
200 |
-
// Dot folowed by a non-word character should be considered an error.
|
201 |
-
if (stream.match(/\.\W+/)) {
|
202 |
-
return "error";
|
203 |
-
} else if (stream.eat(".")) {
|
204 |
-
state.waitProperty = true;
|
205 |
-
return "null";
|
206 |
-
} else {
|
207 |
-
throw Error ("Unexpected error while waiting for property.");
|
208 |
-
}
|
209 |
-
}
|
210 |
-
|
211 |
-
// Attempt to match a pipe that precedes a filter
|
212 |
-
if (state.waitPipe) {
|
213 |
-
state.waitPipe = false;
|
214 |
-
|
215 |
-
if (stream.peek() != "|") {
|
216 |
-
return "null";
|
217 |
-
}
|
218 |
-
|
219 |
-
// Pipe folowed by a non-word character should be considered an error.
|
220 |
-
if (stream.match(/\.\W+/)) {
|
221 |
-
return "error";
|
222 |
-
} else if (stream.eat("|")) {
|
223 |
-
state.waitFilter = true;
|
224 |
-
return "null";
|
225 |
-
} else {
|
226 |
-
throw Error ("Unexpected error while waiting for filter.");
|
227 |
-
}
|
228 |
-
}
|
229 |
-
|
230 |
-
// Highlight properties
|
231 |
-
if (state.waitProperty) {
|
232 |
-
state.waitProperty = false;
|
233 |
-
if (stream.match(/\b(\w+)\b/)) {
|
234 |
-
state.waitDot = true; // A property can be followed by another property
|
235 |
-
state.waitPipe = true; // A property can be followed by a filter
|
236 |
-
return "property";
|
237 |
-
}
|
238 |
-
}
|
239 |
-
|
240 |
-
// Highlight filters
|
241 |
-
if (state.waitFilter) {
|
242 |
-
state.waitFilter = false;
|
243 |
-
if (stream.match(filters)) {
|
244 |
-
return "variable-2";
|
245 |
-
}
|
246 |
-
}
|
247 |
-
|
248 |
-
// Ignore all white spaces
|
249 |
-
if (stream.eatSpace()) {
|
250 |
-
state.waitProperty = false;
|
251 |
-
return "null";
|
252 |
-
}
|
253 |
-
|
254 |
-
// Identify numbers
|
255 |
-
if (stream.match(/\b\d+(\.\d+)?\b/)) {
|
256 |
-
return "number";
|
257 |
-
}
|
258 |
-
|
259 |
-
// Identify strings
|
260 |
-
if (stream.match("'")) {
|
261 |
-
state.tokenize = inString("'", state.tokenize);
|
262 |
-
return "string";
|
263 |
-
} else if (stream.match('"')) {
|
264 |
-
state.tokenize = inString('"', state.tokenize);
|
265 |
-
return "string";
|
266 |
-
}
|
267 |
-
|
268 |
-
// Attempt to match an operator
|
269 |
-
if (stream.match(operators)) {
|
270 |
-
return "operator";
|
271 |
-
}
|
272 |
-
|
273 |
-
// Attempt to match a keyword
|
274 |
-
var keywordMatch = stream.match(keywords);
|
275 |
-
if (keywordMatch) {
|
276 |
-
if (keywordMatch[0] == "comment") {
|
277 |
-
state.blockCommentTag = true;
|
278 |
-
}
|
279 |
-
return "keyword";
|
280 |
-
}
|
281 |
-
|
282 |
-
// Attempt to match a variable
|
283 |
-
if (stream.match(/\b(\w+)\b/)) {
|
284 |
-
state.waitDot = true;
|
285 |
-
state.waitPipe = true; // A property can be followed by a filter
|
286 |
-
return "variable";
|
287 |
-
}
|
288 |
-
|
289 |
-
// If found closing tag reset
|
290 |
-
if (stream.match("%}")) {
|
291 |
-
state.waitProperty = null;
|
292 |
-
state.waitFilter = null;
|
293 |
-
state.waitDot = null;
|
294 |
-
state.waitPipe = null;
|
295 |
-
// If the tag that closes is a block comment tag, we want to mark the
|
296 |
-
// following code as comment, until the tag closes.
|
297 |
-
if (state.blockCommentTag) {
|
298 |
-
state.blockCommentTag = false; // Release the "lock"
|
299 |
-
state.tokenize = inBlockComment;
|
300 |
-
} else {
|
301 |
-
state.tokenize = tokenBase;
|
302 |
-
}
|
303 |
-
return "tag";
|
304 |
-
}
|
305 |
-
|
306 |
-
// If nothing was found, advance to the next character
|
307 |
-
stream.next();
|
308 |
-
return "null";
|
309 |
-
}
|
310 |
-
|
311 |
-
// Mark everything as comment inside the tag and the tag itself.
|
312 |
-
function inComment (stream, state) {
|
313 |
-
if (stream.match("#}")) {
|
314 |
-
state.tokenize = tokenBase;
|
315 |
-
}
|
316 |
-
return "comment";
|
317 |
-
}
|
318 |
-
|
319 |
-
// Mark everything as a comment until the `blockcomment` tag closes.
|
320 |
-
function inBlockComment (stream, state) {
|
321 |
-
if (stream.match(/\{%\s*endcomment\s*%\}/, false)) {
|
322 |
-
state.tokenize = inTag;
|
323 |
-
stream.match("{%");
|
324 |
-
return "tag";
|
325 |
-
} else {
|
326 |
-
stream.next();
|
327 |
-
return "comment";
|
328 |
-
}
|
329 |
-
}
|
330 |
-
|
331 |
-
return {
|
332 |
-
startState: function () {
|
333 |
-
return {tokenize: tokenBase};
|
334 |
-
},
|
335 |
-
token: function (stream, state) {
|
336 |
-
return state.tokenize(stream, state);
|
337 |
-
},
|
338 |
-
blockCommentStart: "{% comment %}",
|
339 |
-
blockCommentEnd: "{% endcomment %}"
|
340 |
-
};
|
341 |
-
});
|
342 |
-
|
343 |
-
CodeMirror.defineMode("django", function(config) {
|
344 |
-
var htmlBase = CodeMirror.getMode(config, "text/html");
|
345 |
-
var djangoInner = CodeMirror.getMode(config, "django:inner");
|
346 |
-
return CodeMirror.overlayMode(htmlBase, djangoInner);
|
347 |
-
});
|
348 |
-
|
349 |
-
CodeMirror.defineMIME("text/x-django", "django");
|
350 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/django/index.html
DELETED
@@ -1,73 +0,0 @@
|
|
1 |
-
<!doctype html>
|
2 |
-
|
3 |
-
<title>CodeMirror: Django template mode</title>
|
4 |
-
<meta charset="utf-8"/>
|
5 |
-
<link rel=stylesheet href="../../doc/docs.css">
|
6 |
-
|
7 |
-
<link rel="stylesheet" href="../../lib/codemirror.css">
|
8 |
-
<link rel="stylesheet" href="../../theme/mdn-like.css">
|
9 |
-
<script src="../../lib/codemirror.js"></script>
|
10 |
-
<script src="../../addon/mode/overlay.js"></script>
|
11 |
-
<script src="../xml/xml.js"></script>
|
12 |
-
<script src="../htmlmixed/htmlmixed.js"></script>
|
13 |
-
<script src="django.js"></script>
|
14 |
-
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
15 |
-
<div id=nav>
|
16 |
-
<a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
17 |
-
|
18 |
-
<ul>
|
19 |
-
<li><a href="../../index.html">Home</a>
|
20 |
-
<li><a href="../../doc/manual.html">Manual</a>
|
21 |
-
<li><a href="https://github.com/codemirror/codemirror">Code</a>
|
22 |
-
</ul>
|
23 |
-
<ul>
|
24 |
-
<li><a href="../index.html">Language modes</a>
|
25 |
-
<li><a class=active href="#">Django</a>
|
26 |
-
</ul>
|
27 |
-
</div>
|
28 |
-
|
29 |
-
<article>
|
30 |
-
<h2>Django template mode</h2>
|
31 |
-
<form><textarea id="code" name="code">
|
32 |
-
<!doctype html>
|
33 |
-
<html>
|
34 |
-
<head>
|
35 |
-
<title>My Django web application</title>
|
36 |
-
</head>
|
37 |
-
<body>
|
38 |
-
<h1>
|
39 |
-
{{ page.title|capfirst }}
|
40 |
-
</h1>
|
41 |
-
<ul class="my-list">
|
42 |
-
{# traverse a list of items and produce links to their views. #}
|
43 |
-
{% for item in items %}
|
44 |
-
<li>
|
45 |
-
<a href="{% url 'item_view' item.name|slugify %}">
|
46 |
-
{{ item.name }}
|
47 |
-
</a>
|
48 |
-
</li>
|
49 |
-
{% empty %}
|
50 |
-
<li>You have no items in your list.</li>
|
51 |
-
{% endfor %}
|
52 |
-
</ul>
|
53 |
-
{% comment "this is a forgotten footer" %}
|
54 |
-
<footer></footer>
|
55 |
-
{% endcomment %}
|
56 |
-
</body>
|
57 |
-
</html>
|
58 |
-
</textarea></form>
|
59 |
-
|
60 |
-
<script>
|
61 |
-
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
|
62 |
-
lineNumbers: true,
|
63 |
-
mode: "django",
|
64 |
-
indentUnit: 2,
|
65 |
-
indentWithTabs: true,
|
66 |
-
theme: "mdn-like"
|
67 |
-
});
|
68 |
-
</script>
|
69 |
-
|
70 |
-
<p>Mode for HTML with embedded Django template markup.</p>
|
71 |
-
|
72 |
-
<p><strong>MIME types defined:</strong> <code>text/x-django</code></p>
|
73 |
-
</article>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/dockerfile/dockerfile.js
DELETED
@@ -1,79 +0,0 @@
|
|
1 |
-
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
2 |
-
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
3 |
-
|
4 |
-
(function(mod) {
|
5 |
-
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
6 |
-
mod(require("../../lib/codemirror"), require("../../addon/mode/simple"));
|
7 |
-
else if (typeof define == "function" && define.amd) // AMD
|
8 |
-
define(["../../lib/codemirror", "../../addon/mode/simple"], mod);
|
9 |
-
else // Plain browser env
|
10 |
-
mod(CodeMirror);
|
11 |
-
})(function(CodeMirror) {
|
12 |
-
"use strict";
|
13 |
-
|
14 |
-
// Collect all Dockerfile directives
|
15 |
-
var instructions = ["from", "maintainer", "run", "cmd", "expose", "env",
|
16 |
-
"add", "copy", "entrypoint", "volume", "user",
|
17 |
-
"workdir", "onbuild"],
|
18 |
-
instructionRegex = "(" + instructions.join('|') + ")",
|
19 |
-
instructionOnlyLine = new RegExp(instructionRegex + "\\s*$", "i"),
|
20 |
-
instructionWithArguments = new RegExp(instructionRegex + "(\\s+)", "i");
|
21 |
-
|
22 |
-
CodeMirror.defineSimpleMode("dockerfile", {
|
23 |
-
start: [
|
24 |
-
// Block comment: This is a line starting with a comment
|
25 |
-
{
|
26 |
-
regex: /#.*$/,
|
27 |
-
token: "comment"
|
28 |
-
},
|
29 |
-
// Highlight an instruction without any arguments (for convenience)
|
30 |
-
{
|
31 |
-
regex: instructionOnlyLine,
|
32 |
-
token: "variable-2"
|
33 |
-
},
|
34 |
-
// Highlight an instruction followed by arguments
|
35 |
-
{
|
36 |
-
regex: instructionWithArguments,
|
37 |
-
token: ["variable-2", null],
|
38 |
-
next: "arguments"
|
39 |
-
},
|
40 |
-
{
|
41 |
-
regex: /./,
|
42 |
-
token: null
|
43 |
-
}
|
44 |
-
],
|
45 |
-
arguments: [
|
46 |
-
{
|
47 |
-
// Line comment without instruction arguments is an error
|
48 |
-
regex: /#.*$/,
|
49 |
-
token: "error",
|
50 |
-
next: "start"
|
51 |
-
},
|
52 |
-
{
|
53 |
-
regex: /[^#]+\\$/,
|
54 |
-
token: null
|
55 |
-
},
|
56 |
-
{
|
57 |
-
// Match everything except for the inline comment
|
58 |
-
regex: /[^#]+/,
|
59 |
-
token: null,
|
60 |
-
next: "start"
|
61 |
-
},
|
62 |
-
{
|
63 |
-
regex: /$/,
|
64 |
-
token: null,
|
65 |
-
next: "start"
|
66 |
-
},
|
67 |
-
// Fail safe return to start
|
68 |
-
{
|
69 |
-
token: null,
|
70 |
-
next: "start"
|
71 |
-
}
|
72 |
-
],
|
73 |
-
meta: {
|
74 |
-
lineComment: "#"
|
75 |
-
}
|
76 |
-
});
|
77 |
-
|
78 |
-
CodeMirror.defineMIME("text/x-dockerfile", "dockerfile");
|
79 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/dockerfile/index.html
DELETED
@@ -1,73 +0,0 @@
|
|
1 |
-
<!doctype html>
|
2 |
-
|
3 |
-
<title>CodeMirror: Dockerfile mode</title>
|
4 |
-
<meta charset="utf-8"/>
|
5 |
-
<link rel=stylesheet href="../../doc/docs.css">
|
6 |
-
|
7 |
-
<link rel="stylesheet" href="../../lib/codemirror.css">
|
8 |
-
<script src="../../lib/codemirror.js"></script>
|
9 |
-
<script src="../../addon/mode/simple.js"></script>
|
10 |
-
<script src="dockerfile.js"></script>
|
11 |
-
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
12 |
-
<div id=nav>
|
13 |
-
<a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
14 |
-
|
15 |
-
<ul>
|
16 |
-
<li><a href="../../index.html">Home</a>
|
17 |
-
<li><a href="../../doc/manual.html">Manual</a>
|
18 |
-
<li><a href="https://github.com/codemirror/codemirror">Code</a>
|
19 |
-
</ul>
|
20 |
-
<ul>
|
21 |
-
<li><a href="../index.html">Language modes</a>
|
22 |
-
<li><a class=active href="#">Dockerfile</a>
|
23 |
-
</ul>
|
24 |
-
</div>
|
25 |
-
|
26 |
-
<article>
|
27 |
-
<h2>Dockerfile mode</h2>
|
28 |
-
<form><textarea id="code" name="code"># Install Ghost blogging platform and run development environment
|
29 |
-
#
|
30 |
-
# VERSION 1.0.0
|
31 |
-
|
32 |
-
FROM ubuntu:12.10
|
33 |
-
MAINTAINER Amer Grgic "amer@livebyt.es"
|
34 |
-
WORKDIR /data/ghost
|
35 |
-
|
36 |
-
# Install dependencies for nginx installation
|
37 |
-
RUN apt-get update
|
38 |
-
RUN apt-get install -y python g++ make software-properties-common --force-yes
|
39 |
-
RUN add-apt-repository ppa:chris-lea/node.js
|
40 |
-
RUN apt-get update
|
41 |
-
# Install unzip
|
42 |
-
RUN apt-get install -y unzip
|
43 |
-
# Install curl
|
44 |
-
RUN apt-get install -y curl
|
45 |
-
# Install nodejs & npm
|
46 |
-
RUN apt-get install -y rlwrap
|
47 |
-
RUN apt-get install -y nodejs
|
48 |
-
# Download Ghost v0.4.1
|
49 |
-
RUN curl -L https://ghost.org/zip/ghost-latest.zip -o /tmp/ghost.zip
|
50 |
-
# Unzip Ghost zip to /data/ghost
|
51 |
-
RUN unzip -uo /tmp/ghost.zip -d /data/ghost
|
52 |
-
# Add custom config js to /data/ghost
|
53 |
-
ADD ./config.example.js /data/ghost/config.js
|
54 |
-
# Install Ghost with NPM
|
55 |
-
RUN cd /data/ghost/ && npm install --production
|
56 |
-
# Expose port 2368
|
57 |
-
EXPOSE 2368
|
58 |
-
# Run Ghost
|
59 |
-
CMD ["npm","start"]
|
60 |
-
</textarea></form>
|
61 |
-
|
62 |
-
<script>
|
63 |
-
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
|
64 |
-
lineNumbers: true,
|
65 |
-
mode: "dockerfile"
|
66 |
-
});
|
67 |
-
</script>
|
68 |
-
|
69 |
-
<p>Dockerfile syntax highlighting for CodeMirror. Depends on
|
70 |
-
the <a href="../../demo/simplemode.html">simplemode</a> addon.</p>
|
71 |
-
|
72 |
-
<p><strong>MIME types defined:</strong> <code>text/x-dockerfile</code></p>
|
73 |
-
</article>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/dtd/dtd.js
DELETED
@@ -1,142 +0,0 @@
|
|
1 |
-
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
2 |
-
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
3 |
-
|
4 |
-
/*
|
5 |
-
DTD mode
|
6 |
-
Ported to CodeMirror by Peter Kroon <plakroon@gmail.com>
|
7 |
-
Report bugs/issues here: https://github.com/codemirror/CodeMirror/issues
|
8 |
-
GitHub: @peterkroon
|
9 |
-
*/
|
10 |
-
|
11 |
-
(function(mod) {
|
12 |
-
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
13 |
-
mod(require("../../lib/codemirror"));
|
14 |
-
else if (typeof define == "function" && define.amd) // AMD
|
15 |
-
define(["../../lib/codemirror"], mod);
|
16 |
-
else // Plain browser env
|
17 |
-
mod(CodeMirror);
|
18 |
-
})(function(CodeMirror) {
|
19 |
-
"use strict";
|
20 |
-
|
21 |
-
CodeMirror.defineMode("dtd", function(config) {
|
22 |
-
var indentUnit = config.indentUnit, type;
|
23 |
-
function ret(style, tp) {type = tp; return style;}
|
24 |
-
|
25 |
-
function tokenBase(stream, state) {
|
26 |
-
var ch = stream.next();
|
27 |
-
|
28 |
-
if (ch == "<" && stream.eat("!") ) {
|
29 |
-
if (stream.eatWhile(/[\-]/)) {
|
30 |
-
state.tokenize = tokenSGMLComment;
|
31 |
-
return tokenSGMLComment(stream, state);
|
32 |
-
} else if (stream.eatWhile(/[\w]/)) return ret("keyword", "doindent");
|
33 |
-
} else if (ch == "<" && stream.eat("?")) { //xml declaration
|
34 |
-
state.tokenize = inBlock("meta", "?>");
|
35 |
-
return ret("meta", ch);
|
36 |
-
} else if (ch == "#" && stream.eatWhile(/[\w]/)) return ret("atom", "tag");
|
37 |
-
else if (ch == "|") return ret("keyword", "seperator");
|
38 |
-
else if (ch.match(/[\(\)\[\]\-\.,\+\?>]/)) return ret(null, ch);//if(ch === ">") return ret(null, "endtag"); else
|
39 |
-
else if (ch.match(/[\[\]]/)) return ret("rule", ch);
|
40 |
-
else if (ch == "\"" || ch == "'") {
|
41 |
-
state.tokenize = tokenString(ch);
|
42 |
-
return state.tokenize(stream, state);
|
43 |
-
} else if (stream.eatWhile(/[a-zA-Z\?\+\d]/)) {
|
44 |
-
var sc = stream.current();
|
45 |
-
if( sc.substr(sc.length-1,sc.length).match(/\?|\+/) !== null )stream.backUp(1);
|
46 |
-
return ret("tag", "tag");
|
47 |
-
} else if (ch == "%" || ch == "*" ) return ret("number", "number");
|
48 |
-
else {
|
49 |
-
stream.eatWhile(/[\w\\\-_%.{,]/);
|
50 |
-
return ret(null, null);
|
51 |
-
}
|
52 |
-
}
|
53 |
-
|
54 |
-
function tokenSGMLComment(stream, state) {
|
55 |
-
var dashes = 0, ch;
|
56 |
-
while ((ch = stream.next()) != null) {
|
57 |
-
if (dashes >= 2 && ch == ">") {
|
58 |
-
state.tokenize = tokenBase;
|
59 |
-
break;
|
60 |
-
}
|
61 |
-
dashes = (ch == "-") ? dashes + 1 : 0;
|
62 |
-
}
|
63 |
-
return ret("comment", "comment");
|
64 |
-
}
|
65 |
-
|
66 |
-
function tokenString(quote) {
|
67 |
-
return function(stream, state) {
|
68 |
-
var escaped = false, ch;
|
69 |
-
while ((ch = stream.next()) != null) {
|
70 |
-
if (ch == quote && !escaped) {
|
71 |
-
state.tokenize = tokenBase;
|
72 |
-
break;
|
73 |
-
}
|
74 |
-
escaped = !escaped && ch == "\\";
|
75 |
-
}
|
76 |
-
return ret("string", "tag");
|
77 |
-
};
|
78 |
-
}
|
79 |
-
|
80 |
-
function inBlock(style, terminator) {
|
81 |
-
return function(stream, state) {
|
82 |
-
while (!stream.eol()) {
|
83 |
-
if (stream.match(terminator)) {
|
84 |
-
state.tokenize = tokenBase;
|
85 |
-
break;
|
86 |
-
}
|
87 |
-
stream.next();
|
88 |
-
}
|
89 |
-
return style;
|
90 |
-
};
|
91 |
-
}
|
92 |
-
|
93 |
-
return {
|
94 |
-
startState: function(base) {
|
95 |
-
return {tokenize: tokenBase,
|
96 |
-
baseIndent: base || 0,
|
97 |
-
stack: []};
|
98 |
-
},
|
99 |
-
|
100 |
-
token: function(stream, state) {
|
101 |
-
if (stream.eatSpace()) return null;
|
102 |
-
var style = state.tokenize(stream, state);
|
103 |
-
|
104 |
-
var context = state.stack[state.stack.length-1];
|
105 |
-
if (stream.current() == "[" || type === "doindent" || type == "[") state.stack.push("rule");
|
106 |
-
else if (type === "endtag") state.stack[state.stack.length-1] = "endtag";
|
107 |
-
else if (stream.current() == "]" || type == "]" || (type == ">" && context == "rule")) state.stack.pop();
|
108 |
-
else if (type == "[") state.stack.push("[");
|
109 |
-
return style;
|
110 |
-
},
|
111 |
-
|
112 |
-
indent: function(state, textAfter) {
|
113 |
-
var n = state.stack.length;
|
114 |
-
|
115 |
-
if( textAfter.match(/\]\s+|\]/) )n=n-1;
|
116 |
-
else if(textAfter.substr(textAfter.length-1, textAfter.length) === ">"){
|
117 |
-
if(textAfter.substr(0,1) === "<")n;
|
118 |
-
else if( type == "doindent" && textAfter.length > 1 )n;
|
119 |
-
else if( type == "doindent")n--;
|
120 |
-
else if( type == ">" && textAfter.length > 1)n;
|
121 |
-
else if( type == "tag" && textAfter !== ">")n;
|
122 |
-
else if( type == "tag" && state.stack[state.stack.length-1] == "rule")n--;
|
123 |
-
else if( type == "tag")n++;
|
124 |
-
else if( textAfter === ">" && state.stack[state.stack.length-1] == "rule" && type === ">")n--;
|
125 |
-
else if( textAfter === ">" && state.stack[state.stack.length-1] == "rule")n;
|
126 |
-
else if( textAfter.substr(0,1) !== "<" && textAfter.substr(0,1) === ">" )n=n-1;
|
127 |
-
else if( textAfter === ">")n;
|
128 |
-
else n=n-1;
|
129 |
-
//over rule them all
|
130 |
-
if(type == null || type == "]")n--;
|
131 |
-
}
|
132 |
-
|
133 |
-
return state.baseIndent + n * indentUnit;
|
134 |
-
},
|
135 |
-
|
136 |
-
electricChars: "]>"
|
137 |
-
};
|
138 |
-
});
|
139 |
-
|
140 |
-
CodeMirror.defineMIME("application/xml-dtd", "dtd");
|
141 |
-
|
142 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/dtd/index.html
DELETED
@@ -1,89 +0,0 @@
|
|
1 |
-
<!doctype html>
|
2 |
-
|
3 |
-
<title>CodeMirror: DTD mode</title>
|
4 |
-
<meta charset="utf-8"/>
|
5 |
-
<link rel=stylesheet href="../../doc/docs.css">
|
6 |
-
|
7 |
-
<link rel="stylesheet" href="../../lib/codemirror.css">
|
8 |
-
<script src="../../lib/codemirror.js"></script>
|
9 |
-
<script src="dtd.js"></script>
|
10 |
-
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
11 |
-
<div id=nav>
|
12 |
-
<a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
13 |
-
|
14 |
-
<ul>
|
15 |
-
<li><a href="../../index.html">Home</a>
|
16 |
-
<li><a href="../../doc/manual.html">Manual</a>
|
17 |
-
<li><a href="https://github.com/codemirror/codemirror">Code</a>
|
18 |
-
</ul>
|
19 |
-
<ul>
|
20 |
-
<li><a href="../index.html">Language modes</a>
|
21 |
-
<li><a class=active href="#">DTD</a>
|
22 |
-
</ul>
|
23 |
-
</div>
|
24 |
-
|
25 |
-
<article>
|
26 |
-
<h2>DTD mode</h2>
|
27 |
-
<form><textarea id="code" name="code"><?xml version="1.0" encoding="UTF-8"?>
|
28 |
-
|
29 |
-
<!ATTLIST title
|
30 |
-
xmlns CDATA #FIXED "http://docbook.org/ns/docbook"
|
31 |
-
role CDATA #IMPLIED
|
32 |
-
%db.common.attributes;
|
33 |
-
%db.common.linking.attributes;
|
34 |
-
>
|
35 |
-
|
36 |
-
<!--
|
37 |
-
Try: http://docbook.org/xml/5.0/dtd/docbook.dtd
|
38 |
-
-->
|
39 |
-
|
40 |
-
<!DOCTYPE xsl:stylesheet
|
41 |
-
[
|
42 |
-
<!ENTITY nbsp "&#160;">
|
43 |
-
<!ENTITY copy "&#169;">
|
44 |
-
<!ENTITY reg "&#174;">
|
45 |
-
<!ENTITY trade "&#8482;">
|
46 |
-
<!ENTITY mdash "&#8212;">
|
47 |
-
<!ENTITY ldquo "&#8220;">
|
48 |
-
<!ENTITY rdquo "&#8221;">
|
49 |
-
<!ENTITY pound "&#163;">
|
50 |
-
<!ENTITY yen "&#165;">
|
51 |
-
<!ENTITY euro "&#8364;">
|
52 |
-
<!ENTITY mathml "http://www.w3.org/1998/Math/MathML">
|
53 |
-
]
|
54 |
-
>
|
55 |
-
|
56 |
-
<!ELEMENT title (#PCDATA|inlinemediaobject|remark|superscript|subscript|xref|link|olink|anchor|biblioref|alt|annotation|indexterm|abbrev|acronym|date|emphasis|footnote|footnoteref|foreignphrase|phrase|quote|wordasword|firstterm|glossterm|coref|trademark|productnumber|productname|database|application|hardware|citation|citerefentry|citetitle|citebiblioid|author|person|personname|org|orgname|editor|jobtitle|replaceable|package|parameter|termdef|nonterminal|systemitem|option|optional|property|inlineequation|tag|markup|token|symbol|literal|code|constant|email|uri|guiicon|guibutton|guimenuitem|guimenu|guisubmenu|guilabel|menuchoice|mousebutton|keycombo|keycap|keycode|keysym|shortcut|accel|prompt|envar|filename|command|computeroutput|userinput|function|varname|returnvalue|type|classname|exceptionname|interfacename|methodname|modifier|initializer|ooclass|ooexception|oointerface|errorcode|errortext|errorname|errortype)*>
|
57 |
-
|
58 |
-
<!ENTITY % db.common.attributes "
|
59 |
-
xml:id ID #IMPLIED
|
60 |
-
version CDATA #IMPLIED
|
61 |
-
xml:lang CDATA #IMPLIED
|
62 |
-
xml:base CDATA #IMPLIED
|
63 |
-
remap CDATA #IMPLIED
|
64 |
-
xreflabel CDATA #IMPLIED
|
65 |
-
revisionflag (changed|added|deleted|off) #IMPLIED
|
66 |
-
dir (ltr|rtl|lro|rlo) #IMPLIED
|
67 |
-
arch CDATA #IMPLIED
|
68 |
-
audience CDATA #IMPLIED
|
69 |
-
condition CDATA #IMPLIED
|
70 |
-
conformance CDATA #IMPLIED
|
71 |
-
os CDATA #IMPLIED
|
72 |
-
revision CDATA #IMPLIED
|
73 |
-
security CDATA #IMPLIED
|
74 |
-
userlevel CDATA #IMPLIED
|
75 |
-
vendor CDATA #IMPLIED
|
76 |
-
wordsize CDATA #IMPLIED
|
77 |
-
annotations CDATA #IMPLIED
|
78 |
-
|
79 |
-
"></textarea></form>
|
80 |
-
<script>
|
81 |
-
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
|
82 |
-
mode: {name: "dtd", alignCDATA: true},
|
83 |
-
lineNumbers: true,
|
84 |
-
lineWrapping: true
|
85 |
-
});
|
86 |
-
</script>
|
87 |
-
|
88 |
-
<p><strong>MIME types defined:</strong> <code>application/xml-dtd</code>.</p>
|
89 |
-
</article>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/dylan/dylan.js
DELETED
@@ -1,291 +0,0 @@
|
|
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("dylan", function(_config) {
|
15 |
-
// Words
|
16 |
-
var words = {
|
17 |
-
// Words that introduce unnamed definitions like "define interface"
|
18 |
-
unnamedDefinition: ["interface"],
|
19 |
-
|
20 |
-
// Words that introduce simple named definitions like "define library"
|
21 |
-
namedDefinition: ["module", "library", "macro",
|
22 |
-
"C-struct", "C-union",
|
23 |
-
"C-function", "C-callable-wrapper"
|
24 |
-
],
|
25 |
-
|
26 |
-
// Words that introduce type definitions like "define class".
|
27 |
-
// These are also parameterized like "define method" and are
|
28 |
-
// appended to otherParameterizedDefinitionWords
|
29 |
-
typeParameterizedDefinition: ["class", "C-subtype", "C-mapped-subtype"],
|
30 |
-
|
31 |
-
// Words that introduce trickier definitions like "define method".
|
32 |
-
// These require special definitions to be added to startExpressions
|
33 |
-
otherParameterizedDefinition: ["method", "function",
|
34 |
-
"C-variable", "C-address"
|
35 |
-
],
|
36 |
-
|
37 |
-
// Words that introduce module constant definitions.
|
38 |
-
// These must also be simple definitions and are
|
39 |
-
// appended to otherSimpleDefinitionWords
|
40 |
-
constantSimpleDefinition: ["constant"],
|
41 |
-
|
42 |
-
// Words that introduce module variable definitions.
|
43 |
-
// These must also be simple definitions and are
|
44 |
-
// appended to otherSimpleDefinitionWords
|
45 |
-
variableSimpleDefinition: ["variable"],
|
46 |
-
|
47 |
-
// Other words that introduce simple definitions
|
48 |
-
// (without implicit bodies).
|
49 |
-
otherSimpleDefinition: ["generic", "domain",
|
50 |
-
"C-pointer-type",
|
51 |
-
"table"
|
52 |
-
],
|
53 |
-
|
54 |
-
// Words that begin statements with implicit bodies.
|
55 |
-
statement: ["if", "block", "begin", "method", "case",
|
56 |
-
"for", "select", "when", "unless", "until",
|
57 |
-
"while", "iterate", "profiling", "dynamic-bind"
|
58 |
-
],
|
59 |
-
|
60 |
-
// Patterns that act as separators in compound statements.
|
61 |
-
// This may include any general pattern that must be indented
|
62 |
-
// specially.
|
63 |
-
separator: ["finally", "exception", "cleanup", "else",
|
64 |
-
"elseif", "afterwards"
|
65 |
-
],
|
66 |
-
|
67 |
-
// Keywords that do not require special indentation handling,
|
68 |
-
// but which should be highlighted
|
69 |
-
other: ["above", "below", "by", "from", "handler", "in",
|
70 |
-
"instance", "let", "local", "otherwise", "slot",
|
71 |
-
"subclass", "then", "to", "keyed-by", "virtual"
|
72 |
-
],
|
73 |
-
|
74 |
-
// Condition signaling function calls
|
75 |
-
signalingCalls: ["signal", "error", "cerror",
|
76 |
-
"break", "check-type", "abort"
|
77 |
-
]
|
78 |
-
};
|
79 |
-
|
80 |
-
words["otherDefinition"] =
|
81 |
-
words["unnamedDefinition"]
|
82 |
-
.concat(words["namedDefinition"])
|
83 |
-
.concat(words["otherParameterizedDefinition"]);
|
84 |
-
|
85 |
-
words["definition"] =
|
86 |
-
words["typeParameterizedDefinition"]
|
87 |
-
.concat(words["otherDefinition"]);
|
88 |
-
|
89 |
-
words["parameterizedDefinition"] =
|
90 |
-
words["typeParameterizedDefinition"]
|
91 |
-
.concat(words["otherParameterizedDefinition"]);
|
92 |
-
|
93 |
-
words["simpleDefinition"] =
|
94 |
-
words["constantSimpleDefinition"]
|
95 |
-
.concat(words["variableSimpleDefinition"])
|
96 |
-
.concat(words["otherSimpleDefinition"]);
|
97 |
-
|
98 |
-
words["keyword"] =
|
99 |
-
words["statement"]
|
100 |
-
.concat(words["separator"])
|
101 |
-
.concat(words["other"]);
|
102 |
-
|
103 |
-
// Patterns
|
104 |
-
var symbolPattern = "[-_a-zA-Z?!*@<>$%]+";
|
105 |
-
var symbol = new RegExp("^" + symbolPattern);
|
106 |
-
var patterns = {
|
107 |
-
// Symbols with special syntax
|
108 |
-
symbolKeyword: symbolPattern + ":",
|
109 |
-
symbolClass: "<" + symbolPattern + ">",
|
110 |
-
symbolGlobal: "\\*" + symbolPattern + "\\*",
|
111 |
-
symbolConstant: "\\$" + symbolPattern
|
112 |
-
};
|
113 |
-
var patternStyles = {
|
114 |
-
symbolKeyword: "atom",
|
115 |
-
symbolClass: "tag",
|
116 |
-
symbolGlobal: "variable-2",
|
117 |
-
symbolConstant: "variable-3"
|
118 |
-
};
|
119 |
-
|
120 |
-
// Compile all patterns to regular expressions
|
121 |
-
for (var patternName in patterns)
|
122 |
-
if (patterns.hasOwnProperty(patternName))
|
123 |
-
patterns[patternName] = new RegExp("^" + patterns[patternName]);
|
124 |
-
|
125 |
-
// Names beginning "with-" and "without-" are commonly
|
126 |
-
// used as statement macro
|
127 |
-
patterns["keyword"] = [/^with(?:out)?-[-_a-zA-Z?!*@<>$%]+/];
|
128 |
-
|
129 |
-
var styles = {};
|
130 |
-
styles["keyword"] = "keyword";
|
131 |
-
styles["definition"] = "def";
|
132 |
-
styles["simpleDefinition"] = "def";
|
133 |
-
styles["signalingCalls"] = "builtin";
|
134 |
-
|
135 |
-
// protected words lookup table
|
136 |
-
var wordLookup = {};
|
137 |
-
var styleLookup = {};
|
138 |
-
|
139 |
-
[
|
140 |
-
"keyword",
|
141 |
-
"definition",
|
142 |
-
"simpleDefinition",
|
143 |
-
"signalingCalls"
|
144 |
-
].forEach(function(type) {
|
145 |
-
words[type].forEach(function(word) {
|
146 |
-
wordLookup[word] = type;
|
147 |
-
styleLookup[word] = styles[type];
|
148 |
-
});
|
149 |
-
});
|
150 |
-
|
151 |
-
|
152 |
-
function chain(stream, state, f) {
|
153 |
-
state.tokenize = f;
|
154 |
-
return f(stream, state);
|
155 |
-
}
|
156 |
-
|
157 |
-
function tokenBase(stream, state) {
|
158 |
-
// String
|
159 |
-
var ch = stream.peek();
|
160 |
-
if (ch == "'" || ch == '"') {
|
161 |
-
stream.next();
|
162 |
-
return chain(stream, state, tokenString(ch, "string"));
|
163 |
-
}
|
164 |
-
// Comment
|
165 |
-
else if (ch == "/") {
|
166 |
-
stream.next();
|
167 |
-
if (stream.eat("*")) {
|
168 |
-
return chain(stream, state, tokenComment);
|
169 |
-
} else if (stream.eat("/")) {
|
170 |
-
stream.skipToEnd();
|
171 |
-
return "comment";
|
172 |
-
} else {
|
173 |
-
stream.skipTo(" ");
|
174 |
-
return "operator";
|
175 |
-
}
|
176 |
-
}
|
177 |
-
// Decimal
|
178 |
-
else if (/\d/.test(ch)) {
|
179 |
-
stream.match(/^\d*(?:\.\d*)?(?:e[+\-]?\d+)?/);
|
180 |
-
return "number";
|
181 |
-
}
|
182 |
-
// Hash
|
183 |
-
else if (ch == "#") {
|
184 |
-
stream.next();
|
185 |
-
// Symbol with string syntax
|
186 |
-
ch = stream.peek();
|
187 |
-
if (ch == '"') {
|
188 |
-
stream.next();
|
189 |
-
return chain(stream, state, tokenString('"', "string-2"));
|
190 |
-
}
|
191 |
-
// Binary number
|
192 |
-
else if (ch == "b") {
|
193 |
-
stream.next();
|
194 |
-
stream.eatWhile(/[01]/);
|
195 |
-
return "number";
|
196 |
-
}
|
197 |
-
// Hex number
|
198 |
-
else if (ch == "x") {
|
199 |
-
stream.next();
|
200 |
-
stream.eatWhile(/[\da-f]/i);
|
201 |
-
return "number";
|
202 |
-
}
|
203 |
-
// Octal number
|
204 |
-
else if (ch == "o") {
|
205 |
-
stream.next();
|
206 |
-
stream.eatWhile(/[0-7]/);
|
207 |
-
return "number";
|
208 |
-
}
|
209 |
-
// Hash symbol
|
210 |
-
else {
|
211 |
-
stream.eatWhile(/[-a-zA-Z]/);
|
212 |
-
return "keyword";
|
213 |
-
}
|
214 |
-
} else if (stream.match("end")) {
|
215 |
-
return "keyword";
|
216 |
-
}
|
217 |
-
for (var name in patterns) {
|
218 |
-
if (patterns.hasOwnProperty(name)) {
|
219 |
-
var pattern = patterns[name];
|
220 |
-
if ((pattern instanceof Array && pattern.some(function(p) {
|
221 |
-
return stream.match(p);
|
222 |
-
})) || stream.match(pattern))
|
223 |
-
return patternStyles[name];
|
224 |
-
}
|
225 |
-
}
|
226 |
-
if (stream.match("define")) {
|
227 |
-
return "def";
|
228 |
-
} else {
|
229 |
-
stream.eatWhile(/[\w\-]/);
|
230 |
-
// Keyword
|
231 |
-
if (wordLookup[stream.current()]) {
|
232 |
-
return styleLookup[stream.current()];
|
233 |
-
} else if (stream.current().match(symbol)) {
|
234 |
-
return "variable";
|
235 |
-
} else {
|
236 |
-
stream.next();
|
237 |
-
return "variable-2";
|
238 |
-
}
|
239 |
-
}
|
240 |
-
}
|
241 |
-
|
242 |
-
function tokenComment(stream, state) {
|
243 |
-
var maybeEnd = false,
|
244 |
-
ch;
|
245 |
-
while ((ch = stream.next())) {
|
246 |
-
if (ch == "/" && maybeEnd) {
|
247 |
-
state.tokenize = tokenBase;
|
248 |
-
break;
|
249 |
-
}
|
250 |
-
maybeEnd = (ch == "*");
|
251 |
-
}
|
252 |
-
return "comment";
|
253 |
-
}
|
254 |
-
|
255 |
-
function tokenString(quote, style) {
|
256 |
-
return function(stream, state) {
|
257 |
-
var next, end = false;
|
258 |
-
while ((next = stream.next()) != null) {
|
259 |
-
if (next == quote) {
|
260 |
-
end = true;
|
261 |
-
break;
|
262 |
-
}
|
263 |
-
}
|
264 |
-
if (end)
|
265 |
-
state.tokenize = tokenBase;
|
266 |
-
return style;
|
267 |
-
};
|
268 |
-
}
|
269 |
-
|
270 |
-
// Interface
|
271 |
-
return {
|
272 |
-
startState: function() {
|
273 |
-
return {
|
274 |
-
tokenize: tokenBase,
|
275 |
-
currentIndent: 0
|
276 |
-
};
|
277 |
-
},
|
278 |
-
token: function(stream, state) {
|
279 |
-
if (stream.eatSpace())
|
280 |
-
return null;
|
281 |
-
var style = state.tokenize(stream, state);
|
282 |
-
return style;
|
283 |
-
},
|
284 |
-
blockCommentStart: "/*",
|
285 |
-
blockCommentEnd: "*/"
|
286 |
-
};
|
287 |
-
});
|
288 |
-
|
289 |
-
CodeMirror.defineMIME("text/x-dylan", "dylan");
|
290 |
-
|
291 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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
<link rel="stylesheet" href="../../lib/codemirror.css">
|
8 |
-
<script src="../../lib/codemirror.js"></script>
|
9 |
-
<script src="../../addon/edit/matchbrackets.js"></script>
|
10 |
-
<script src="../../addon/comment/continuecomment.js"></script>
|
11 |
-
<script src="../../addon/comment/comment.js"></script>
|
12 |
-
<script src="dylan.js"></script>
|
13 |
-
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
14 |
-
<div id=nav>
|
15 |
-
<a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
16 |
-
|
17 |
-
<ul>
|
18 |
-
<li><a href="../../index.html">Home</a>
|
19 |
-
<li><a href="../../doc/manual.html">Manual</a>
|
20 |
-
<li><a href="https://github.com/codemirror/codemirror">Code</a>
|
21 |
-
</ul>
|
22 |
-
<ul>
|
23 |
-
<li><a href="../index.html">Language modes</a>
|
24 |
-
<li><a class=active href="#">Dylan</a>
|
25 |
-
</ul>
|
26 |
-
</div>
|
27 |
-
|
28 |
-
<article>
|
29 |
-
<h2>Dylan mode</h2>
|
30 |
-
|
31 |
-
|
32 |
-
<div><textarea id="code" name="code">
|
33 |
-
Module: locators-internals
|
34 |
-
Synopsis: Abstract modeling of locations
|
35 |
-
Author: Andy Armstrong
|
36 |
-
Copyright: Original Code is Copyright (c) 1995-2004 Functional Objects, Inc.
|
37 |
-
All rights reserved.
|
38 |
-
License: See License.txt in this distribution for details.
|
39 |
-
Warranty: Distributed WITHOUT WARRANTY OF ANY KIND
|
40 |
-
|
41 |
-
define open generic locator-server
|
42 |
-
(locator :: <locator>) => (server :: false-or(<server-locator>));
|
43 |
-
define open generic locator-host
|
44 |
-
(locator :: <locator>) => (host :: false-or(<string>));
|
45 |
-
define open generic locator-volume
|
46 |
-
(locator :: <locator>) => (volume :: false-or(<string>));
|
47 |
-
define open generic locator-directory
|
48 |
-
(locator :: <locator>) => (directory :: false-or(<directory-locator>));
|
49 |
-
define open generic locator-relative?
|
50 |
-
(locator :: <locator>) => (relative? :: <boolean>);
|
51 |
-
define open generic locator-path
|
52 |
-
(locator :: <locator>) => (path :: <sequence>);
|
53 |
-
define open generic locator-base
|
54 |
-
(locator :: <locator>) => (base :: false-or(<string>));
|
55 |
-
define open generic locator-extension
|
56 |
-
(locator :: <locator>) => (extension :: false-or(<string>));
|
57 |
-
|
58 |
-
/// Locator classes
|
59 |
-
|
60 |
-
define open abstract class <directory-locator> (<physical-locator>)
|
61 |
-
end class <directory-locator>;
|
62 |
-
|
63 |
-
define open abstract class <file-locator> (<physical-locator>)
|
64 |
-
end class <file-locator>;
|
65 |
-
|
66 |
-
define method as
|
67 |
-
(class == <directory-locator>, string :: <string>)
|
68 |
-
=> (locator :: <directory-locator>)
|
69 |
-
as(<native-directory-locator>, string)
|
70 |
-
end method as;
|
71 |
-
|
72 |
-
define method make
|
73 |
-
(class == <directory-locator>,
|
74 |
-
#key server :: false-or(<server-locator>) = #f,
|
75 |
-
path :: <sequence> = #[],
|
76 |
-
relative? :: <boolean> = #f,
|
77 |
-
name :: false-or(<string>) = #f)
|
78 |
-
=> (locator :: <directory-locator>)
|
79 |
-
make(<native-directory-locator>,
|
80 |
-
server: server,
|
81 |
-
path: path,
|
82 |
-
relative?: relative?,
|
83 |
-
name: name)
|
84 |
-
end method make;
|
85 |
-
|
86 |
-
define method as
|
87 |
-
(class == <file-locator>, string :: <string>)
|
88 |
-
=> (locator :: <file-locator>)
|
89 |
-
as(<native-file-locator>, string)
|
90 |
-
end method as;
|
91 |
-
|
92 |
-
define method make
|
93 |
-
(class == <file-locator>,
|
94 |
-
#key directory :: false-or(<directory-locator>) = #f,
|
95 |
-
base :: false-or(<string>) = #f,
|
96 |
-
extension :: false-or(<string>) = #f,
|
97 |
-
name :: false-or(<string>) = #f)
|
98 |
-
=> (locator :: <file-locator>)
|
99 |
-
make(<native-file-locator>,
|
100 |
-
directory: directory,
|
101 |
-
base: base,
|
102 |
-
extension: extension,
|
103 |
-
name: name)
|
104 |
-
end method make;
|
105 |
-
|
106 |
-
/// Locator coercion
|
107 |
-
|
108 |
-
//---*** andrewa: This caching scheme doesn't work yet, so disable it.
|
109 |
-
define constant $cache-locators? = #f;
|
110 |
-
define constant $cache-locator-strings? = #f;
|
111 |
-
|
112 |
-
define constant $locator-to-string-cache = make(<object-table>, weak: #"key");
|
113 |
-
define constant $string-to-locator-cache = make(<string-table>, weak: #"value");
|
114 |
-
|
115 |
-
define open generic locator-as-string
|
116 |
-
(class :: subclass(<string>), locator :: <locator>)
|
117 |
-
=> (string :: <string>);
|
118 |
-
|
119 |
-
define open generic string-as-locator
|
120 |
-
(class :: subclass(<locator>), string :: <string>)
|
121 |
-
=> (locator :: <locator>);
|
122 |
-
|
123 |
-
define sealed sideways method as
|
124 |
-
(class :: subclass(<string>), locator :: <locator>)
|
125 |
-
=> (string :: <string>)
|
126 |
-
let string = element($locator-to-string-cache, locator, default: #f);
|
127 |
-
if (string)
|
128 |
-
as(class, string)
|
129 |
-
else
|
130 |
-
let string = locator-as-string(class, locator);
|
131 |
-
if ($cache-locator-strings?)
|
132 |
-
element($locator-to-string-cache, locator) := string;
|
133 |
-
else
|
134 |
-
string
|
135 |
-
end
|
136 |
-
end
|
137 |
-
end method as;
|
138 |
-
|
139 |
-
define sealed sideways method as
|
140 |
-
(class :: subclass(<locator>), string :: <string>)
|
141 |
-
=> (locator :: <locator>)
|
142 |
-
let locator = element($string-to-locator-cache, string, default: #f);
|
143 |
-
if (instance?(locator, class))
|
144 |
-
locator
|
145 |
-
else
|
146 |
-
let locator = string-as-locator(class, string);
|
147 |
-
if ($cache-locators?)
|
148 |
-
element($string-to-locator-cache, string) := locator;
|
149 |
-
else
|
150 |
-
locator
|
151 |
-
end
|
152 |
-
end
|
153 |
-
end method as;
|
154 |
-
|
155 |
-
/// Locator conditions
|
156 |
-
|
157 |
-
define class <locator-error> (<format-string-condition>, <error>)
|
158 |
-
end class <locator-error>;
|
159 |
-
|
160 |
-
define function locator-error
|
161 |
-
(format-string :: <string>, #rest format-arguments)
|
162 |
-
error(make(<locator-error>,
|
163 |
-
format-string: format-string,
|
164 |
-
format-arguments: format-arguments))
|
165 |
-
end function locator-error;
|
166 |
-
|
167 |
-
/// Useful locator protocols
|
168 |
-
|
169 |
-
define open generic locator-test
|
170 |
-
(locator :: <directory-locator>) => (test :: <function>);
|
171 |
-
|
172 |
-
define method locator-test
|
173 |
-
(locator :: <directory-locator>) => (test :: <function>)
|
174 |
-
\=
|
175 |
-
end method locator-test;
|
176 |
-
|
177 |
-
define open generic locator-might-have-links?
|
178 |
-
(locator :: <directory-locator>) => (links? :: <boolean>);
|
179 |
-
|
180 |
-
define method locator-might-have-links?
|
181 |
-
(locator :: <directory-locator>) => (links? :: singleton(#f))
|
182 |
-
#f
|
183 |
-
end method locator-might-have-links?;
|
184 |
-
|
185 |
-
define method locator-relative?
|
186 |
-
(locator :: <file-locator>) => (relative? :: <boolean>)
|
187 |
-
let directory = locator.locator-directory;
|
188 |
-
~directory | directory.locator-relative?
|
189 |
-
end method locator-relative?;
|
190 |
-
|
191 |
-
define method current-directory-locator?
|
192 |
-
(locator :: <directory-locator>) => (current-directory? :: <boolean>)
|
193 |
-
locator.locator-relative?
|
194 |
-
& locator.locator-path = #[#"self"]
|
195 |
-
end method current-directory-locator?;
|
196 |
-
|
197 |
-
define method locator-directory
|
198 |
-
(locator :: <directory-locator>) => (parent :: false-or(<directory-locator>))
|
199 |
-
let path = locator.locator-path;
|
200 |
-
unless (empty?(path))
|
201 |
-
make(object-class(locator),
|
202 |
-
server: locator.locator-server,
|
203 |
-
path: copy-sequence(path, end: path.size - 1),
|
204 |
-
relative?: locator.locator-relative?)
|
205 |
-
end
|
206 |
-
end method locator-directory;
|
207 |
-
|
208 |
-
/// Simplify locator
|
209 |
-
|
210 |
-
define open generic simplify-locator
|
211 |
-
(locator :: <physical-locator>)
|
212 |
-
=> (simplified-locator :: <physical-locator>);
|
213 |
-
|
214 |
-
define method simplify-locator
|
215 |
-
(locator :: <directory-locator>)
|
216 |
-
=> (simplified-locator :: <directory-locator>)
|
217 |
-
let path = locator.locator-path;
|
218 |
-
let relative? = locator.locator-relative?;
|
219 |
-
let resolve-parent? = ~locator.locator-might-have-links?;
|
220 |
-
let simplified-path
|
221 |
-
= simplify-path(path,
|
222 |
-
resolve-parent?: resolve-parent?,
|
223 |
-
relative?: relative?);
|
224 |
-
if (path ~= simplified-path)
|
225 |
-
make(object-class(locator),
|
226 |
-
server: locator.locator-server,
|
227 |
-
path: simplified-path,
|
228 |
-
relative?: locator.locator-relative?)
|
229 |
-
else
|
230 |
-
locator
|
231 |
-
end
|
232 |
-
end method simplify-locator;
|
233 |
-
|
234 |
-
define method simplify-locator
|
235 |
-
(locator :: <file-locator>) => (simplified-locator :: <file-locator>)
|
236 |
-
let directory = locator.locator-directory;
|
237 |
-
let simplified-directory = directory & simplify-locator(directory);
|
238 |
-
if (directory ~= simplified-directory)
|
239 |
-
make(object-class(locator),
|
240 |
-
directory: simplified-directory,
|
241 |
-
base: locator.locator-base,
|
242 |
-
extension: locator.locator-extension)
|
243 |
-
else
|
244 |
-
locator
|
245 |
-
end
|
246 |
-
end method simplify-locator;
|
247 |
-
|
248 |
-
/// Subdirectory locator
|
249 |
-
|
250 |
-
define open generic subdirectory-locator
|
251 |
-
(locator :: <directory-locator>, #rest sub-path)
|
252 |
-
=> (subdirectory :: <directory-locator>);
|
253 |
-
|
254 |
-
define method subdirectory-locator
|
255 |
-
(locator :: <directory-locator>, #rest sub-path)
|
256 |
-
=> (subdirectory :: <directory-locator>)
|
257 |
-
let old-path = locator.locator-path;
|
258 |
-
let new-path = concatenate-as(<simple-object-vector>, old-path, sub-path);
|
259 |
-
make(object-class(locator),
|
260 |
-
server: locator.locator-server,
|
261 |
-
path: new-path,
|
262 |
-
relative?: locator.locator-relative?)
|
263 |
-
end method subdirectory-locator;
|
264 |
-
|
265 |
-
/// Relative locator
|
266 |
-
|
267 |
-
define open generic relative-locator
|
268 |
-
(locator :: <physical-locator>, from-locator :: <physical-locator>)
|
269 |
-
=> (relative-locator :: <physical-locator>);
|
270 |
-
|
271 |
-
define method relative-locator
|
272 |
-
(locator :: <directory-locator>, from-locator :: <directory-locator>)
|
273 |
-
=> (relative-locator :: <directory-locator>)
|
274 |
-
let path = locator.locator-path;
|
275 |
-
let from-path = from-locator.locator-path;
|
276 |
-
case
|
277 |
-
~locator.locator-relative? & from-locator.locator-relative? =>
|
278 |
-
locator-error
|
279 |
-
("Cannot find relative path of absolute locator %= from relative locator %=",
|
280 |
-
locator, from-locator);
|
281 |
-
locator.locator-server ~= from-locator.locator-server =>
|
282 |
-
locator;
|
283 |
-
path = from-path =>
|
284 |
-
make(object-class(locator),
|
285 |
-
path: vector(#"self"),
|
286 |
-
relative?: #t);
|
287 |
-
otherwise =>
|
288 |
-
make(object-class(locator),
|
289 |
-
path: relative-path(path, from-path, test: locator.locator-test),
|
290 |
-
relative?: #t);
|
291 |
-
end
|
292 |
-
end method relative-locator;
|
293 |
-
|
294 |
-
define method relative-locator
|
295 |
-
(locator :: <file-locator>, from-directory :: <directory-locator>)
|
296 |
-
=> (relative-locator :: <file-locator>)
|
297 |
-
let directory = locator.locator-directory;
|
298 |
-
let relative-directory = directory & relative-locator(directory, from-directory);
|
299 |
-
if (relative-directory ~= directory)
|
300 |
-
simplify-locator
|
301 |
-
(make(object-class(locator),
|
302 |
-
directory: relative-directory,
|
303 |
-
base: locator.locator-base,
|
304 |
-
extension: locator.locator-extension))
|
305 |
-
else
|
306 |
-
locator
|
307 |
-
end
|
308 |
-
end method relative-locator;
|
309 |
-
|
310 |
-
define method relative-locator
|
311 |
-
(locator :: <physical-locator>, from-locator :: <file-locator>)
|
312 |
-
=> (relative-locator :: <physical-locator>)
|
313 |
-
let from-directory = from-locator.locator-directory;
|
314 |
-
case
|
315 |
-
from-directory =>
|
316 |
-
relative-locator(locator, from-directory);
|
317 |
-
~locator.locator-relative? =>
|
318 |
-
locator-error
|
319 |
-
("Cannot find relative path of absolute locator %= from relative locator %=",
|
320 |
-
locator, from-locator);
|
321 |
-
otherwise =>
|
322 |
-
locator;
|
323 |
-
end
|
324 |
-
end method relative-locator;
|
325 |
-
|
326 |
-
/// Merge locators
|
327 |
-
|
328 |
-
define open generic merge-locators
|
329 |
-
(locator :: <physical-locator>, from-locator :: <physical-locator>)
|
330 |
-
=> (merged-locator :: <physical-locator>);
|
331 |
-
|
332 |
-
/// Merge locators
|
333 |
-
|
334 |
-
define method merge-locators
|
335 |
-
(locator :: <directory-locator>, from-locator :: <directory-locator>)
|
336 |
-
=> (merged-locator :: <directory-locator>)
|
337 |
-
if (locator.locator-relative?)
|
338 |
-
let path = concatenate(from-locator.locator-path, locator.locator-path);
|
339 |
-
simplify-locator
|
340 |
-
(make(object-class(locator),
|
341 |
-
server: from-locator.locator-server,
|
342 |
-
path: path,
|
343 |
-
relative?: from-locator.locator-relative?))
|
344 |
-
else
|
345 |
-
locator
|
346 |
-
end
|
347 |
-
end method merge-locators;
|
348 |
-
|
349 |
-
define method merge-locators
|
350 |
-
(locator :: <file-locator>, from-locator :: <directory-locator>)
|
351 |
-
=> (merged-locator :: <file-locator>)
|
352 |
-
let directory = locator.locator-directory;
|
353 |
-
let merged-directory
|
354 |
-
= if (directory)
|
355 |
-
merge-locators(directory, from-locator)
|
356 |
-
else
|
357 |
-
simplify-locator(from-locator)
|
358 |
-
end;
|
359 |
-
if (merged-directory ~= directory)
|
360 |
-
make(object-class(locator),
|
361 |
-
directory: merged-directory,
|
362 |
-
base: locator.locator-base,
|
363 |
-
extension: locator.locator-extension)
|
364 |
-
else
|
365 |
-
locator
|
366 |
-
end
|
367 |
-
end method merge-locators;
|
368 |
-
|
369 |
-
define method merge-locators
|
370 |
-
(locator :: <physical-locator>, from-locator :: <file-locator>)
|
371 |
-
=> (merged-locator :: <physical-locator>)
|
372 |
-
let from-directory = from-locator.locator-directory;
|
373 |
-
if (from-directory)
|
374 |
-
merge-locators(locator, from-directory)
|
375 |
-
else
|
376 |
-
locator
|
377 |
-
end
|
378 |
-
end method merge-locators;
|
379 |
-
|
380 |
-
/// Locator protocols
|
381 |
-
|
382 |
-
define sideways method supports-open-locator?
|
383 |
-
(locator :: <file-locator>) => (openable? :: <boolean>)
|
384 |
-
~locator.locator-relative?
|
385 |
-
end method supports-open-locator?;
|
386 |
-
|
387 |
-
define sideways method open-locator
|
388 |
-
(locator :: <file-locator>, #rest keywords, #key, #all-keys)
|
389 |
-
=> (stream :: <stream>)
|
390 |
-
apply(open-file-stream, locator, keywords)
|
391 |
-
end method open-locator;
|
392 |
-
</textarea></div>
|
393 |
-
|
394 |
-
<script>
|
395 |
-
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
|
396 |
-
mode: "text/x-dylan",
|
397 |
-
lineNumbers: true,
|
398 |
-
matchBrackets: true,
|
399 |
-
continueComments: "Enter",
|
400 |
-
extraKeys: {"Ctrl-Q": "toggleComment"},
|
401 |
-
tabMode: "indent",
|
402 |
-
indentUnit: 2
|
403 |
-
});
|
404 |
-
</script>
|
405 |
-
|
406 |
-
<p><strong>MIME types defined:</strong> <code>text/x-dylan</code>.</p>
|
407 |
-
</article>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/ebnf/ebnf.js
DELETED
@@ -1,195 +0,0 @@
|
|
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("ebnf", function (config) {
|
15 |
-
var commentType = {slash: 0, parenthesis: 1};
|
16 |
-
var stateType = {comment: 0, _string: 1, characterClass: 2};
|
17 |
-
var bracesMode = null;
|
18 |
-
|
19 |
-
if (config.bracesMode)
|
20 |
-
bracesMode = CodeMirror.getMode(config, config.bracesMode);
|
21 |
-
|
22 |
-
return {
|
23 |
-
startState: function () {
|
24 |
-
return {
|
25 |
-
stringType: null,
|
26 |
-
commentType: null,
|
27 |
-
braced: 0,
|
28 |
-
lhs: true,
|
29 |
-
localState: null,
|
30 |
-
stack: [],
|
31 |
-
inDefinition: false
|
32 |
-
};
|
33 |
-
},
|
34 |
-
token: function (stream, state) {
|
35 |
-
if (!stream) return;
|
36 |
-
|
37 |
-
//check for state changes
|
38 |
-
if (state.stack.length === 0) {
|
39 |
-
//strings
|
40 |
-
if ((stream.peek() == '"') || (stream.peek() == "'")) {
|
41 |
-
state.stringType = stream.peek();
|
42 |
-
stream.next(); // Skip quote
|
43 |
-
state.stack.unshift(stateType._string);
|
44 |
-
} else if (stream.match(/^\/\*/)) { //comments starting with /*
|
45 |
-
state.stack.unshift(stateType.comment);
|
46 |
-
state.commentType = commentType.slash;
|
47 |
-
} else if (stream.match(/^\(\*/)) { //comments starting with (*
|
48 |
-
state.stack.unshift(stateType.comment);
|
49 |
-
state.commentType = commentType.parenthesis;
|
50 |
-
}
|
51 |
-
}
|
52 |
-
|
53 |
-
//return state
|
54 |
-
//stack has
|
55 |
-
switch (state.stack[0]) {
|
56 |
-
case stateType._string:
|
57 |
-
while (state.stack[0] === stateType._string && !stream.eol()) {
|
58 |
-
if (stream.peek() === state.stringType) {
|
59 |
-
stream.next(); // Skip quote
|
60 |
-
state.stack.shift(); // Clear flag
|
61 |
-
} else if (stream.peek() === "\\") {
|
62 |
-
stream.next();
|
63 |
-
stream.next();
|
64 |
-
} else {
|
65 |
-
stream.match(/^.[^\\\"\']*/);
|
66 |
-
}
|
67 |
-
}
|
68 |
-
return state.lhs ? "property string" : "string"; // Token style
|
69 |
-
|
70 |
-
case stateType.comment:
|
71 |
-
while (state.stack[0] === stateType.comment && !stream.eol()) {
|
72 |
-
if (state.commentType === commentType.slash && stream.match(/\*\//)) {
|
73 |
-
state.stack.shift(); // Clear flag
|
74 |
-
state.commentType = null;
|
75 |
-
} else if (state.commentType === commentType.parenthesis && stream.match(/\*\)/)) {
|
76 |
-
state.stack.shift(); // Clear flag
|
77 |
-
state.commentType = null;
|
78 |
-
} else {
|
79 |
-
stream.match(/^.[^\*]*/);
|
80 |
-
}
|
81 |
-
}
|
82 |
-
return "comment";
|
83 |
-
|
84 |
-
case stateType.characterClass:
|
85 |
-
while (state.stack[0] === stateType.characterClass && !stream.eol()) {
|
86 |
-
if (!(stream.match(/^[^\]\\]+/) || stream.match(/^\\./))) {
|
87 |
-
state.stack.shift();
|
88 |
-
}
|
89 |
-
}
|
90 |
-
return "operator";
|
91 |
-
}
|
92 |
-
|
93 |
-
var peek = stream.peek();
|
94 |
-
|
95 |
-
if (bracesMode !== null && (state.braced || peek === "{")) {
|
96 |
-
if (state.localState === null)
|
97 |
-
state.localState = bracesMode.startState();
|
98 |
-
|
99 |
-
var token = bracesMode.token(stream, state.localState),
|
100 |
-
text = stream.current();
|
101 |
-
|
102 |
-
if (!token) {
|
103 |
-
for (var i = 0; i < text.length; i++) {
|
104 |
-
if (text[i] === "{") {
|
105 |
-
if (state.braced === 0) {
|
106 |
-
token = "matchingbracket";
|
107 |
-
}
|
108 |
-
state.braced++;
|
109 |
-
} else if (text[i] === "}") {
|
110 |
-
state.braced--;
|
111 |
-
if (state.braced === 0) {
|
112 |
-
token = "matchingbracket";
|
113 |
-
}
|
114 |
-
}
|
115 |
-
}
|
116 |
-
}
|
117 |
-
return token;
|
118 |
-
}
|
119 |
-
|
120 |
-
//no stack
|
121 |
-
switch (peek) {
|
122 |
-
case "[":
|
123 |
-
stream.next();
|
124 |
-
state.stack.unshift(stateType.characterClass);
|
125 |
-
return "bracket";
|
126 |
-
case ":":
|
127 |
-
case "|":
|
128 |
-
case ";":
|
129 |
-
stream.next();
|
130 |
-
return "operator";
|
131 |
-
case "%":
|
132 |
-
if (stream.match("%%")) {
|
133 |
-
return "header";
|
134 |
-
} else if (stream.match(/[%][A-Za-z]+/)) {
|
135 |
-
return "keyword";
|
136 |
-
} else if (stream.match(/[%][}]/)) {
|
137 |
-
return "matchingbracket";
|
138 |
-
}
|
139 |
-
break;
|
140 |
-
case "/":
|
141 |
-
if (stream.match(/[\/][A-Za-z]+/)) {
|
142 |
-
return "keyword";
|
143 |
-
}
|
144 |
-
case "\\":
|
145 |
-
if (stream.match(/[\][a-z]+/)) {
|
146 |
-
return "string-2";
|
147 |
-
}
|
148 |
-
case ".":
|
149 |
-
if (stream.match(".")) {
|
150 |
-
return "atom";
|
151 |
-
}
|
152 |
-
case "*":
|
153 |
-
case "-":
|
154 |
-
case "+":
|
155 |
-
case "^":
|
156 |
-
if (stream.match(peek)) {
|
157 |
-
return "atom";
|
158 |
-
}
|
159 |
-
case "$":
|
160 |
-
if (stream.match("$$")) {
|
161 |
-
return "builtin";
|
162 |
-
} else if (stream.match(/[$][0-9]+/)) {
|
163 |
-
return "variable-3";
|
164 |
-
}
|
165 |
-
case "<":
|
166 |
-
if (stream.match(/<<[a-zA-Z_]+>>/)) {
|
167 |
-
return "builtin";
|
168 |
-
}
|
169 |
-
}
|
170 |
-
|
171 |
-
if (stream.match(/^\/\//)) {
|
172 |
-
stream.skipToEnd();
|
173 |
-
return "comment";
|
174 |
-
} else if (stream.match(/return/)) {
|
175 |
-
return "operator";
|
176 |
-
} else if (stream.match(/^[a-zA-Z_][a-zA-Z0-9_]*/)) {
|
177 |
-
if (stream.match(/(?=[\(.])/)) {
|
178 |
-
return "variable";
|
179 |
-
} else if (stream.match(/(?=[\s\n]*[:=])/)) {
|
180 |
-
return "def";
|
181 |
-
}
|
182 |
-
return "variable-2";
|
183 |
-
} else if (["[", "]", "(", ")"].indexOf(stream.peek()) != -1) {
|
184 |
-
stream.next();
|
185 |
-
return "bracket";
|
186 |
-
} else if (!stream.eatSpace()) {
|
187 |
-
stream.next();
|
188 |
-
}
|
189 |
-
return null;
|
190 |
-
}
|
191 |
-
};
|
192 |
-
});
|
193 |
-
|
194 |
-
CodeMirror.defineMIME("text/x-ebnf", "ebnf");
|
195 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/ebnf/index.html
DELETED
@@ -1,102 +0,0 @@
|
|
1 |
-
<!doctype html>
|
2 |
-
<html>
|
3 |
-
<head>
|
4 |
-
<title>CodeMirror: EBNF Mode</title>
|
5 |
-
<meta charset="utf-8"/>
|
6 |
-
<link rel=stylesheet href="../../doc/docs.css">
|
7 |
-
|
8 |
-
<link rel="stylesheet" href="../../lib/codemirror.css">
|
9 |
-
<script src="../../lib/codemirror.js"></script>
|
10 |
-
<script src="../javascript/javascript.js"></script>
|
11 |
-
<script src="ebnf.js"></script>
|
12 |
-
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
13 |
-
</head>
|
14 |
-
<body>
|
15 |
-
<div id=nav>
|
16 |
-
<a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
17 |
-
|
18 |
-
<ul>
|
19 |
-
<li><a href="../../index.html">Home</a>
|
20 |
-
<li><a href="../../doc/manual.html">Manual</a>
|
21 |
-
<li><a href="https://github.com/codemirror/codemirror">Code</a>
|
22 |
-
</ul>
|
23 |
-
<ul>
|
24 |
-
<li><a href="../index.html">Language modes</a>
|
25 |
-
<li><a class=active href="#">EBNF Mode</a>
|
26 |
-
</ul>
|
27 |
-
</div>
|
28 |
-
|
29 |
-
<article>
|
30 |
-
<h2>EBNF Mode (bracesMode setting = "javascript")</h2>
|
31 |
-
<form><textarea id="code" name="code">
|
32 |
-
/* description: Parses end executes mathematical expressions. */
|
33 |
-
|
34 |
-
/* lexical grammar */
|
35 |
-
%lex
|
36 |
-
|
37 |
-
%%
|
38 |
-
\s+ /* skip whitespace */
|
39 |
-
[0-9]+("."[0-9]+)?\b return 'NUMBER';
|
40 |
-
"*" return '*';
|
41 |
-
"/" return '/';
|
42 |
-
"-" return '-';
|
43 |
-
"+" return '+';
|
44 |
-
"^" return '^';
|
45 |
-
"(" return '(';
|
46 |
-
")" return ')';
|
47 |
-
"PI" return 'PI';
|
48 |
-
"E" return 'E';
|
49 |
-
<<EOF>> return 'EOF';
|
50 |
-
|
51 |
-
/lex
|
52 |
-
|
53 |
-
/* operator associations and precedence */
|
54 |
-
|
55 |
-
%left '+' '-'
|
56 |
-
%left '*' '/'
|
57 |
-
%left '^'
|
58 |
-
%left UMINUS
|
59 |
-
|
60 |
-
%start expressions
|
61 |
-
|
62 |
-
%% /* language grammar */
|
63 |
-
|
64 |
-
expressions
|
65 |
-
: e EOF
|
66 |
-
{print($1); return $1;}
|
67 |
-
;
|
68 |
-
|
69 |
-
e
|
70 |
-
: e '+' e
|
71 |
-
{$$ = $1+$3;}
|
72 |
-
| e '-' e
|
73 |
-
{$$ = $1-$3;}
|
74 |
-
| e '*' e
|
75 |
-
{$$ = $1*$3;}
|
76 |
-
| e '/' e
|
77 |
-
{$$ = $1/$3;}
|
78 |
-
| e '^' e
|
79 |
-
{$$ = Math.pow($1, $3);}
|
80 |
-
| '-' e %prec UMINUS
|
81 |
-
{$$ = -$2;}
|
82 |
-
| '(' e ')'
|
83 |
-
{$$ = $2;}
|
84 |
-
| NUMBER
|
85 |
-
{$$ = Number(yytext);}
|
86 |
-
| E
|
87 |
-
{$$ = Math.E;}
|
88 |
-
| PI
|
89 |
-
{$$ = Math.PI;}
|
90 |
-
;</textarea></form>
|
91 |
-
<script>
|
92 |
-
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
|
93 |
-
mode: {name: "ebnf"},
|
94 |
-
lineNumbers: true,
|
95 |
-
bracesMode: 'javascript'
|
96 |
-
});
|
97 |
-
</script>
|
98 |
-
<h3>The EBNF Mode</h3>
|
99 |
-
<p> Created by <a href="https://github.com/robertleeplummerjr">Robert Plummer</a></p>
|
100 |
-
</article>
|
101 |
-
</body>
|
102 |
-
</html>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/ecl/ecl.js
DELETED
@@ -1,206 +0,0 @@
|
|
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("ecl", function(config) {
|
15 |
-
|
16 |
-
function words(str) {
|
17 |
-
var obj = {}, words = str.split(" ");
|
18 |
-
for (var i = 0; i < words.length; ++i) obj[words[i]] = true;
|
19 |
-
return obj;
|
20 |
-
}
|
21 |
-
|
22 |
-
function metaHook(stream, state) {
|
23 |
-
if (!state.startOfLine) return false;
|
24 |
-
stream.skipToEnd();
|
25 |
-
return "meta";
|
26 |
-
}
|
27 |
-
|
28 |
-
var indentUnit = config.indentUnit;
|
29 |
-
var keyword = words("abs acos allnodes ascii asin asstring atan atan2 ave case choose choosen choosesets clustersize combine correlation cos cosh count covariance cron dataset dedup define denormalize distribute distributed distribution ebcdic enth error evaluate event eventextra eventname exists exp failcode failmessage fetch fromunicode getisvalid global graph group hash hash32 hash64 hashcrc hashmd5 having if index intformat isvalid iterate join keyunicode length library limit ln local log loop map matched matchlength matchposition matchtext matchunicode max merge mergejoin min nolocal nonempty normalize parse pipe power preload process project pull random range rank ranked realformat recordof regexfind regexreplace regroup rejected rollup round roundup row rowdiff sample set sin sinh sizeof soapcall sort sorted sqrt stepped stored sum table tan tanh thisnode topn tounicode transfer trim truncate typeof ungroup unicodeorder variance which workunit xmldecode xmlencode xmltext xmlunicode");
|
30 |
-
var variable = words("apply assert build buildindex evaluate fail keydiff keypatch loadxml nothor notify output parallel sequential soapcall wait");
|
31 |
-
var variable_2 = words("__compressed__ all and any as atmost before beginc++ best between case const counter csv descend encrypt end endc++ endmacro except exclusive expire export extend false few first flat from full function group header heading hole ifblock import in interface joined keep keyed last left limit load local locale lookup macro many maxcount maxlength min skew module named nocase noroot noscan nosort not of only opt or outer overwrite packed partition penalty physicallength pipe quote record relationship repeat return right scan self separator service shared skew skip sql store terminator thor threshold token transform trim true type unicodeorder unsorted validate virtual whole wild within xml xpath");
|
32 |
-
var variable_3 = words("ascii big_endian boolean data decimal ebcdic integer pattern qstring real record rule set of string token udecimal unicode unsigned varstring varunicode");
|
33 |
-
var builtin = words("checkpoint deprecated failcode failmessage failure global independent onwarning persist priority recovery stored success wait when");
|
34 |
-
var blockKeywords = words("catch class do else finally for if switch try while");
|
35 |
-
var atoms = words("true false null");
|
36 |
-
var hooks = {"#": metaHook};
|
37 |
-
var isOperatorChar = /[+\-*&%=<>!?|\/]/;
|
38 |
-
|
39 |
-
var curPunc;
|
40 |
-
|
41 |
-
function tokenBase(stream, state) {
|
42 |
-
var ch = stream.next();
|
43 |
-
if (hooks[ch]) {
|
44 |
-
var result = hooks[ch](stream, state);
|
45 |
-
if (result !== false) return result;
|
46 |
-
}
|
47 |
-
if (ch == '"' || ch == "'") {
|
48 |
-
state.tokenize = tokenString(ch);
|
49 |
-
return state.tokenize(stream, state);
|
50 |
-
}
|
51 |
-
if (/[\[\]{}\(\),;\:\.]/.test(ch)) {
|
52 |
-
curPunc = ch;
|
53 |
-
return null;
|
54 |
-
}
|
55 |
-
if (/\d/.test(ch)) {
|
56 |
-
stream.eatWhile(/[\w\.]/);
|
57 |
-
return "number";
|
58 |
-
}
|
59 |
-
if (ch == "/") {
|
60 |
-
if (stream.eat("*")) {
|
61 |
-
state.tokenize = tokenComment;
|
62 |
-
return tokenComment(stream, state);
|
63 |
-
}
|
64 |
-
if (stream.eat("/")) {
|
65 |
-
stream.skipToEnd();
|
66 |
-
return "comment";
|
67 |
-
}
|
68 |
-
}
|
69 |
-
if (isOperatorChar.test(ch)) {
|
70 |
-
stream.eatWhile(isOperatorChar);
|
71 |
-
return "operator";
|
72 |
-
}
|
73 |
-
stream.eatWhile(/[\w\$_]/);
|
74 |
-
var cur = stream.current().toLowerCase();
|
75 |
-
if (keyword.propertyIsEnumerable(cur)) {
|
76 |
-
if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement";
|
77 |
-
return "keyword";
|
78 |
-
} else if (variable.propertyIsEnumerable(cur)) {
|
79 |
-
if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement";
|
80 |
-
return "variable";
|
81 |
-
} else if (variable_2.propertyIsEnumerable(cur)) {
|
82 |
-
if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement";
|
83 |
-
return "variable-2";
|
84 |
-
} else if (variable_3.propertyIsEnumerable(cur)) {
|
85 |
-
if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement";
|
86 |
-
return "variable-3";
|
87 |
-
} else if (builtin.propertyIsEnumerable(cur)) {
|
88 |
-
if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement";
|
89 |
-
return "builtin";
|
90 |
-
} else { //Data types are of from KEYWORD##
|
91 |
-
var i = cur.length - 1;
|
92 |
-
while(i >= 0 && (!isNaN(cur[i]) || cur[i] == '_'))
|
93 |
-
--i;
|
94 |
-
|
95 |
-
if (i > 0) {
|
96 |
-
var cur2 = cur.substr(0, i + 1);
|
97 |
-
if (variable_3.propertyIsEnumerable(cur2)) {
|
98 |
-
if (blockKeywords.propertyIsEnumerable(cur2)) curPunc = "newstatement";
|
99 |
-
return "variable-3";
|
100 |
-
}
|
101 |
-
}
|
102 |
-
}
|
103 |
-
if (atoms.propertyIsEnumerable(cur)) return "atom";
|
104 |
-
return null;
|
105 |
-
}
|
106 |
-
|
107 |
-
function tokenString(quote) {
|
108 |
-
return function(stream, state) {
|
109 |
-
var escaped = false, next, end = false;
|
110 |
-
while ((next = stream.next()) != null) {
|
111 |
-
if (next == quote && !escaped) {end = true; break;}
|
112 |
-
escaped = !escaped && next == "\\";
|
113 |
-
}
|
114 |
-
if (end || !escaped)
|
115 |
-
state.tokenize = tokenBase;
|
116 |
-
return "string";
|
117 |
-
};
|
118 |
-
}
|
119 |
-
|
120 |
-
function tokenComment(stream, state) {
|
121 |
-
var maybeEnd = false, ch;
|
122 |
-
while (ch = stream.next()) {
|
123 |
-
if (ch == "/" && maybeEnd) {
|
124 |
-
state.tokenize = tokenBase;
|
125 |
-
break;
|
126 |
-
}
|
127 |
-
maybeEnd = (ch == "*");
|
128 |
-
}
|
129 |
-
return "comment";
|
130 |
-
}
|
131 |
-
|
132 |
-
function Context(indented, column, type, align, prev) {
|
133 |
-
this.indented = indented;
|
134 |
-
this.column = column;
|
135 |
-
this.type = type;
|
136 |
-
this.align = align;
|
137 |
-
this.prev = prev;
|
138 |
-
}
|
139 |
-
function pushContext(state, col, type) {
|
140 |
-
return state.context = new Context(state.indented, col, type, null, state.context);
|
141 |
-
}
|
142 |
-
function popContext(state) {
|
143 |
-
var t = state.context.type;
|
144 |
-
if (t == ")" || t == "]" || t == "}")
|
145 |
-
state.indented = state.context.indented;
|
146 |
-
return state.context = state.context.prev;
|
147 |
-
}
|
148 |
-
|
149 |
-
// Interface
|
150 |
-
|
151 |
-
return {
|
152 |
-
startState: function(basecolumn) {
|
153 |
-
return {
|
154 |
-
tokenize: null,
|
155 |
-
context: new Context((basecolumn || 0) - indentUnit, 0, "top", false),
|
156 |
-
indented: 0,
|
157 |
-
startOfLine: true
|
158 |
-
};
|
159 |
-
},
|
160 |
-
|
161 |
-
token: function(stream, state) {
|
162 |
-
var ctx = state.context;
|
163 |
-
if (stream.sol()) {
|
164 |
-
if (ctx.align == null) ctx.align = false;
|
165 |
-
state.indented = stream.indentation();
|
166 |
-
state.startOfLine = true;
|
167 |
-
}
|
168 |
-
if (stream.eatSpace()) return null;
|
169 |
-
curPunc = null;
|
170 |
-
var style = (state.tokenize || tokenBase)(stream, state);
|
171 |
-
if (style == "comment" || style == "meta") return style;
|
172 |
-
if (ctx.align == null) ctx.align = true;
|
173 |
-
|
174 |
-
if ((curPunc == ";" || curPunc == ":") && ctx.type == "statement") popContext(state);
|
175 |
-
else if (curPunc == "{") pushContext(state, stream.column(), "}");
|
176 |
-
else if (curPunc == "[") pushContext(state, stream.column(), "]");
|
177 |
-
else if (curPunc == "(") pushContext(state, stream.column(), ")");
|
178 |
-
else if (curPunc == "}") {
|
179 |
-
while (ctx.type == "statement") ctx = popContext(state);
|
180 |
-
if (ctx.type == "}") ctx = popContext(state);
|
181 |
-
while (ctx.type == "statement") ctx = popContext(state);
|
182 |
-
}
|
183 |
-
else if (curPunc == ctx.type) popContext(state);
|
184 |
-
else if (ctx.type == "}" || ctx.type == "top" || (ctx.type == "statement" && curPunc == "newstatement"))
|
185 |
-
pushContext(state, stream.column(), "statement");
|
186 |
-
state.startOfLine = false;
|
187 |
-
return style;
|
188 |
-
},
|
189 |
-
|
190 |
-
indent: function(state, textAfter) {
|
191 |
-
if (state.tokenize != tokenBase && state.tokenize != null) return 0;
|
192 |
-
var ctx = state.context, firstChar = textAfter && textAfter.charAt(0);
|
193 |
-
if (ctx.type == "statement" && firstChar == "}") ctx = ctx.prev;
|
194 |
-
var closing = firstChar == ctx.type;
|
195 |
-
if (ctx.type == "statement") return ctx.indented + (firstChar == "{" ? 0 : indentUnit);
|
196 |
-
else if (ctx.align) return ctx.column + (closing ? 0 : 1);
|
197 |
-
else return ctx.indented + (closing ? 0 : indentUnit);
|
198 |
-
},
|
199 |
-
|
200 |
-
electricChars: "{}"
|
201 |
-
};
|
202 |
-
});
|
203 |
-
|
204 |
-
CodeMirror.defineMIME("text/x-ecl", "ecl");
|
205 |
-
|
206 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/ecl/index.html
DELETED
@@ -1,52 +0,0 @@
|
|
1 |
-
<!doctype html>
|
2 |
-
|
3 |
-
<title>CodeMirror: ECL mode</title>
|
4 |
-
<meta charset="utf-8"/>
|
5 |
-
<link rel=stylesheet href="../../doc/docs.css">
|
6 |
-
|
7 |
-
<link rel="stylesheet" href="../../lib/codemirror.css">
|
8 |
-
<script src="../../lib/codemirror.js"></script>
|
9 |
-
<script src="ecl.js"></script>
|
10 |
-
<style>.CodeMirror {border: 1px solid black;}</style>
|
11 |
-
<div id=nav>
|
12 |
-
<a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
13 |
-
|
14 |
-
<ul>
|
15 |
-
<li><a href="../../index.html">Home</a>
|
16 |
-
<li><a href="../../doc/manual.html">Manual</a>
|
17 |
-
<li><a href="https://github.com/codemirror/codemirror">Code</a>
|
18 |
-
</ul>
|
19 |
-
<ul>
|
20 |
-
<li><a href="../index.html">Language modes</a>
|
21 |
-
<li><a class=active href="#">ECL</a>
|
22 |
-
</ul>
|
23 |
-
</div>
|
24 |
-
|
25 |
-
<article>
|
26 |
-
<h2>ECL mode</h2>
|
27 |
-
<form><textarea id="code" name="code">
|
28 |
-
/*
|
29 |
-
sample useless code to demonstrate ecl syntax highlighting
|
30 |
-
this is a multiline comment!
|
31 |
-
*/
|
32 |
-
|
33 |
-
// this is a singleline comment!
|
34 |
-
|
35 |
-
import ut;
|
36 |
-
r :=
|
37 |
-
record
|
38 |
-
string22 s1 := '123';
|
39 |
-
integer4 i1 := 123;
|
40 |
-
end;
|
41 |
-
#option('tmp', true);
|
42 |
-
d := dataset('tmp::qb', r, thor);
|
43 |
-
output(d);
|
44 |
-
</textarea></form>
|
45 |
-
<script>
|
46 |
-
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {});
|
47 |
-
</script>
|
48 |
-
|
49 |
-
<p>Based on CodeMirror's clike mode. For more information see <a href="http://hpccsystems.com">HPCC Systems</a> web site.</p>
|
50 |
-
<p><strong>MIME types defined:</strong> <code>text/x-ecl</code>.</p>
|
51 |
-
|
52 |
-
</article>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/eiffel/eiffel.js
DELETED
@@ -1,160 +0,0 @@
|
|
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("eiffel", function() {
|
15 |
-
function wordObj(words) {
|
16 |
-
var o = {};
|
17 |
-
for (var i = 0, e = words.length; i < e; ++i) o[words[i]] = true;
|
18 |
-
return o;
|
19 |
-
}
|
20 |
-
var keywords = wordObj([
|
21 |
-
'note',
|
22 |
-
'across',
|
23 |
-
'when',
|
24 |
-
'variant',
|
25 |
-
'until',
|
26 |
-
'unique',
|
27 |
-
'undefine',
|
28 |
-
'then',
|
29 |
-
'strip',
|
30 |
-
'select',
|
31 |
-
'retry',
|
32 |
-
'rescue',
|
33 |
-
'require',
|
34 |
-
'rename',
|
35 |
-
'reference',
|
36 |
-
'redefine',
|
37 |
-
'prefix',
|
38 |
-
'once',
|
39 |
-
'old',
|
40 |
-
'obsolete',
|
41 |
-
'loop',
|
42 |
-
'local',
|
43 |
-
'like',
|
44 |
-
'is',
|
45 |
-
'inspect',
|
46 |
-
'infix',
|
47 |
-
'include',
|
48 |
-
'if',
|
49 |
-
'frozen',
|
50 |
-
'from',
|
51 |
-
'external',
|
52 |
-
'export',
|
53 |
-
'ensure',
|
54 |
-
'end',
|
55 |
-
'elseif',
|
56 |
-
'else',
|
57 |
-
'do',
|
58 |
-
'creation',
|
59 |
-
'create',
|
60 |
-
'check',
|
61 |
-
'alias',
|
62 |
-
'agent',
|
63 |
-
'separate',
|
64 |
-
'invariant',
|
65 |
-
'inherit',
|
66 |
-
'indexing',
|
67 |
-
'feature',
|
68 |
-
'expanded',
|
69 |
-
'deferred',
|
70 |
-
'class',
|
71 |
-
'Void',
|
72 |
-
'True',
|
73 |
-
'Result',
|
74 |
-
'Precursor',
|
75 |
-
'False',
|
76 |
-
'Current',
|
77 |
-
'create',
|
78 |
-
'attached',
|
79 |
-
'detachable',
|
80 |
-
'as',
|
81 |
-
'and',
|
82 |
-
'implies',
|
83 |
-
'not',
|
84 |
-
'or'
|
85 |
-
]);
|
86 |
-
var operators = wordObj([":=", "and then","and", "or","<<",">>"]);
|
87 |
-
|
88 |
-
function chain(newtok, stream, state) {
|
89 |
-
state.tokenize.push(newtok);
|
90 |
-
return newtok(stream, state);
|
91 |
-
}
|
92 |
-
|
93 |
-
function tokenBase(stream, state) {
|
94 |
-
if (stream.eatSpace()) return null;
|
95 |
-
var ch = stream.next();
|
96 |
-
if (ch == '"'||ch == "'") {
|
97 |
-
return chain(readQuoted(ch, "string"), stream, state);
|
98 |
-
} else if (ch == "-"&&stream.eat("-")) {
|
99 |
-
stream.skipToEnd();
|
100 |
-
return "comment";
|
101 |
-
} else if (ch == ":"&&stream.eat("=")) {
|
102 |
-
return "operator";
|
103 |
-
} else if (/[0-9]/.test(ch)) {
|
104 |
-
stream.eatWhile(/[xXbBCc0-9\.]/);
|
105 |
-
stream.eat(/[\?\!]/);
|
106 |
-
return "ident";
|
107 |
-
} else if (/[a-zA-Z_0-9]/.test(ch)) {
|
108 |
-
stream.eatWhile(/[a-zA-Z_0-9]/);
|
109 |
-
stream.eat(/[\?\!]/);
|
110 |
-
return "ident";
|
111 |
-
} else if (/[=+\-\/*^%<>~]/.test(ch)) {
|
112 |
-
stream.eatWhile(/[=+\-\/*^%<>~]/);
|
113 |
-
return "operator";
|
114 |
-
} else {
|
115 |
-
return null;
|
116 |
-
}
|
117 |
-
}
|
118 |
-
|
119 |
-
function readQuoted(quote, style, unescaped) {
|
120 |
-
return function(stream, state) {
|
121 |
-
var escaped = false, ch;
|
122 |
-
while ((ch = stream.next()) != null) {
|
123 |
-
if (ch == quote && (unescaped || !escaped)) {
|
124 |
-
state.tokenize.pop();
|
125 |
-
break;
|
126 |
-
}
|
127 |
-
escaped = !escaped && ch == "%";
|
128 |
-
}
|
129 |
-
return style;
|
130 |
-
};
|
131 |
-
}
|
132 |
-
|
133 |
-
return {
|
134 |
-
startState: function() {
|
135 |
-
return {tokenize: [tokenBase]};
|
136 |
-
},
|
137 |
-
|
138 |
-
token: function(stream, state) {
|
139 |
-
var style = state.tokenize[state.tokenize.length-1](stream, state);
|
140 |
-
if (style == "ident") {
|
141 |
-
var word = stream.current();
|
142 |
-
style = keywords.propertyIsEnumerable(stream.current()) ? "keyword"
|
143 |
-
: operators.propertyIsEnumerable(stream.current()) ? "operator"
|
144 |
-
: /^[A-Z][A-Z_0-9]*$/g.test(word) ? "tag"
|
145 |
-
: /^0[bB][0-1]+$/g.test(word) ? "number"
|
146 |
-
: /^0[cC][0-7]+$/g.test(word) ? "number"
|
147 |
-
: /^0[xX][a-fA-F0-9]+$/g.test(word) ? "number"
|
148 |
-
: /^([0-9]+\.[0-9]*)|([0-9]*\.[0-9]+)$/g.test(word) ? "number"
|
149 |
-
: /^[0-9]+$/g.test(word) ? "number"
|
150 |
-
: "variable";
|
151 |
-
}
|
152 |
-
return style;
|
153 |
-
},
|
154 |
-
lineComment: "--"
|
155 |
-
};
|
156 |
-
});
|
157 |
-
|
158 |
-
CodeMirror.defineMIME("text/x-eiffel", "eiffel");
|
159 |
-
|
160 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/eiffel/index.html
DELETED
@@ -1,429 +0,0 @@
|
|
1 |
-
<!doctype html>
|
2 |
-
|
3 |
-
<title>CodeMirror: Eiffel mode</title>
|
4 |
-
<meta charset="utf-8"/>
|
5 |
-
<link rel=stylesheet href="../../doc/docs.css">
|
6 |
-
|
7 |
-
<link rel="stylesheet" href="../../lib/codemirror.css">
|
8 |
-
<link rel="stylesheet" href="../../theme/neat.css">
|
9 |
-
<script src="../../lib/codemirror.js"></script>
|
10 |
-
<script src="eiffel.js"></script>
|
11 |
-
<style>
|
12 |
-
.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}
|
13 |
-
.cm-s-default span.cm-arrow { color: red; }
|
14 |
-
</style>
|
15 |
-
<div id=nav>
|
16 |
-
<a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
17 |
-
|
18 |
-
<ul>
|
19 |
-
<li><a href="../../index.html">Home</a>
|
20 |
-
<li><a href="../../doc/manual.html">Manual</a>
|
21 |
-
<li><a href="https://github.com/codemirror/codemirror">Code</a>
|
22 |
-
</ul>
|
23 |
-
<ul>
|
24 |
-
<li><a href="../index.html">Language modes</a>
|
25 |
-
<li><a class=active href="#">Eiffel</a>
|
26 |
-
</ul>
|
27 |
-
</div>
|
28 |
-
|
29 |
-
<article>
|
30 |
-
<h2>Eiffel mode</h2>
|
31 |
-
<form><textarea id="code" name="code">
|
32 |
-
note
|
33 |
-
description: "[
|
34 |
-
Project-wide universal properties.
|
35 |
-
This class is an ancestor to all developer-written classes.
|
36 |
-
ANY may be customized for individual projects or teams.
|
37 |
-
]"
|
38 |
-
|
39 |
-
library: "Free implementation of ELKS library"
|
40 |
-
status: "See notice at end of class."
|
41 |
-
legal: "See notice at end of class."
|
42 |
-
date: "$Date: 2013-01-25 11:49:00 -0800 (Fri, 25 Jan 2013) $"
|
43 |
-
revision: "$Revision: 712 $"
|
44 |
-
|
45 |
-
class
|
46 |
-
ANY
|
47 |
-
|
48 |
-
feature -- Customization
|
49 |
-
|
50 |
-
feature -- Access
|
51 |
-
|
52 |
-
generator: STRING
|
53 |
-
-- Name of current object's generating class
|
54 |
-
-- (base class of the type of which it is a direct instance)
|
55 |
-
external
|
56 |
-
"built_in"
|
57 |
-
ensure
|
58 |
-
generator_not_void: Result /= Void
|
59 |
-
generator_not_empty: not Result.is_empty
|
60 |
-
end
|
61 |
-
|
62 |
-
generating_type: TYPE [detachable like Current]
|
63 |
-
-- Type of current object
|
64 |
-
-- (type of which it is a direct instance)
|
65 |
-
do
|
66 |
-
Result := {detachable like Current}
|
67 |
-
ensure
|
68 |
-
generating_type_not_void: Result /= Void
|
69 |
-
end
|
70 |
-
|
71 |
-
feature -- Status report
|
72 |
-
|
73 |
-
conforms_to (other: ANY): BOOLEAN
|
74 |
-
-- Does type of current object conform to type
|
75 |
-
-- of `other' (as per Eiffel: The Language, chapter 13)?
|
76 |
-
require
|
77 |
-
other_not_void: other /= Void
|
78 |
-
external
|
79 |
-
"built_in"
|
80 |
-
end
|
81 |
-
|
82 |
-
same_type (other: ANY): BOOLEAN
|
83 |
-
-- Is type of current object identical to type of `other'?
|
84 |
-
require
|
85 |
-
other_not_void: other /= Void
|
86 |
-
external
|
87 |
-
"built_in"
|
88 |
-
ensure
|
89 |
-
definition: Result = (conforms_to (other) and
|
90 |
-
other.conforms_to (Current))
|
91 |
-
end
|
92 |
-
|
93 |
-
feature -- Comparison
|
94 |
-
|
95 |
-
is_equal (other: like Current): BOOLEAN
|
96 |
-
-- Is `other' attached to an object considered
|
97 |
-
-- equal to current object?
|
98 |
-
require
|
99 |
-
other_not_void: other /= Void
|
100 |
-
external
|
101 |
-
"built_in"
|
102 |
-
ensure
|
103 |
-
symmetric: Result implies other ~ Current
|
104 |
-
consistent: standard_is_equal (other) implies Result
|
105 |
-
end
|
106 |
-
|
107 |
-
frozen standard_is_equal (other: like Current): BOOLEAN
|
108 |
-
-- Is `other' attached to an object of the same type
|
109 |
-
-- as current object, and field-by-field identical to it?
|
110 |
-
require
|
111 |
-
other_not_void: other /= Void
|
112 |
-
external
|
113 |
-
"built_in"
|
114 |
-
ensure
|
115 |
-
same_type: Result implies same_type (other)
|
116 |
-
symmetric: Result implies other.standard_is_equal (Current)
|
117 |
-
end
|
118 |
-
|
119 |
-
frozen equal (a: detachable ANY; b: like a): BOOLEAN
|
120 |
-
-- Are `a' and `b' either both void or attached
|
121 |
-
-- to objects considered equal?
|
122 |
-
do
|
123 |
-
if a = Void then
|
124 |
-
Result := b = Void
|
125 |
-
else
|
126 |
-
Result := b /= Void and then
|
127 |
-
a.is_equal (b)
|
128 |
-
end
|
129 |
-
ensure
|
130 |
-
definition: Result = (a = Void and b = Void) or else
|
131 |
-
((a /= Void and b /= Void) and then
|
132 |
-
a.is_equal (b))
|
133 |
-
end
|
134 |
-
|
135 |
-
frozen standard_equal (a: detachable ANY; b: like a): BOOLEAN
|
136 |
-
-- Are `a' and `b' either both void or attached to
|
137 |
-
-- field-by-field identical objects of the same type?
|
138 |
-
-- Always uses default object comparison criterion.
|
139 |
-
do
|
140 |
-
if a = Void then
|
141 |
-
Result := b = Void
|
142 |
-
else
|
143 |
-
Result := b /= Void and then
|
144 |
-
a.standard_is_equal (b)
|
145 |
-
end
|
146 |
-
ensure
|
147 |
-
definition: Result = (a = Void and b = Void) or else
|
148 |
-
((a /= Void and b /= Void) and then
|
149 |
-
a.standard_is_equal (b))
|
150 |
-
end
|
151 |
-
|
152 |
-
frozen is_deep_equal (other: like Current): BOOLEAN
|
153 |
-
-- Are `Current' and `other' attached to isomorphic object structures?
|
154 |
-
require
|
155 |
-
other_not_void: other /= Void
|
156 |
-
external
|
157 |
-
"built_in"
|
158 |
-
ensure
|
159 |
-
shallow_implies_deep: standard_is_equal (other) implies Result
|
160 |
-
same_type: Result implies same_type (other)
|
161 |
-
symmetric: Result implies other.is_deep_equal (Current)
|
162 |
-
end
|
163 |
-
|
164 |
-
frozen deep_equal (a: detachable ANY; b: like a): BOOLEAN
|
165 |
-
-- Are `a' and `b' either both void
|
166 |
-
-- or attached to isomorphic object structures?
|
167 |
-
do
|
168 |
-
if a = Void then
|
169 |
-
Result := b = Void
|
170 |
-
else
|
171 |
-
Result := b /= Void and then a.is_deep_equal (b)
|
172 |
-
end
|
173 |
-
ensure
|
174 |
-
shallow_implies_deep: standard_equal (a, b) implies Result
|
175 |
-
both_or_none_void: (a = Void) implies (Result = (b = Void))
|
176 |
-
same_type: (Result and (a /= Void)) implies (b /= Void and then a.same_type (b))
|
177 |
-
symmetric: Result implies deep_equal (b, a)
|
178 |
-
end
|
179 |
-
|
180 |
-
feature -- Duplication
|
181 |
-
|
182 |
-
frozen twin: like Current
|
183 |
-
-- New object equal to `Current'
|
184 |
-
-- `twin' calls `copy'; to change copying/twinning semantics, redefine `copy'.
|
185 |
-
external
|
186 |
-
"built_in"
|
187 |
-
ensure
|
188 |
-
twin_not_void: Result /= Void
|
189 |
-
is_equal: Result ~ Current
|
190 |
-
end
|
191 |
-
|
192 |
-
copy (other: like Current)
|
193 |
-
-- Update current object using fields of object attached
|
194 |
-
-- to `other', so as to yield equal objects.
|
195 |
-
require
|
196 |
-
other_not_void: other /= Void
|
197 |
-
type_identity: same_type (other)
|
198 |
-
external
|
199 |
-
"built_in"
|
200 |
-
ensure
|
201 |
-
is_equal: Current ~ other
|
202 |
-
end
|
203 |
-
|
204 |
-
frozen standard_copy (other: like Current)
|
205 |
-
-- Copy every field of `other' onto corresponding field
|
206 |
-
-- of current object.
|
207 |
-
require
|
208 |
-
other_not_void: other /= Void
|
209 |
-
type_identity: same_type (other)
|
210 |
-
external
|
211 |
-
"built_in"
|
212 |
-
ensure
|
213 |
-
is_standard_equal: standard_is_equal (other)
|
214 |
-
end
|
215 |
-
|
216 |
-
frozen clone (other: detachable ANY): like other
|
217 |
-
-- Void if `other' is void; otherwise new object
|
218 |
-
-- equal to `other'
|
219 |
-
--
|
220 |
-
-- For non-void `other', `clone' calls `copy';
|
221 |
-
-- to change copying/cloning semantics, redefine `copy'.
|
222 |
-
obsolete
|
223 |
-
"Use `twin' instead."
|
224 |
-
do
|
225 |
-
if other /= Void then
|
226 |
-
Result := other.twin
|
227 |
-
end
|
228 |
-
ensure
|
229 |
-
equal: Result ~ other
|
230 |
-
end
|
231 |
-
|
232 |
-
frozen standard_clone (other: detachable ANY): like other
|
233 |
-
-- Void if `other' is void; otherwise new object
|
234 |
-
-- field-by-field identical to `other'.
|
235 |
-
-- Always uses default copying semantics.
|
236 |
-
obsolete
|
237 |
-
"Use `standard_twin' instead."
|
238 |
-
do
|
239 |
-
if other /= Void then
|
240 |
-
Result := other.standard_twin
|
241 |
-
end
|
242 |
-
ensure
|
243 |
-
equal: standard_equal (Result, other)
|
244 |
-
end
|
245 |
-
|
246 |
-
frozen standard_twin: like Current
|
247 |
-
-- New object field-by-field identical to `other'.
|
248 |
-
-- Always uses default copying semantics.
|
249 |
-
external
|
250 |
-
"built_in"
|
251 |
-
ensure
|
252 |
-
standard_twin_not_void: Result /= Void
|
253 |
-
equal: standard_equal (Result, Current)
|
254 |
-
end
|
255 |
-
|
256 |
-
frozen deep_twin: like Current
|
257 |
-
-- New object structure recursively duplicated from Current.
|
258 |
-
external
|
259 |
-
"built_in"
|
260 |
-
ensure
|
261 |
-
deep_twin_not_void: Result /= Void
|
262 |
-
deep_equal: deep_equal (Current, Result)
|
263 |
-
end
|
264 |
-
|
265 |
-
frozen deep_clone (other: detachable ANY): like other
|
266 |
-
-- Void if `other' is void: otherwise, new object structure
|
267 |
-
-- recursively duplicated from the one attached to `other'
|
268 |
-
obsolete
|
269 |
-
"Use `deep_twin' instead."
|
270 |
-
do
|
271 |
-
if other /= Void then
|
272 |
-
Result := other.deep_twin
|
273 |
-
end
|
274 |
-
ensure
|
275 |
-
deep_equal: deep_equal (other, Result)
|
276 |
-
end
|
277 |
-
|
278 |
-
frozen deep_copy (other: like Current)
|
279 |
-
-- Effect equivalent to that of:
|
280 |
-
-- `copy' (`other' . `deep_twin')
|
281 |
-
require
|
282 |
-
other_not_void: other /= Void
|
283 |
-
do
|
284 |
-
copy (other.deep_twin)
|
285 |
-
ensure
|
286 |
-
deep_equal: deep_equal (Current, other)
|
287 |
-
end
|
288 |
-
|
289 |
-
feature {NONE} -- Retrieval
|
290 |
-
|
291 |
-
frozen internal_correct_mismatch
|
292 |
-
-- Called from runtime to perform a proper dynamic dispatch on `correct_mismatch'
|
293 |
-
-- from MISMATCH_CORRECTOR.
|
294 |
-
local
|
295 |
-
l_msg: STRING
|
296 |
-
l_exc: EXCEPTIONS
|
297 |
-
do
|
298 |
-
if attached {MISMATCH_CORRECTOR} Current as l_corrector then
|
299 |
-
l_corrector.correct_mismatch
|
300 |
-
else
|
301 |
-
create l_msg.make_from_string ("Mismatch: ")
|
302 |
-
create l_exc
|
303 |
-
l_msg.append (generating_type.name)
|
304 |
-
l_exc.raise_retrieval_exception (l_msg)
|
305 |
-
end
|
306 |
-
end
|
307 |
-
|
308 |
-
feature -- Output
|
309 |
-
|
310 |
-
io: STD_FILES
|
311 |
-
-- Handle to standard file setup
|
312 |
-
once
|
313 |
-
create Result
|
314 |
-
Result.set_output_default
|
315 |
-
ensure
|
316 |
-
io_not_void: Result /= Void
|
317 |
-
end
|
318 |
-
|
319 |
-
out: STRING
|
320 |
-
-- New string containing terse printable representation
|
321 |
-
-- of current object
|
322 |
-
do
|
323 |
-
Result := tagged_out
|
324 |
-
ensure
|
325 |
-
out_not_void: Result /= Void
|
326 |
-
end
|
327 |
-
|
328 |
-
frozen tagged_out: STRING
|
329 |
-
-- New string containing terse printable representation
|
330 |
-
-- of current object
|
331 |
-
external
|
332 |
-
"built_in"
|
333 |
-
ensure
|
334 |
-
tagged_out_not_void: Result /= Void
|
335 |
-
end
|
336 |
-
|
337 |
-
print (o: detachable ANY)
|
338 |
-
-- Write terse external representation of `o'
|
339 |
-
-- on standard output.
|
340 |
-
do
|
341 |
-
if o /= Void then
|
342 |
-
io.put_string (o.out)
|
343 |
-
end
|
344 |
-
end
|
345 |
-
|
346 |
-
feature -- Platform
|
347 |
-
|
348 |
-
Operating_environment: OPERATING_ENVIRONMENT
|
349 |
-
-- Objects available from the operating system
|
350 |
-
once
|
351 |
-
create Result
|
352 |
-
ensure
|
353 |
-
operating_environment_not_void: Result /= Void
|
354 |
-
end
|
355 |
-
|
356 |
-
feature {NONE} -- Initialization
|
357 |
-
|
358 |
-
default_create
|
359 |
-
-- Process instances of classes with no creation clause.
|
360 |
-
-- (Default: do nothing.)
|
361 |
-
do
|
362 |
-
end
|
363 |
-
|
364 |
-
feature -- Basic operations
|
365 |
-
|
366 |
-
default_rescue
|
367 |
-
-- Process exception for routines with no Rescue clause.
|
368 |
-
-- (Default: do nothing.)
|
369 |
-
do
|
370 |
-
end
|
371 |
-
|
372 |
-
frozen do_nothing
|
373 |
-
-- Execute a null action.
|
374 |
-
do
|
375 |
-
end
|
376 |
-
|
377 |
-
frozen default: detachable like Current
|
378 |
-
-- Default value of object's type
|
379 |
-
do
|
380 |
-
end
|
381 |
-
|
382 |
-
frozen default_pointer: POINTER
|
383 |
-
-- Default value of type `POINTER'
|
384 |
-
-- (Avoid the need to write `p'.`default' for
|
385 |
-
-- some `p' of type `POINTER'.)
|
386 |
-
do
|
387 |
-
ensure
|
388 |
-
-- Result = Result.default
|
389 |
-
end
|
390 |
-
|
391 |
-
frozen as_attached: attached like Current
|
392 |
-
-- Attached version of Current
|
393 |
-
-- (Can be used during transitional period to convert
|
394 |
-
-- non-void-safe classes to void-safe ones.)
|
395 |
-
do
|
396 |
-
Result := Current
|
397 |
-
end
|
398 |
-
|
399 |
-
invariant
|
400 |
-
reflexive_equality: standard_is_equal (Current)
|
401 |
-
reflexive_conformance: conforms_to (Current)
|
402 |
-
|
403 |
-
note
|
404 |
-
copyright: "Copyright (c) 1984-2012, Eiffel Software and others"
|
405 |
-
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
406 |
-
source: "[
|
407 |
-
Eiffel Software
|
408 |
-
5949 Hollister Ave., Goleta, CA 93117 USA
|
409 |
-
Telephone 805-685-1006, Fax 805-685-6869
|
410 |
-
Website http://www.eiffel.com
|
411 |
-
Customer support http://support.eiffel.com
|
412 |
-
]"
|
413 |
-
|
414 |
-
end
|
415 |
-
|
416 |
-
</textarea></form>
|
417 |
-
<script>
|
418 |
-
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
|
419 |
-
mode: "text/x-eiffel",
|
420 |
-
indentUnit: 4,
|
421 |
-
lineNumbers: true,
|
422 |
-
theme: "neat"
|
423 |
-
});
|
424 |
-
</script>
|
425 |
-
|
426 |
-
<p><strong>MIME types defined:</strong> <code>text/x-eiffel</code>.</p>
|
427 |
-
|
428 |
-
<p> Created by <a href="https://github.com/ynh">YNH</a>.</p>
|
429 |
-
</article>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/elm/elm.js
DELETED
@@ -1,205 +0,0 @@
|
|
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("elm", function() {
|
15 |
-
|
16 |
-
function switchState(source, setState, f) {
|
17 |
-
setState(f);
|
18 |
-
return f(source, setState);
|
19 |
-
}
|
20 |
-
|
21 |
-
// These should all be Unicode extended, as per the Haskell 2010 report
|
22 |
-
var smallRE = /[a-z_]/;
|
23 |
-
var largeRE = /[A-Z]/;
|
24 |
-
var digitRE = /[0-9]/;
|
25 |
-
var hexitRE = /[0-9A-Fa-f]/;
|
26 |
-
var octitRE = /[0-7]/;
|
27 |
-
var idRE = /[a-z_A-Z0-9\']/;
|
28 |
-
var symbolRE = /[-!#$%&*+.\/<=>?@\\^|~:\u03BB\u2192]/;
|
29 |
-
var specialRE = /[(),;[\]`{}]/;
|
30 |
-
var whiteCharRE = /[ \t\v\f]/; // newlines are handled in tokenizer
|
31 |
-
|
32 |
-
function normal() {
|
33 |
-
return function (source, setState) {
|
34 |
-
if (source.eatWhile(whiteCharRE)) {
|
35 |
-
return null;
|
36 |
-
}
|
37 |
-
|
38 |
-
var ch = source.next();
|
39 |
-
if (specialRE.test(ch)) {
|
40 |
-
if (ch == '{' && source.eat('-')) {
|
41 |
-
var t = "comment";
|
42 |
-
if (source.eat('#')) t = "meta";
|
43 |
-
return switchState(source, setState, ncomment(t, 1));
|
44 |
-
}
|
45 |
-
return null;
|
46 |
-
}
|
47 |
-
|
48 |
-
if (ch == '\'') {
|
49 |
-
if (source.eat('\\'))
|
50 |
-
source.next(); // should handle other escapes here
|
51 |
-
else
|
52 |
-
source.next();
|
53 |
-
|
54 |
-
if (source.eat('\''))
|
55 |
-
return "string";
|
56 |
-
return "error";
|
57 |
-
}
|
58 |
-
|
59 |
-
if (ch == '"') {
|
60 |
-
return switchState(source, setState, stringLiteral);
|
61 |
-
}
|
62 |
-
|
63 |
-
if (largeRE.test(ch)) {
|
64 |
-
source.eatWhile(idRE);
|
65 |
-
if (source.eat('.'))
|
66 |
-
return "qualifier";
|
67 |
-
return "variable-2";
|
68 |
-
}
|
69 |
-
|
70 |
-
if (smallRE.test(ch)) {
|
71 |
-
var isDef = source.pos === 1;
|
72 |
-
source.eatWhile(idRE);
|
73 |
-
return isDef ? "variable-3" : "variable";
|
74 |
-
}
|
75 |
-
|
76 |
-
if (digitRE.test(ch)) {
|
77 |
-
if (ch == '0') {
|
78 |
-
if (source.eat(/[xX]/)) {
|
79 |
-
source.eatWhile(hexitRE); // should require at least 1
|
80 |
-
return "integer";
|
81 |
-
}
|
82 |
-
if (source.eat(/[oO]/)) {
|
83 |
-
source.eatWhile(octitRE); // should require at least 1
|
84 |
-
return "number";
|
85 |
-
}
|
86 |
-
}
|
87 |
-
source.eatWhile(digitRE);
|
88 |
-
var t = "number";
|
89 |
-
if (source.eat('.')) {
|
90 |
-
t = "number";
|
91 |
-
source.eatWhile(digitRE); // should require at least 1
|
92 |
-
}
|
93 |
-
if (source.eat(/[eE]/)) {
|
94 |
-
t = "number";
|
95 |
-
source.eat(/[-+]/);
|
96 |
-
source.eatWhile(digitRE); // should require at least 1
|
97 |
-
}
|
98 |
-
return t;
|
99 |
-
}
|
100 |
-
|
101 |
-
if (symbolRE.test(ch)) {
|
102 |
-
if (ch == '-' && source.eat(/-/)) {
|
103 |
-
source.eatWhile(/-/);
|
104 |
-
if (!source.eat(symbolRE)) {
|
105 |
-
source.skipToEnd();
|
106 |
-
return "comment";
|
107 |
-
}
|
108 |
-
}
|
109 |
-
source.eatWhile(symbolRE);
|
110 |
-
return "builtin";
|
111 |
-
}
|
112 |
-
|
113 |
-
return "error";
|
114 |
-
}
|
115 |
-
}
|
116 |
-
|
117 |
-
function ncomment(type, nest) {
|
118 |
-
if (nest == 0) {
|
119 |
-
return normal();
|
120 |
-
}
|
121 |
-
return function(source, setState) {
|
122 |
-
var currNest = nest;
|
123 |
-
while (!source.eol()) {
|
124 |
-
var ch = source.next();
|
125 |
-
if (ch == '{' && source.eat('-')) {
|
126 |
-
++currNest;
|
127 |
-
} else if (ch == '-' && source.eat('}')) {
|
128 |
-
--currNest;
|
129 |
-
if (currNest == 0) {
|
130 |
-
setState(normal());
|
131 |
-
return type;
|
132 |
-
}
|
133 |
-
}
|
134 |
-
}
|
135 |
-
setState(ncomment(type, currNest));
|
136 |
-
return type;
|
137 |
-
}
|
138 |
-
}
|
139 |
-
|
140 |
-
function stringLiteral(source, setState) {
|
141 |
-
while (!source.eol()) {
|
142 |
-
var ch = source.next();
|
143 |
-
if (ch == '"') {
|
144 |
-
setState(normal());
|
145 |
-
return "string";
|
146 |
-
}
|
147 |
-
if (ch == '\\') {
|
148 |
-
if (source.eol() || source.eat(whiteCharRE)) {
|
149 |
-
setState(stringGap);
|
150 |
-
return "string";
|
151 |
-
}
|
152 |
-
if (!source.eat('&')) source.next(); // should handle other escapes here
|
153 |
-
}
|
154 |
-
}
|
155 |
-
setState(normal());
|
156 |
-
return "error";
|
157 |
-
}
|
158 |
-
|
159 |
-
function stringGap(source, setState) {
|
160 |
-
if (source.eat('\\')) {
|
161 |
-
return switchState(source, setState, stringLiteral);
|
162 |
-
}
|
163 |
-
source.next();
|
164 |
-
setState(normal());
|
165 |
-
return "error";
|
166 |
-
}
|
167 |
-
|
168 |
-
|
169 |
-
var wellKnownWords = (function() {
|
170 |
-
var wkw = {};
|
171 |
-
|
172 |
-
var keywords = [
|
173 |
-
"case", "of", "as",
|
174 |
-
"if", "then", "else",
|
175 |
-
"let", "in",
|
176 |
-
"infix", "infixl", "infixr",
|
177 |
-
"type", "alias",
|
178 |
-
"input", "output", "foreign", "loopback",
|
179 |
-
"module", "where", "import", "exposing",
|
180 |
-
"_", "..", "|", ":", "=", "\\", "\"", "->", "<-"
|
181 |
-
];
|
182 |
-
|
183 |
-
for (var i = keywords.length; i--;)
|
184 |
-
wkw[keywords[i]] = "keyword";
|
185 |
-
|
186 |
-
return wkw;
|
187 |
-
})();
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
return {
|
192 |
-
startState: function () { return { f: normal() }; },
|
193 |
-
copyState: function (s) { return { f: s.f }; },
|
194 |
-
|
195 |
-
token: function(stream, state) {
|
196 |
-
var t = state.f(stream, function(s) { state.f = s; });
|
197 |
-
var w = stream.current();
|
198 |
-
return (wellKnownWords.hasOwnProperty(w)) ? wellKnownWords[w] : t;
|
199 |
-
}
|
200 |
-
};
|
201 |
-
|
202 |
-
});
|
203 |
-
|
204 |
-
CodeMirror.defineMIME("text/x-elm", "elm");
|
205 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/elm/index.html
DELETED
@@ -1,61 +0,0 @@
|
|
1 |
-
<!doctype html>
|
2 |
-
|
3 |
-
<title>CodeMirror: Elm mode</title>
|
4 |
-
<meta charset="utf-8"/>
|
5 |
-
<link rel=stylesheet href="../../doc/docs.css">
|
6 |
-
|
7 |
-
<link rel="stylesheet" href="../../lib/codemirror.css">
|
8 |
-
<script src="../../lib/codemirror.js"></script>
|
9 |
-
<script src="elm.js"></script>
|
10 |
-
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
11 |
-
<div id=nav>
|
12 |
-
<a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
13 |
-
|
14 |
-
<ul>
|
15 |
-
<li><a href="../../index.html">Home</a>
|
16 |
-
<li><a href="../../doc/manual.html">Manual</a>
|
17 |
-
<li><a href="https://github.com/codemirror/codemirror">Code</a>
|
18 |
-
</ul>
|
19 |
-
<ul>
|
20 |
-
<li><a href="../index.html">Language modes</a>
|
21 |
-
<li><a class=active href="#">Elm</a>
|
22 |
-
</ul>
|
23 |
-
</div>
|
24 |
-
|
25 |
-
<article>
|
26 |
-
<h2>Elm mode</h2>
|
27 |
-
|
28 |
-
<div><textarea id="code" name="code">
|
29 |
-
import Color exposing (..)
|
30 |
-
import Graphics.Collage exposing (..)
|
31 |
-
import Graphics.Element exposing (..)
|
32 |
-
import Time exposing (..)
|
33 |
-
|
34 |
-
main =
|
35 |
-
Signal.map clock (every second)
|
36 |
-
|
37 |
-
clock t =
|
38 |
-
collage 400 400
|
39 |
-
[ filled lightGrey (ngon 12 110)
|
40 |
-
, outlined (solid grey) (ngon 12 110)
|
41 |
-
, hand orange 100 t
|
42 |
-
, hand charcoal 100 (t/60)
|
43 |
-
, hand charcoal 60 (t/720)
|
44 |
-
]
|
45 |
-
|
46 |
-
hand clr len time =
|
47 |
-
let angle = degrees (90 - 6 * inSeconds time)
|
48 |
-
in
|
49 |
-
segment (0,0) (fromPolar (len,angle))
|
50 |
-
|> traced (solid clr)
|
51 |
-
</textarea></div>
|
52 |
-
|
53 |
-
<script>
|
54 |
-
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
|
55 |
-
lineNumbers: true,
|
56 |
-
mode: "text/x-elm"
|
57 |
-
});
|
58 |
-
</script>
|
59 |
-
|
60 |
-
<p><strong>MIME types defined:</strong> <code>text/x-elm</code>.</p>
|
61 |
-
</article>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/erlang/erlang.js
DELETED
@@ -1,618 +0,0 @@
|
|
1 |
-
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
2 |
-
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
3 |
-
|
4 |
-
/*jshint unused:true, eqnull:true, curly:true, bitwise:true */
|
5 |
-
/*jshint undef:true, latedef:true, trailing:true */
|
6 |
-
/*global CodeMirror:true */
|
7 |
-
|
8 |
-
// erlang mode.
|
9 |
-
// tokenizer -> token types -> CodeMirror styles
|
10 |
-
// tokenizer maintains a parse stack
|
11 |
-
// indenter uses the parse stack
|
12 |
-
|
13 |
-
// TODO indenter:
|
14 |
-
// bit syntax
|
15 |
-
// old guard/bif/conversion clashes (e.g. "float/1")
|
16 |
-
// type/spec/opaque
|
17 |
-
|
18 |
-
(function(mod) {
|
19 |
-
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
20 |
-
mod(require("../../lib/codemirror"));
|
21 |
-
else if (typeof define == "function" && define.amd) // AMD
|
22 |
-
define(["../../lib/codemirror"], mod);
|
23 |
-
else // Plain browser env
|
24 |
-
mod(CodeMirror);
|
25 |
-
})(function(CodeMirror) {
|
26 |
-
"use strict";
|
27 |
-
|
28 |
-
CodeMirror.defineMIME("text/x-erlang", "erlang");
|
29 |
-
|
30 |
-
CodeMirror.defineMode("erlang", function(cmCfg) {
|
31 |
-
"use strict";
|
32 |
-
|
33 |
-
/////////////////////////////////////////////////////////////////////////////
|
34 |
-
// constants
|
35 |
-
|
36 |
-
var typeWords = [
|
37 |
-
"-type", "-spec", "-export_type", "-opaque"];
|
38 |
-
|
39 |
-
var keywordWords = [
|
40 |
-
"after","begin","catch","case","cond","end","fun","if",
|
41 |
-
"let","of","query","receive","try","when"];
|
42 |
-
|
43 |
-
var separatorRE = /[\->,;]/;
|
44 |
-
var separatorWords = [
|
45 |
-
"->",";",","];
|
46 |
-
|
47 |
-
var operatorAtomWords = [
|
48 |
-
"and","andalso","band","bnot","bor","bsl","bsr","bxor",
|
49 |
-
"div","not","or","orelse","rem","xor"];
|
50 |
-
|
51 |
-
var operatorSymbolRE = /[\+\-\*\/<>=\|:!]/;
|
52 |
-
var operatorSymbolWords = [
|
53 |
-
"=","+","-","*","/",">",">=","<","=<","=:=","==","=/=","/=","||","<-","!"];
|
54 |
-
|
55 |
-
var openParenRE = /[<\(\[\{]/;
|
56 |
-
var openParenWords = [
|
57 |
-
"<<","(","[","{"];
|
58 |
-
|
59 |
-
var closeParenRE = /[>\)\]\}]/;
|
60 |
-
var closeParenWords = [
|
61 |
-
"}","]",")",">>"];
|
62 |
-
|
63 |
-
var guardWords = [
|
64 |
-
"is_atom","is_binary","is_bitstring","is_boolean","is_float",
|
65 |
-
"is_function","is_integer","is_list","is_number","is_pid",
|
66 |
-
"is_port","is_record","is_reference","is_tuple",
|
67 |
-
"atom","binary","bitstring","boolean","function","integer","list",
|
68 |
-
"number","pid","port","record","reference","tuple"];
|
69 |
-
|
70 |
-
var bifWords = [
|
71 |
-
"abs","adler32","adler32_combine","alive","apply","atom_to_binary",
|
72 |
-
"atom_to_list","binary_to_atom","binary_to_existing_atom",
|
73 |
-
"binary_to_list","binary_to_term","bit_size","bitstring_to_list",
|
74 |
-
"byte_size","check_process_code","contact_binary","crc32",
|
75 |
-
"crc32_combine","date","decode_packet","delete_module",
|
76 |
-
"disconnect_node","element","erase","exit","float","float_to_list",
|
77 |
-
"garbage_collect","get","get_keys","group_leader","halt","hd",
|
78 |
-
"integer_to_list","internal_bif","iolist_size","iolist_to_binary",
|
79 |
-
"is_alive","is_atom","is_binary","is_bitstring","is_boolean",
|
80 |
-
"is_float","is_function","is_integer","is_list","is_number","is_pid",
|
81 |
-
"is_port","is_process_alive","is_record","is_reference","is_tuple",
|
82 |
-
"length","link","list_to_atom","list_to_binary","list_to_bitstring",
|
83 |
-
"list_to_existing_atom","list_to_float","list_to_integer",
|
84 |
-
"list_to_pid","list_to_tuple","load_module","make_ref","module_loaded",
|
85 |
-
"monitor_node","node","node_link","node_unlink","nodes","notalive",
|
86 |
-
"now","open_port","pid_to_list","port_close","port_command",
|
87 |
-
"port_connect","port_control","pre_loaded","process_flag",
|
88 |
-
"process_info","processes","purge_module","put","register",
|
89 |
-
"registered","round","self","setelement","size","spawn","spawn_link",
|
90 |
-
"spawn_monitor","spawn_opt","split_binary","statistics",
|
91 |
-
"term_to_binary","time","throw","tl","trunc","tuple_size",
|
92 |
-
"tuple_to_list","unlink","unregister","whereis"];
|
93 |
-
|
94 |
-
// upper case: [A-Z] [Ø-Þ] [À-Ö]
|
95 |
-
// lower case: [a-z] [ß-ö] [ø-ÿ]
|
96 |
-
var anumRE = /[\w@Ø-ÞÀ-Öß-öø-ÿ]/;
|
97 |
-
var escapesRE =
|
98 |
-
/[0-7]{1,3}|[bdefnrstv\\"']|\^[a-zA-Z]|x[0-9a-zA-Z]{2}|x{[0-9a-zA-Z]+}/;
|
99 |
-
|
100 |
-
/////////////////////////////////////////////////////////////////////////////
|
101 |
-
// tokenizer
|
102 |
-
|
103 |
-
function tokenizer(stream,state) {
|
104 |
-
// in multi-line string
|
105 |
-
if (state.in_string) {
|
106 |
-
state.in_string = (!doubleQuote(stream));
|
107 |
-
return rval(state,stream,"string");
|
108 |
-
}
|
109 |
-
|
110 |
-
// in multi-line atom
|
111 |
-
if (state.in_atom) {
|
112 |
-
state.in_atom = (!singleQuote(stream));
|
113 |
-
return rval(state,stream,"atom");
|
114 |
-
}
|
115 |
-
|
116 |
-
// whitespace
|
117 |
-
if (stream.eatSpace()) {
|
118 |
-
return rval(state,stream,"whitespace");
|
119 |
-
}
|
120 |
-
|
121 |
-
// attributes and type specs
|
122 |
-
if (!peekToken(state) &&
|
123 |
-
stream.match(/-\s*[a-zß-öø-ÿ][\wØ-ÞÀ-Öß-öø-ÿ]*/)) {
|
124 |
-
if (is_member(stream.current(),typeWords)) {
|
125 |
-
return rval(state,stream,"type");
|
126 |
-
}else{
|
127 |
-
return rval(state,stream,"attribute");
|
128 |
-
}
|
129 |
-
}
|
130 |
-
|
131 |
-
var ch = stream.next();
|
132 |
-
|
133 |
-
// comment
|
134 |
-
if (ch == '%') {
|
135 |
-
stream.skipToEnd();
|
136 |
-
return rval(state,stream,"comment");
|
137 |
-
}
|
138 |
-
|
139 |
-
// colon
|
140 |
-
if (ch == ":") {
|
141 |
-
return rval(state,stream,"colon");
|
142 |
-
}
|
143 |
-
|
144 |
-
// macro
|
145 |
-
if (ch == '?') {
|
146 |
-
stream.eatSpace();
|
147 |
-
stream.eatWhile(anumRE);
|
148 |
-
return rval(state,stream,"macro");
|
149 |
-
}
|
150 |
-
|
151 |
-
// record
|
152 |
-
if (ch == "#") {
|
153 |
-
stream.eatSpace();
|
154 |
-
stream.eatWhile(anumRE);
|
155 |
-
return rval(state,stream,"record");
|
156 |
-
}
|
157 |
-
|
158 |
-
// dollar escape
|
159 |
-
if (ch == "$") {
|
160 |
-
if (stream.next() == "\\" && !stream.match(escapesRE)) {
|
161 |
-
return rval(state,stream,"error");
|
162 |
-
}
|
163 |
-
return rval(state,stream,"number");
|
164 |
-
}
|
165 |
-
|
166 |
-
// dot
|
167 |
-
if (ch == ".") {
|
168 |
-
return rval(state,stream,"dot");
|
169 |
-
}
|
170 |
-
|
171 |
-
// quoted atom
|
172 |
-
if (ch == '\'') {
|
173 |
-
if (!(state.in_atom = (!singleQuote(stream)))) {
|
174 |
-
if (stream.match(/\s*\/\s*[0-9]/,false)) {
|
175 |
-
stream.match(/\s*\/\s*[0-9]/,true);
|
176 |
-
return rval(state,stream,"fun"); // 'f'/0 style fun
|
177 |
-
}
|
178 |
-
if (stream.match(/\s*\(/,false) || stream.match(/\s*:/,false)) {
|
179 |
-
return rval(state,stream,"function");
|
180 |
-
}
|
181 |
-
}
|
182 |
-
return rval(state,stream,"atom");
|
183 |
-
}
|
184 |
-
|
185 |
-
// string
|
186 |
-
if (ch == '"') {
|
187 |
-
state.in_string = (!doubleQuote(stream));
|
188 |
-
return rval(state,stream,"string");
|
189 |
-
}
|
190 |
-
|
191 |
-
// variable
|
192 |
-
if (/[A-Z_Ø-ÞÀ-Ö]/.test(ch)) {
|
193 |
-
stream.eatWhile(anumRE);
|
194 |
-
return rval(state,stream,"variable");
|
195 |
-
}
|
196 |
-
|
197 |
-
// atom/keyword/BIF/function
|
198 |
-
if (/[a-z_ß-öø-ÿ]/.test(ch)) {
|
199 |
-
stream.eatWhile(anumRE);
|
200 |
-
|
201 |
-
if (stream.match(/\s*\/\s*[0-9]/,false)) {
|
202 |
-
stream.match(/\s*\/\s*[0-9]/,true);
|
203 |
-
return rval(state,stream,"fun"); // f/0 style fun
|
204 |
-
}
|
205 |
-
|
206 |
-
var w = stream.current();
|
207 |
-
|
208 |
-
if (is_member(w,keywordWords)) {
|
209 |
-
return rval(state,stream,"keyword");
|
210 |
-
}else if (is_member(w,operatorAtomWords)) {
|
211 |
-
return rval(state,stream,"operator");
|
212 |
-
}else if (stream.match(/\s*\(/,false)) {
|
213 |
-
// 'put' and 'erlang:put' are bifs, 'foo:put' is not
|
214 |
-
if (is_member(w,bifWords) &&
|
215 |
-
((peekToken(state).token != ":") ||
|
216 |
-
(peekToken(state,2).token == "erlang"))) {
|
217 |
-
return rval(state,stream,"builtin");
|
218 |
-
}else if (is_member(w,guardWords)) {
|
219 |
-
return rval(state,stream,"guard");
|
220 |
-
}else{
|
221 |
-
return rval(state,stream,"function");
|
222 |
-
}
|
223 |
-
}else if (lookahead(stream) == ":") {
|
224 |
-
if (w == "erlang") {
|
225 |
-
return rval(state,stream,"builtin");
|
226 |
-
} else {
|
227 |
-
return rval(state,stream,"function");
|
228 |
-
}
|
229 |
-
}else if (is_member(w,["true","false"])) {
|
230 |
-
return rval(state,stream,"boolean");
|
231 |
-
}else{
|
232 |
-
return rval(state,stream,"atom");
|
233 |
-
}
|
234 |
-
}
|
235 |
-
|
236 |
-
// number
|
237 |
-
var digitRE = /[0-9]/;
|
238 |
-
var radixRE = /[0-9a-zA-Z]/; // 36#zZ style int
|
239 |
-
if (digitRE.test(ch)) {
|
240 |
-
stream.eatWhile(digitRE);
|
241 |
-
if (stream.eat('#')) { // 36#aZ style integer
|
242 |
-
if (!stream.eatWhile(radixRE)) {
|
243 |
-
stream.backUp(1); //"36#" - syntax error
|
244 |
-
}
|
245 |
-
} else if (stream.eat('.')) { // float
|
246 |
-
if (!stream.eatWhile(digitRE)) {
|
247 |
-
stream.backUp(1); // "3." - probably end of function
|
248 |
-
} else {
|
249 |
-
if (stream.eat(/[eE]/)) { // float with exponent
|
250 |
-
if (stream.eat(/[-+]/)) {
|
251 |
-
if (!stream.eatWhile(digitRE)) {
|
252 |
-
stream.backUp(2); // "2e-" - syntax error
|
253 |
-
}
|
254 |
-
} else {
|
255 |
-
if (!stream.eatWhile(digitRE)) {
|
256 |
-
stream.backUp(1); // "2e" - syntax error
|
257 |
-
}
|
258 |
-
}
|
259 |
-
}
|
260 |
-
}
|
261 |
-
}
|
262 |
-
return rval(state,stream,"number"); // normal integer
|
263 |
-
}
|
264 |
-
|
265 |
-
// open parens
|
266 |
-
if (nongreedy(stream,openParenRE,openParenWords)) {
|
267 |
-
return rval(state,stream,"open_paren");
|
268 |
-
}
|
269 |
-
|
270 |
-
// close parens
|
271 |
-
if (nongreedy(stream,closeParenRE,closeParenWords)) {
|
272 |
-
return rval(state,stream,"close_paren");
|
273 |
-
}
|
274 |
-
|
275 |
-
// separators
|
276 |
-
if (greedy(stream,separatorRE,separatorWords)) {
|
277 |
-
return rval(state,stream,"separator");
|
278 |
-
}
|
279 |
-
|
280 |
-
// operators
|
281 |
-
if (greedy(stream,operatorSymbolRE,operatorSymbolWords)) {
|
282 |
-
return rval(state,stream,"operator");
|
283 |
-
}
|
284 |
-
|
285 |
-
return rval(state,stream,null);
|
286 |
-
}
|
287 |
-
|
288 |
-
/////////////////////////////////////////////////////////////////////////////
|
289 |
-
// utilities
|
290 |
-
function nongreedy(stream,re,words) {
|
291 |
-
if (stream.current().length == 1 && re.test(stream.current())) {
|
292 |
-
stream.backUp(1);
|
293 |
-
while (re.test(stream.peek())) {
|
294 |
-
stream.next();
|
295 |
-
if (is_member(stream.current(),words)) {
|
296 |
-
return true;
|
297 |
-
}
|
298 |
-
}
|
299 |
-
stream.backUp(stream.current().length-1);
|
300 |
-
}
|
301 |
-
return false;
|
302 |
-
}
|
303 |
-
|
304 |
-
function greedy(stream,re,words) {
|
305 |
-
if (stream.current().length == 1 && re.test(stream.current())) {
|
306 |
-
while (re.test(stream.peek())) {
|
307 |
-
stream.next();
|
308 |
-
}
|
309 |
-
while (0 < stream.current().length) {
|
310 |
-
if (is_member(stream.current(),words)) {
|
311 |
-
return true;
|
312 |
-
}else{
|
313 |
-
stream.backUp(1);
|
314 |
-
}
|
315 |
-
}
|
316 |
-
stream.next();
|
317 |
-
}
|
318 |
-
return false;
|
319 |
-
}
|
320 |
-
|
321 |
-
function doubleQuote(stream) {
|
322 |
-
return quote(stream, '"', '\\');
|
323 |
-
}
|
324 |
-
|
325 |
-
function singleQuote(stream) {
|
326 |
-
return quote(stream,'\'','\\');
|
327 |
-
}
|
328 |
-
|
329 |
-
function quote(stream,quoteChar,escapeChar) {
|
330 |
-
while (!stream.eol()) {
|
331 |
-
var ch = stream.next();
|
332 |
-
if (ch == quoteChar) {
|
333 |
-
return true;
|
334 |
-
}else if (ch == escapeChar) {
|
335 |
-
stream.next();
|
336 |
-
}
|
337 |
-
}
|
338 |
-
return false;
|
339 |
-
}
|
340 |
-
|
341 |
-
function lookahead(stream) {
|
342 |
-
var m = stream.match(/([\n\s]+|%[^\n]*\n)*(.)/,false);
|
343 |
-
return m ? m.pop() : "";
|
344 |
-
}
|
345 |
-
|
346 |
-
function is_member(element,list) {
|
347 |
-
return (-1 < list.indexOf(element));
|
348 |
-
}
|
349 |
-
|
350 |
-
function rval(state,stream,type) {
|
351 |
-
|
352 |
-
// parse stack
|
353 |
-
pushToken(state,realToken(type,stream));
|
354 |
-
|
355 |
-
// map erlang token type to CodeMirror style class
|
356 |
-
// erlang -> CodeMirror tag
|
357 |
-
switch (type) {
|
358 |
-
case "atom": return "atom";
|
359 |
-
case "attribute": return "attribute";
|
360 |
-
case "boolean": return "atom";
|
361 |
-
case "builtin": return "builtin";
|
362 |
-
case "close_paren": return null;
|
363 |
-
case "colon": return null;
|
364 |
-
case "comment": return "comment";
|
365 |
-
case "dot": return null;
|
366 |
-
case "error": return "error";
|
367 |
-
case "fun": return "meta";
|
368 |
-
case "function": return "tag";
|
369 |
-
case "guard": return "property";
|
370 |
-
case "keyword": return "keyword";
|
371 |
-
case "macro": return "variable-2";
|
372 |
-
case "number": return "number";
|
373 |
-
case "open_paren": return null;
|
374 |
-
case "operator": return "operator";
|
375 |
-
case "record": return "bracket";
|
376 |
-
case "separator": return null;
|
377 |
-
case "string": return "string";
|
378 |
-
case "type": return "def";
|
379 |
-
case "variable": return "variable";
|
380 |
-
default: return null;
|
381 |
-
}
|
382 |
-
}
|
383 |
-
|
384 |
-
function aToken(tok,col,ind,typ) {
|
385 |
-
return {token: tok,
|
386 |
-
column: col,
|
387 |
-
indent: ind,
|
388 |
-
type: typ};
|
389 |
-
}
|
390 |
-
|
391 |
-
function realToken(type,stream) {
|
392 |
-
return aToken(stream.current(),
|
393 |
-
stream.column(),
|
394 |
-
stream.indentation(),
|
395 |
-
type);
|
396 |
-
}
|
397 |
-
|
398 |
-
function fakeToken(type) {
|
399 |
-
return aToken(type,0,0,type);
|
400 |
-
}
|
401 |
-
|
402 |
-
function peekToken(state,depth) {
|
403 |
-
var len = state.tokenStack.length;
|
404 |
-
var dep = (depth ? depth : 1);
|
405 |
-
|
406 |
-
if (len < dep) {
|
407 |
-
return false;
|
408 |
-
}else{
|
409 |
-
return state.tokenStack[len-dep];
|
410 |
-
}
|
411 |
-
}
|
412 |
-
|
413 |
-
function pushToken(state,token) {
|
414 |
-
|
415 |
-
if (!(token.type == "comment" || token.type == "whitespace")) {
|
416 |
-
state.tokenStack = maybe_drop_pre(state.tokenStack,token);
|
417 |
-
state.tokenStack = maybe_drop_post(state.tokenStack);
|
418 |
-
}
|
419 |
-
}
|
420 |
-
|
421 |
-
function maybe_drop_pre(s,token) {
|
422 |
-
var last = s.length-1;
|
423 |
-
|
424 |
-
if (0 < last && s[last].type === "record" && token.type === "dot") {
|
425 |
-
s.pop();
|
426 |
-
}else if (0 < last && s[last].type === "group") {
|
427 |
-
s.pop();
|
428 |
-
s.push(token);
|
429 |
-
}else{
|
430 |
-
s.push(token);
|
431 |
-
}
|
432 |
-
return s;
|
433 |
-
}
|
434 |
-
|
435 |
-
function maybe_drop_post(s) {
|
436 |
-
var last = s.length-1;
|
437 |
-
|
438 |
-
if (s[last].type === "dot") {
|
439 |
-
return [];
|
440 |
-
}
|
441 |
-
if (s[last].type === "fun" && s[last-1].token === "fun") {
|
442 |
-
return s.slice(0,last-1);
|
443 |
-
}
|
444 |
-
switch (s[s.length-1].token) {
|
445 |
-
case "}": return d(s,{g:["{"]});
|
446 |
-
case "]": return d(s,{i:["["]});
|
447 |
-
case ")": return d(s,{i:["("]});
|
448 |
-
case ">>": return d(s,{i:["<<"]});
|
449 |
-
case "end": return d(s,{i:["begin","case","fun","if","receive","try"]});
|
450 |
-
case ",": return d(s,{e:["begin","try","when","->",
|
451 |
-
",","(","[","{","<<"]});
|
452 |
-
case "->": return d(s,{r:["when"],
|
453 |
-
m:["try","if","case","receive"]});
|
454 |
-
case ";": return d(s,{E:["case","fun","if","receive","try","when"]});
|
455 |
-
case "catch":return d(s,{e:["try"]});
|
456 |
-
case "of": return d(s,{e:["case"]});
|
457 |
-
case "after":return d(s,{e:["receive","try"]});
|
458 |
-
default: return s;
|
459 |
-
}
|
460 |
-
}
|
461 |
-
|
462 |
-
function d(stack,tt) {
|
463 |
-
// stack is a stack of Token objects.
|
464 |
-
// tt is an object; {type:tokens}
|
465 |
-
// type is a char, tokens is a list of token strings.
|
466 |
-
// The function returns (possibly truncated) stack.
|
467 |
-
// It will descend the stack, looking for a Token such that Token.token
|
468 |
-
// is a member of tokens. If it does not find that, it will normally (but
|
469 |
-
// see "E" below) return stack. If it does find a match, it will remove
|
470 |
-
// all the Tokens between the top and the matched Token.
|
471 |
-
// If type is "m", that is all it does.
|
472 |
-
// If type is "i", it will also remove the matched Token and the top Token.
|
473 |
-
// If type is "g", like "i", but add a fake "group" token at the top.
|
474 |
-
// If type is "r", it will remove the matched Token, but not the top Token.
|
475 |
-
// If type is "e", it will keep the matched Token but not the top Token.
|
476 |
-
// If type is "E", it behaves as for type "e", except if there is no match,
|
477 |
-
// in which case it will return an empty stack.
|
478 |
-
|
479 |
-
for (var type in tt) {
|
480 |
-
var len = stack.length-1;
|
481 |
-
var tokens = tt[type];
|
482 |
-
for (var i = len-1; -1 < i ; i--) {
|
483 |
-
if (is_member(stack[i].token,tokens)) {
|
484 |
-
var ss = stack.slice(0,i);
|
485 |
-
switch (type) {
|
486 |
-
case "m": return ss.concat(stack[i]).concat(stack[len]);
|
487 |
-
case "r": return ss.concat(stack[len]);
|
488 |
-
case "i": return ss;
|
489 |
-
case "g": return ss.concat(fakeToken("group"));
|
490 |
-
case "E": return ss.concat(stack[i]);
|
491 |
-
case "e": return ss.concat(stack[i]);
|
492 |
-
}
|
493 |
-
}
|
494 |
-
}
|
495 |
-
}
|
496 |
-
return (type == "E" ? [] : stack);
|
497 |
-
}
|
498 |
-
|
499 |
-
/////////////////////////////////////////////////////////////////////////////
|
500 |
-
// indenter
|
501 |
-
|
502 |
-
function indenter(state,textAfter) {
|
503 |
-
var t;
|
504 |
-
var unit = cmCfg.indentUnit;
|
505 |
-
var wordAfter = wordafter(textAfter);
|
506 |
-
var currT = peekToken(state,1);
|
507 |
-
var prevT = peekToken(state,2);
|
508 |
-
|
509 |
-
if (state.in_string || state.in_atom) {
|
510 |
-
return CodeMirror.Pass;
|
511 |
-
}else if (!prevT) {
|
512 |
-
return 0;
|
513 |
-
}else if (currT.token == "when") {
|
514 |
-
return currT.column+unit;
|
515 |
-
}else if (wordAfter === "when" && prevT.type === "function") {
|
516 |
-
return prevT.indent+unit;
|
517 |
-
}else if (wordAfter === "(" && currT.token === "fun") {
|
518 |
-
return currT.column+3;
|
519 |
-
}else if (wordAfter === "catch" && (t = getToken(state,["try"]))) {
|
520 |
-
return t.column;
|
521 |
-
}else if (is_member(wordAfter,["end","after","of"])) {
|
522 |
-
t = getToken(state,["begin","case","fun","if","receive","try"]);
|
523 |
-
return t ? t.column : CodeMirror.Pass;
|
524 |
-
}else if (is_member(wordAfter,closeParenWords)) {
|
525 |
-
t = getToken(state,openParenWords);
|
526 |
-
return t ? t.column : CodeMirror.Pass;
|
527 |
-
}else if (is_member(currT.token,[",","|","||"]) ||
|
528 |
-
is_member(wordAfter,[",","|","||"])) {
|
529 |
-
t = postcommaToken(state);
|
530 |
-
return t ? t.column+t.token.length : unit;
|
531 |
-
}else if (currT.token == "->") {
|
532 |
-
if (is_member(prevT.token, ["receive","case","if","try"])) {
|
533 |
-
return prevT.column+unit+unit;
|
534 |
-
}else{
|
535 |
-
return prevT.column+unit;
|
536 |
-
}
|
537 |
-
}else if (is_member(currT.token,openParenWords)) {
|
538 |
-
return currT.column+currT.token.length;
|
539 |
-
}else{
|
540 |
-
t = defaultToken(state);
|
541 |
-
return truthy(t) ? t.column+unit : 0;
|
542 |
-
}
|
543 |
-
}
|
544 |
-
|
545 |
-
function wordafter(str) {
|
546 |
-
var m = str.match(/,|[a-z]+|\}|\]|\)|>>|\|+|\(/);
|
547 |
-
|
548 |
-
return truthy(m) && (m.index === 0) ? m[0] : "";
|
549 |
-
}
|
550 |
-
|
551 |
-
function postcommaToken(state) {
|
552 |
-
var objs = state.tokenStack.slice(0,-1);
|
553 |
-
var i = getTokenIndex(objs,"type",["open_paren"]);
|
554 |
-
|
555 |
-
return truthy(objs[i]) ? objs[i] : false;
|
556 |
-
}
|
557 |
-
|
558 |
-
function defaultToken(state) {
|
559 |
-
var objs = state.tokenStack;
|
560 |
-
var stop = getTokenIndex(objs,"type",["open_paren","separator","keyword"]);
|
561 |
-
var oper = getTokenIndex(objs,"type",["operator"]);
|
562 |
-
|
563 |
-
if (truthy(stop) && truthy(oper) && stop < oper) {
|
564 |
-
return objs[stop+1];
|
565 |
-
} else if (truthy(stop)) {
|
566 |
-
return objs[stop];
|
567 |
-
} else {
|
568 |
-
return false;
|
569 |
-
}
|
570 |
-
}
|
571 |
-
|
572 |
-
function getToken(state,tokens) {
|
573 |
-
var objs = state.tokenStack;
|
574 |
-
var i = getTokenIndex(objs,"token",tokens);
|
575 |
-
|
576 |
-
return truthy(objs[i]) ? objs[i] : false;
|
577 |
-
}
|
578 |
-
|
579 |
-
function getTokenIndex(objs,propname,propvals) {
|
580 |
-
|
581 |
-
for (var i = objs.length-1; -1 < i ; i--) {
|
582 |
-
if (is_member(objs[i][propname],propvals)) {
|
583 |
-
return i;
|
584 |
-
}
|
585 |
-
}
|
586 |
-
return false;
|
587 |
-
}
|
588 |
-
|
589 |
-
function truthy(x) {
|
590 |
-
return (x !== false) && (x != null);
|
591 |
-
}
|
592 |
-
|
593 |
-
/////////////////////////////////////////////////////////////////////////////
|
594 |
-
// this object defines the mode
|
595 |
-
|
596 |
-
return {
|
597 |
-
startState:
|
598 |
-
function() {
|
599 |
-
return {tokenStack: [],
|
600 |
-
in_string: false,
|
601 |
-
in_atom: false};
|
602 |
-
},
|
603 |
-
|
604 |
-
token:
|
605 |
-
function(stream, state) {
|
606 |
-
return tokenizer(stream, state);
|
607 |
-
},
|
608 |
-
|
609 |
-
indent:
|
610 |
-
function(state, textAfter) {
|
611 |
-
return indenter(state,textAfter);
|
612 |
-
},
|
613 |
-
|
614 |
-
lineComment: "%"
|
615 |
-
};
|
616 |
-
});
|
617 |
-
|
618 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/erlang/index.html
DELETED
@@ -1,76 +0,0 @@
|
|
1 |
-
<!doctype html>
|
2 |
-
|
3 |
-
<title>CodeMirror: Erlang mode</title>
|
4 |
-
<meta charset="utf-8"/>
|
5 |
-
<link rel=stylesheet href="../../doc/docs.css">
|
6 |
-
|
7 |
-
<link rel="stylesheet" href="../../lib/codemirror.css">
|
8 |
-
<link rel="stylesheet" href="../../theme/erlang-dark.css">
|
9 |
-
<script src="../../lib/codemirror.js"></script>
|
10 |
-
<script src="../../addon/edit/matchbrackets.js"></script>
|
11 |
-
<script src="erlang.js"></script>
|
12 |
-
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
13 |
-
<div id=nav>
|
14 |
-
<a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
15 |
-
|
16 |
-
<ul>
|
17 |
-
<li><a href="../../index.html">Home</a>
|
18 |
-
<li><a href="../../doc/manual.html">Manual</a>
|
19 |
-
<li><a href="https://github.com/codemirror/codemirror">Code</a>
|
20 |
-
</ul>
|
21 |
-
<ul>
|
22 |
-
<li><a href="../index.html">Language modes</a>
|
23 |
-
<li><a class=active href="#">Erlang</a>
|
24 |
-
</ul>
|
25 |
-
</div>
|
26 |
-
|
27 |
-
<article>
|
28 |
-
<h2>Erlang mode</h2>
|
29 |
-
<form><textarea id="code" name="code">
|
30 |
-
%% -*- mode: erlang; erlang-indent-level: 2 -*-
|
31 |
-
%%% Created : 7 May 2012 by mats cronqvist <masse@klarna.com>
|
32 |
-
|
33 |
-
%% @doc
|
34 |
-
%% Demonstrates how to print a record.
|
35 |
-
%% @end
|
36 |
-
|
37 |
-
-module('ex').
|
38 |
-
-author('mats cronqvist').
|
39 |
-
-export([demo/0,
|
40 |
-
rec_info/1]).
|
41 |
-
|
42 |
-
-record(demo,{a="One",b="Two",c="Three",d="Four"}).
|
43 |
-
|
44 |
-
rec_info(demo) -> record_info(fields,demo).
|
45 |
-
|
46 |
-
demo() -> expand_recs(?MODULE,#demo{a="A",b="BB"}).
|
47 |
-
|
48 |
-
expand_recs(M,List) when is_list(List) ->
|
49 |
-
[expand_recs(M,L)||L<-List];
|
50 |
-
expand_recs(M,Tup) when is_tuple(Tup) ->
|
51 |
-
case tuple_size(Tup) of
|
52 |
-
L when L < 1 -> Tup;
|
53 |
-
L ->
|
54 |
-
try
|
55 |
-
Fields = M:rec_info(element(1,Tup)),
|
56 |
-
L = length(Fields)+1,
|
57 |
-
lists:zip(Fields,expand_recs(M,tl(tuple_to_list(Tup))))
|
58 |
-
catch
|
59 |
-
_:_ -> list_to_tuple(expand_recs(M,tuple_to_list(Tup)))
|
60 |
-
end
|
61 |
-
end;
|
62 |
-
expand_recs(_,Term) ->
|
63 |
-
Term.
|
64 |
-
</textarea></form>
|
65 |
-
|
66 |
-
<script>
|
67 |
-
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
|
68 |
-
lineNumbers: true,
|
69 |
-
matchBrackets: true,
|
70 |
-
extraKeys: {"Tab": "indentAuto"},
|
71 |
-
theme: "erlang-dark"
|
72 |
-
});
|
73 |
-
</script>
|
74 |
-
|
75 |
-
<p><strong>MIME types defined:</strong> <code>text/x-erlang</code>.</p>
|
76 |
-
</article>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/factor/factor.js
DELETED
@@ -1,83 +0,0 @@
|
|
1 |
-
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
2 |
-
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
3 |
-
|
4 |
-
// Factor syntax highlight - simple mode
|
5 |
-
//
|
6 |
-
// by Dimage Sapelkin (https://github.com/kerabromsmu)
|
7 |
-
|
8 |
-
(function(mod) {
|
9 |
-
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
10 |
-
mod(require("../../lib/codemirror"), require("../../addon/mode/simple"));
|
11 |
-
else if (typeof define == "function" && define.amd) // AMD
|
12 |
-
define(["../../lib/codemirror", "../../addon/mode/simple"], mod);
|
13 |
-
else // Plain browser env
|
14 |
-
mod(CodeMirror);
|
15 |
-
})(function(CodeMirror) {
|
16 |
-
"use strict";
|
17 |
-
|
18 |
-
CodeMirror.defineSimpleMode("factor", {
|
19 |
-
// The start state contains the rules that are intially used
|
20 |
-
start: [
|
21 |
-
// comments
|
22 |
-
{regex: /#?!.*/, token: "comment"},
|
23 |
-
// strings """, multiline --> state
|
24 |
-
{regex: /"""/, token: "string", next: "string3"},
|
25 |
-
{regex: /"/, token: "string", next: "string"},
|
26 |
-
// numbers: dec, hex, unicode, bin, fractional, complex
|
27 |
-
{regex: /(?:[+-]?)(?:0x[\d,a-f]+)|(?:0o[0-7]+)|(?:0b[0,1]+)|(?:\d+.?\d*)/, token: "number"},
|
28 |
-
//{regex: /[+-]?/} //fractional
|
29 |
-
// definition: defining word, defined word, etc
|
30 |
-
{regex: /(\:)(\s+)(\S+)(\s+)(\()/, token: ["keyword", null, "def", null, "keyword"], next: "stack"},
|
31 |
-
// vocabulary using --> state
|
32 |
-
{regex: /USING\:/, token: "keyword", next: "vocabulary"},
|
33 |
-
// vocabulary definition/use
|
34 |
-
{regex: /(USE\:|IN\:)(\s+)(\S+)/, token: ["keyword", null, "variable-2"]},
|
35 |
-
// <constructors>
|
36 |
-
{regex: /<\S+>/, token: "builtin"},
|
37 |
-
// "keywords", incl. ; t f . [ ] { } defining words
|
38 |
-
{regex: /;|t|f|if|\.|\[|\]|\{|\}|MAIN:/, token: "keyword"},
|
39 |
-
// any id (?)
|
40 |
-
{regex: /\S+/, token: "variable"},
|
41 |
-
|
42 |
-
{
|
43 |
-
regex: /./,
|
44 |
-
token: null
|
45 |
-
}
|
46 |
-
],
|
47 |
-
vocabulary: [
|
48 |
-
{regex: /;/, token: "keyword", next: "start"},
|
49 |
-
{regex: /\S+/, token: "variable-2"},
|
50 |
-
{
|
51 |
-
regex: /./,
|
52 |
-
token: null
|
53 |
-
}
|
54 |
-
],
|
55 |
-
string: [
|
56 |
-
{regex: /(?:[^\\]|\\.)*?"/, token: "string", next: "start"},
|
57 |
-
{regex: /.*/, token: "string"}
|
58 |
-
],
|
59 |
-
string3: [
|
60 |
-
{regex: /(?:[^\\]|\\.)*?"""/, token: "string", next: "start"},
|
61 |
-
{regex: /.*/, token: "string"}
|
62 |
-
],
|
63 |
-
stack: [
|
64 |
-
{regex: /\)/, token: "meta", next: "start"},
|
65 |
-
{regex: /--/, token: "meta"},
|
66 |
-
{regex: /\S+/, token: "variable-3"},
|
67 |
-
{
|
68 |
-
regex: /./,
|
69 |
-
token: null
|
70 |
-
}
|
71 |
-
],
|
72 |
-
// The meta property contains global information about the mode. It
|
73 |
-
// can contain properties like lineComment, which are supported by
|
74 |
-
// all modes, and also directives like dontIndentStates, which are
|
75 |
-
// specific to simple modes.
|
76 |
-
meta: {
|
77 |
-
dontIndentStates: ["start", "vocabulary", "string", "string3", "stack"],
|
78 |
-
lineComment: [ "!", "#!" ]
|
79 |
-
}
|
80 |
-
});
|
81 |
-
|
82 |
-
CodeMirror.defineMIME("text/x-factor", "factor");
|
83 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/factor/index.html
DELETED
@@ -1,77 +0,0 @@
|
|
1 |
-
<!doctype html>
|
2 |
-
|
3 |
-
<title>CodeMirror: Factor mode</title>
|
4 |
-
<meta charset="utf-8"/>
|
5 |
-
<link rel=stylesheet href="../../doc/docs.css">
|
6 |
-
|
7 |
-
<link href='http://fonts.googleapis.com/css?family=Droid+Sans+Mono' rel='stylesheet' type='text/css'>
|
8 |
-
<link rel="stylesheet" href="../../lib/codemirror.css">
|
9 |
-
<script src="../../lib/codemirror.js"></script>
|
10 |
-
<script src="../../addon/mode/simple.js"></script>
|
11 |
-
<script src="factor.js"></script>
|
12 |
-
<style>
|
13 |
-
.CodeMirror {
|
14 |
-
font-family: 'Droid Sans Mono', monospace;
|
15 |
-
font-size: 14px;
|
16 |
-
}
|
17 |
-
</style>
|
18 |
-
<div id=nav>
|
19 |
-
<a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
20 |
-
|
21 |
-
<ul>
|
22 |
-
<li><a href="../../index.html">Home</a>
|
23 |
-
<li><a href="../../doc/manual.html">Manual</a>
|
24 |
-
<li><a href="https://github.com/codemirror/codemirror">Code</a>
|
25 |
-
</ul>
|
26 |
-
<ul>
|
27 |
-
<li><a href="../index.html">Language modes</a>
|
28 |
-
<li><a class=active href="#">Factor</a>
|
29 |
-
</ul>
|
30 |
-
</div>
|
31 |
-
|
32 |
-
<article>
|
33 |
-
|
34 |
-
<h2>Factor mode</h2>
|
35 |
-
|
36 |
-
<form><textarea id="code" name="code">
|
37 |
-
! Copyright (C) 2008 Slava Pestov.
|
38 |
-
! See http://factorcode.org/license.txt for BSD license.
|
39 |
-
|
40 |
-
! A simple time server
|
41 |
-
|
42 |
-
USING: accessors calendar calendar.format io io.encodings.ascii
|
43 |
-
io.servers kernel threads ;
|
44 |
-
IN: time-server
|
45 |
-
|
46 |
-
: handle-time-client ( -- )
|
47 |
-
now timestamp>rfc822 print ;
|
48 |
-
|
49 |
-
: <time-server> ( -- threaded-server )
|
50 |
-
ascii <threaded-server>
|
51 |
-
"time-server" >>name
|
52 |
-
1234 >>insecure
|
53 |
-
[ handle-time-client ] >>handler ;
|
54 |
-
|
55 |
-
: start-time-server ( -- )
|
56 |
-
<time-server> start-server drop ;
|
57 |
-
|
58 |
-
MAIN: start-time-server
|
59 |
-
</textarea>
|
60 |
-
</form>
|
61 |
-
|
62 |
-
<script>
|
63 |
-
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
|
64 |
-
lineNumbers: true,
|
65 |
-
lineWrapping: true,
|
66 |
-
indentUnit: 2,
|
67 |
-
tabSize: 2,
|
68 |
-
autofocus: true,
|
69 |
-
mode: "text/x-factor"
|
70 |
-
});
|
71 |
-
</script>
|
72 |
-
<p/>
|
73 |
-
<p>Simple mode that handles Factor Syntax (<a href="http://en.wikipedia.org/wiki/Factor_(programming_language)">Factor on WikiPedia</a>).</p>
|
74 |
-
|
75 |
-
<p><strong>MIME types defined:</strong> <code>text/x-factor</code>.</p>
|
76 |
-
|
77 |
-
</article>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/forth/forth.js
DELETED
@@ -1,180 +0,0 @@
|
|
1 |
-
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
2 |
-
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
3 |
-
|
4 |
-
// Author: Aliaksei Chapyzhenka
|
5 |
-
|
6 |
-
(function(mod) {
|
7 |
-
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
8 |
-
mod(require("../../lib/codemirror"));
|
9 |
-
else if (typeof define == "function" && define.amd) // AMD
|
10 |
-
define(["../../lib/codemirror"], mod);
|
11 |
-
else // Plain browser env
|
12 |
-
mod(CodeMirror);
|
13 |
-
})(function(CodeMirror) {
|
14 |
-
"use strict";
|
15 |
-
|
16 |
-
function toWordList(words) {
|
17 |
-
var ret = [];
|
18 |
-
words.split(' ').forEach(function(e){
|
19 |
-
ret.push({name: e});
|
20 |
-
});
|
21 |
-
return ret;
|
22 |
-
}
|
23 |
-
|
24 |
-
var coreWordList = toWordList(
|
25 |
-
'INVERT AND OR XOR\
|
26 |
-
2* 2/ LSHIFT RSHIFT\
|
27 |
-
0= = 0< < > U< MIN MAX\
|
28 |
-
2DROP 2DUP 2OVER 2SWAP ?DUP DEPTH DROP DUP OVER ROT SWAP\
|
29 |
-
>R R> R@\
|
30 |
-
+ - 1+ 1- ABS NEGATE\
|
31 |
-
S>D * M* UM*\
|
32 |
-
FM/MOD SM/REM UM/MOD */ */MOD / /MOD MOD\
|
33 |
-
HERE , @ ! CELL+ CELLS C, C@ C! CHARS 2@ 2!\
|
34 |
-
ALIGN ALIGNED +! ALLOT\
|
35 |
-
CHAR [CHAR] [ ] BL\
|
36 |
-
FIND EXECUTE IMMEDIATE COUNT LITERAL STATE\
|
37 |
-
; DOES> >BODY\
|
38 |
-
EVALUATE\
|
39 |
-
SOURCE >IN\
|
40 |
-
<# # #S #> HOLD SIGN BASE >NUMBER HEX DECIMAL\
|
41 |
-
FILL MOVE\
|
42 |
-
. CR EMIT SPACE SPACES TYPE U. .R U.R\
|
43 |
-
ACCEPT\
|
44 |
-
TRUE FALSE\
|
45 |
-
<> U> 0<> 0>\
|
46 |
-
NIP TUCK ROLL PICK\
|
47 |
-
2>R 2R@ 2R>\
|
48 |
-
WITHIN UNUSED MARKER\
|
49 |
-
I J\
|
50 |
-
TO\
|
51 |
-
COMPILE, [COMPILE]\
|
52 |
-
SAVE-INPUT RESTORE-INPUT\
|
53 |
-
PAD ERASE\
|
54 |
-
2LITERAL DNEGATE\
|
55 |
-
D- D+ D0< D0= D2* D2/ D< D= DMAX DMIN D>S DABS\
|
56 |
-
M+ M*/ D. D.R 2ROT DU<\
|
57 |
-
CATCH THROW\
|
58 |
-
FREE RESIZE ALLOCATE\
|
59 |
-
CS-PICK CS-ROLL\
|
60 |
-
GET-CURRENT SET-CURRENT FORTH-WORDLIST GET-ORDER SET-ORDER\
|
61 |
-
PREVIOUS SEARCH-WORDLIST WORDLIST FIND ALSO ONLY FORTH DEFINITIONS ORDER\
|
62 |
-
-TRAILING /STRING SEARCH COMPARE CMOVE CMOVE> BLANK SLITERAL');
|
63 |
-
|
64 |
-
var immediateWordList = toWordList('IF ELSE THEN BEGIN WHILE REPEAT UNTIL RECURSE [IF] [ELSE] [THEN] ?DO DO LOOP +LOOP UNLOOP LEAVE EXIT AGAIN CASE OF ENDOF ENDCASE');
|
65 |
-
|
66 |
-
CodeMirror.defineMode('forth', function() {
|
67 |
-
function searchWordList (wordList, word) {
|
68 |
-
var i;
|
69 |
-
for (i = wordList.length - 1; i >= 0; i--) {
|
70 |
-
if (wordList[i].name === word.toUpperCase()) {
|
71 |
-
return wordList[i];
|
72 |
-
}
|
73 |
-
}
|
74 |
-
return undefined;
|
75 |
-
}
|
76 |
-
return {
|
77 |
-
startState: function() {
|
78 |
-
return {
|
79 |
-
state: '',
|
80 |
-
base: 10,
|
81 |
-
coreWordList: coreWordList,
|
82 |
-
immediateWordList: immediateWordList,
|
83 |
-
wordList: []
|
84 |
-
};
|
85 |
-
},
|
86 |
-
token: function (stream, stt) {
|
87 |
-
var mat;
|
88 |
-
if (stream.eatSpace()) {
|
89 |
-
return null;
|
90 |
-
}
|
91 |
-
if (stt.state === '') { // interpretation
|
92 |
-
if (stream.match(/^(\]|:NONAME)(\s|$)/i)) {
|
93 |
-
stt.state = ' compilation';
|
94 |
-
return 'builtin compilation';
|
95 |
-
}
|
96 |
-
mat = stream.match(/^(\:)\s+(\S+)(\s|$)+/);
|
97 |
-
if (mat) {
|
98 |
-
stt.wordList.push({name: mat[2].toUpperCase()});
|
99 |
-
stt.state = ' compilation';
|
100 |
-
return 'def' + stt.state;
|
101 |
-
}
|
102 |
-
mat = stream.match(/^(VARIABLE|2VARIABLE|CONSTANT|2CONSTANT|CREATE|POSTPONE|VALUE|WORD)\s+(\S+)(\s|$)+/i);
|
103 |
-
if (mat) {
|
104 |
-
stt.wordList.push({name: mat[2].toUpperCase()});
|
105 |
-
return 'def' + stt.state;
|
106 |
-
}
|
107 |
-
mat = stream.match(/^(\'|\[\'\])\s+(\S+)(\s|$)+/);
|
108 |
-
if (mat) {
|
109 |
-
return 'builtin' + stt.state;
|
110 |
-
}
|
111 |
-
} else { // compilation
|
112 |
-
// ; [
|
113 |
-
if (stream.match(/^(\;|\[)(\s)/)) {
|
114 |
-
stt.state = '';
|
115 |
-
stream.backUp(1);
|
116 |
-
return 'builtin compilation';
|
117 |
-
}
|
118 |
-
if (stream.match(/^(\;|\[)($)/)) {
|
119 |
-
stt.state = '';
|
120 |
-
return 'builtin compilation';
|
121 |
-
}
|
122 |
-
if (stream.match(/^(POSTPONE)\s+\S+(\s|$)+/)) {
|
123 |
-
return 'builtin';
|
124 |
-
}
|
125 |
-
}
|
126 |
-
|
127 |
-
// dynamic wordlist
|
128 |
-
mat = stream.match(/^(\S+)(\s+|$)/);
|
129 |
-
if (mat) {
|
130 |
-
if (searchWordList(stt.wordList, mat[1]) !== undefined) {
|
131 |
-
return 'variable' + stt.state;
|
132 |
-
}
|
133 |
-
|
134 |
-
// comments
|
135 |
-
if (mat[1] === '\\') {
|
136 |
-
stream.skipToEnd();
|
137 |
-
return 'comment' + stt.state;
|
138 |
-
}
|
139 |
-
|
140 |
-
// core words
|
141 |
-
if (searchWordList(stt.coreWordList, mat[1]) !== undefined) {
|
142 |
-
return 'builtin' + stt.state;
|
143 |
-
}
|
144 |
-
if (searchWordList(stt.immediateWordList, mat[1]) !== undefined) {
|
145 |
-
return 'keyword' + stt.state;
|
146 |
-
}
|
147 |
-
|
148 |
-
if (mat[1] === '(') {
|
149 |
-
stream.eatWhile(function (s) { return s !== ')'; });
|
150 |
-
stream.eat(')');
|
151 |
-
return 'comment' + stt.state;
|
152 |
-
}
|
153 |
-
|
154 |
-
// // strings
|
155 |
-
if (mat[1] === '.(') {
|
156 |
-
stream.eatWhile(function (s) { return s !== ')'; });
|
157 |
-
stream.eat(')');
|
158 |
-
return 'string' + stt.state;
|
159 |
-
}
|
160 |
-
if (mat[1] === 'S"' || mat[1] === '."' || mat[1] === 'C"') {
|
161 |
-
stream.eatWhile(function (s) { return s !== '"'; });
|
162 |
-
stream.eat('"');
|
163 |
-
return 'string' + stt.state;
|
164 |
-
}
|
165 |
-
|
166 |
-
// numbers
|
167 |
-
if (mat[1] - 0xfffffffff) {
|
168 |
-
return 'number' + stt.state;
|
169 |
-
}
|
170 |
-
// if (mat[1].match(/^[-+]?[0-9]+\.[0-9]*/)) {
|
171 |
-
// return 'number' + stt.state;
|
172 |
-
// }
|
173 |
-
|
174 |
-
return 'atom' + stt.state;
|
175 |
-
}
|
176 |
-
}
|
177 |
-
};
|
178 |
-
});
|
179 |
-
CodeMirror.defineMIME("text/x-forth", "forth");
|
180 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/forth/index.html
DELETED
@@ -1,75 +0,0 @@
|
|
1 |
-
<!doctype html>
|
2 |
-
|
3 |
-
<title>CodeMirror: Forth mode</title>
|
4 |
-
<meta charset="utf-8"/>
|
5 |
-
<link rel=stylesheet href="../../doc/docs.css">
|
6 |
-
|
7 |
-
<link href='http://fonts.googleapis.com/css?family=Droid+Sans+Mono' rel='stylesheet' type='text/css'>
|
8 |
-
<link rel="stylesheet" href="../../lib/codemirror.css">
|
9 |
-
<link rel=stylesheet href="../../theme/colorforth.css">
|
10 |
-
<script src="../../lib/codemirror.js"></script>
|
11 |
-
<script src="forth.js"></script>
|
12 |
-
<style>
|
13 |
-
.CodeMirror {
|
14 |
-
font-family: 'Droid Sans Mono', monospace;
|
15 |
-
font-size: 14px;
|
16 |
-
}
|
17 |
-
</style>
|
18 |
-
<div id=nav>
|
19 |
-
<a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
20 |
-
|
21 |
-
<ul>
|
22 |
-
<li><a href="../../index.html">Home</a>
|
23 |
-
<li><a href="../../doc/manual.html">Manual</a>
|
24 |
-
<li><a href="https://github.com/codemirror/codemirror">Code</a>
|
25 |
-
</ul>
|
26 |
-
<ul>
|
27 |
-
<li><a href="../index.html">Language modes</a>
|
28 |
-
<li><a class=active href="#">Forth</a>
|
29 |
-
</ul>
|
30 |
-
</div>
|
31 |
-
|
32 |
-
<article>
|
33 |
-
|
34 |
-
<h2>Forth mode</h2>
|
35 |
-
|
36 |
-
<form><textarea id="code" name="code">
|
37 |
-
\ Insertion sort
|
38 |
-
|
39 |
-
: cell- 1 cells - ;
|
40 |
-
|
41 |
-
: insert ( start end -- start )
|
42 |
-
dup @ >r ( r: v )
|
43 |
-
begin
|
44 |
-
2dup <
|
45 |
-
while
|
46 |
-
r@ over cell- @ <
|
47 |
-
while
|
48 |
-
cell-
|
49 |
-
dup @ over cell+ !
|
50 |
-
repeat then
|
51 |
-
r> swap ! ;
|
52 |
-
|
53 |
-
: sort ( array len -- )
|
54 |
-
1 ?do
|
55 |
-
dup i cells + insert
|
56 |
-
loop drop ;</textarea>
|
57 |
-
</form>
|
58 |
-
|
59 |
-
<script>
|
60 |
-
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
|
61 |
-
lineNumbers: true,
|
62 |
-
lineWrapping: true,
|
63 |
-
indentUnit: 2,
|
64 |
-
tabSize: 2,
|
65 |
-
autofocus: true,
|
66 |
-
theme: "colorforth",
|
67 |
-
mode: "text/x-forth"
|
68 |
-
});
|
69 |
-
</script>
|
70 |
-
|
71 |
-
<p>Simple mode that handle Forth-Syntax (<a href="http://en.wikipedia.org/wiki/Forth_%28programming_language%29">Forth on WikiPedia</a>).</p>
|
72 |
-
|
73 |
-
<p><strong>MIME types defined:</strong> <code>text/x-forth</code>.</p>
|
74 |
-
|
75 |
-
</article>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/fortran/fortran.js
DELETED
@@ -1,188 +0,0 @@
|
|
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("fortran", function() {
|
15 |
-
function words(array) {
|
16 |
-
var keys = {};
|
17 |
-
for (var i = 0; i < array.length; ++i) {
|
18 |
-
keys[array[i]] = true;
|
19 |
-
}
|
20 |
-
return keys;
|
21 |
-
}
|
22 |
-
|
23 |
-
var keywords = words([
|
24 |
-
"abstract", "accept", "allocatable", "allocate",
|
25 |
-
"array", "assign", "asynchronous", "backspace",
|
26 |
-
"bind", "block", "byte", "call", "case",
|
27 |
-
"class", "close", "common", "contains",
|
28 |
-
"continue", "cycle", "data", "deallocate",
|
29 |
-
"decode", "deferred", "dimension", "do",
|
30 |
-
"elemental", "else", "encode", "end",
|
31 |
-
"endif", "entry", "enumerator", "equivalence",
|
32 |
-
"exit", "external", "extrinsic", "final",
|
33 |
-
"forall", "format", "function", "generic",
|
34 |
-
"go", "goto", "if", "implicit", "import", "include",
|
35 |
-
"inquire", "intent", "interface", "intrinsic",
|
36 |
-
"module", "namelist", "non_intrinsic",
|
37 |
-
"non_overridable", "none", "nopass",
|
38 |
-
"nullify", "open", "optional", "options",
|
39 |
-
"parameter", "pass", "pause", "pointer",
|
40 |
-
"print", "private", "program", "protected",
|
41 |
-
"public", "pure", "read", "recursive", "result",
|
42 |
-
"return", "rewind", "save", "select", "sequence",
|
43 |
-
"stop", "subroutine", "target", "then", "to", "type",
|
44 |
-
"use", "value", "volatile", "where", "while",
|
45 |
-
"write"]);
|
46 |
-
var builtins = words(["abort", "abs", "access", "achar", "acos",
|
47 |
-
"adjustl", "adjustr", "aimag", "aint", "alarm",
|
48 |
-
"all", "allocated", "alog", "amax", "amin",
|
49 |
-
"amod", "and", "anint", "any", "asin",
|
50 |
-
"associated", "atan", "besj", "besjn", "besy",
|
51 |
-
"besyn", "bit_size", "btest", "cabs", "ccos",
|
52 |
-
"ceiling", "cexp", "char", "chdir", "chmod",
|
53 |
-
"clog", "cmplx", "command_argument_count",
|
54 |
-
"complex", "conjg", "cos", "cosh", "count",
|
55 |
-
"cpu_time", "cshift", "csin", "csqrt", "ctime",
|
56 |
-
"c_funloc", "c_loc", "c_associated", "c_null_ptr",
|
57 |
-
"c_null_funptr", "c_f_pointer", "c_null_char",
|
58 |
-
"c_alert", "c_backspace", "c_form_feed",
|
59 |
-
"c_new_line", "c_carriage_return",
|
60 |
-
"c_horizontal_tab", "c_vertical_tab", "dabs",
|
61 |
-
"dacos", "dasin", "datan", "date_and_time",
|
62 |
-
"dbesj", "dbesj", "dbesjn", "dbesy", "dbesy",
|
63 |
-
"dbesyn", "dble", "dcos", "dcosh", "ddim", "derf",
|
64 |
-
"derfc", "dexp", "digits", "dim", "dint", "dlog",
|
65 |
-
"dlog", "dmax", "dmin", "dmod", "dnint",
|
66 |
-
"dot_product", "dprod", "dsign", "dsinh",
|
67 |
-
"dsin", "dsqrt", "dtanh", "dtan", "dtime",
|
68 |
-
"eoshift", "epsilon", "erf", "erfc", "etime",
|
69 |
-
"exit", "exp", "exponent", "extends_type_of",
|
70 |
-
"fdate", "fget", "fgetc", "float", "floor",
|
71 |
-
"flush", "fnum", "fputc", "fput", "fraction",
|
72 |
-
"fseek", "fstat", "ftell", "gerror", "getarg",
|
73 |
-
"get_command", "get_command_argument",
|
74 |
-
"get_environment_variable", "getcwd",
|
75 |
-
"getenv", "getgid", "getlog", "getpid",
|
76 |
-
"getuid", "gmtime", "hostnm", "huge", "iabs",
|
77 |
-
"iachar", "iand", "iargc", "ibclr", "ibits",
|
78 |
-
"ibset", "ichar", "idate", "idim", "idint",
|
79 |
-
"idnint", "ieor", "ierrno", "ifix", "imag",
|
80 |
-
"imagpart", "index", "int", "ior", "irand",
|
81 |
-
"isatty", "ishft", "ishftc", "isign",
|
82 |
-
"iso_c_binding", "is_iostat_end", "is_iostat_eor",
|
83 |
-
"itime", "kill", "kind", "lbound", "len", "len_trim",
|
84 |
-
"lge", "lgt", "link", "lle", "llt", "lnblnk", "loc",
|
85 |
-
"log", "logical", "long", "lshift", "lstat", "ltime",
|
86 |
-
"matmul", "max", "maxexponent", "maxloc", "maxval",
|
87 |
-
"mclock", "merge", "move_alloc", "min", "minexponent",
|
88 |
-
"minloc", "minval", "mod", "modulo", "mvbits",
|
89 |
-
"nearest", "new_line", "nint", "not", "or", "pack",
|
90 |
-
"perror", "precision", "present", "product", "radix",
|
91 |
-
"rand", "random_number", "random_seed", "range",
|
92 |
-
"real", "realpart", "rename", "repeat", "reshape",
|
93 |
-
"rrspacing", "rshift", "same_type_as", "scale",
|
94 |
-
"scan", "second", "selected_int_kind",
|
95 |
-
"selected_real_kind", "set_exponent", "shape",
|
96 |
-
"short", "sign", "signal", "sinh", "sin", "sleep",
|
97 |
-
"sngl", "spacing", "spread", "sqrt", "srand", "stat",
|
98 |
-
"sum", "symlnk", "system", "system_clock", "tan",
|
99 |
-
"tanh", "time", "tiny", "transfer", "transpose",
|
100 |
-
"trim", "ttynam", "ubound", "umask", "unlink",
|
101 |
-
"unpack", "verify", "xor", "zabs", "zcos", "zexp",
|
102 |
-
"zlog", "zsin", "zsqrt"]);
|
103 |
-
|
104 |
-
var dataTypes = words(["c_bool", "c_char", "c_double", "c_double_complex",
|
105 |
-
"c_float", "c_float_complex", "c_funptr", "c_int",
|
106 |
-
"c_int16_t", "c_int32_t", "c_int64_t", "c_int8_t",
|
107 |
-
"c_int_fast16_t", "c_int_fast32_t", "c_int_fast64_t",
|
108 |
-
"c_int_fast8_t", "c_int_least16_t", "c_int_least32_t",
|
109 |
-
"c_int_least64_t", "c_int_least8_t", "c_intmax_t",
|
110 |
-
"c_intptr_t", "c_long", "c_long_double",
|
111 |
-
"c_long_double_complex", "c_long_long", "c_ptr",
|
112 |
-
"c_short", "c_signed_char", "c_size_t", "character",
|
113 |
-
"complex", "double", "integer", "logical", "real"]);
|
114 |
-
var isOperatorChar = /[+\-*&=<>\/\:]/;
|
115 |
-
var litOperator = new RegExp("(\.and\.|\.or\.|\.eq\.|\.lt\.|\.le\.|\.gt\.|\.ge\.|\.ne\.|\.not\.|\.eqv\.|\.neqv\.)", "i");
|
116 |
-
|
117 |
-
function tokenBase(stream, state) {
|
118 |
-
|
119 |
-
if (stream.match(litOperator)){
|
120 |
-
return 'operator';
|
121 |
-
}
|
122 |
-
|
123 |
-
var ch = stream.next();
|
124 |
-
if (ch == "!") {
|
125 |
-
stream.skipToEnd();
|
126 |
-
return "comment";
|
127 |
-
}
|
128 |
-
if (ch == '"' || ch == "'") {
|
129 |
-
state.tokenize = tokenString(ch);
|
130 |
-
return state.tokenize(stream, state);
|
131 |
-
}
|
132 |
-
if (/[\[\]\(\),]/.test(ch)) {
|
133 |
-
return null;
|
134 |
-
}
|
135 |
-
if (/\d/.test(ch)) {
|
136 |
-
stream.eatWhile(/[\w\.]/);
|
137 |
-
return "number";
|
138 |
-
}
|
139 |
-
if (isOperatorChar.test(ch)) {
|
140 |
-
stream.eatWhile(isOperatorChar);
|
141 |
-
return "operator";
|
142 |
-
}
|
143 |
-
stream.eatWhile(/[\w\$_]/);
|
144 |
-
var word = stream.current().toLowerCase();
|
145 |
-
|
146 |
-
if (keywords.hasOwnProperty(word)){
|
147 |
-
return 'keyword';
|
148 |
-
}
|
149 |
-
if (builtins.hasOwnProperty(word) || dataTypes.hasOwnProperty(word)) {
|
150 |
-
return 'builtin';
|
151 |
-
}
|
152 |
-
return "variable";
|
153 |
-
}
|
154 |
-
|
155 |
-
function tokenString(quote) {
|
156 |
-
return function(stream, state) {
|
157 |
-
var escaped = false, next, end = false;
|
158 |
-
while ((next = stream.next()) != null) {
|
159 |
-
if (next == quote && !escaped) {
|
160 |
-
end = true;
|
161 |
-
break;
|
162 |
-
}
|
163 |
-
escaped = !escaped && next == "\\";
|
164 |
-
}
|
165 |
-
if (end || !escaped) state.tokenize = null;
|
166 |
-
return "string";
|
167 |
-
};
|
168 |
-
}
|
169 |
-
|
170 |
-
// Interface
|
171 |
-
|
172 |
-
return {
|
173 |
-
startState: function() {
|
174 |
-
return {tokenize: null};
|
175 |
-
},
|
176 |
-
|
177 |
-
token: function(stream, state) {
|
178 |
-
if (stream.eatSpace()) return null;
|
179 |
-
var style = (state.tokenize || tokenBase)(stream, state);
|
180 |
-
if (style == "comment" || style == "meta") return style;
|
181 |
-
return style;
|
182 |
-
}
|
183 |
-
};
|
184 |
-
});
|
185 |
-
|
186 |
-
CodeMirror.defineMIME("text/x-fortran", "fortran");
|
187 |
-
|
188 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/fortran/index.html
DELETED
@@ -1,81 +0,0 @@
|
|
1 |
-
<!doctype html>
|
2 |
-
|
3 |
-
<title>CodeMirror: Fortran mode</title>
|
4 |
-
<meta charset="utf-8"/>
|
5 |
-
<link rel=stylesheet href="../../doc/docs.css">
|
6 |
-
|
7 |
-
<link rel="stylesheet" href="../../lib/codemirror.css">
|
8 |
-
<script src="../../lib/codemirror.js"></script>
|
9 |
-
<script src="fortran.js"></script>
|
10 |
-
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
11 |
-
<div id=nav>
|
12 |
-
<a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
13 |
-
|
14 |
-
<ul>
|
15 |
-
<li><a href="../../index.html">Home</a>
|
16 |
-
<li><a href="../../doc/manual.html">Manual</a>
|
17 |
-
<li><a href="https://github.com/codemirror/codemirror">Code</a>
|
18 |
-
</ul>
|
19 |
-
<ul>
|
20 |
-
<li><a href="../index.html">Language modes</a>
|
21 |
-
<li><a class=active href="#">Fortran</a>
|
22 |
-
</ul>
|
23 |
-
</div>
|
24 |
-
|
25 |
-
<article>
|
26 |
-
<h2>Fortran mode</h2>
|
27 |
-
|
28 |
-
|
29 |
-
<div><textarea id="code" name="code">
|
30 |
-
! Example Fortran code
|
31 |
-
program average
|
32 |
-
|
33 |
-
! Read in some numbers and take the average
|
34 |
-
! As written, if there are no data points, an average of zero is returned
|
35 |
-
! While this may not be desired behavior, it keeps this example simple
|
36 |
-
|
37 |
-
implicit none
|
38 |
-
|
39 |
-
real, dimension(:), allocatable :: points
|
40 |
-
integer :: number_of_points
|
41 |
-
real :: average_points=0., positive_average=0., negative_average=0.
|
42 |
-
|
43 |
-
write (*,*) "Input number of points to average:"
|
44 |
-
read (*,*) number_of_points
|
45 |
-
|
46 |
-
allocate (points(number_of_points))
|
47 |
-
|
48 |
-
write (*,*) "Enter the points to average:"
|
49 |
-
read (*,*) points
|
50 |
-
|
51 |
-
! Take the average by summing points and dividing by number_of_points
|
52 |
-
if (number_of_points > 0) average_points = sum(points) / number_of_points
|
53 |
-
|
54 |
-
! Now form average over positive and negative points only
|
55 |
-
if (count(points > 0.) > 0) then
|
56 |
-
positive_average = sum(points, points > 0.) / count(points > 0.)
|
57 |
-
end if
|
58 |
-
|
59 |
-
if (count(points < 0.) > 0) then
|
60 |
-
negative_average = sum(points, points < 0.) / count(points < 0.)
|
61 |
-
end if
|
62 |
-
|
63 |
-
deallocate (points)
|
64 |
-
|
65 |
-
! Print result to terminal
|
66 |
-
write (*,'(a,g12.4)') 'Average = ', average_points
|
67 |
-
write (*,'(a,g12.4)') 'Average of positive points = ', positive_average
|
68 |
-
write (*,'(a,g12.4)') 'Average of negative points = ', negative_average
|
69 |
-
|
70 |
-
end program average
|
71 |
-
</textarea></div>
|
72 |
-
|
73 |
-
<script>
|
74 |
-
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
|
75 |
-
lineNumbers: true,
|
76 |
-
mode: "text/x-fortran"
|
77 |
-
});
|
78 |
-
</script>
|
79 |
-
|
80 |
-
<p><strong>MIME types defined:</strong> <code>text/x-Fortran</code>.</p>
|
81 |
-
</article>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/gas/gas.js
DELETED
@@ -1,345 +0,0 @@
|
|
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("gas", function(_config, parserConfig) {
|
15 |
-
'use strict';
|
16 |
-
|
17 |
-
// If an architecture is specified, its initialization function may
|
18 |
-
// populate this array with custom parsing functions which will be
|
19 |
-
// tried in the event that the standard functions do not find a match.
|
20 |
-
var custom = [];
|
21 |
-
|
22 |
-
// The symbol used to start a line comment changes based on the target
|
23 |
-
// architecture.
|
24 |
-
// If no architecture is pased in "parserConfig" then only multiline
|
25 |
-
// comments will have syntax support.
|
26 |
-
var lineCommentStartSymbol = "";
|
27 |
-
|
28 |
-
// These directives are architecture independent.
|
29 |
-
// Machine specific directives should go in their respective
|
30 |
-
// architecture initialization function.
|
31 |
-
// Reference:
|
32 |
-
// http://sourceware.org/binutils/docs/as/Pseudo-Ops.html#Pseudo-Ops
|
33 |
-
var directives = {
|
34 |
-
".abort" : "builtin",
|
35 |
-
".align" : "builtin",
|
36 |
-
".altmacro" : "builtin",
|
37 |
-
".ascii" : "builtin",
|
38 |
-
".asciz" : "builtin",
|
39 |
-
".balign" : "builtin",
|
40 |
-
".balignw" : "builtin",
|
41 |
-
".balignl" : "builtin",
|
42 |
-
".bundle_align_mode" : "builtin",
|
43 |
-
".bundle_lock" : "builtin",
|
44 |
-
".bundle_unlock" : "builtin",
|
45 |
-
".byte" : "builtin",
|
46 |
-
".cfi_startproc" : "builtin",
|
47 |
-
".comm" : "builtin",
|
48 |
-
".data" : "builtin",
|
49 |
-
".def" : "builtin",
|
50 |
-
".desc" : "builtin",
|
51 |
-
".dim" : "builtin",
|
52 |
-
".double" : "builtin",
|
53 |
-
".eject" : "builtin",
|
54 |
-
".else" : "builtin",
|
55 |
-
".elseif" : "builtin",
|
56 |
-
".end" : "builtin",
|
57 |
-
".endef" : "builtin",
|
58 |
-
".endfunc" : "builtin",
|
59 |
-
".endif" : "builtin",
|
60 |
-
".equ" : "builtin",
|
61 |
-
".equiv" : "builtin",
|
62 |
-
".eqv" : "builtin",
|
63 |
-
".err" : "builtin",
|
64 |
-
".error" : "builtin",
|
65 |
-
".exitm" : "builtin",
|
66 |
-
".extern" : "builtin",
|
67 |
-
".fail" : "builtin",
|
68 |
-
".file" : "builtin",
|
69 |
-
".fill" : "builtin",
|
70 |
-
".float" : "builtin",
|
71 |
-
".func" : "builtin",
|
72 |
-
".global" : "builtin",
|
73 |
-
".gnu_attribute" : "builtin",
|
74 |
-
".hidden" : "builtin",
|
75 |
-
".hword" : "builtin",
|
76 |
-
".ident" : "builtin",
|
77 |
-
".if" : "builtin",
|
78 |
-
".incbin" : "builtin",
|
79 |
-
".include" : "builtin",
|
80 |
-
".int" : "builtin",
|
81 |
-
".internal" : "builtin",
|
82 |
-
".irp" : "builtin",
|
83 |
-
".irpc" : "builtin",
|
84 |
-
".lcomm" : "builtin",
|
85 |
-
".lflags" : "builtin",
|
86 |
-
".line" : "builtin",
|
87 |
-
".linkonce" : "builtin",
|
88 |
-
".list" : "builtin",
|
89 |
-
".ln" : "builtin",
|
90 |
-
".loc" : "builtin",
|
91 |
-
".loc_mark_labels" : "builtin",
|
92 |
-
".local" : "builtin",
|
93 |
-
".long" : "builtin",
|
94 |
-
".macro" : "builtin",
|
95 |
-
".mri" : "builtin",
|
96 |
-
".noaltmacro" : "builtin",
|
97 |
-
".nolist" : "builtin",
|
98 |
-
".octa" : "builtin",
|
99 |
-
".offset" : "builtin",
|
100 |
-
".org" : "builtin",
|
101 |
-
".p2align" : "builtin",
|
102 |
-
".popsection" : "builtin",
|
103 |
-
".previous" : "builtin",
|
104 |
-
".print" : "builtin",
|
105 |
-
".protected" : "builtin",
|
106 |
-
".psize" : "builtin",
|
107 |
-
".purgem" : "builtin",
|
108 |
-
".pushsection" : "builtin",
|
109 |
-
".quad" : "builtin",
|
110 |
-
".reloc" : "builtin",
|
111 |
-
".rept" : "builtin",
|
112 |
-
".sbttl" : "builtin",
|
113 |
-
".scl" : "builtin",
|
114 |
-
".section" : "builtin",
|
115 |
-
".set" : "builtin",
|
116 |
-
".short" : "builtin",
|
117 |
-
".single" : "builtin",
|
118 |
-
".size" : "builtin",
|
119 |
-
".skip" : "builtin",
|
120 |
-
".sleb128" : "builtin",
|
121 |
-
".space" : "builtin",
|
122 |
-
".stab" : "builtin",
|
123 |
-
".string" : "builtin",
|
124 |
-
".struct" : "builtin",
|
125 |
-
".subsection" : "builtin",
|
126 |
-
".symver" : "builtin",
|
127 |
-
".tag" : "builtin",
|
128 |
-
".text" : "builtin",
|
129 |
-
".title" : "builtin",
|
130 |
-
".type" : "builtin",
|
131 |
-
".uleb128" : "builtin",
|
132 |
-
".val" : "builtin",
|
133 |
-
".version" : "builtin",
|
134 |
-
".vtable_entry" : "builtin",
|
135 |
-
".vtable_inherit" : "builtin",
|
136 |
-
".warning" : "builtin",
|
137 |
-
".weak" : "builtin",
|
138 |
-
".weakref" : "builtin",
|
139 |
-
".word" : "builtin"
|
140 |
-
};
|
141 |
-
|
142 |
-
var registers = {};
|
143 |
-
|
144 |
-
function x86(_parserConfig) {
|
145 |
-
lineCommentStartSymbol = "#";
|
146 |
-
|
147 |
-
registers.ax = "variable";
|
148 |
-
registers.eax = "variable-2";
|
149 |
-
registers.rax = "variable-3";
|
150 |
-
|
151 |
-
registers.bx = "variable";
|
152 |
-
registers.ebx = "variable-2";
|
153 |
-
registers.rbx = "variable-3";
|
154 |
-
|
155 |
-
registers.cx = "variable";
|
156 |
-
registers.ecx = "variable-2";
|
157 |
-
registers.rcx = "variable-3";
|
158 |
-
|
159 |
-
registers.dx = "variable";
|
160 |
-
registers.edx = "variable-2";
|
161 |
-
registers.rdx = "variable-3";
|
162 |
-
|
163 |
-
registers.si = "variable";
|
164 |
-
registers.esi = "variable-2";
|
165 |
-
registers.rsi = "variable-3";
|
166 |
-
|
167 |
-
registers.di = "variable";
|
168 |
-
registers.edi = "variable-2";
|
169 |
-
registers.rdi = "variable-3";
|
170 |
-
|
171 |
-
registers.sp = "variable";
|
172 |
-
registers.esp = "variable-2";
|
173 |
-
registers.rsp = "variable-3";
|
174 |
-
|
175 |
-
registers.bp = "variable";
|
176 |
-
registers.ebp = "variable-2";
|
177 |
-
registers.rbp = "variable-3";
|
178 |
-
|
179 |
-
registers.ip = "variable";
|
180 |
-
registers.eip = "variable-2";
|
181 |
-
registers.rip = "variable-3";
|
182 |
-
|
183 |
-
registers.cs = "keyword";
|
184 |
-
registers.ds = "keyword";
|
185 |
-
registers.ss = "keyword";
|
186 |
-
registers.es = "keyword";
|
187 |
-
registers.fs = "keyword";
|
188 |
-
registers.gs = "keyword";
|
189 |
-
}
|
190 |
-
|
191 |
-
function armv6(_parserConfig) {
|
192 |
-
// Reference:
|
193 |
-
// http://infocenter.arm.com/help/topic/com.arm.doc.qrc0001l/QRC0001_UAL.pdf
|
194 |
-
// http://infocenter.arm.com/help/topic/com.arm.doc.ddi0301h/DDI0301H_arm1176jzfs_r0p7_trm.pdf
|
195 |
-
lineCommentStartSymbol = "@";
|
196 |
-
directives.syntax = "builtin";
|
197 |
-
|
198 |
-
registers.r0 = "variable";
|
199 |
-
registers.r1 = "variable";
|
200 |
-
registers.r2 = "variable";
|
201 |
-
registers.r3 = "variable";
|
202 |
-
registers.r4 = "variable";
|
203 |
-
registers.r5 = "variable";
|
204 |
-
registers.r6 = "variable";
|
205 |
-
registers.r7 = "variable";
|
206 |
-
registers.r8 = "variable";
|
207 |
-
registers.r9 = "variable";
|
208 |
-
registers.r10 = "variable";
|
209 |
-
registers.r11 = "variable";
|
210 |
-
registers.r12 = "variable";
|
211 |
-
|
212 |
-
registers.sp = "variable-2";
|
213 |
-
registers.lr = "variable-2";
|
214 |
-
registers.pc = "variable-2";
|
215 |
-
registers.r13 = registers.sp;
|
216 |
-
registers.r14 = registers.lr;
|
217 |
-
registers.r15 = registers.pc;
|
218 |
-
|
219 |
-
custom.push(function(ch, stream) {
|
220 |
-
if (ch === '#') {
|
221 |
-
stream.eatWhile(/\w/);
|
222 |
-
return "number";
|
223 |
-
}
|
224 |
-
});
|
225 |
-
}
|
226 |
-
|
227 |
-
var arch = (parserConfig.architecture || "x86").toLowerCase();
|
228 |
-
if (arch === "x86") {
|
229 |
-
x86(parserConfig);
|
230 |
-
} else if (arch === "arm" || arch === "armv6") {
|
231 |
-
armv6(parserConfig);
|
232 |
-
}
|
233 |
-
|
234 |
-
function nextUntilUnescaped(stream, end) {
|
235 |
-
var escaped = false, next;
|
236 |
-
while ((next = stream.next()) != null) {
|
237 |
-
if (next === end && !escaped) {
|
238 |
-
return false;
|
239 |
-
}
|
240 |
-
escaped = !escaped && next === "\\";
|
241 |
-
}
|
242 |
-
return escaped;
|
243 |
-
}
|
244 |
-
|
245 |
-
function clikeComment(stream, state) {
|
246 |
-
var maybeEnd = false, ch;
|
247 |
-
while ((ch = stream.next()) != null) {
|
248 |
-
if (ch === "/" && maybeEnd) {
|
249 |
-
state.tokenize = null;
|
250 |
-
break;
|
251 |
-
}
|
252 |
-
maybeEnd = (ch === "*");
|
253 |
-
}
|
254 |
-
return "comment";
|
255 |
-
}
|
256 |
-
|
257 |
-
return {
|
258 |
-
startState: function() {
|
259 |
-
return {
|
260 |
-
tokenize: null
|
261 |
-
};
|
262 |
-
},
|
263 |
-
|
264 |
-
token: function(stream, state) {
|
265 |
-
if (state.tokenize) {
|
266 |
-
return state.tokenize(stream, state);
|
267 |
-
}
|
268 |
-
|
269 |
-
if (stream.eatSpace()) {
|
270 |
-
return null;
|
271 |
-
}
|
272 |
-
|
273 |
-
var style, cur, ch = stream.next();
|
274 |
-
|
275 |
-
if (ch === "/") {
|
276 |
-
if (stream.eat("*")) {
|
277 |
-
state.tokenize = clikeComment;
|
278 |
-
return clikeComment(stream, state);
|
279 |
-
}
|
280 |
-
}
|
281 |
-
|
282 |
-
if (ch === lineCommentStartSymbol) {
|
283 |
-
stream.skipToEnd();
|
284 |
-
return "comment";
|
285 |
-
}
|
286 |
-
|
287 |
-
if (ch === '"') {
|
288 |
-
nextUntilUnescaped(stream, '"');
|
289 |
-
return "string";
|
290 |
-
}
|
291 |
-
|
292 |
-
if (ch === '.') {
|
293 |
-
stream.eatWhile(/\w/);
|
294 |
-
cur = stream.current().toLowerCase();
|
295 |
-
style = directives[cur];
|
296 |
-
return style || null;
|
297 |
-
}
|
298 |
-
|
299 |
-
if (ch === '=') {
|
300 |
-
stream.eatWhile(/\w/);
|
301 |
-
return "tag";
|
302 |
-
}
|
303 |
-
|
304 |
-
if (ch === '{') {
|
305 |
-
return "braket";
|
306 |
-
}
|
307 |
-
|
308 |
-
if (ch === '}') {
|
309 |
-
return "braket";
|
310 |
-
}
|
311 |
-
|
312 |
-
if (/\d/.test(ch)) {
|
313 |
-
if (ch === "0" && stream.eat("x")) {
|
314 |
-
stream.eatWhile(/[0-9a-fA-F]/);
|
315 |
-
return "number";
|
316 |
-
}
|
317 |
-
stream.eatWhile(/\d/);
|
318 |
-
return "number";
|
319 |
-
}
|
320 |
-
|
321 |
-
if (/\w/.test(ch)) {
|
322 |
-
stream.eatWhile(/\w/);
|
323 |
-
if (stream.eat(":")) {
|
324 |
-
return 'tag';
|
325 |
-
}
|
326 |
-
cur = stream.current().toLowerCase();
|
327 |
-
style = registers[cur];
|
328 |
-
return style || null;
|
329 |
-
}
|
330 |
-
|
331 |
-
for (var i = 0; i < custom.length; i++) {
|
332 |
-
style = custom[i](ch, stream, state);
|
333 |
-
if (style) {
|
334 |
-
return style;
|
335 |
-
}
|
336 |
-
}
|
337 |
-
},
|
338 |
-
|
339 |
-
lineComment: lineCommentStartSymbol,
|
340 |
-
blockCommentStart: "/*",
|
341 |
-
blockCommentEnd: "*/"
|
342 |
-
};
|
343 |
-
});
|
344 |
-
|
345 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/gas/index.html
DELETED
@@ -1,68 +0,0 @@
|
|
1 |
-
<!doctype html>
|
2 |
-
|
3 |
-
<title>CodeMirror: Gas mode</title>
|
4 |
-
<meta charset="utf-8"/>
|
5 |
-
<link rel=stylesheet href="../../doc/docs.css">
|
6 |
-
|
7 |
-
<link rel="stylesheet" href="../../lib/codemirror.css">
|
8 |
-
<script src="../../lib/codemirror.js"></script>
|
9 |
-
<script src="gas.js"></script>
|
10 |
-
<style>.CodeMirror {border: 2px inset #dee;}</style>
|
11 |
-
<div id=nav>
|
12 |
-
<a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
13 |
-
|
14 |
-
<ul>
|
15 |
-
<li><a href="../../index.html">Home</a>
|
16 |
-
<li><a href="../../doc/manual.html">Manual</a>
|
17 |
-
<li><a href="https://github.com/codemirror/codemirror">Code</a>
|
18 |
-
</ul>
|
19 |
-
<ul>
|
20 |
-
<li><a href="../index.html">Language modes</a>
|
21 |
-
<li><a class=active href="#">Gas</a>
|
22 |
-
</ul>
|
23 |
-
</div>
|
24 |
-
|
25 |
-
<article>
|
26 |
-
<h2>Gas mode</h2>
|
27 |
-
<form>
|
28 |
-
<textarea id="code" name="code">
|
29 |
-
.syntax unified
|
30 |
-
.global main
|
31 |
-
|
32 |
-
/*
|
33 |
-
* A
|
34 |
-
* multi-line
|
35 |
-
* comment.
|
36 |
-
*/
|
37 |
-
|
38 |
-
@ A single line comment.
|
39 |
-
|
40 |
-
main:
|
41 |
-
push {sp, lr}
|
42 |
-
ldr r0, =message
|
43 |
-
bl puts
|
44 |
-
mov r0, #0
|
45 |
-
pop {sp, pc}
|
46 |
-
|
47 |
-
message:
|
48 |
-
.asciz "Hello world!<br />"
|
49 |
-
</textarea>
|
50 |
-
</form>
|
51 |
-
|
52 |
-
<script>
|
53 |
-
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
|
54 |
-
lineNumbers: true,
|
55 |
-
mode: {name: "gas", architecture: "ARMv6"},
|
56 |
-
});
|
57 |
-
</script>
|
58 |
-
|
59 |
-
<p>Handles AT&T assembler syntax (more specifically this handles
|
60 |
-
the GNU Assembler (gas) syntax.)
|
61 |
-
It takes a single optional configuration parameter:
|
62 |
-
<code>architecture</code>, which can be one of <code>"ARM"</code>,
|
63 |
-
<code>"ARMv6"</code> or <code>"x86"</code>.
|
64 |
-
Including the parameter adds syntax for the registers and special
|
65 |
-
directives for the supplied architecture.
|
66 |
-
|
67 |
-
<p><strong>MIME types defined:</strong> <code>text/x-gas</code></p>
|
68 |
-
</article>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/gfm/gfm.js
DELETED
@@ -1,130 +0,0 @@
|
|
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("../markdown/markdown"), require("../../addon/mode/overlay"));
|
7 |
-
else if (typeof define == "function" && define.amd) // AMD
|
8 |
-
define(["../../lib/codemirror", "../markdown/markdown", "../../addon/mode/overlay"], mod);
|
9 |
-
else // Plain browser env
|
10 |
-
mod(CodeMirror);
|
11 |
-
})(function(CodeMirror) {
|
12 |
-
"use strict";
|
13 |
-
|
14 |
-
var urlRE = /^((?:(?:aaas?|about|acap|adiumxtra|af[ps]|aim|apt|attachment|aw|beshare|bitcoin|bolo|callto|cap|chrome(?:-extension)?|cid|coap|com-eventbrite-attendee|content|crid|cvs|data|dav|dict|dlna-(?:playcontainer|playsingle)|dns|doi|dtn|dvb|ed2k|facetime|feed|file|finger|fish|ftp|geo|gg|git|gizmoproject|go|gopher|gtalk|h323|hcp|https?|iax|icap|icon|im|imap|info|ipn|ipp|irc[6s]?|iris(?:\.beep|\.lwz|\.xpc|\.xpcs)?|itms|jar|javascript|jms|keyparc|lastfm|ldaps?|magnet|mailto|maps|market|message|mid|mms|ms-help|msnim|msrps?|mtqp|mumble|mupdate|mvn|news|nfs|nih?|nntp|notes|oid|opaquelocktoken|palm|paparazzi|platform|pop|pres|proxy|psyc|query|res(?:ource)?|rmi|rsync|rtmp|rtsp|secondlife|service|session|sftp|sgn|shttp|sieve|sips?|skype|sm[bs]|snmp|soap\.beeps?|soldat|spotify|ssh|steam|svn|tag|teamspeak|tel(?:net)?|tftp|things|thismessage|tip|tn3270|tv|udp|unreal|urn|ut2004|vemmi|ventrilo|view-source|webcal|wss?|wtai|wyciwyg|xcon(?:-userid)?|xfire|xmlrpc\.beeps?|xmpp|xri|ymsgr|z39\.50[rs]?):(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]|\([^\s()<>]*\))+(?:\([^\s()<>]*\)|[^\s`*!()\[\]{};:'".,<>?«»“”‘’]))/i
|
15 |
-
|
16 |
-
CodeMirror.defineMode("gfm", function(config, modeConfig) {
|
17 |
-
var codeDepth = 0;
|
18 |
-
function blankLine(state) {
|
19 |
-
state.code = false;
|
20 |
-
return null;
|
21 |
-
}
|
22 |
-
var gfmOverlay = {
|
23 |
-
startState: function() {
|
24 |
-
return {
|
25 |
-
code: false,
|
26 |
-
codeBlock: false,
|
27 |
-
ateSpace: false
|
28 |
-
};
|
29 |
-
},
|
30 |
-
copyState: function(s) {
|
31 |
-
return {
|
32 |
-
code: s.code,
|
33 |
-
codeBlock: s.codeBlock,
|
34 |
-
ateSpace: s.ateSpace
|
35 |
-
};
|
36 |
-
},
|
37 |
-
token: function(stream, state) {
|
38 |
-
state.combineTokens = null;
|
39 |
-
|
40 |
-
// Hack to prevent formatting override inside code blocks (block and inline)
|
41 |
-
if (state.codeBlock) {
|
42 |
-
if (stream.match(/^```+/)) {
|
43 |
-
state.codeBlock = false;
|
44 |
-
return null;
|
45 |
-
}
|
46 |
-
stream.skipToEnd();
|
47 |
-
return null;
|
48 |
-
}
|
49 |
-
if (stream.sol()) {
|
50 |
-
state.code = false;
|
51 |
-
}
|
52 |
-
if (stream.sol() && stream.match(/^```+/)) {
|
53 |
-
stream.skipToEnd();
|
54 |
-
state.codeBlock = true;
|
55 |
-
return null;
|
56 |
-
}
|
57 |
-
// If this block is changed, it may need to be updated in Markdown mode
|
58 |
-
if (stream.peek() === '`') {
|
59 |
-
stream.next();
|
60 |
-
var before = stream.pos;
|
61 |
-
stream.eatWhile('`');
|
62 |
-
var difference = 1 + stream.pos - before;
|
63 |
-
if (!state.code) {
|
64 |
-
codeDepth = difference;
|
65 |
-
state.code = true;
|
66 |
-
} else {
|
67 |
-
if (difference === codeDepth) { // Must be exact
|
68 |
-
state.code = false;
|
69 |
-
}
|
70 |
-
}
|
71 |
-
return null;
|
72 |
-
} else if (state.code) {
|
73 |
-
stream.next();
|
74 |
-
return null;
|
75 |
-
}
|
76 |
-
// Check if space. If so, links can be formatted later on
|
77 |
-
if (stream.eatSpace()) {
|
78 |
-
state.ateSpace = true;
|
79 |
-
return null;
|
80 |
-
}
|
81 |
-
if (stream.sol() || state.ateSpace) {
|
82 |
-
state.ateSpace = false;
|
83 |
-
if (modeConfig.gitHubSpice !== false) {
|
84 |
-
if(stream.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+@)?(?:[a-f0-9]{7,40}\b)/)) {
|
85 |
-
// User/Project@SHA
|
86 |
-
// User@SHA
|
87 |
-
// SHA
|
88 |
-
state.combineTokens = true;
|
89 |
-
return "link";
|
90 |
-
} else if (stream.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+)?#[0-9]+\b/)) {
|
91 |
-
// User/Project#Num
|
92 |
-
// User#Num
|
93 |
-
// #Num
|
94 |
-
state.combineTokens = true;
|
95 |
-
return "link";
|
96 |
-
}
|
97 |
-
}
|
98 |
-
}
|
99 |
-
if (stream.match(urlRE) &&
|
100 |
-
stream.string.slice(stream.start - 2, stream.start) != "](" &&
|
101 |
-
(stream.start == 0 || /\W/.test(stream.string.charAt(stream.start - 1)))) {
|
102 |
-
// URLs
|
103 |
-
// Taken from http://daringfireball.net/2010/07/improved_regex_for_matching_urls
|
104 |
-
// And then (issue #1160) simplified to make it not crash the Chrome Regexp engine
|
105 |
-
// And then limited url schemes to the CommonMark list, so foo:bar isn't matched as a URL
|
106 |
-
state.combineTokens = true;
|
107 |
-
return "link";
|
108 |
-
}
|
109 |
-
stream.next();
|
110 |
-
return null;
|
111 |
-
},
|
112 |
-
blankLine: blankLine
|
113 |
-
};
|
114 |
-
|
115 |
-
var markdownConfig = {
|
116 |
-
underscoresBreakWords: false,
|
117 |
-
taskLists: true,
|
118 |
-
fencedCodeBlocks: '```',
|
119 |
-
strikethrough: true
|
120 |
-
};
|
121 |
-
for (var attr in modeConfig) {
|
122 |
-
markdownConfig[attr] = modeConfig[attr];
|
123 |
-
}
|
124 |
-
markdownConfig.name = "markdown";
|
125 |
-
return CodeMirror.overlayMode(CodeMirror.getMode(config, markdownConfig), gfmOverlay);
|
126 |
-
|
127 |
-
}, "markdown");
|
128 |
-
|
129 |
-
CodeMirror.defineMIME("text/x-gfm", "gfm");
|
130 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/gfm/index.html
DELETED
@@ -1,93 +0,0 @@
|
|
1 |
-
<!doctype html>
|
2 |
-
|
3 |
-
<title>CodeMirror: GFM mode</title>
|
4 |
-
<meta charset="utf-8"/>
|
5 |
-
<link rel=stylesheet href="../../doc/docs.css">
|
6 |
-
|
7 |
-
<link rel="stylesheet" href="../../lib/codemirror.css">
|
8 |
-
<script src="../../lib/codemirror.js"></script>
|
9 |
-
<script src="../../addon/mode/overlay.js"></script>
|
10 |
-
<script src="../xml/xml.js"></script>
|
11 |
-
<script src="../markdown/markdown.js"></script>
|
12 |
-
<script src="gfm.js"></script>
|
13 |
-
<script src="../javascript/javascript.js"></script>
|
14 |
-
<script src="../css/css.js"></script>
|
15 |
-
<script src="../htmlmixed/htmlmixed.js"></script>
|
16 |
-
<script src="../clike/clike.js"></script>
|
17 |
-
<script src="../meta.js"></script>
|
18 |
-
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
19 |
-
<div id=nav>
|
20 |
-
<a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
21 |
-
|
22 |
-
<ul>
|
23 |
-
<li><a href="../../index.html">Home</a>
|
24 |
-
<li><a href="../../doc/manual.html">Manual</a>
|
25 |
-
<li><a href="https://github.com/codemirror/codemirror">Code</a>
|
26 |
-
</ul>
|
27 |
-
<ul>
|
28 |
-
<li><a href="../index.html">Language modes</a>
|
29 |
-
<li><a class=active href="#">GFM</a>
|
30 |
-
</ul>
|
31 |
-
</div>
|
32 |
-
|
33 |
-
<article>
|
34 |
-
<h2>GFM mode</h2>
|
35 |
-
<form><textarea id="code" name="code">
|
36 |
-
GitHub Flavored Markdown
|
37 |
-
========================
|
38 |
-
|
39 |
-
Everything from markdown plus GFM features:
|
40 |
-
|
41 |
-
## URL autolinking
|
42 |
-
|
43 |
-
Underscores_are_allowed_between_words.
|
44 |
-
|
45 |
-
## Strikethrough text
|
46 |
-
|
47 |
-
GFM adds syntax to strikethrough text, which is missing from standard Markdown.
|
48 |
-
|
49 |
-
~~Mistaken text.~~
|
50 |
-
~~**works with other fomatting**~~
|
51 |
-
|
52 |
-
~~spans across
|
53 |
-
lines~~
|
54 |
-
|
55 |
-
## Fenced code blocks (and syntax highlighting)
|
56 |
-
|
57 |
-
```javascript
|
58 |
-
for (var i = 0; i < items.length; i++) {
|
59 |
-
console.log(items[i], i); // log them
|
60 |
-
}
|
61 |
-
```
|
62 |
-
|
63 |
-
## Task Lists
|
64 |
-
|
65 |
-
- [ ] Incomplete task list item
|
66 |
-
- [x] **Completed** task list item
|
67 |
-
|
68 |
-
## A bit of GitHub spice
|
69 |
-
|
70 |
-
* SHA: be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2
|
71 |
-
* User@SHA ref: mojombo@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2
|
72 |
-
* User/Project@SHA: mojombo/god@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2
|
73 |
-
* \#Num: #1
|
74 |
-
* User/#Num: mojombo#1
|
75 |
-
* User/Project#Num: mojombo/god#1
|
76 |
-
|
77 |
-
See http://github.github.com/github-flavored-markdown/.
|
78 |
-
|
79 |
-
</textarea></form>
|
80 |
-
|
81 |
-
<script>
|
82 |
-
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
|
83 |
-
mode: 'gfm',
|
84 |
-
lineNumbers: true,
|
85 |
-
theme: "default"
|
86 |
-
});
|
87 |
-
</script>
|
88 |
-
|
89 |
-
<p>Optionally depends on other modes for properly highlighted code blocks.</p>
|
90 |
-
|
91 |
-
<p><strong>Parsing/Highlighting Tests:</strong> <a href="../../test/index.html#gfm_*">normal</a>, <a href="../../test/index.html#verbose,gfm_*">verbose</a>.</p>
|
92 |
-
|
93 |
-
</article>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/gfm/test.js
DELETED
@@ -1,230 +0,0 @@
|
|
1 |
-
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
2 |
-
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
3 |
-
|
4 |
-
(function() {
|
5 |
-
var mode = CodeMirror.getMode({tabSize: 4}, "gfm");
|
6 |
-
function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); }
|
7 |
-
var modeHighlightFormatting = CodeMirror.getMode({tabSize: 4}, {name: "gfm", highlightFormatting: true});
|
8 |
-
function FT(name) { test.mode(name, modeHighlightFormatting, Array.prototype.slice.call(arguments, 1)); }
|
9 |
-
|
10 |
-
FT("codeBackticks",
|
11 |
-
"[comment&formatting&formatting-code `][comment foo][comment&formatting&formatting-code `]");
|
12 |
-
|
13 |
-
FT("doubleBackticks",
|
14 |
-
"[comment&formatting&formatting-code ``][comment foo ` bar][comment&formatting&formatting-code ``]");
|
15 |
-
|
16 |
-
FT("codeBlock",
|
17 |
-
"[comment&formatting&formatting-code-block ```css]",
|
18 |
-
"[tag foo]",
|
19 |
-
"[comment&formatting&formatting-code-block ```]");
|
20 |
-
|
21 |
-
FT("taskList",
|
22 |
-
"[variable-2&formatting&formatting-list&formatting-list-ul - ][meta&formatting&formatting-task [ ]]][variable-2 foo]",
|
23 |
-
"[variable-2&formatting&formatting-list&formatting-list-ul - ][property&formatting&formatting-task [x]]][variable-2 foo]");
|
24 |
-
|
25 |
-
FT("formatting_strikethrough",
|
26 |
-
"[strikethrough&formatting&formatting-strikethrough ~~][strikethrough foo][strikethrough&formatting&formatting-strikethrough ~~]");
|
27 |
-
|
28 |
-
FT("formatting_strikethrough",
|
29 |
-
"foo [strikethrough&formatting&formatting-strikethrough ~~][strikethrough bar][strikethrough&formatting&formatting-strikethrough ~~]");
|
30 |
-
|
31 |
-
MT("emInWordAsterisk",
|
32 |
-
"foo[em *bar*]hello");
|
33 |
-
|
34 |
-
MT("emInWordUnderscore",
|
35 |
-
"foo_bar_hello");
|
36 |
-
|
37 |
-
MT("emStrongUnderscore",
|
38 |
-
"[strong __][em&strong _foo__][em _] bar");
|
39 |
-
|
40 |
-
MT("fencedCodeBlocks",
|
41 |
-
"[comment ```]",
|
42 |
-
"[comment foo]",
|
43 |
-
"",
|
44 |
-
"[comment ```]",
|
45 |
-
"bar");
|
46 |
-
|
47 |
-
MT("fencedCodeBlockModeSwitching",
|
48 |
-
"[comment ```javascript]",
|
49 |
-
"[variable foo]",
|
50 |
-
"",
|
51 |
-
"[comment ```]",
|
52 |
-
"bar");
|
53 |
-
|
54 |
-
MT("fencedCodeBlocksNoTildes",
|
55 |
-
"~~~",
|
56 |
-
"foo",
|
57 |
-
"~~~");
|
58 |
-
|
59 |
-
MT("taskListAsterisk",
|
60 |
-
"[variable-2 * []] foo]", // Invalid; must have space or x between []
|
61 |
-
"[variable-2 * [ ]]bar]", // Invalid; must have space after ]
|
62 |
-
"[variable-2 * [x]]hello]", // Invalid; must have space after ]
|
63 |
-
"[variable-2 * ][meta [ ]]][variable-2 [world]]]", // Valid; tests reference style links
|
64 |
-
" [variable-3 * ][property [x]]][variable-3 foo]"); // Valid; can be nested
|
65 |
-
|
66 |
-
MT("taskListPlus",
|
67 |
-
"[variable-2 + []] foo]", // Invalid; must have space or x between []
|
68 |
-
"[variable-2 + [ ]]bar]", // Invalid; must have space after ]
|
69 |
-
"[variable-2 + [x]]hello]", // Invalid; must have space after ]
|
70 |
-
"[variable-2 + ][meta [ ]]][variable-2 [world]]]", // Valid; tests reference style links
|
71 |
-
" [variable-3 + ][property [x]]][variable-3 foo]"); // Valid; can be nested
|
72 |
-
|
73 |
-
MT("taskListDash",
|
74 |
-
"[variable-2 - []] foo]", // Invalid; must have space or x between []
|
75 |
-
"[variable-2 - [ ]]bar]", // Invalid; must have space after ]
|
76 |
-
"[variable-2 - [x]]hello]", // Invalid; must have space after ]
|
77 |
-
"[variable-2 - ][meta [ ]]][variable-2 [world]]]", // Valid; tests reference style links
|
78 |
-
" [variable-3 - ][property [x]]][variable-3 foo]"); // Valid; can be nested
|
79 |
-
|
80 |
-
MT("taskListNumber",
|
81 |
-
"[variable-2 1. []] foo]", // Invalid; must have space or x between []
|
82 |
-
"[variable-2 2. [ ]]bar]", // Invalid; must have space after ]
|
83 |
-
"[variable-2 3. [x]]hello]", // Invalid; must have space after ]
|
84 |
-
"[variable-2 4. ][meta [ ]]][variable-2 [world]]]", // Valid; tests reference style links
|
85 |
-
" [variable-3 1. ][property [x]]][variable-3 foo]"); // Valid; can be nested
|
86 |
-
|
87 |
-
MT("SHA",
|
88 |
-
"foo [link be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2] bar");
|
89 |
-
|
90 |
-
MT("SHAEmphasis",
|
91 |
-
"[em *foo ][em&link be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2][em *]");
|
92 |
-
|
93 |
-
MT("shortSHA",
|
94 |
-
"foo [link be6a8cc] bar");
|
95 |
-
|
96 |
-
MT("tooShortSHA",
|
97 |
-
"foo be6a8c bar");
|
98 |
-
|
99 |
-
MT("longSHA",
|
100 |
-
"foo be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd22 bar");
|
101 |
-
|
102 |
-
MT("badSHA",
|
103 |
-
"foo be6a8cc1c1ecfe9489fb51e4869af15a13fc2cg2 bar");
|
104 |
-
|
105 |
-
MT("userSHA",
|
106 |
-
"foo [link bar@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2] hello");
|
107 |
-
|
108 |
-
MT("userSHAEmphasis",
|
109 |
-
"[em *foo ][em&link bar@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2][em *]");
|
110 |
-
|
111 |
-
MT("userProjectSHA",
|
112 |
-
"foo [link bar/hello@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2] world");
|
113 |
-
|
114 |
-
MT("userProjectSHAEmphasis",
|
115 |
-
"[em *foo ][em&link bar/hello@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2][em *]");
|
116 |
-
|
117 |
-
MT("num",
|
118 |
-
"foo [link #1] bar");
|
119 |
-
|
120 |
-
MT("numEmphasis",
|
121 |
-
"[em *foo ][em&link #1][em *]");
|
122 |
-
|
123 |
-
MT("badNum",
|
124 |
-
"foo #1bar hello");
|
125 |
-
|
126 |
-
MT("userNum",
|
127 |
-
"foo [link bar#1] hello");
|
128 |
-
|
129 |
-
MT("userNumEmphasis",
|
130 |
-
"[em *foo ][em&link bar#1][em *]");
|
131 |
-
|
132 |
-
MT("userProjectNum",
|
133 |
-
"foo [link bar/hello#1] world");
|
134 |
-
|
135 |
-
MT("userProjectNumEmphasis",
|
136 |
-
"[em *foo ][em&link bar/hello#1][em *]");
|
137 |
-
|
138 |
-
MT("vanillaLink",
|
139 |
-
"foo [link http://www.example.com/] bar");
|
140 |
-
|
141 |
-
MT("vanillaLinkNoScheme",
|
142 |
-
"foo [link www.example.com] bar");
|
143 |
-
|
144 |
-
MT("vanillaLinkHttps",
|
145 |
-
"foo [link https://www.example.com/] bar");
|
146 |
-
|
147 |
-
MT("vanillaLinkDataSchema",
|
148 |
-
"foo [link data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==] bar");
|
149 |
-
|
150 |
-
MT("vanillaLinkPunctuation",
|
151 |
-
"foo [link http://www.example.com/]. bar");
|
152 |
-
|
153 |
-
MT("vanillaLinkExtension",
|
154 |
-
"foo [link http://www.example.com/index.html] bar");
|
155 |
-
|
156 |
-
MT("vanillaLinkEmphasis",
|
157 |
-
"foo [em *][em&link http://www.example.com/index.html][em *] bar");
|
158 |
-
|
159 |
-
MT("notALink",
|
160 |
-
"foo asfd:asdf bar");
|
161 |
-
|
162 |
-
MT("notALink",
|
163 |
-
"[comment ```css]",
|
164 |
-
"[tag foo] {[property color]:[keyword black];}",
|
165 |
-
"[comment ```][link http://www.example.com/]");
|
166 |
-
|
167 |
-
MT("notALink",
|
168 |
-
"[comment ``foo `bar` http://www.example.com/``] hello");
|
169 |
-
|
170 |
-
MT("notALink",
|
171 |
-
"[comment `foo]",
|
172 |
-
"[comment&link http://www.example.com/]",
|
173 |
-
"[comment `] foo",
|
174 |
-
"",
|
175 |
-
"[link http://www.example.com/]");
|
176 |
-
|
177 |
-
MT("headerCodeBlockGithub",
|
178 |
-
"[header&header-1 # heading]",
|
179 |
-
"",
|
180 |
-
"[comment ```]",
|
181 |
-
"[comment code]",
|
182 |
-
"[comment ```]",
|
183 |
-
"",
|
184 |
-
"Commit: [link be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2]",
|
185 |
-
"Issue: [link #1]",
|
186 |
-
"Link: [link http://www.example.com/]");
|
187 |
-
|
188 |
-
MT("strikethrough",
|
189 |
-
"[strikethrough ~~foo~~]");
|
190 |
-
|
191 |
-
MT("strikethroughWithStartingSpace",
|
192 |
-
"~~ foo~~");
|
193 |
-
|
194 |
-
MT("strikethroughUnclosedStrayTildes",
|
195 |
-
"[strikethrough ~~foo~~~]");
|
196 |
-
|
197 |
-
MT("strikethroughUnclosedStrayTildes",
|
198 |
-
"[strikethrough ~~foo ~~]");
|
199 |
-
|
200 |
-
MT("strikethroughUnclosedStrayTildes",
|
201 |
-
"[strikethrough ~~foo ~~ bar]");
|
202 |
-
|
203 |
-
MT("strikethroughUnclosedStrayTildes",
|
204 |
-
"[strikethrough ~~foo ~~ bar~~]hello");
|
205 |
-
|
206 |
-
MT("strikethroughOneLetter",
|
207 |
-
"[strikethrough ~~a~~]");
|
208 |
-
|
209 |
-
MT("strikethroughWrapped",
|
210 |
-
"[strikethrough ~~foo]",
|
211 |
-
"[strikethrough foo~~]");
|
212 |
-
|
213 |
-
MT("strikethroughParagraph",
|
214 |
-
"[strikethrough ~~foo]",
|
215 |
-
"",
|
216 |
-
"foo[strikethrough ~~bar]");
|
217 |
-
|
218 |
-
MT("strikethroughEm",
|
219 |
-
"[strikethrough ~~foo][em&strikethrough *bar*][strikethrough ~~]");
|
220 |
-
|
221 |
-
MT("strikethroughEm",
|
222 |
-
"[em *][em&strikethrough ~~foo~~][em *]");
|
223 |
-
|
224 |
-
MT("strikethroughStrong",
|
225 |
-
"[strikethrough ~~][strong&strikethrough **foo**][strikethrough ~~]");
|
226 |
-
|
227 |
-
MT("strikethroughStrong",
|
228 |
-
"[strong **][strong&strikethrough ~~foo~~][strong **]");
|
229 |
-
|
230 |
-
})();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/gherkin/gherkin.js
DELETED
@@ -1,178 +0,0 @@
|
|
1 |
-
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
2 |
-
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
3 |
-
|
4 |
-
/*
|
5 |
-
Gherkin mode - http://www.cukes.info/
|
6 |
-
Report bugs/issues here: https://github.com/codemirror/CodeMirror/issues
|
7 |
-
*/
|
8 |
-
|
9 |
-
// Following Objs from Brackets implementation: https://github.com/tregusti/brackets-gherkin/blob/master/main.js
|
10 |
-
//var Quotes = {
|
11 |
-
// SINGLE: 1,
|
12 |
-
// DOUBLE: 2
|
13 |
-
//};
|
14 |
-
|
15 |
-
//var regex = {
|
16 |
-
// keywords: /(Feature| {2}(Scenario|In order to|As|I)| {4}(Given|When|Then|And))/
|
17 |
-
//};
|
18 |
-
|
19 |
-
(function(mod) {
|
20 |
-
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
21 |
-
mod(require("../../lib/codemirror"));
|
22 |
-
else if (typeof define == "function" && define.amd) // AMD
|
23 |
-
define(["../../lib/codemirror"], mod);
|
24 |
-
else // Plain browser env
|
25 |
-
mod(CodeMirror);
|
26 |
-
})(function(CodeMirror) {
|
27 |
-
"use strict";
|
28 |
-
|
29 |
-
CodeMirror.defineMode("gherkin", function () {
|
30 |
-
return {
|
31 |
-
startState: function () {
|
32 |
-
return {
|
33 |
-
lineNumber: 0,
|
34 |
-
tableHeaderLine: false,
|
35 |
-
allowFeature: true,
|
36 |
-
allowBackground: false,
|
37 |
-
allowScenario: false,
|
38 |
-
allowSteps: false,
|
39 |
-
allowPlaceholders: false,
|
40 |
-
allowMultilineArgument: false,
|
41 |
-
inMultilineString: false,
|
42 |
-
inMultilineTable: false,
|
43 |
-
inKeywordLine: false
|
44 |
-
};
|
45 |
-
},
|
46 |
-
token: function (stream, state) {
|
47 |
-
if (stream.sol()) {
|
48 |
-
state.lineNumber++;
|
49 |
-
state.inKeywordLine = false;
|
50 |
-
if (state.inMultilineTable) {
|
51 |
-
state.tableHeaderLine = false;
|
52 |
-
if (!stream.match(/\s*\|/, false)) {
|
53 |
-
state.allowMultilineArgument = false;
|
54 |
-
state.inMultilineTable = false;
|
55 |
-
}
|
56 |
-
}
|
57 |
-
}
|
58 |
-
|
59 |
-
stream.eatSpace();
|
60 |
-
|
61 |
-
if (state.allowMultilineArgument) {
|
62 |
-
|
63 |
-
// STRING
|
64 |
-
if (state.inMultilineString) {
|
65 |
-
if (stream.match('"""')) {
|
66 |
-
state.inMultilineString = false;
|
67 |
-
state.allowMultilineArgument = false;
|
68 |
-
} else {
|
69 |
-
stream.match(/.*/);
|
70 |
-
}
|
71 |
-
return "string";
|
72 |
-
}
|
73 |
-
|
74 |
-
// TABLE
|
75 |
-
if (state.inMultilineTable) {
|
76 |
-
if (stream.match(/\|\s*/)) {
|
77 |
-
return "bracket";
|
78 |
-
} else {
|
79 |
-
stream.match(/[^\|]*/);
|
80 |
-
return state.tableHeaderLine ? "header" : "string";
|
81 |
-
}
|
82 |
-
}
|
83 |
-
|
84 |
-
// DETECT START
|
85 |
-
if (stream.match('"""')) {
|
86 |
-
// String
|
87 |
-
state.inMultilineString = true;
|
88 |
-
return "string";
|
89 |
-
} else if (stream.match("|")) {
|
90 |
-
// Table
|
91 |
-
state.inMultilineTable = true;
|
92 |
-
state.tableHeaderLine = true;
|
93 |
-
return "bracket";
|
94 |
-
}
|
95 |
-
|
96 |
-
}
|
97 |
-
|
98 |
-
// LINE COMMENT
|
99 |
-
if (stream.match(/#.*/)) {
|
100 |
-
return "comment";
|
101 |
-
|
102 |
-
// TAG
|
103 |
-
} else if (!state.inKeywordLine && stream.match(/@\S+/)) {
|
104 |
-
return "tag";
|
105 |
-
|
106 |
-
// FEATURE
|
107 |
-
} else if (!state.inKeywordLine && state.allowFeature && stream.match(/(機能|功能|フィーチャ|기능|โครงหลัก|ความสามารถ|ความต้องการทางธุรกิจ|ಹೆಚ್ಚಳ|గుణము|ਮੁਹਾਂਦਰਾ|ਨਕਸ਼ ਨੁਹਾਰ|ਖਾਸੀਅਤ|रूप लेख|وِیژگی|خاصية|תכונה|Функціонал|Функция|Функционалност|Функционал|Үзенчәлеклелек|Свойство|Особина|Мөмкинлек|Могућност|Λειτουργία|Δυνατότητα|Właściwość|Vlastnosť|Trajto|Tính năng|Savybė|Pretty much|Požiadavka|Požadavek|Potrzeba biznesowa|Özellik|Osobina|Ominaisuus|Omadus|OH HAI|Mogućnost|Mogucnost|Jellemző|Hwæt|Hwaet|Funzionalità|Funktionalitéit|Funktionalität|Funkcja|Funkcionalnost|Funkcionalitāte|Funkcia|Fungsi|Functionaliteit|Funcționalitate|Funcţionalitate|Functionalitate|Funcionalitat|Funcionalidade|Fonctionnalité|Fitur|Fīča|Feature|Eiginleiki|Egenskap|Egenskab|Característica|Caracteristica|Business Need|Aspekt|Arwedd|Ahoy matey!|Ability):/)) {
|
108 |
-
state.allowScenario = true;
|
109 |
-
state.allowBackground = true;
|
110 |
-
state.allowPlaceholders = false;
|
111 |
-
state.allowSteps = false;
|
112 |
-
state.allowMultilineArgument = false;
|
113 |
-
state.inKeywordLine = true;
|
114 |
-
return "keyword";
|
115 |
-
|
116 |
-
// BACKGROUND
|
117 |
-
} else if (!state.inKeywordLine && state.allowBackground && stream.match(/(背景|배경|แนวคิด|ಹಿನ್ನೆಲೆ|నేపథ్యం|ਪਿਛੋਕੜ|पृष्ठभूमि|زمینه|الخلفية|רקע|Тарих|Предыстория|Предистория|Позадина|Передумова|Основа|Контекст|Кереш|Υπόβαθρο|Założenia|Yo\-ho\-ho|Tausta|Taust|Situācija|Rerefons|Pozadina|Pozadie|Pozadí|Osnova|Latar Belakang|Kontext|Konteksts|Kontekstas|Kontekst|Háttér|Hannergrond|Grundlage|Geçmiş|Fundo|Fono|First off|Dis is what went down|Dasar|Contexto|Contexte|Context|Contesto|Cenário de Fundo|Cenario de Fundo|Cefndir|Bối cảnh|Bakgrunnur|Bakgrunn|Bakgrund|Baggrund|Background|B4|Antecedents|Antecedentes|Ær|Aer|Achtergrond):/)) {
|
118 |
-
state.allowPlaceholders = false;
|
119 |
-
state.allowSteps = true;
|
120 |
-
state.allowBackground = false;
|
121 |
-
state.allowMultilineArgument = false;
|
122 |
-
state.inKeywordLine = true;
|
123 |
-
return "keyword";
|
124 |
-
|
125 |
-
// SCENARIO OUTLINE
|
126 |
-
} else if (!state.inKeywordLine && state.allowScenario && stream.match(/(場景大綱|场景大纲|劇本大綱|剧本大纲|テンプレ|シナリオテンプレート|シナリオテンプレ|シナリオアウトライン|시나리오 개요|สรุปเหตุการณ์|โครงสร้างของเหตุการณ์|ವಿವರಣೆ|కథనం|ਪਟਕਥਾ ਰੂਪ ਰੇਖਾ|ਪਟਕਥਾ ਢਾਂਚਾ|परिदृश्य रूपरेखा|سيناريو مخطط|الگوی سناریو|תבנית תרחיש|Сценарийның төзелеше|Сценарий структураси|Структура сценарію|Структура сценария|Структура сценарија|Скица|Рамка на сценарий|Концепт|Περιγραφή Σεναρίου|Wharrimean is|Template Situai|Template Senario|Template Keadaan|Tapausaihio|Szenariogrundriss|Szablon scenariusza|Swa hwær swa|Swa hwaer swa|Struktura scenarija|Structură scenariu|Structura scenariu|Skica|Skenario konsep|Shiver me timbers|Senaryo taslağı|Schema dello scenario|Scenariomall|Scenariomal|Scenario Template|Scenario Outline|Scenario Amlinellol|Scenārijs pēc parauga|Scenarijaus šablonas|Reckon it's like|Raamstsenaarium|Plang vum Szenario|Plan du Scénario|Plan du scénario|Osnova scénáře|Osnova Scenára|Náčrt Scenáru|Náčrt Scénáře|Náčrt Scenára|MISHUN SRSLY|Menggariskan Senario|Lýsing Dæma|Lýsing Atburðarásar|Konturo de la scenaro|Koncept|Khung tình huống|Khung kịch bản|Forgatókönyv vázlat|Esquema do Cenário|Esquema do Cenario|Esquema del escenario|Esquema de l'escenari|Esbozo do escenario|Delineação do Cenário|Delineacao do Cenario|All y'all|Abstrakt Scenario|Abstract Scenario):/)) {
|
127 |
-
state.allowPlaceholders = true;
|
128 |
-
state.allowSteps = true;
|
129 |
-
state.allowMultilineArgument = false;
|
130 |
-
state.inKeywordLine = true;
|
131 |
-
return "keyword";
|
132 |
-
|
133 |
-
// EXAMPLES
|
134 |
-
} else if (state.allowScenario && stream.match(/(例子|例|サンプル|예|ชุดของเหตุการณ์|ชุดของตัวอย่าง|ಉದಾಹರಣೆಗಳು|ఉదాహరణలు|ਉਦਾਹਰਨਾਂ|उदाहरण|نمونه ها|امثلة|דוגמאות|Үрнәкләр|Сценарији|Примеры|Примери|Приклади|Мисоллар|Мисаллар|Σενάρια|Παραδείγματα|You'll wanna|Voorbeelden|Variantai|Tapaukset|Se þe|Se the|Se ðe|Scenarios|Scenariji|Scenarijai|Przykłady|Primjeri|Primeri|Příklady|Príklady|Piemēri|Példák|Pavyzdžiai|Paraugs|Örnekler|Juhtumid|Exemplos|Exemples|Exemple|Exempel|EXAMPLZ|Examples|Esempi|Enghreifftiau|Ekzemploj|Eksempler|Ejemplos|Dữ liệu|Dead men tell no tales|Dæmi|Contoh|Cenários|Cenarios|Beispiller|Beispiele|Atburðarásir):/)) {
|
135 |
-
state.allowPlaceholders = false;
|
136 |
-
state.allowSteps = true;
|
137 |
-
state.allowBackground = false;
|
138 |
-
state.allowMultilineArgument = true;
|
139 |
-
return "keyword";
|
140 |
-
|
141 |
-
// SCENARIO
|
142 |
-
} else if (!state.inKeywordLine && state.allowScenario && stream.match(/(場景|场景|劇本|剧本|シナリオ|시나리오|เหตุการณ์|ಕಥಾಸಾರಾಂಶ|సన్నివేశం|ਪਟਕਥਾ|परिदृश्य|سيناريو|سناریو|תרחיש|Сценарій|Сценарио|Сценарий|Пример|Σενάριο|Tình huống|The thing of it is|Tapaus|Szenario|Swa|Stsenaarium|Skenario|Situai|Senaryo|Senario|Scenaro|Scenariusz|Scenariu|Scénario|Scenario|Scenarijus|Scenārijs|Scenarij|Scenarie|Scénář|Scenár|Primer|MISHUN|Kịch bản|Keadaan|Heave to|Forgatókönyv|Escenario|Escenari|Cenário|Cenario|Awww, look mate|Atburðarás):/)) {
|
143 |
-
state.allowPlaceholders = false;
|
144 |
-
state.allowSteps = true;
|
145 |
-
state.allowBackground = false;
|
146 |
-
state.allowMultilineArgument = false;
|
147 |
-
state.inKeywordLine = true;
|
148 |
-
return "keyword";
|
149 |
-
|
150 |
-
// STEPS
|
151 |
-
} else if (!state.inKeywordLine && state.allowSteps && stream.match(/(那麼|那么|而且|當|当|并且|同時|同时|前提|假设|假設|假定|假如|但是|但し|並且|もし|ならば|ただし|しかし|かつ|하지만|조건|먼저|만일|만약|단|그리고|그러면|และ |เมื่อ |แต่ |ดังนั้น |กำหนดให้ |ಸ್ಥಿತಿಯನ್ನು |ಮತ್ತು |ನೀಡಿದ |ನಂತರ |ಆದರೆ |మరియు |చెప్పబడినది |కాని |ఈ పరిస్థితిలో |అప్పుడు |ਪਰ |ਤਦ |ਜੇਕਰ |ਜਿਵੇਂ ਕਿ |ਜਦੋਂ |ਅਤੇ |यदि |परन्तु |पर |तब |तदा |तथा |जब |चूंकि |किन्तु |कदा |और |अगर |و |هنگامی |متى |لكن |عندما |ثم |بفرض |با فرض |اما |اذاً |آنگاه |כאשר |וגם |בהינתן |אזי |אז |אבל |Якщо |Һәм |Унда |Тоді |Тогда |То |Также |Та |Пусть |Припустимо, що |Припустимо |Онда |Но |Нехай |Нәтиҗәдә |Лекин |Ләкин |Коли |Когда |Когато |Када |Кад |К тому же |І |И |Задато |Задати |Задате |Если |Допустим |Дано |Дадено |Вә |Ва |Бирок |Әмма |Әйтик |Әгәр |Аммо |Али |Але |Агар |А також |А |Τότε |Όταν |Και |Δεδομένου |Αλλά |Þurh |Þegar |Þa þe |Þá |Þa |Zatati |Zakładając |Zadato |Zadate |Zadano |Zadani |Zadan |Za předpokladu |Za predpokladu |Youse know when youse got |Youse know like when |Yna |Yeah nah |Y'know |Y |Wun |Wtedy |When y'all |When |Wenn |WEN |wann |Ve |Và |Und |Un |ugeholl |Too right |Thurh |Thì |Then y'all |Then |Tha the |Tha |Tetapi |Tapi |Tak |Tada |Tad |Stel |Soit |Siis |Și |Şi |Si |Sed |Se |Så |Quando |Quand |Quan |Pryd |Potom |Pokud |Pokiaľ |Però |Pero |Pak |Oraz |Onda |Ond |Oletetaan |Og |Och |O zaman |Niin |Nhưng |När |Når |Mutta |Men |Mas |Maka |Majd |Mając |Mais |Maar |mä |Ma |Lorsque |Lorsqu'|Logo |Let go and haul |Kun |Kuid |Kui |Kiedy |Khi |Ketika |Kemudian |Keď |Když |Kaj |Kai |Kada |Kad |Jeżeli |Jeśli |Ja |It's just unbelievable |Ir |I CAN HAZ |I |Ha |Givun |Givet |Given y'all |Given |Gitt |Gegeven |Gegeben seien |Gegeben sei |Gdy |Gangway! |Fakat |Étant donnés |Etant donnés |Étant données |Etant données |Étant donnée |Etant donnée |Étant donné |Etant donné |Et |És |Entonces |Entón |Então |Entao |En |Eğer ki |Ef |Eeldades |E |Ðurh |Duota |Dun |Donitaĵo |Donat |Donada |Do |Diyelim ki |Diberi |Dengan |Den youse gotta |DEN |De |Dato |Dați fiind |Daţi fiind |Dati fiind |Dati |Date fiind |Date |Data |Dat fiind |Dar |Dann |dann |Dan |Dados |Dado |Dadas |Dada |Ða ðe |Ða |Cuando |Cho |Cando |Când |Cand |Cal |But y'all |But at the end of the day I reckon |BUT |But |Buh |Blimey! |Biết |Bet |Bagi |Aye |awer |Avast! |Atunci |Atesa |Atès |Apabila |Anrhegedig a |Angenommen |And y'all |And |AN |An |an |Amikor |Amennyiben |Ama |Als |Alors |Allora |Ali |Aleshores |Ale |Akkor |Ak |Adott |Ac |Aber |A zároveň |A tiež |A taktiež |A také |A |a |7 |\* )/)) {
|
152 |
-
state.inStep = true;
|
153 |
-
state.allowPlaceholders = true;
|
154 |
-
state.allowMultilineArgument = true;
|
155 |
-
state.inKeywordLine = true;
|
156 |
-
return "keyword";
|
157 |
-
|
158 |
-
// INLINE STRING
|
159 |
-
} else if (stream.match(/"[^"]*"?/)) {
|
160 |
-
return "string";
|
161 |
-
|
162 |
-
// PLACEHOLDER
|
163 |
-
} else if (state.allowPlaceholders && stream.match(/<[^>]*>?/)) {
|
164 |
-
return "variable";
|
165 |
-
|
166 |
-
// Fall through
|
167 |
-
} else {
|
168 |
-
stream.next();
|
169 |
-
stream.eatWhile(/[^@"<#]/);
|
170 |
-
return null;
|
171 |
-
}
|
172 |
-
}
|
173 |
-
};
|
174 |
-
});
|
175 |
-
|
176 |
-
CodeMirror.defineMIME("text/x-feature", "gherkin");
|
177 |
-
|
178 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/gherkin/index.html
DELETED
@@ -1,48 +0,0 @@
|
|
1 |
-
<!doctype html>
|
2 |
-
|
3 |
-
<title>CodeMirror: Gherkin mode</title>
|
4 |
-
<meta charset="utf-8"/>
|
5 |
-
<link rel=stylesheet href="../../doc/docs.css">
|
6 |
-
|
7 |
-
<link rel="stylesheet" href="../../lib/codemirror.css">
|
8 |
-
<script src="../../lib/codemirror.js"></script>
|
9 |
-
<script src="gherkin.js"></script>
|
10 |
-
<style>.CodeMirror { border-top: 1px solid #ddd; border-bottom: 1px solid #ddd; }</style>
|
11 |
-
<div id=nav>
|
12 |
-
<a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
13 |
-
|
14 |
-
<ul>
|
15 |
-
<li><a href="../../index.html">Home</a>
|
16 |
-
<li><a href="../../doc/manual.html">Manual</a>
|
17 |
-
<li><a href="https://github.com/codemirror/codemirror">Code</a>
|
18 |
-
</ul>
|
19 |
-
<ul>
|
20 |
-
<li><a href="../index.html">Language modes</a>
|
21 |
-
<li><a class=active href="#">Gherkin</a>
|
22 |
-
</ul>
|
23 |
-
</div>
|
24 |
-
|
25 |
-
<article>
|
26 |
-
<h2>Gherkin mode</h2>
|
27 |
-
<form><textarea id="code" name="code">
|
28 |
-
Feature: Using Google
|
29 |
-
Background:
|
30 |
-
Something something
|
31 |
-
Something else
|
32 |
-
Scenario: Has a homepage
|
33 |
-
When I navigate to the google home page
|
34 |
-
Then the home page should contain the menu and the search form
|
35 |
-
Scenario: Searching for a term
|
36 |
-
When I navigate to the google home page
|
37 |
-
When I search for Tofu
|
38 |
-
Then the search results page is displayed
|
39 |
-
Then the search results page contains 10 individual search results
|
40 |
-
Then the search results contain a link to the wikipedia tofu page
|
41 |
-
</textarea></form>
|
42 |
-
<script>
|
43 |
-
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {});
|
44 |
-
</script>
|
45 |
-
|
46 |
-
<p><strong>MIME types defined:</strong> <code>text/x-feature</code>.</p>
|
47 |
-
|
48 |
-
</article>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/go/go.js
DELETED
@@ -1,185 +0,0 @@
|
|
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("go", function(config) {
|
15 |
-
var indentUnit = config.indentUnit;
|
16 |
-
|
17 |
-
var keywords = {
|
18 |
-
"break":true, "case":true, "chan":true, "const":true, "continue":true,
|
19 |
-
"default":true, "defer":true, "else":true, "fallthrough":true, "for":true,
|
20 |
-
"func":true, "go":true, "goto":true, "if":true, "import":true,
|
21 |
-
"interface":true, "map":true, "package":true, "range":true, "return":true,
|
22 |
-
"select":true, "struct":true, "switch":true, "type":true, "var":true,
|
23 |
-
"bool":true, "byte":true, "complex64":true, "complex128":true,
|
24 |
-
"float32":true, "float64":true, "int8":true, "int16":true, "int32":true,
|
25 |
-
"int64":true, "string":true, "uint8":true, "uint16":true, "uint32":true,
|
26 |
-
"uint64":true, "int":true, "uint":true, "uintptr":true
|
27 |
-
};
|
28 |
-
|
29 |
-
var atoms = {
|
30 |
-
"true":true, "false":true, "iota":true, "nil":true, "append":true,
|
31 |
-
"cap":true, "close":true, "complex":true, "copy":true, "imag":true,
|
32 |
-
"len":true, "make":true, "new":true, "panic":true, "print":true,
|
33 |
-
"println":true, "real":true, "recover":true
|
34 |
-
};
|
35 |
-
|
36 |
-
var isOperatorChar = /[+\-*&^%:=<>!|\/]/;
|
37 |
-
|
38 |
-
var curPunc;
|
39 |
-
|
40 |
-
function tokenBase(stream, state) {
|
41 |
-
var ch = stream.next();
|
42 |
-
if (ch == '"' || ch == "'" || ch == "`") {
|
43 |
-
state.tokenize = tokenString(ch);
|
44 |
-
return state.tokenize(stream, state);
|
45 |
-
}
|
46 |
-
if (/[\d\.]/.test(ch)) {
|
47 |
-
if (ch == ".") {
|
48 |
-
stream.match(/^[0-9]+([eE][\-+]?[0-9]+)?/);
|
49 |
-
} else if (ch == "0") {
|
50 |
-
stream.match(/^[xX][0-9a-fA-F]+/) || stream.match(/^0[0-7]+/);
|
51 |
-
} else {
|
52 |
-
stream.match(/^[0-9]*\.?[0-9]*([eE][\-+]?[0-9]+)?/);
|
53 |
-
}
|
54 |
-
return "number";
|
55 |
-
}
|
56 |
-
if (/[\[\]{}\(\),;\:\.]/.test(ch)) {
|
57 |
-
curPunc = ch;
|
58 |
-
return null;
|
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 |
-
stream.eatWhile(isOperatorChar);
|
72 |
-
return "operator";
|
73 |
-
}
|
74 |
-
stream.eatWhile(/[\w\$_\xa1-\uffff]/);
|
75 |
-
var cur = stream.current();
|
76 |
-
if (keywords.propertyIsEnumerable(cur)) {
|
77 |
-
if (cur == "case" || cur == "default") curPunc = "case";
|
78 |
-
return "keyword";
|
79 |
-
}
|
80 |
-
if (atoms.propertyIsEnumerable(cur)) return "atom";
|
81 |
-
return "variable";
|
82 |
-
}
|
83 |
-
|
84 |
-
function tokenString(quote) {
|
85 |
-
return function(stream, state) {
|
86 |
-
var escaped = false, next, end = false;
|
87 |
-
while ((next = stream.next()) != null) {
|
88 |
-
if (next == quote && !escaped) {end = true; break;}
|
89 |
-
escaped = !escaped && quote != "`" && next == "\\";
|
90 |
-
}
|
91 |
-
if (end || !(escaped || quote == "`"))
|
92 |
-
state.tokenize = tokenBase;
|
93 |
-
return "string";
|
94 |
-
};
|
95 |
-
}
|
96 |
-
|
97 |
-
function tokenComment(stream, state) {
|
98 |
-
var maybeEnd = false, ch;
|
99 |
-
while (ch = stream.next()) {
|
100 |
-
if (ch == "/" && maybeEnd) {
|
101 |
-
state.tokenize = tokenBase;
|
102 |
-
break;
|
103 |
-
}
|
104 |
-
maybeEnd = (ch == "*");
|
105 |
-
}
|
106 |
-
return "comment";
|
107 |
-
}
|
108 |
-
|
109 |
-
function Context(indented, column, type, align, prev) {
|
110 |
-
this.indented = indented;
|
111 |
-
this.column = column;
|
112 |
-
this.type = type;
|
113 |
-
this.align = align;
|
114 |
-
this.prev = prev;
|
115 |
-
}
|
116 |
-
function pushContext(state, col, type) {
|
117 |
-
return state.context = new Context(state.indented, col, type, null, state.context);
|
118 |
-
}
|
119 |
-
function popContext(state) {
|
120 |
-
if (!state.context.prev) return;
|
121 |
-
var t = state.context.type;
|
122 |
-
if (t == ")" || t == "]" || t == "}")
|
123 |
-
state.indented = state.context.indented;
|
124 |
-
return state.context = state.context.prev;
|
125 |
-
}
|
126 |
-
|
127 |
-
// Interface
|
128 |
-
|
129 |
-
return {
|
130 |
-
startState: function(basecolumn) {
|
131 |
-
return {
|
132 |
-
tokenize: null,
|
133 |
-
context: new Context((basecolumn || 0) - indentUnit, 0, "top", false),
|
134 |
-
indented: 0,
|
135 |
-
startOfLine: true
|
136 |
-
};
|
137 |
-
},
|
138 |
-
|
139 |
-
token: function(stream, state) {
|
140 |
-
var ctx = state.context;
|
141 |
-
if (stream.sol()) {
|
142 |
-
if (ctx.align == null) ctx.align = false;
|
143 |
-
state.indented = stream.indentation();
|
144 |
-
state.startOfLine = true;
|
145 |
-
if (ctx.type == "case") ctx.type = "}";
|
146 |
-
}
|
147 |
-
if (stream.eatSpace()) return null;
|
148 |
-
curPunc = null;
|
149 |
-
var style = (state.tokenize || tokenBase)(stream, state);
|
150 |
-
if (style == "comment") return style;
|
151 |
-
if (ctx.align == null) ctx.align = true;
|
152 |
-
|
153 |
-
if (curPunc == "{") pushContext(state, stream.column(), "}");
|
154 |
-
else if (curPunc == "[") pushContext(state, stream.column(), "]");
|
155 |
-
else if (curPunc == "(") pushContext(state, stream.column(), ")");
|
156 |
-
else if (curPunc == "case") ctx.type = "case";
|
157 |
-
else if (curPunc == "}" && ctx.type == "}") ctx = popContext(state);
|
158 |
-
else if (curPunc == ctx.type) popContext(state);
|
159 |
-
state.startOfLine = false;
|
160 |
-
return style;
|
161 |
-
},
|
162 |
-
|
163 |
-
indent: function(state, textAfter) {
|
164 |
-
if (state.tokenize != tokenBase && state.tokenize != null) return 0;
|
165 |
-
var ctx = state.context, firstChar = textAfter && textAfter.charAt(0);
|
166 |
-
if (ctx.type == "case" && /^(?:case|default)\b/.test(textAfter)) {
|
167 |
-
state.context.type = "}";
|
168 |
-
return ctx.indented;
|
169 |
-
}
|
170 |
-
var closing = firstChar == ctx.type;
|
171 |
-
if (ctx.align) return ctx.column + (closing ? 0 : 1);
|
172 |
-
else return ctx.indented + (closing ? 0 : indentUnit);
|
173 |
-
},
|
174 |
-
|
175 |
-
electricChars: "{}):",
|
176 |
-
fold: "brace",
|
177 |
-
blockCommentStart: "/*",
|
178 |
-
blockCommentEnd: "*/",
|
179 |
-
lineComment: "//"
|
180 |
-
};
|
181 |
-
});
|
182 |
-
|
183 |
-
CodeMirror.defineMIME("text/x-go", "go");
|
184 |
-
|
185 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/go/index.html
DELETED
@@ -1,85 +0,0 @@
|
|
1 |
-
<!doctype html>
|
2 |
-
|
3 |
-
<title>CodeMirror: Go mode</title>
|
4 |
-
<meta charset="utf-8"/>
|
5 |
-
<link rel=stylesheet href="../../doc/docs.css">
|
6 |
-
|
7 |
-
<link rel="stylesheet" href="../../lib/codemirror.css">
|
8 |
-
<link rel="stylesheet" href="../../theme/elegant.css">
|
9 |
-
<script src="../../lib/codemirror.js"></script>
|
10 |
-
<script src="../../addon/edit/matchbrackets.js"></script>
|
11 |
-
<script src="go.js"></script>
|
12 |
-
<style>.CodeMirror {border:1px solid #999; background:#ffc}</style>
|
13 |
-
<div id=nav>
|
14 |
-
<a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
15 |
-
|
16 |
-
<ul>
|
17 |
-
<li><a href="../../index.html">Home</a>
|
18 |
-
<li><a href="../../doc/manual.html">Manual</a>
|
19 |
-
<li><a href="https://github.com/codemirror/codemirror">Code</a>
|
20 |
-
</ul>
|
21 |
-
<ul>
|
22 |
-
<li><a href="../index.html">Language modes</a>
|
23 |
-
<li><a class=active href="#">Go</a>
|
24 |
-
</ul>
|
25 |
-
</div>
|
26 |
-
|
27 |
-
<article>
|
28 |
-
<h2>Go mode</h2>
|
29 |
-
<form><textarea id="code" name="code">
|
30 |
-
// Prime Sieve in Go.
|
31 |
-
// Taken from the Go specification.
|
32 |
-
// Copyright © The Go Authors.
|
33 |
-
|
34 |
-
package main
|
35 |
-
|
36 |
-
import "fmt"
|
37 |
-
|
38 |
-
// Send the sequence 2, 3, 4, ... to channel 'ch'.
|
39 |
-
func generate(ch chan<- int) {
|
40 |
-
for i := 2; ; i++ {
|
41 |
-
ch <- i // Send 'i' to channel 'ch'
|
42 |
-
}
|
43 |
-
}
|
44 |
-
|
45 |
-
// Copy the values from channel 'src' to channel 'dst',
|
46 |
-
// removing those divisible by 'prime'.
|
47 |
-
func filter(src <-chan int, dst chan<- int, prime int) {
|
48 |
-
for i := range src { // Loop over values received from 'src'.
|
49 |
-
if i%prime != 0 {
|
50 |
-
dst <- i // Send 'i' to channel 'dst'.
|
51 |
-
}
|
52 |
-
}
|
53 |
-
}
|
54 |
-
|
55 |
-
// The prime sieve: Daisy-chain filter processes together.
|
56 |
-
func sieve() {
|
57 |
-
ch := make(chan int) // Create a new channel.
|
58 |
-
go generate(ch) // Start generate() as a subprocess.
|
59 |
-
for {
|
60 |
-
prime := <-ch
|
61 |
-
fmt.Print(prime, "\n")
|
62 |
-
ch1 := make(chan int)
|
63 |
-
go filter(ch, ch1, prime)
|
64 |
-
ch = ch1
|
65 |
-
}
|
66 |
-
}
|
67 |
-
|
68 |
-
func main() {
|
69 |
-
sieve()
|
70 |
-
}
|
71 |
-
</textarea></form>
|
72 |
-
|
73 |
-
<script>
|
74 |
-
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
|
75 |
-
theme: "elegant",
|
76 |
-
matchBrackets: true,
|
77 |
-
indentUnit: 8,
|
78 |
-
tabSize: 8,
|
79 |
-
indentWithTabs: true,
|
80 |
-
mode: "text/x-go"
|
81 |
-
});
|
82 |
-
</script>
|
83 |
-
|
84 |
-
<p><strong>MIME type:</strong> <code>text/x-go</code></p>
|
85 |
-
</article>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/groovy/groovy.js
DELETED
@@ -1,230 +0,0 @@
|
|
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("groovy", function(config) {
|
15 |
-
function words(str) {
|
16 |
-
var obj = {}, words = str.split(" ");
|
17 |
-
for (var i = 0; i < words.length; ++i) obj[words[i]] = true;
|
18 |
-
return obj;
|
19 |
-
}
|
20 |
-
var keywords = words(
|
21 |
-
"abstract as assert boolean break byte case catch char class const continue def default " +
|
22 |
-
"do double else enum extends final finally float for goto if implements import in " +
|
23 |
-
"instanceof int interface long native new package private protected public return " +
|
24 |
-
"short static strictfp super switch synchronized threadsafe throw throws transient " +
|
25 |
-
"try void volatile while");
|
26 |
-
var blockKeywords = words("catch class do else finally for if switch try while enum interface def");
|
27 |
-
var standaloneKeywords = words("return break continue");
|
28 |
-
var atoms = words("null true false this");
|
29 |
-
|
30 |
-
var curPunc;
|
31 |
-
function tokenBase(stream, state) {
|
32 |
-
var ch = stream.next();
|
33 |
-
if (ch == '"' || ch == "'") {
|
34 |
-
return startString(ch, stream, state);
|
35 |
-
}
|
36 |
-
if (/[\[\]{}\(\),;\:\.]/.test(ch)) {
|
37 |
-
curPunc = ch;
|
38 |
-
return null;
|
39 |
-
}
|
40 |
-
if (/\d/.test(ch)) {
|
41 |
-
stream.eatWhile(/[\w\.]/);
|
42 |
-
if (stream.eat(/eE/)) { stream.eat(/\+\-/); stream.eatWhile(/\d/); }
|
43 |
-
return "number";
|
44 |
-
}
|
45 |
-
if (ch == "/") {
|
46 |
-
if (stream.eat("*")) {
|
47 |
-
state.tokenize.push(tokenComment);
|
48 |
-
return tokenComment(stream, state);
|
49 |
-
}
|
50 |
-
if (stream.eat("/")) {
|
51 |
-
stream.skipToEnd();
|
52 |
-
return "comment";
|
53 |
-
}
|
54 |
-
if (expectExpression(state.lastToken, false)) {
|
55 |
-
return startString(ch, stream, state);
|
56 |
-
}
|
57 |
-
}
|
58 |
-
if (ch == "-" && stream.eat(">")) {
|
59 |
-
curPunc = "->";
|
60 |
-
return null;
|
61 |
-
}
|
62 |
-
if (/[+\-*&%=<>!?|\/~]/.test(ch)) {
|
63 |
-
stream.eatWhile(/[+\-*&%=<>|~]/);
|
64 |
-
return "operator";
|
65 |
-
}
|
66 |
-
stream.eatWhile(/[\w\$_]/);
|
67 |
-
if (ch == "@") { stream.eatWhile(/[\w\$_\.]/); return "meta"; }
|
68 |
-
if (state.lastToken == ".") return "property";
|
69 |
-
if (stream.eat(":")) { curPunc = "proplabel"; return "property"; }
|
70 |
-
var cur = stream.current();
|
71 |
-
if (atoms.propertyIsEnumerable(cur)) { return "atom"; }
|
72 |
-
if (keywords.propertyIsEnumerable(cur)) {
|
73 |
-
if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement";
|
74 |
-
else if (standaloneKeywords.propertyIsEnumerable(cur)) curPunc = "standalone";
|
75 |
-
return "keyword";
|
76 |
-
}
|
77 |
-
return "variable";
|
78 |
-
}
|
79 |
-
tokenBase.isBase = true;
|
80 |
-
|
81 |
-
function startString(quote, stream, state) {
|
82 |
-
var tripleQuoted = false;
|
83 |
-
if (quote != "/" && stream.eat(quote)) {
|
84 |
-
if (stream.eat(quote)) tripleQuoted = true;
|
85 |
-
else return "string";
|
86 |
-
}
|
87 |
-
function t(stream, state) {
|
88 |
-
var escaped = false, next, end = !tripleQuoted;
|
89 |
-
while ((next = stream.next()) != null) {
|
90 |
-
if (next == quote && !escaped) {
|
91 |
-
if (!tripleQuoted) { break; }
|
92 |
-
if (stream.match(quote + quote)) { end = true; break; }
|
93 |
-
}
|
94 |
-
if (quote == '"' && next == "$" && !escaped && stream.eat("{")) {
|
95 |
-
state.tokenize.push(tokenBaseUntilBrace());
|
96 |
-
return "string";
|
97 |
-
}
|
98 |
-
escaped = !escaped && next == "\\";
|
99 |
-
}
|
100 |
-
if (end) state.tokenize.pop();
|
101 |
-
return "string";
|
102 |
-
}
|
103 |
-
state.tokenize.push(t);
|
104 |
-
return t(stream, state);
|
105 |
-
}
|
106 |
-
|
107 |
-
function tokenBaseUntilBrace() {
|
108 |
-
var depth = 1;
|
109 |
-
function t(stream, state) {
|
110 |
-
if (stream.peek() == "}") {
|
111 |
-
depth--;
|
112 |
-
if (depth == 0) {
|
113 |
-
state.tokenize.pop();
|
114 |
-
return state.tokenize[state.tokenize.length-1](stream, state);
|
115 |
-
}
|
116 |
-
} else if (stream.peek() == "{") {
|
117 |
-
depth++;
|
118 |
-
}
|
119 |
-
return tokenBase(stream, state);
|
120 |
-
}
|
121 |
-
t.isBase = true;
|
122 |
-
return t;
|
123 |
-
}
|
124 |
-
|
125 |
-
function tokenComment(stream, state) {
|
126 |
-
var maybeEnd = false, ch;
|
127 |
-
while (ch = stream.next()) {
|
128 |
-
if (ch == "/" && maybeEnd) {
|
129 |
-
state.tokenize.pop();
|
130 |
-
break;
|
131 |
-
}
|
132 |
-
maybeEnd = (ch == "*");
|
133 |
-
}
|
134 |
-
return "comment";
|
135 |
-
}
|
136 |
-
|
137 |
-
function expectExpression(last, newline) {
|
138 |
-
return !last || last == "operator" || last == "->" || /[\.\[\{\(,;:]/.test(last) ||
|
139 |
-
last == "newstatement" || last == "keyword" || last == "proplabel" ||
|
140 |
-
(last == "standalone" && !newline);
|
141 |
-
}
|
142 |
-
|
143 |
-
function Context(indented, column, type, align, prev) {
|
144 |
-
this.indented = indented;
|
145 |
-
this.column = column;
|
146 |
-
this.type = type;
|
147 |
-
this.align = align;
|
148 |
-
this.prev = prev;
|
149 |
-
}
|
150 |
-
function pushContext(state, col, type) {
|
151 |
-
return state.context = new Context(state.indented, col, type, null, state.context);
|
152 |
-
}
|
153 |
-
function popContext(state) {
|
154 |
-
var t = state.context.type;
|
155 |
-
if (t == ")" || t == "]" || t == "}")
|
156 |
-
state.indented = state.context.indented;
|
157 |
-
return state.context = state.context.prev;
|
158 |
-
}
|
159 |
-
|
160 |
-
// Interface
|
161 |
-
|
162 |
-
return {
|
163 |
-
startState: function(basecolumn) {
|
164 |
-
return {
|
165 |
-
tokenize: [tokenBase],
|
166 |
-
context: new Context((basecolumn || 0) - config.indentUnit, 0, "top", false),
|
167 |
-
indented: 0,
|
168 |
-
startOfLine: true,
|
169 |
-
lastToken: null
|
170 |
-
};
|
171 |
-
},
|
172 |
-
|
173 |
-
token: function(stream, state) {
|
174 |
-
var ctx = state.context;
|
175 |
-
if (stream.sol()) {
|
176 |
-
if (ctx.align == null) ctx.align = false;
|
177 |
-
state.indented = stream.indentation();
|
178 |
-
state.startOfLine = true;
|
179 |
-
// Automatic semicolon insertion
|
180 |
-
if (ctx.type == "statement" && !expectExpression(state.lastToken, true)) {
|
181 |
-
popContext(state); ctx = state.context;
|
182 |
-
}
|
183 |
-
}
|
184 |
-
if (stream.eatSpace()) return null;
|
185 |
-
curPunc = null;
|
186 |
-
var style = state.tokenize[state.tokenize.length-1](stream, state);
|
187 |
-
if (style == "comment") return style;
|
188 |
-
if (ctx.align == null) ctx.align = true;
|
189 |
-
|
190 |
-
if ((curPunc == ";" || curPunc == ":") && ctx.type == "statement") popContext(state);
|
191 |
-
// Handle indentation for {x -> \n ... }
|
192 |
-
else if (curPunc == "->" && ctx.type == "statement" && ctx.prev.type == "}") {
|
193 |
-
popContext(state);
|
194 |
-
state.context.align = false;
|
195 |
-
}
|
196 |
-
else if (curPunc == "{") pushContext(state, stream.column(), "}");
|
197 |
-
else if (curPunc == "[") pushContext(state, stream.column(), "]");
|
198 |
-
else if (curPunc == "(") pushContext(state, stream.column(), ")");
|
199 |
-
else if (curPunc == "}") {
|
200 |
-
while (ctx.type == "statement") ctx = popContext(state);
|
201 |
-
if (ctx.type == "}") ctx = popContext(state);
|
202 |
-
while (ctx.type == "statement") ctx = popContext(state);
|
203 |
-
}
|
204 |
-
else if (curPunc == ctx.type) popContext(state);
|
205 |
-
else if (ctx.type == "}" || ctx.type == "top" || (ctx.type == "statement" && curPunc == "newstatement"))
|
206 |
-
pushContext(state, stream.column(), "statement");
|
207 |
-
state.startOfLine = false;
|
208 |
-
state.lastToken = curPunc || style;
|
209 |
-
return style;
|
210 |
-
},
|
211 |
-
|
212 |
-
indent: function(state, textAfter) {
|
213 |
-
if (!state.tokenize[state.tokenize.length-1].isBase) return 0;
|
214 |
-
var firstChar = textAfter && textAfter.charAt(0), ctx = state.context;
|
215 |
-
if (ctx.type == "statement" && !expectExpression(state.lastToken, true)) ctx = ctx.prev;
|
216 |
-
var closing = firstChar == ctx.type;
|
217 |
-
if (ctx.type == "statement") return ctx.indented + (firstChar == "{" ? 0 : config.indentUnit);
|
218 |
-
else if (ctx.align) return ctx.column + (closing ? 0 : 1);
|
219 |
-
else return ctx.indented + (closing ? 0 : config.indentUnit);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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/groovy/index.html
DELETED
@@ -1,84 +0,0 @@
|
|
1 |
-
<!doctype html>
|
2 |
-
|
3 |
-
<title>CodeMirror: Groovy mode</title>
|
4 |
-
<meta charset="utf-8"/>
|
5 |
-
<link rel=stylesheet href="../../doc/docs.css">
|
6 |
-
|
7 |
-
<link rel="stylesheet" href="../../lib/codemirror.css">
|
8 |
-
<script src="../../lib/codemirror.js"></script>
|
9 |
-
<script src="../../addon/edit/matchbrackets.js"></script>
|
10 |
-
<script src="groovy.js"></script>
|
11 |
-
<style>.CodeMirror {border-top: 1px solid #500; border-bottom: 1px solid #500;}</style>
|
12 |
-
<div id=nav>
|
13 |
-
<a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
14 |
-
|
15 |
-
<ul>
|
16 |
-
<li><a href="../../index.html">Home</a>
|
17 |
-
<li><a href="../../doc/manual.html">Manual</a>
|
18 |
-
<li><a href="https://github.com/codemirror/codemirror">Code</a>
|
19 |
-
</ul>
|
20 |
-
<ul>
|
21 |
-
<li><a href="../index.html">Language modes</a>
|
22 |
-
<li><a class=active href="#">Groovy</a>
|
23 |
-
</ul>
|
24 |
-
</div>
|
25 |
-
|
26 |
-
<article>
|
27 |
-
<h2>Groovy mode</h2>
|
28 |
-
<form><textarea id="code" name="code">
|
29 |
-
//Pattern for groovy script
|
30 |
-
def p = ~/.*\.groovy/
|
31 |
-
new File( 'd:\\scripts' ).eachFileMatch(p) {f ->
|
32 |
-
// imports list
|
33 |
-
def imports = []
|
34 |
-
f.eachLine {
|
35 |
-
// condition to detect an import instruction
|
36 |
-
ln -> if ( ln =~ '^import .*' ) {
|
37 |
-
imports << "${ln - 'import '}"
|
38 |
-
}
|
39 |
-
}
|
40 |
-
// print thmen
|
41 |
-
if ( ! imports.empty ) {
|
42 |
-
println f
|
43 |
-
imports.each{ println " $it" }
|
44 |
-
}
|
45 |
-
}
|
46 |
-
|
47 |
-
/* Coin changer demo code from http://groovy.codehaus.org */
|
48 |
-
|
49 |
-
enum UsCoin {
|
50 |
-
quarter(25), dime(10), nickel(5), penny(1)
|
51 |
-
UsCoin(v) { value = v }
|
52 |
-
final value
|
53 |
-
}
|
54 |
-
|
55 |
-
enum OzzieCoin {
|
56 |
-
fifty(50), twenty(20), ten(10), five(5)
|
57 |
-
OzzieCoin(v) { value = v }
|
58 |
-
final value
|
59 |
-
}
|
60 |
-
|
61 |
-
def plural(word, count) {
|
62 |
-
if (count == 1) return word
|
63 |
-
word[-1] == 'y' ? word[0..-2] + "ies" : word + "s"
|
64 |
-
}
|
65 |
-
|
66 |
-
def change(currency, amount) {
|
67 |
-
currency.values().inject([]){ list, coin ->
|
68 |
-
int count = amount / coin.value
|
69 |
-
amount = amount % coin.value
|
70 |
-
list += "$count ${plural(coin.toString(), count)}"
|
71 |
-
}
|
72 |
-
}
|
73 |
-
</textarea></form>
|
74 |
-
|
75 |
-
<script>
|
76 |
-
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
|
77 |
-
lineNumbers: true,
|
78 |
-
matchBrackets: true,
|
79 |
-
mode: "text/x-groovy"
|
80 |
-
});
|
81 |
-
</script>
|
82 |
-
|
83 |
-
<p><strong>MIME types defined:</strong> <code>text/x-groovy</code></p>
|
84 |
-
</article>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/handlebars/handlebars.js
DELETED
@@ -1,53 +0,0 @@
|
|
1 |
-
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
2 |
-
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
3 |
-
|
4 |
-
(function(mod) {
|
5 |
-
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
6 |
-
mod(require("../../lib/codemirror"), require("../../addon/mode/simple"));
|
7 |
-
else if (typeof define == "function" && define.amd) // AMD
|
8 |
-
define(["../../lib/codemirror", "../../addon/mode/simple"], mod);
|
9 |
-
else // Plain browser env
|
10 |
-
mod(CodeMirror);
|
11 |
-
})(function(CodeMirror) {
|
12 |
-
"use strict";
|
13 |
-
|
14 |
-
CodeMirror.defineSimpleMode("handlebars", {
|
15 |
-
start: [
|
16 |
-
{ regex: /\{\{!--/, push: "dash_comment", token: "comment" },
|
17 |
-
{ regex: /\{\{!/, push: "comment", token: "comment" },
|
18 |
-
{ regex: /\{\{/, push: "handlebars", token: "tag" }
|
19 |
-
],
|
20 |
-
handlebars: [
|
21 |
-
{ regex: /\}\}/, pop: true, token: "tag" },
|
22 |
-
|
23 |
-
// Double and single quotes
|
24 |
-
{ regex: /"(?:[^\\"]|\\.)*"?/, token: "string" },
|
25 |
-
{ regex: /'(?:[^\\']|\\.)*'?/, token: "string" },
|
26 |
-
|
27 |
-
// Handlebars keywords
|
28 |
-
{ regex: />|[#\/]([A-Za-z_]\w*)/, token: "keyword" },
|
29 |
-
{ regex: /(?:else|this)\b/, token: "keyword" },
|
30 |
-
|
31 |
-
// Numeral
|
32 |
-
{ regex: /\d+/i, token: "number" },
|
33 |
-
|
34 |
-
// Atoms like = and .
|
35 |
-
{ regex: /=|~|@|true|false/, token: "atom" },
|
36 |
-
|
37 |
-
// Paths
|
38 |
-
{ regex: /(?:\.\.\/)*(?:[A-Za-z_][\w\.]*)+/, token: "variable-2" }
|
39 |
-
],
|
40 |
-
dash_comment: [
|
41 |
-
{ regex: /--\}\}/, pop: true, token: "comment" },
|
42 |
-
|
43 |
-
// Commented code
|
44 |
-
{ regex: /./, token: "comment"}
|
45 |
-
],
|
46 |
-
comment: [
|
47 |
-
{ regex: /\}\}/, pop: true, token: "comment" },
|
48 |
-
{ regex: /./, token: "comment" }
|
49 |
-
]
|
50 |
-
});
|
51 |
-
|
52 |
-
CodeMirror.defineMIME("text/x-handlebars-template", "handlebars");
|
53 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/handlebars/index.html
DELETED
@@ -1,83 +0,0 @@
|
|
1 |
-
<!doctype html>
|
2 |
-
|
3 |
-
<title>CodeMirror: Handlebars mode</title>
|
4 |
-
<meta charset="utf-8"/>
|
5 |
-
<link rel=stylesheet href="../../doc/docs.css">
|
6 |
-
|
7 |
-
<link rel="stylesheet" href="../../lib/codemirror.css">
|
8 |
-
<script src="../../lib/codemirror.js"></script>
|
9 |
-
<script src="../../addon/mode/simple.js"></script>
|
10 |
-
<script src="../../addon/mode/multiplex.js"></script>
|
11 |
-
<script src="../xml/xml.js"></script>
|
12 |
-
<script src="handlebars.js"></script>
|
13 |
-
<style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
14 |
-
<div id=nav>
|
15 |
-
<a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
16 |
-
|
17 |
-
<ul>
|
18 |
-
<li><a href="../../index.html">Home</a>
|
19 |
-
<li><a href="../../doc/manual.html">Manual</a>
|
20 |
-
<li><a href="https://github.com/codemirror/codemirror">Code</a>
|
21 |
-
</ul>
|
22 |
-
<ul>
|
23 |
-
<li><a href="../index.html">Language modes</a>
|
24 |
-
<li><a class=active href="#">HTML mixed</a>
|
25 |
-
</ul>
|
26 |
-
</div>
|
27 |
-
|
28 |
-
<article>
|
29 |
-
<h2>Handlebars</h2>
|
30 |
-
<form><textarea id="code" name="code">
|
31 |
-
{{> breadcrumbs}}
|
32 |
-
|
33 |
-
{{!--
|
34 |
-
You can use the t function to get
|
35 |
-
content translated to the current locale, es:
|
36 |
-
{{t 'article_list'}}
|
37 |
-
--}}
|
38 |
-
|
39 |
-
<h1>{{t 'article_list'}}</h1>
|
40 |
-
|
41 |
-
{{! one line comment }}
|
42 |
-
|
43 |
-
{{#each articles}}
|
44 |
-
{{~title}}
|
45 |
-
<p>{{excerpt body size=120 ellipsis=true}}</p>
|
46 |
-
|
47 |
-
{{#with author}}
|
48 |
-
written by {{first_name}} {{last_name}}
|
49 |
-
from category: {{../category.title}}
|
50 |
-
{{#if @../last}}foobar!{{/if}}
|
51 |
-
{{/with~}}
|
52 |
-
|
53 |
-
{{#if promoted.latest}}Read this one! {{else}} This is ok! {{/if}}
|
54 |
-
|
55 |
-
{{#if @last}}<hr>{{/if}}
|
56 |
-
{{/each}}
|
57 |
-
|
58 |
-
{{#form new_comment}}
|
59 |
-
<input type="text" name="body">
|
60 |
-
{{/form}}
|
61 |
-
|
62 |
-
</textarea></form>
|
63 |
-
<script>
|
64 |
-
CodeMirror.defineMode("htmlhandlebars", function(config) {
|
65 |
-
return CodeMirror.multiplexingMode(
|
66 |
-
CodeMirror.getMode(config, "text/html"),
|
67 |
-
{open: "{{", close: "}}",
|
68 |
-
mode: CodeMirror.getMode(config, "handlebars"),
|
69 |
-
parseDelimiters: true});
|
70 |
-
});
|
71 |
-
|
72 |
-
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
|
73 |
-
lineNumbers: true,
|
74 |
-
matchBrackets: true,
|
75 |
-
mode: "htmlhandlebars"
|
76 |
-
});
|
77 |
-
</script>
|
78 |
-
</script>
|
79 |
-
|
80 |
-
<p>Handlebars syntax highlighting for CodeMirror.</p>
|
81 |
-
|
82 |
-
<p><strong>MIME types defined:</strong> <code>text/x-handlebars-template</code></p>
|
83 |
-
</article>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/haskell/haskell.js
DELETED
@@ -1,267 +0,0 @@
|
|
1 |
-
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
2 |
-
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
3 |
-
|
4 |
-
(function(mod) {
|
5 |
-
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
6 |
-
mod(require("../../lib/codemirror"));
|
7 |
-
else if (typeof define == "function" && define.amd) // AMD
|
8 |
-
define(["../../lib/codemirror"], mod);
|
9 |
-
else // Plain browser env
|
10 |
-
mod(CodeMirror);
|
11 |
-
})(function(CodeMirror) {
|
12 |
-
"use strict";
|
13 |
-
|
14 |
-
CodeMirror.defineMode("haskell", function(_config, modeConfig) {
|
15 |
-
|
16 |
-
function switchState(source, setState, f) {
|
17 |
-
setState(f);
|
18 |
-
return f(source, setState);
|
19 |
-
}
|
20 |
-
|
21 |
-
// These should all be Unicode extended, as per the Haskell 2010 report
|
22 |
-
var smallRE = /[a-z_]/;
|
23 |
-
var largeRE = /[A-Z]/;
|
24 |
-
var digitRE = /\d/;
|
25 |
-
var hexitRE = /[0-9A-Fa-f]/;
|
26 |
-
var octitRE = /[0-7]/;
|
27 |
-
var idRE = /[a-z_A-Z0-9'\xa1-\uffff]/;
|
28 |
-
var symbolRE = /[-!#$%&*+.\/<=>?@\\^|~:]/;
|
29 |
-
var specialRE = /[(),;[\]`{}]/;
|
30 |
-
var whiteCharRE = /[ \t\v\f]/; // newlines are handled in tokenizer
|
31 |
-
|
32 |
-
function normal(source, setState) {
|
33 |
-
if (source.eatWhile(whiteCharRE)) {
|
34 |
-
return null;
|
35 |
-
}
|
36 |
-
|
37 |
-
var ch = source.next();
|
38 |
-
if (specialRE.test(ch)) {
|
39 |
-
if (ch == '{' && source.eat('-')) {
|
40 |
-
var t = "comment";
|
41 |
-
if (source.eat('#')) {
|
42 |
-
t = "meta";
|
43 |
-
}
|
44 |
-
return switchState(source, setState, ncomment(t, 1));
|
45 |
-
}
|
46 |
-
return null;
|
47 |
-
}
|
48 |
-
|
49 |
-
if (ch == '\'') {
|
50 |
-
if (source.eat('\\')) {
|
51 |
-
source.next(); // should handle other escapes here
|
52 |
-
}
|
53 |
-
else {
|
54 |
-
source.next();
|
55 |
-
}
|
56 |
-
if (source.eat('\'')) {
|
57 |
-
return "string";
|
58 |
-
}
|
59 |
-
return "error";
|
60 |
-
}
|
61 |
-
|
62 |
-
if (ch == '"') {
|
63 |
-
return switchState(source, setState, stringLiteral);
|
64 |
-
}
|
65 |
-
|
66 |
-
if (largeRE.test(ch)) {
|
67 |
-
source.eatWhile(idRE);
|
68 |
-
if (source.eat('.')) {
|
69 |
-
return "qualifier";
|
70 |
-
}
|
71 |
-
return "variable-2";
|
72 |
-
}
|
73 |
-
|
74 |
-
if (smallRE.test(ch)) {
|
75 |
-
source.eatWhile(idRE);
|
76 |
-
return "variable";
|
77 |
-
}
|
78 |
-
|
79 |
-
if (digitRE.test(ch)) {
|
80 |
-
if (ch == '0') {
|
81 |
-
if (source.eat(/[xX]/)) {
|
82 |
-
source.eatWhile(hexitRE); // should require at least 1
|
83 |
-
return "integer";
|
84 |
-
}
|
85 |
-
if (source.eat(/[oO]/)) {
|
86 |
-
source.eatWhile(octitRE); // should require at least 1
|
87 |
-
return "number";
|
88 |
-
}
|
89 |
-
}
|
90 |
-
source.eatWhile(digitRE);
|
91 |
-
var t = "number";
|
92 |
-
if (source.match(/^\.\d+/)) {
|
93 |
-
t = "number";
|
94 |
-
}
|
95 |
-
if (source.eat(/[eE]/)) {
|
96 |
-
t = "number";
|
97 |
-
source.eat(/[-+]/);
|
98 |
-
source.eatWhile(digitRE); // should require at least 1
|
99 |
-
}
|
100 |
-
return t;
|
101 |
-
}
|
102 |
-
|
103 |
-
if (ch == "." && source.eat("."))
|
104 |
-
return "keyword";
|
105 |
-
|
106 |
-
if (symbolRE.test(ch)) {
|
107 |
-
if (ch == '-' && source.eat(/-/)) {
|
108 |
-
source.eatWhile(/-/);
|
109 |
-
if (!source.eat(symbolRE)) {
|
110 |
-
source.skipToEnd();
|
111 |
-
return "comment";
|
112 |
-
}
|
113 |
-
}
|
114 |
-
var t = "variable";
|
115 |
-
if (ch == ':') {
|
116 |
-
t = "variable-2";
|
117 |
-
}
|
118 |
-
source.eatWhile(symbolRE);
|
119 |
-
return t;
|
120 |
-
}
|
121 |
-
|
122 |
-
return "error";
|
123 |
-
}
|
124 |
-
|
125 |
-
function ncomment(type, nest) {
|
126 |
-
if (nest == 0) {
|
127 |
-
return normal;
|
128 |
-
}
|
129 |
-
return function(source, setState) {
|
130 |
-
var currNest = nest;
|
131 |
-
while (!source.eol()) {
|
132 |
-
var ch = source.next();
|
133 |
-
if (ch == '{' && source.eat('-')) {
|
134 |
-
++currNest;
|
135 |
-
}
|
136 |
-
else if (ch == '-' && source.eat('}')) {
|
137 |
-
--currNest;
|
138 |
-
if (currNest == 0) {
|
139 |
-
setState(normal);
|
140 |
-
return type;
|
141 |
-
}
|
142 |
-
}
|
143 |
-
}
|
144 |
-
setState(ncomment(type, currNest));
|
145 |
-
return type;
|
146 |
-
};
|
147 |
-
}
|
148 |
-
|
149 |
-
function stringLiteral(source, setState) {
|
150 |
-
while (!source.eol()) {
|
151 |
-
var ch = source.next();
|
152 |
-
if (ch == '"') {
|
153 |
-
setState(normal);
|
154 |
-
return "string";
|
155 |
-
}
|
156 |
-
if (ch == '\\') {
|
157 |
-
if (source.eol() || source.eat(whiteCharRE)) {
|
158 |
-
setState(stringGap);
|
159 |
-
return "string";
|
160 |
-
}
|
161 |
-
if (source.eat('&')) {
|
162 |
-
}
|
163 |
-
else {
|
164 |
-
source.next(); // should handle other escapes here
|
165 |
-
}
|
166 |
-
}
|
167 |
-
}
|
168 |
-
setState(normal);
|
169 |
-
return "error";
|
170 |
-
}
|
171 |
-
|
172 |
-
function stringGap(source, setState) {
|
173 |
-
if (source.eat('\\')) {
|
174 |
-
return switchState(source, setState, stringLiteral);
|
175 |
-
}
|
176 |
-
source.next();
|
177 |
-
setState(normal);
|
178 |
-
return "error";
|
179 |
-
}
|
180 |
-
|
181 |
-
|
182 |
-
var wellKnownWords = (function() {
|
183 |
-
var wkw = {};
|
184 |
-
function setType(t) {
|
185 |
-
return function () {
|
186 |
-
for (var i = 0; i < arguments.length; i++)
|
187 |
-
wkw[arguments[i]] = t;
|
188 |
-
};
|
189 |
-
}
|
190 |
-
|
191 |
-
setType("keyword")(
|
192 |
-
"case", "class", "data", "default", "deriving", "do", "else", "foreign",
|
193 |
-
"if", "import", "in", "infix", "infixl", "infixr", "instance", "let",
|
194 |
-
"module", "newtype", "of", "then", "type", "where", "_");
|
195 |
-
|
196 |
-
setType("keyword")(
|
197 |
-
"\.\.", ":", "::", "=", "\\", "\"", "<-", "->", "@", "~", "=>");
|
198 |
-
|
199 |
-
setType("builtin")(
|
200 |
-
"!!", "$!", "$", "&&", "+", "++", "-", ".", "/", "/=", "<", "<=", "=<<",
|
201 |
-
"==", ">", ">=", ">>", ">>=", "^", "^^", "||", "*", "**");
|
202 |
-
|
203 |
-
setType("builtin")(
|
204 |
-
"Bool", "Bounded", "Char", "Double", "EQ", "Either", "Enum", "Eq",
|
205 |
-
"False", "FilePath", "Float", "Floating", "Fractional", "Functor", "GT",
|
206 |
-
"IO", "IOError", "Int", "Integer", "Integral", "Just", "LT", "Left",
|
207 |
-
"Maybe", "Monad", "Nothing", "Num", "Ord", "Ordering", "Rational", "Read",
|
208 |
-
"ReadS", "Real", "RealFloat", "RealFrac", "Right", "Show", "ShowS",
|
209 |
-
"String", "True");
|
210 |
-
|
211 |
-
setType("builtin")(
|
212 |
-
"abs", "acos", "acosh", "all", "and", "any", "appendFile", "asTypeOf",
|
213 |
-
"asin", "asinh", "atan", "atan2", "atanh", "break", "catch", "ceiling",
|
214 |
-
"compare", "concat", "concatMap", "const", "cos", "cosh", "curry",
|
215 |
-
"cycle", "decodeFloat", "div", "divMod", "drop", "dropWhile", "either",
|
216 |
-
"elem", "encodeFloat", "enumFrom", "enumFromThen", "enumFromThenTo",
|
217 |
-
"enumFromTo", "error", "even", "exp", "exponent", "fail", "filter",
|
218 |
-
"flip", "floatDigits", "floatRadix", "floatRange", "floor", "fmap",
|
219 |
-
"foldl", "foldl1", "foldr", "foldr1", "fromEnum", "fromInteger",
|
220 |
-
"fromIntegral", "fromRational", "fst", "gcd", "getChar", "getContents",
|
221 |
-
"getLine", "head", "id", "init", "interact", "ioError", "isDenormalized",
|
222 |
-
"isIEEE", "isInfinite", "isNaN", "isNegativeZero", "iterate", "last",
|
223 |
-
"lcm", "length", "lex", "lines", "log", "logBase", "lookup", "map",
|
224 |
-
"mapM", "mapM_", "max", "maxBound", "maximum", "maybe", "min", "minBound",
|
225 |
-
"minimum", "mod", "negate", "not", "notElem", "null", "odd", "or",
|
226 |
-
"otherwise", "pi", "pred", "print", "product", "properFraction",
|
227 |
-
"putChar", "putStr", "putStrLn", "quot", "quotRem", "read", "readFile",
|
228 |
-
"readIO", "readList", "readLn", "readParen", "reads", "readsPrec",
|
229 |
-
"realToFrac", "recip", "rem", "repeat", "replicate", "return", "reverse",
|
230 |
-
"round", "scaleFloat", "scanl", "scanl1", "scanr", "scanr1", "seq",
|
231 |
-
"sequence", "sequence_", "show", "showChar", "showList", "showParen",
|
232 |
-
"showString", "shows", "showsPrec", "significand", "signum", "sin",
|
233 |
-
"sinh", "snd", "span", "splitAt", "sqrt", "subtract", "succ", "sum",
|
234 |
-
"tail", "take", "takeWhile", "tan", "tanh", "toEnum", "toInteger",
|
235 |
-
"toRational", "truncate", "uncurry", "undefined", "unlines", "until",
|
236 |
-
"unwords", "unzip", "unzip3", "userError", "words", "writeFile", "zip",
|
237 |
-
"zip3", "zipWith", "zipWith3");
|
238 |
-
|
239 |
-
var override = modeConfig.overrideKeywords;
|
240 |
-
if (override) for (var word in override) if (override.hasOwnProperty(word))
|
241 |
-
wkw[word] = override[word];
|
242 |
-
|
243 |
-
return wkw;
|
244 |
-
})();
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
return {
|
249 |
-
startState: function () { return { f: normal }; },
|
250 |
-
copyState: function (s) { return { f: s.f }; },
|
251 |
-
|
252 |
-
token: function(stream, state) {
|
253 |
-
var t = state.f(stream, function(s) { state.f = s; });
|
254 |
-
var w = stream.current();
|
255 |
-
return wellKnownWords.hasOwnProperty(w) ? wellKnownWords[w] : t;
|
256 |
-
},
|
257 |
-
|
258 |
-
blockCommentStart: "{-",
|
259 |
-
blockCommentEnd: "-}",
|
260 |
-
lineComment: "--"
|
261 |
-
};
|
262 |
-
|
263 |
-
});
|
264 |
-
|
265 |
-
CodeMirror.defineMIME("text/x-haskell", "haskell");
|
266 |
-
|
267 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/haskell/index.html
DELETED
@@ -1,73 +0,0 @@
|
|
1 |
-
<!doctype html>
|
2 |
-
|
3 |
-
<title>CodeMirror: Haskell mode</title>
|
4 |
-
<meta charset="utf-8"/>
|
5 |
-
<link rel=stylesheet href="../../doc/docs.css">
|
6 |
-
|
7 |
-
<link rel="stylesheet" href="../../lib/codemirror.css">
|
8 |
-
<link rel="stylesheet" href="../../theme/elegant.css">
|
9 |
-
<script src="../../lib/codemirror.js"></script>
|
10 |
-
<script src="../../addon/edit/matchbrackets.js"></script>
|
11 |
-
<script src="haskell.js"></script>
|
12 |
-
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
13 |
-
<div id=nav>
|
14 |
-
<a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
15 |
-
|
16 |
-
<ul>
|
17 |
-
<li><a href="../../index.html">Home</a>
|
18 |
-
<li><a href="../../doc/manual.html">Manual</a>
|
19 |
-
<li><a href="https://github.com/codemirror/codemirror">Code</a>
|
20 |
-
</ul>
|
21 |
-
<ul>
|
22 |
-
<li><a href="../index.html">Language modes</a>
|
23 |
-
<li><a class=active href="#">Haskell</a>
|
24 |
-
</ul>
|
25 |
-
</div>
|
26 |
-
|
27 |
-
<article>
|
28 |
-
<h2>Haskell mode</h2>
|
29 |
-
<form><textarea id="code" name="code">
|
30 |
-
module UniquePerms (
|
31 |
-
uniquePerms
|
32 |
-
)
|
33 |
-
where
|
34 |
-
|
35 |
-
-- | Find all unique permutations of a list where there might be duplicates.
|
36 |
-
uniquePerms :: (Eq a) => [a] -> [[a]]
|
37 |
-
uniquePerms = permBag . makeBag
|
38 |
-
|
39 |
-
-- | An unordered collection where duplicate values are allowed,
|
40 |
-
-- but represented with a single value and a count.
|
41 |
-
type Bag a = [(a, Int)]
|
42 |
-
|
43 |
-
makeBag :: (Eq a) => [a] -> Bag a
|
44 |
-
makeBag [] = []
|
45 |
-
makeBag (a:as) = mix a $ makeBag as
|
46 |
-
where
|
47 |
-
mix a [] = [(a,1)]
|
48 |
-
mix a (bn@(b,n):bs) | a == b = (b,n+1):bs
|
49 |
-
| otherwise = bn : mix a bs
|
50 |
-
|
51 |
-
permBag :: Bag a -> [[a]]
|
52 |
-
permBag [] = [[]]
|
53 |
-
permBag bs = concatMap (\(f,cs) -> map (f:) $ permBag cs) . oneOfEach $ bs
|
54 |
-
where
|
55 |
-
oneOfEach [] = []
|
56 |
-
oneOfEach (an@(a,n):bs) =
|
57 |
-
let bs' = if n == 1 then bs else (a,n-1):bs
|
58 |
-
in (a,bs') : mapSnd (an:) (oneOfEach bs)
|
59 |
-
|
60 |
-
apSnd f (a,b) = (a, f b)
|
61 |
-
mapSnd = map . apSnd
|
62 |
-
</textarea></form>
|
63 |
-
|
64 |
-
<script>
|
65 |
-
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
|
66 |
-
lineNumbers: true,
|
67 |
-
matchBrackets: true,
|
68 |
-
theme: "elegant"
|
69 |
-
});
|
70 |
-
</script>
|
71 |
-
|
72 |
-
<p><strong>MIME types defined:</strong> <code>text/x-haskell</code>.</p>
|
73 |
-
</article>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/haxe/haxe.js
DELETED
@@ -1,515 +0,0 @@
|
|
1 |
-
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
2 |
-
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
3 |
-
|
4 |
-
(function(mod) {
|
5 |
-
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
6 |
-
mod(require("../../lib/codemirror"));
|
7 |
-
else if (typeof define == "function" && define.amd) // AMD
|
8 |
-
define(["../../lib/codemirror"], mod);
|
9 |
-
else // Plain browser env
|
10 |
-
mod(CodeMirror);
|
11 |
-
})(function(CodeMirror) {
|
12 |
-
"use strict";
|
13 |
-
|
14 |
-
CodeMirror.defineMode("haxe", function(config, parserConfig) {
|
15 |
-
var indentUnit = config.indentUnit;
|
16 |
-
|
17 |
-
// Tokenizer
|
18 |
-
|
19 |
-
function kw(type) {return {type: type, style: "keyword"};}
|
20 |
-
var A = kw("keyword a"), B = kw("keyword b"), C = kw("keyword c");
|
21 |
-
var operator = kw("operator"), atom = {type: "atom", style: "atom"}, attribute = {type:"attribute", style: "attribute"};
|
22 |
-
var type = kw("typedef");
|
23 |
-
var keywords = {
|
24 |
-
"if": A, "while": A, "else": B, "do": B, "try": B,
|
25 |
-
"return": C, "break": C, "continue": C, "new": C, "throw": C,
|
26 |
-
"var": kw("var"), "inline":attribute, "static": attribute, "using":kw("import"),
|
27 |
-
"public": attribute, "private": attribute, "cast": kw("cast"), "import": kw("import"), "macro": kw("macro"),
|
28 |
-
"function": kw("function"), "catch": kw("catch"), "untyped": kw("untyped"), "callback": kw("cb"),
|
29 |
-
"for": kw("for"), "switch": kw("switch"), "case": kw("case"), "default": kw("default"),
|
30 |
-
"in": operator, "never": kw("property_access"), "trace":kw("trace"),
|
31 |
-
"class": type, "abstract":type, "enum":type, "interface":type, "typedef":type, "extends":type, "implements":type, "dynamic":type,
|
32 |
-
"true": atom, "false": atom, "null": atom
|
33 |
-
};
|
34 |
-
|
35 |
-
var isOperatorChar = /[+\-*&%=<>!?|]/;
|
36 |
-
|
37 |
-
function chain(stream, state, f) {
|
38 |
-
state.tokenize = f;
|
39 |
-
return f(stream, state);
|
40 |
-
}
|
41 |
-
|
42 |
-
function toUnescaped(stream, end) {
|
43 |
-
var escaped = false, next;
|
44 |
-
while ((next = stream.next()) != null) {
|
45 |
-
if (next == end && !escaped)
|
46 |
-
return true;
|
47 |
-
escaped = !escaped && next == "\\";
|
48 |
-
}
|
49 |
-
}
|
50 |
-
|
51 |
-
// Used as scratch variables to communicate multiple values without
|
52 |
-
// consing up tons of objects.
|
53 |
-
var type, content;
|
54 |
-
function ret(tp, style, cont) {
|
55 |
-
type = tp; content = cont;
|
56 |
-
return style;
|
57 |
-
}
|
58 |
-
|
59 |
-
function haxeTokenBase(stream, state) {
|
60 |
-
var ch = stream.next();
|
61 |
-
if (ch == '"' || ch == "'") {
|
62 |
-
return chain(stream, state, haxeTokenString(ch));
|
63 |
-
} else if (/[\[\]{}\(\),;\:\.]/.test(ch)) {
|
64 |
-
return ret(ch);
|
65 |
-
} else if (ch == "0" && stream.eat(/x/i)) {
|
66 |
-
stream.eatWhile(/[\da-f]/i);
|
67 |
-
return ret("number", "number");
|
68 |
-
} else if (/\d/.test(ch) || ch == "-" && stream.eat(/\d/)) {
|
69 |
-
stream.match(/^\d*(?:\.\d*(?!\.))?(?:[eE][+\-]?\d+)?/);
|
70 |
-
return ret("number", "number");
|
71 |
-
} else if (state.reAllowed && (ch == "~" && stream.eat(/\//))) {
|
72 |
-
toUnescaped(stream, "/");
|
73 |
-
stream.eatWhile(/[gimsu]/);
|
74 |
-
return ret("regexp", "string-2");
|
75 |
-
} else if (ch == "/") {
|
76 |
-
if (stream.eat("*")) {
|
77 |
-
return chain(stream, state, haxeTokenComment);
|
78 |
-
} else if (stream.eat("/")) {
|
79 |
-
stream.skipToEnd();
|
80 |
-
return ret("comment", "comment");
|
81 |
-
} else {
|
82 |
-
stream.eatWhile(isOperatorChar);
|
83 |
-
return ret("operator", null, stream.current());
|
84 |
-
}
|
85 |
-
} else if (ch == "#") {
|
86 |
-
stream.skipToEnd();
|
87 |
-
return ret("conditional", "meta");
|
88 |
-
} else if (ch == "@") {
|
89 |
-
stream.eat(/:/);
|
90 |
-
stream.eatWhile(/[\w_]/);
|
91 |
-
return ret ("metadata", "meta");
|
92 |
-
} else if (isOperatorChar.test(ch)) {
|
93 |
-
stream.eatWhile(isOperatorChar);
|
94 |
-
return ret("operator", null, stream.current());
|
95 |
-
} else {
|
96 |
-
var word;
|
97 |
-
if(/[A-Z]/.test(ch)) {
|
98 |
-
stream.eatWhile(/[\w_<>]/);
|
99 |
-
word = stream.current();
|
100 |
-
return ret("type", "variable-3", word);
|
101 |
-
} else {
|
102 |
-
stream.eatWhile(/[\w_]/);
|
103 |
-
var word = stream.current(), known = keywords.propertyIsEnumerable(word) && keywords[word];
|
104 |
-
return (known && state.kwAllowed) ? ret(known.type, known.style, word) :
|
105 |
-
ret("variable", "variable", word);
|
106 |
-
}
|
107 |
-
}
|
108 |
-
}
|
109 |
-
|
110 |
-
function haxeTokenString(quote) {
|
111 |
-
return function(stream, state) {
|
112 |
-
if (toUnescaped(stream, quote))
|
113 |
-
state.tokenize = haxeTokenBase;
|
114 |
-
return ret("string", "string");
|
115 |
-
};
|
116 |
-
}
|
117 |
-
|
118 |
-
function haxeTokenComment(stream, state) {
|
119 |
-
var maybeEnd = false, ch;
|
120 |
-
while (ch = stream.next()) {
|
121 |
-
if (ch == "/" && maybeEnd) {
|
122 |
-
state.tokenize = haxeTokenBase;
|
123 |
-
break;
|
124 |
-
}
|
125 |
-
maybeEnd = (ch == "*");
|
126 |
-
}
|
127 |
-
return ret("comment", "comment");
|
128 |
-
}
|
129 |
-
|
130 |
-
// Parser
|
131 |
-
|
132 |
-
var atomicTypes = {"atom": true, "number": true, "variable": true, "string": true, "regexp": true};
|
133 |
-
|
134 |
-
function HaxeLexical(indented, column, type, align, prev, info) {
|
135 |
-
this.indented = indented;
|
136 |
-
this.column = column;
|
137 |
-
this.type = type;
|
138 |
-
this.prev = prev;
|
139 |
-
this.info = info;
|
140 |
-
if (align != null) this.align = align;
|
141 |
-
}
|
142 |
-
|
143 |
-
function inScope(state, varname) {
|
144 |
-
for (var v = state.localVars; v; v = v.next)
|
145 |
-
if (v.name == varname) return true;
|
146 |
-
}
|
147 |
-
|
148 |
-
function parseHaxe(state, style, type, content, stream) {
|
149 |
-
var cc = state.cc;
|
150 |
-
// Communicate our context to the combinators.
|
151 |
-
// (Less wasteful than consing up a hundred closures on every call.)
|
152 |
-
cx.state = state; cx.stream = stream; cx.marked = null, cx.cc = cc;
|
153 |
-
|
154 |
-
if (!state.lexical.hasOwnProperty("align"))
|
155 |
-
state.lexical.align = true;
|
156 |
-
|
157 |
-
while(true) {
|
158 |
-
var combinator = cc.length ? cc.pop() : statement;
|
159 |
-
if (combinator(type, content)) {
|
160 |
-
while(cc.length && cc[cc.length - 1].lex)
|
161 |
-
cc.pop()();
|
162 |
-
if (cx.marked) return cx.marked;
|
163 |
-
if (type == "variable" && inScope(state, content)) return "variable-2";
|
164 |
-
if (type == "variable" && imported(state, content)) return "variable-3";
|
165 |
-
return style;
|
166 |
-
}
|
167 |
-
}
|
168 |
-
}
|
169 |
-
|
170 |
-
function imported(state, typename) {
|
171 |
-
if (/[a-z]/.test(typename.charAt(0)))
|
172 |
-
return false;
|
173 |
-
var len = state.importedtypes.length;
|
174 |
-
for (var i = 0; i<len; i++)
|
175 |
-
if(state.importedtypes[i]==typename) return true;
|
176 |
-
}
|
177 |
-
|
178 |
-
function registerimport(importname) {
|
179 |
-
var state = cx.state;
|
180 |
-
for (var t = state.importedtypes; t; t = t.next)
|
181 |
-
if(t.name == importname) return;
|
182 |
-
state.importedtypes = { name: importname, next: state.importedtypes };
|
183 |
-
}
|
184 |
-
// Combinator utils
|
185 |
-
|
186 |
-
var cx = {state: null, column: null, marked: null, cc: null};
|
187 |
-
function pass() {
|
188 |
-
for (var i = arguments.length - 1; i >= 0; i--) cx.cc.push(arguments[i]);
|
189 |
-
}
|
190 |
-
function cont() {
|
191 |
-
pass.apply(null, arguments);
|
192 |
-
return true;
|
193 |
-
}
|
194 |
-
function inList(name, list) {
|
195 |
-
for (var v = list; v; v = v.next)
|
196 |
-
if (v.name == name) return true;
|
197 |
-
return false;
|
198 |
-
}
|
199 |
-
function register(varname) {
|
200 |
-
var state = cx.state;
|
201 |
-
if (state.context) {
|
202 |
-
cx.marked = "def";
|
203 |
-
if (inList(varname, state.localVars)) return;
|
204 |
-
state.localVars = {name: varname, next: state.localVars};
|
205 |
-
} else if (state.globalVars) {
|
206 |
-
if (inList(varname, state.globalVars)) return;
|
207 |
-
state.globalVars = {name: varname, next: state.globalVars};
|
208 |
-
}
|
209 |
-
}
|
210 |
-
|
211 |
-
// Combinators
|
212 |
-
|
213 |
-
var defaultVars = {name: "this", next: null};
|
214 |
-
function pushcontext() {
|
215 |
-
if (!cx.state.context) cx.state.localVars = defaultVars;
|
216 |
-
cx.state.context = {prev: cx.state.context, vars: cx.state.localVars};
|
217 |
-
}
|
218 |
-
function popcontext() {
|
219 |
-
cx.state.localVars = cx.state.context.vars;
|
220 |
-
cx.state.context = cx.state.context.prev;
|
221 |
-
}
|
222 |
-
popcontext.lex = true;
|
223 |
-
function pushlex(type, info) {
|
224 |
-
var result = function() {
|
225 |
-
var state = cx.state;
|
226 |
-
state.lexical = new HaxeLexical(state.indented, cx.stream.column(), type, null, state.lexical, info);
|
227 |
-
};
|
228 |
-
result.lex = true;
|
229 |
-
return result;
|
230 |
-
}
|
231 |
-
function poplex() {
|
232 |
-
var state = cx.state;
|
233 |
-
if (state.lexical.prev) {
|
234 |
-
if (state.lexical.type == ")")
|
235 |
-
state.indented = state.lexical.indented;
|
236 |
-
state.lexical = state.lexical.prev;
|
237 |
-
}
|
238 |
-
}
|
239 |
-
poplex.lex = true;
|
240 |
-
|
241 |
-
function expect(wanted) {
|
242 |
-
function f(type) {
|
243 |
-
if (type == wanted) return cont();
|
244 |
-
else if (wanted == ";") return pass();
|
245 |
-
else return cont(f);
|
246 |
-
}
|
247 |
-
return f;
|
248 |
-
}
|
249 |
-
|
250 |
-
function statement(type) {
|
251 |
-
if (type == "@") return cont(metadef);
|
252 |
-
if (type == "var") return cont(pushlex("vardef"), vardef1, expect(";"), poplex);
|
253 |
-
if (type == "keyword a") return cont(pushlex("form"), expression, statement, poplex);
|
254 |
-
if (type == "keyword b") return cont(pushlex("form"), statement, poplex);
|
255 |
-
if (type == "{") return cont(pushlex("}"), pushcontext, block, poplex, popcontext);
|
256 |
-
if (type == ";") return cont();
|
257 |
-
if (type == "attribute") return cont(maybeattribute);
|
258 |
-
if (type == "function") return cont(functiondef);
|
259 |
-
if (type == "for") return cont(pushlex("form"), expect("("), pushlex(")"), forspec1, expect(")"),
|
260 |
-
poplex, statement, poplex);
|
261 |
-
if (type == "variable") return cont(pushlex("stat"), maybelabel);
|
262 |
-
if (type == "switch") return cont(pushlex("form"), expression, pushlex("}", "switch"), expect("{"),
|
263 |
-
block, poplex, poplex);
|
264 |
-
if (type == "case") return cont(expression, expect(":"));
|
265 |
-
if (type == "default") return cont(expect(":"));
|
266 |
-
if (type == "catch") return cont(pushlex("form"), pushcontext, expect("("), funarg, expect(")"),
|
267 |
-
statement, poplex, popcontext);
|
268 |
-
if (type == "import") return cont(importdef, expect(";"));
|
269 |
-
if (type == "typedef") return cont(typedef);
|
270 |
-
return pass(pushlex("stat"), expression, expect(";"), poplex);
|
271 |
-
}
|
272 |
-
function expression(type) {
|
273 |
-
if (atomicTypes.hasOwnProperty(type)) return cont(maybeoperator);
|
274 |
-
if (type == "type" ) return cont(maybeoperator);
|
275 |
-
if (type == "function") return cont(functiondef);
|
276 |
-
if (type == "keyword c") return cont(maybeexpression);
|
277 |
-
if (type == "(") return cont(pushlex(")"), maybeexpression, expect(")"), poplex, maybeoperator);
|
278 |
-
if (type == "operator") return cont(expression);
|
279 |
-
if (type == "[") return cont(pushlex("]"), commasep(maybeexpression, "]"), poplex, maybeoperator);
|
280 |
-
if (type == "{") return cont(pushlex("}"), commasep(objprop, "}"), poplex, maybeoperator);
|
281 |
-
return cont();
|
282 |
-
}
|
283 |
-
function maybeexpression(type) {
|
284 |
-
if (type.match(/[;\}\)\],]/)) return pass();
|
285 |
-
return pass(expression);
|
286 |
-
}
|
287 |
-
|
288 |
-
function maybeoperator(type, value) {
|
289 |
-
if (type == "operator" && /\+\+|--/.test(value)) return cont(maybeoperator);
|
290 |
-
if (type == "operator" || type == ":") return cont(expression);
|
291 |
-
if (type == ";") return;
|
292 |
-
if (type == "(") return cont(pushlex(")"), commasep(expression, ")"), poplex, maybeoperator);
|
293 |
-
if (type == ".") return cont(property, maybeoperator);
|
294 |
-
if (type == "[") return cont(pushlex("]"), expression, expect("]"), poplex, maybeoperator);
|
295 |
-
}
|
296 |
-
|
297 |
-
function maybeattribute(type) {
|
298 |
-
if (type == "attribute") return cont(maybeattribute);
|
299 |
-
if (type == "function") return cont(functiondef);
|
300 |
-
if (type == "var") return cont(vardef1);
|
301 |
-
}
|
302 |
-
|
303 |
-
function metadef(type) {
|
304 |
-
if(type == ":") return cont(metadef);
|
305 |
-
if(type == "variable") return cont(metadef);
|
306 |
-
if(type == "(") return cont(pushlex(")"), commasep(metaargs, ")"), poplex, statement);
|
307 |
-
}
|
308 |
-
function metaargs(type) {
|
309 |
-
if(type == "variable") return cont();
|
310 |
-
}
|
311 |
-
|
312 |
-
function importdef (type, value) {
|
313 |
-
if(type == "variable" && /[A-Z]/.test(value.charAt(0))) { registerimport(value); return cont(); }
|
314 |
-
else if(type == "variable" || type == "property" || type == "." || value == "*") return cont(importdef);
|
315 |
-
}
|
316 |
-
|
317 |
-
function typedef (type, value)
|
318 |
-
{
|
319 |
-
if(type == "variable" && /[A-Z]/.test(value.charAt(0))) { registerimport(value); return cont(); }
|
320 |
-
else if (type == "type" && /[A-Z]/.test(value.charAt(0))) { return cont(); }
|
321 |
-
}
|
322 |
-
|
323 |
-
function maybelabel(type) {
|
324 |
-
if (type == ":") return cont(poplex, statement);
|
325 |
-
return pass(maybeoperator, expect(";"), poplex);
|
326 |
-
}
|
327 |
-
function property(type) {
|
328 |
-
if (type == "variable") {cx.marked = "property"; return cont();}
|
329 |
-
}
|
330 |
-
function objprop(type) {
|
331 |
-
if (type == "variable") cx.marked = "property";
|
332 |
-
if (atomicTypes.hasOwnProperty(type)) return cont(expect(":"), expression);
|
333 |
-
}
|
334 |
-
function commasep(what, end) {
|
335 |
-
function proceed(type) {
|
336 |
-
if (type == ",") return cont(what, proceed);
|
337 |
-
if (type == end) return cont();
|
338 |
-
return cont(expect(end));
|
339 |
-
}
|
340 |
-
return function(type) {
|
341 |
-
if (type == end) return cont();
|
342 |
-
else return pass(what, proceed);
|
343 |
-
};
|
344 |
-
}
|
345 |
-
function block(type) {
|
346 |
-
if (type == "}") return cont();
|
347 |
-
return pass(statement, block);
|
348 |
-
}
|
349 |
-
function vardef1(type, value) {
|
350 |
-
if (type == "variable"){register(value); return cont(typeuse, vardef2);}
|
351 |
-
return cont();
|
352 |
-
}
|
353 |
-
function vardef2(type, value) {
|
354 |
-
if (value == "=") return cont(expression, vardef2);
|
355 |
-
if (type == ",") return cont(vardef1);
|
356 |
-
}
|
357 |
-
function forspec1(type, value) {
|
358 |
-
if (type == "variable") {
|
359 |
-
register(value);
|
360 |
-
return cont(forin, expression)
|
361 |
-
} else {
|
362 |
-
return pass()
|
363 |
-
}
|
364 |
-
}
|
365 |
-
function forin(_type, value) {
|
366 |
-
if (value == "in") return cont();
|
367 |
-
}
|
368 |
-
function functiondef(type, value) {
|
369 |
-
//function names starting with upper-case letters are recognised as types, so cludging them together here.
|
370 |
-
if (type == "variable" || type == "type") {register(value); return cont(functiondef);}
|
371 |
-
if (value == "new") return cont(functiondef);
|
372 |
-
if (type == "(") return cont(pushlex(")"), pushcontext, commasep(funarg, ")"), poplex, typeuse, statement, popcontext);
|
373 |
-
}
|
374 |
-
function typeuse(type) {
|
375 |
-
if(type == ":") return cont(typestring);
|
376 |
-
}
|
377 |
-
function typestring(type) {
|
378 |
-
if(type == "type") return cont();
|
379 |
-
if(type == "variable") return cont();
|
380 |
-
if(type == "{") return cont(pushlex("}"), commasep(typeprop, "}"), poplex);
|
381 |
-
}
|
382 |
-
function typeprop(type) {
|
383 |
-
if(type == "variable") return cont(typeuse);
|
384 |
-
}
|
385 |
-
function funarg(type, value) {
|
386 |
-
if (type == "variable") {register(value); return cont(typeuse);}
|
387 |
-
}
|
388 |
-
|
389 |
-
// Interface
|
390 |
-
return {
|
391 |
-
startState: function(basecolumn) {
|
392 |
-
var defaulttypes = ["Int", "Float", "String", "Void", "Std", "Bool", "Dynamic", "Array"];
|
393 |
-
var state = {
|
394 |
-
tokenize: haxeTokenBase,
|
395 |
-
reAllowed: true,
|
396 |
-
kwAllowed: true,
|
397 |
-
cc: [],
|
398 |
-
lexical: new HaxeLexical((basecolumn || 0) - indentUnit, 0, "block", false),
|
399 |
-
localVars: parserConfig.localVars,
|
400 |
-
importedtypes: defaulttypes,
|
401 |
-
context: parserConfig.localVars && {vars: parserConfig.localVars},
|
402 |
-
indented: 0
|
403 |
-
};
|
404 |
-
if (parserConfig.globalVars && typeof parserConfig.globalVars == "object")
|
405 |
-
state.globalVars = parserConfig.globalVars;
|
406 |
-
return state;
|
407 |
-
},
|
408 |
-
|
409 |
-
token: function(stream, state) {
|
410 |
-
if (stream.sol()) {
|
411 |
-
if (!state.lexical.hasOwnProperty("align"))
|
412 |
-
state.lexical.align = false;
|
413 |
-
state.indented = stream.indentation();
|
414 |
-
}
|
415 |
-
if (stream.eatSpace()) return null;
|
416 |
-
var style = state.tokenize(stream, state);
|
417 |
-
if (type == "comment") return style;
|
418 |
-
state.reAllowed = !!(type == "operator" || type == "keyword c" || type.match(/^[\[{}\(,;:]$/));
|
419 |
-
state.kwAllowed = type != '.';
|
420 |
-
return parseHaxe(state, style, type, content, stream);
|
421 |
-
},
|
422 |
-
|
423 |
-
indent: function(state, textAfter) {
|
424 |
-
if (state.tokenize != haxeTokenBase) return 0;
|
425 |
-
var firstChar = textAfter && textAfter.charAt(0), lexical = state.lexical;
|
426 |
-
if (lexical.type == "stat" && firstChar == "}") lexical = lexical.prev;
|
427 |
-
var type = lexical.type, closing = firstChar == type;
|
428 |
-
if (type == "vardef") return lexical.indented + 4;
|
429 |
-
else if (type == "form" && firstChar == "{") return lexical.indented;
|
430 |
-
else if (type == "stat" || type == "form") return lexical.indented + indentUnit;
|
431 |
-
else if (lexical.info == "switch" && !closing)
|
432 |
-
return lexical.indented + (/^(?:case|default)\b/.test(textAfter) ? indentUnit : 2 * indentUnit);
|
433 |
-
else if (lexical.align) return lexical.column + (closing ? 0 : 1);
|
434 |
-
else return lexical.indented + (closing ? 0 : indentUnit);
|
435 |
-
},
|
436 |
-
|
437 |
-
electricChars: "{}",
|
438 |
-
blockCommentStart: "/*",
|
439 |
-
blockCommentEnd: "*/",
|
440 |
-
lineComment: "//"
|
441 |
-
};
|
442 |
-
});
|
443 |
-
|
444 |
-
CodeMirror.defineMIME("text/x-haxe", "haxe");
|
445 |
-
|
446 |
-
CodeMirror.defineMode("hxml", function () {
|
447 |
-
|
448 |
-
return {
|
449 |
-
startState: function () {
|
450 |
-
return {
|
451 |
-
define: false,
|
452 |
-
inString: false
|
453 |
-
};
|
454 |
-
},
|
455 |
-
token: function (stream, state) {
|
456 |
-
var ch = stream.peek();
|
457 |
-
var sol = stream.sol();
|
458 |
-
|
459 |
-
///* comments */
|
460 |
-
if (ch == "#") {
|
461 |
-
stream.skipToEnd();
|
462 |
-
return "comment";
|
463 |
-
}
|
464 |
-
if (sol && ch == "-") {
|
465 |
-
var style = "variable-2";
|
466 |
-
|
467 |
-
stream.eat(/-/);
|
468 |
-
|
469 |
-
if (stream.peek() == "-") {
|
470 |
-
stream.eat(/-/);
|
471 |
-
style = "keyword a";
|
472 |
-
}
|
473 |
-
|
474 |
-
if (stream.peek() == "D") {
|
475 |
-
stream.eat(/[D]/);
|
476 |
-
style = "keyword c";
|
477 |
-
state.define = true;
|
478 |
-
}
|
479 |
-
|
480 |
-
stream.eatWhile(/[A-Z]/i);
|
481 |
-
return style;
|
482 |
-
}
|
483 |
-
|
484 |
-
var ch = stream.peek();
|
485 |
-
|
486 |
-
if (state.inString == false && ch == "'") {
|
487 |
-
state.inString = true;
|
488 |
-
ch = stream.next();
|
489 |
-
}
|
490 |
-
|
491 |
-
if (state.inString == true) {
|
492 |
-
if (stream.skipTo("'")) {
|
493 |
-
|
494 |
-
} else {
|
495 |
-
stream.skipToEnd();
|
496 |
-
}
|
497 |
-
|
498 |
-
if (stream.peek() == "'") {
|
499 |
-
stream.next();
|
500 |
-
state.inString = false;
|
501 |
-
}
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/haxe/index.html
DELETED
@@ -1,124 +0,0 @@
|
|
1 |
-
<!doctype html>
|
2 |
-
|
3 |
-
<title>CodeMirror: Haxe mode</title>
|
4 |
-
<meta charset="utf-8"/>
|
5 |
-
<link rel=stylesheet href="../../doc/docs.css">
|
6 |
-
|
7 |
-
<link rel="stylesheet" href="../../lib/codemirror.css">
|
8 |
-
<script src="../../lib/codemirror.js"></script>
|
9 |
-
<script src="haxe.js"></script>
|
10 |
-
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
11 |
-
<div id=nav>
|
12 |
-
<a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
13 |
-
|
14 |
-
<ul>
|
15 |
-
<li><a href="../../index.html">Home</a>
|
16 |
-
<li><a href="../../doc/manual.html">Manual</a>
|
17 |
-
<li><a href="https://github.com/codemirror/codemirror">Code</a>
|
18 |
-
</ul>
|
19 |
-
<ul>
|
20 |
-
<li><a href="../index.html">Language modes</a>
|
21 |
-
<li><a class=active href="#">Haxe</a>
|
22 |
-
</ul>
|
23 |
-
</div>
|
24 |
-
|
25 |
-
<article>
|
26 |
-
<h2>Haxe mode</h2>
|
27 |
-
|
28 |
-
|
29 |
-
<div><p><textarea id="code-haxe" name="code">
|
30 |
-
import one.two.Three;
|
31 |
-
|
32 |
-
@attr("test")
|
33 |
-
class Foo<T> extends Three
|
34 |
-
{
|
35 |
-
public function new()
|
36 |
-
{
|
37 |
-
noFoo = 12;
|
38 |
-
}
|
39 |
-
|
40 |
-
public static inline function doFoo(obj:{k:Int, l:Float}):Int
|
41 |
-
{
|
42 |
-
for(i in 0...10)
|
43 |
-
{
|
44 |
-
obj.k++;
|
45 |
-
trace(i);
|
46 |
-
var var1 = new Array();
|
47 |
-
if(var1.length > 1)
|
48 |
-
throw "Error";
|
49 |
-
}
|
50 |
-
// The following line should not be colored, the variable is scoped out
|
51 |
-
var1;
|
52 |
-
/* Multi line
|
53 |
-
* Comment test
|
54 |
-
*/
|
55 |
-
return obj.k;
|
56 |
-
}
|
57 |
-
private function bar():Void
|
58 |
-
{
|
59 |
-
#if flash
|
60 |
-
var t1:String = "1.21";
|
61 |
-
#end
|
62 |
-
try {
|
63 |
-
doFoo({k:3, l:1.2});
|
64 |
-
}
|
65 |
-
catch (e : String) {
|
66 |
-
trace(e);
|
67 |
-
}
|
68 |
-
var t2:Float = cast(3.2);
|
69 |
-
var t3:haxe.Timer = new haxe.Timer();
|
70 |
-
var t4 = {k:Std.int(t2), l:Std.parseFloat(t1)};
|
71 |
-
var t5 = ~/123+.*$/i;
|
72 |
-
doFoo(t4);
|
73 |
-
untyped t1 = 4;
|
74 |
-
bob = new Foo<Int>
|
75 |
-
}
|
76 |
-
public var okFoo(default, never):Float;
|
77 |
-
var noFoo(getFoo, null):Int;
|
78 |
-
function getFoo():Int {
|
79 |
-
return noFoo;
|
80 |
-
}
|
81 |
-
|
82 |
-
public var three:Int;
|
83 |
-
}
|
84 |
-
enum Color
|
85 |
-
{
|
86 |
-
red;
|
87 |
-
green;
|
88 |
-
blue;
|
89 |
-
grey( v : Int );
|
90 |
-
rgb (r:Int,g:Int,b:Int);
|
91 |
-
}
|
92 |
-
</textarea></p>
|
93 |
-
|
94 |
-
<p>Hxml mode:</p>
|
95 |
-
|
96 |
-
<p><textarea id="code-hxml">
|
97 |
-
-cp test
|
98 |
-
-js path/to/file.js
|
99 |
-
#-remap nme:flash
|
100 |
-
--next
|
101 |
-
-D source-map-content
|
102 |
-
-cmd 'test'
|
103 |
-
-lib lime
|
104 |
-
</textarea></p>
|
105 |
-
</div>
|
106 |
-
|
107 |
-
<script>
|
108 |
-
var editor = CodeMirror.fromTextArea(document.getElementById("code-haxe"), {
|
109 |
-
mode: "haxe",
|
110 |
-
lineNumbers: true,
|
111 |
-
indentUnit: 4,
|
112 |
-
indentWithTabs: true
|
113 |
-
});
|
114 |
-
|
115 |
-
editor = CodeMirror.fromTextArea(document.getElementById("code-hxml"), {
|
116 |
-
mode: "hxml",
|
117 |
-
lineNumbers: true,
|
118 |
-
indentUnit: 4,
|
119 |
-
indentWithTabs: true
|
120 |
-
});
|
121 |
-
</script>
|
122 |
-
|
123 |
-
<p><strong>MIME types defined:</strong> <code>text/x-haxe, text/x-hxml</code>.</p>
|
124 |
-
</article>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/http/http.js
DELETED
@@ -1,113 +0,0 @@
|
|
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("http", function() {
|
15 |
-
function failFirstLine(stream, state) {
|
16 |
-
stream.skipToEnd();
|
17 |
-
state.cur = header;
|
18 |
-
return "error";
|
19 |
-
}
|
20 |
-
|
21 |
-
function start(stream, state) {
|
22 |
-
if (stream.match(/^HTTP\/\d\.\d/)) {
|
23 |
-
state.cur = responseStatusCode;
|
24 |
-
return "keyword";
|
25 |
-
} else if (stream.match(/^[A-Z]+/) && /[ \t]/.test(stream.peek())) {
|
26 |
-
state.cur = requestPath;
|
27 |
-
return "keyword";
|
28 |
-
} else {
|
29 |
-
return failFirstLine(stream, state);
|
30 |
-
}
|
31 |
-
}
|
32 |
-
|
33 |
-
function responseStatusCode(stream, state) {
|
34 |
-
var code = stream.match(/^\d+/);
|
35 |
-
if (!code) return failFirstLine(stream, state);
|
36 |
-
|
37 |
-
state.cur = responseStatusText;
|
38 |
-
var status = Number(code[0]);
|
39 |
-
if (status >= 100 && status < 200) {
|
40 |
-
return "positive informational";
|
41 |
-
} else if (status >= 200 && status < 300) {
|
42 |
-
return "positive success";
|
43 |
-
} else if (status >= 300 && status < 400) {
|
44 |
-
return "positive redirect";
|
45 |
-
} else if (status >= 400 && status < 500) {
|
46 |
-
return "negative client-error";
|
47 |
-
} else if (status >= 500 && status < 600) {
|
48 |
-
return "negative server-error";
|
49 |
-
} else {
|
50 |
-
return "error";
|
51 |
-
}
|
52 |
-
}
|
53 |
-
|
54 |
-
function responseStatusText(stream, state) {
|
55 |
-
stream.skipToEnd();
|
56 |
-
state.cur = header;
|
57 |
-
return null;
|
58 |
-
}
|
59 |
-
|
60 |
-
function requestPath(stream, state) {
|
61 |
-
stream.eatWhile(/\S/);
|
62 |
-
state.cur = requestProtocol;
|
63 |
-
return "string-2";
|
64 |
-
}
|
65 |
-
|
66 |
-
function requestProtocol(stream, state) {
|
67 |
-
if (stream.match(/^HTTP\/\d\.\d$/)) {
|
68 |
-
state.cur = header;
|
69 |
-
return "keyword";
|
70 |
-
} else {
|
71 |
-
return failFirstLine(stream, state);
|
72 |
-
}
|
73 |
-
}
|
74 |
-
|
75 |
-
function header(stream) {
|
76 |
-
if (stream.sol() && !stream.eat(/[ \t]/)) {
|
77 |
-
if (stream.match(/^.*?:/)) {
|
78 |
-
return "atom";
|
79 |
-
} else {
|
80 |
-
stream.skipToEnd();
|
81 |
-
return "error";
|
82 |
-
}
|
83 |
-
} else {
|
84 |
-
stream.skipToEnd();
|
85 |
-
return "string";
|
86 |
-
}
|
87 |
-
}
|
88 |
-
|
89 |
-
function body(stream) {
|
90 |
-
stream.skipToEnd();
|
91 |
-
return null;
|
92 |
-
}
|
93 |
-
|
94 |
-
return {
|
95 |
-
token: function(stream, state) {
|
96 |
-
var cur = state.cur;
|
97 |
-
if (cur != header && cur != body && stream.eatSpace()) return null;
|
98 |
-
return cur(stream, state);
|
99 |
-
},
|
100 |
-
|
101 |
-
blankLine: function(state) {
|
102 |
-
state.cur = body;
|
103 |
-
},
|
104 |
-
|
105 |
-
startState: function() {
|
106 |
-
return {cur: start};
|
107 |
-
}
|
108 |
-
};
|
109 |
-
});
|
110 |
-
|
111 |
-
CodeMirror.defineMIME("message/http", "http");
|
112 |
-
|
113 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/http/index.html
DELETED
@@ -1,45 +0,0 @@
|
|
1 |
-
<!doctype html>
|
2 |
-
|
3 |
-
<title>CodeMirror: HTTP mode</title>
|
4 |
-
<meta charset="utf-8"/>
|
5 |
-
<link rel=stylesheet href="../../doc/docs.css">
|
6 |
-
|
7 |
-
<link rel="stylesheet" href="../../lib/codemirror.css">
|
8 |
-
<script src="../../lib/codemirror.js"></script>
|
9 |
-
<script src="http.js"></script>
|
10 |
-
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
11 |
-
<div id=nav>
|
12 |
-
<a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
13 |
-
|
14 |
-
<ul>
|
15 |
-
<li><a href="../../index.html">Home</a>
|
16 |
-
<li><a href="../../doc/manual.html">Manual</a>
|
17 |
-
<li><a href="https://github.com/codemirror/codemirror">Code</a>
|
18 |
-
</ul>
|
19 |
-
<ul>
|
20 |
-
<li><a href="../index.html">Language modes</a>
|
21 |
-
<li><a class=active href="#">HTTP</a>
|
22 |
-
</ul>
|
23 |
-
</div>
|
24 |
-
|
25 |
-
<article>
|
26 |
-
<h2>HTTP mode</h2>
|
27 |
-
|
28 |
-
|
29 |
-
<div><textarea id="code" name="code">
|
30 |
-
POST /somewhere HTTP/1.1
|
31 |
-
Host: example.com
|
32 |
-
If-Modified-Since: Sat, 29 Oct 1994 19:43:31 GMT
|
33 |
-
Content-Type: application/x-www-form-urlencoded;
|
34 |
-
charset=utf-8
|
35 |
-
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/536.11 (KHTML, like Gecko) Ubuntu/12.04 Chromium/20.0.1132.47 Chrome/20.0.1132.47 Safari/536.11
|
36 |
-
|
37 |
-
This is the request body!
|
38 |
-
</textarea></div>
|
39 |
-
|
40 |
-
<script>
|
41 |
-
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {});
|
42 |
-
</script>
|
43 |
-
|
44 |
-
<p><strong>MIME types defined:</strong> <code>message/http</code>.</p>
|
45 |
-
</article>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/idl/idl.js
DELETED
@@ -1,290 +0,0 @@
|
|
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 wordRegexp(words) {
|
15 |
-
return new RegExp('^((' + words.join(')|(') + '))\\b', 'i');
|
16 |
-
};
|
17 |
-
|
18 |
-
var builtinArray = [
|
19 |
-
'a_correlate', 'abs', 'acos', 'adapt_hist_equal', 'alog',
|
20 |
-
'alog2', 'alog10', 'amoeba', 'annotate', 'app_user_dir',
|
21 |
-
'app_user_dir_query', 'arg_present', 'array_equal', 'array_indices',
|
22 |
-
'arrow', 'ascii_template', 'asin', 'assoc', 'atan',
|
23 |
-
'axis', 'axis', 'bandpass_filter', 'bandreject_filter', 'barplot',
|
24 |
-
'bar_plot', 'beseli', 'beselj', 'beselk', 'besely',
|
25 |
-
'beta', 'biginteger', 'bilinear', 'bin_date', 'binary_template',
|
26 |
-
'bindgen', 'binomial', 'bit_ffs', 'bit_population', 'blas_axpy',
|
27 |
-
'blk_con', 'boolarr', 'boolean', 'boxplot', 'box_cursor',
|
28 |
-
'breakpoint', 'broyden', 'bubbleplot', 'butterworth', 'bytarr',
|
29 |
-
'byte', 'byteorder', 'bytscl', 'c_correlate', 'calendar',
|
30 |
-
'caldat', 'call_external', 'call_function', 'call_method',
|
31 |
-
'call_procedure', 'canny', 'catch', 'cd', 'cdf', 'ceil',
|
32 |
-
'chebyshev', 'check_math', 'chisqr_cvf', 'chisqr_pdf', 'choldc',
|
33 |
-
'cholsol', 'cindgen', 'cir_3pnt', 'clipboard', 'close',
|
34 |
-
'clust_wts', 'cluster', 'cluster_tree', 'cmyk_convert', 'code_coverage',
|
35 |
-
'color_convert', 'color_exchange', 'color_quan', 'color_range_map',
|
36 |
-
'colorbar', 'colorize_sample', 'colormap_applicable',
|
37 |
-
'colormap_gradient', 'colormap_rotation', 'colortable',
|
38 |
-
'comfit', 'command_line_args', 'common', 'compile_opt', 'complex',
|
39 |
-
'complexarr', 'complexround', 'compute_mesh_normals', 'cond', 'congrid',
|
40 |
-
'conj', 'constrained_min', 'contour', 'contour', 'convert_coord',
|
41 |
-
'convol', 'convol_fft', 'coord2to3', 'copy_lun', 'correlate',
|
42 |
-
'cos', 'cosh', 'cpu', 'cramer', 'createboxplotdata',
|
43 |
-
'create_cursor', 'create_struct', 'create_view', 'crossp', 'crvlength',
|
44 |
-
'ct_luminance', 'cti_test', 'cursor', 'curvefit', 'cv_coord',
|
45 |
-
'cvttobm', 'cw_animate', 'cw_animate_getp', 'cw_animate_load',
|
46 |
-
'cw_animate_run', 'cw_arcball', 'cw_bgroup', 'cw_clr_index',
|
47 |
-
'cw_colorsel', 'cw_defroi', 'cw_field', 'cw_filesel', 'cw_form',
|
48 |
-
'cw_fslider', 'cw_light_editor', 'cw_light_editor_get',
|
49 |
-
'cw_light_editor_set', 'cw_orient', 'cw_palette_editor',
|
50 |
-
'cw_palette_editor_get', 'cw_palette_editor_set', 'cw_pdmenu',
|
51 |
-
'cw_rgbslider', 'cw_tmpl', 'cw_zoom', 'db_exists',
|
52 |
-
'dblarr', 'dcindgen', 'dcomplex', 'dcomplexarr', 'define_key',
|
53 |
-
'define_msgblk', 'define_msgblk_from_file', 'defroi', 'defsysv',
|
54 |
-
'delvar', 'dendro_plot', 'dendrogram', 'deriv', 'derivsig',
|
55 |
-
'determ', 'device', 'dfpmin', 'diag_matrix', 'dialog_dbconnect',
|
56 |
-
'dialog_message', 'dialog_pickfile', 'dialog_printersetup',
|
57 |
-
'dialog_printjob', 'dialog_read_image',
|
58 |
-
'dialog_write_image', 'dictionary', 'digital_filter', 'dilate', 'dindgen',
|
59 |
-
'dissolve', 'dist', 'distance_measure', 'dlm_load', 'dlm_register',
|
60 |
-
'doc_library', 'double', 'draw_roi', 'edge_dog', 'efont',
|
61 |
-
'eigenql', 'eigenvec', 'ellipse', 'elmhes', 'emboss',
|
62 |
-
'empty', 'enable_sysrtn', 'eof', 'eos', 'erase',
|
63 |
-
'erf', 'erfc', 'erfcx', 'erode', 'errorplot',
|
64 |
-
'errplot', 'estimator_filter', 'execute', 'exit', 'exp',
|
65 |
-
'expand', 'expand_path', 'expint', 'extrac', 'extract_slice',
|
66 |
-
'f_cvf', 'f_pdf', 'factorial', 'fft', 'file_basename',
|
67 |
-
'file_chmod', 'file_copy', 'file_delete', 'file_dirname',
|
68 |
-
'file_expand_path', 'file_gunzip', 'file_gzip', 'file_info',
|
69 |
-
'file_lines', 'file_link', 'file_mkdir', 'file_move',
|
70 |
-
'file_poll_input', 'file_readlink', 'file_same',
|
71 |
-
'file_search', 'file_tar', 'file_test', 'file_untar', 'file_unzip',
|
72 |
-
'file_which', 'file_zip', 'filepath', 'findgen', 'finite',
|
73 |
-
'fix', 'flick', 'float', 'floor', 'flow3',
|
74 |
-
'fltarr', 'flush', 'format_axis_values', 'forward_function', 'free_lun',
|
75 |
-
'fstat', 'fulstr', 'funct', 'function', 'fv_test',
|
76 |
-
'fx_root', 'fz_roots', 'gamma', 'gamma_ct', 'gauss_cvf',
|
77 |
-
'gauss_pdf', 'gauss_smooth', 'gauss2dfit', 'gaussfit',
|
78 |
-
'gaussian_function', 'gaussint', 'get_drive_list', 'get_dxf_objects',
|
79 |
-
'get_kbrd', 'get_login_info',
|
80 |
-
'get_lun', 'get_screen_size', 'getenv', 'getwindows', 'greg2jul',
|
81 |
-
'grib', 'grid_input', 'grid_tps', 'grid3', 'griddata',
|
82 |
-
'gs_iter', 'h_eq_ct', 'h_eq_int', 'hanning', 'hash',
|
83 |
-
'hdf', 'hdf5', 'heap_free', 'heap_gc', 'heap_nosave',
|
84 |
-
'heap_refcount', 'heap_save', 'help', 'hilbert', 'hist_2d',
|
85 |
-
'hist_equal', 'histogram', 'hls', 'hough', 'hqr',
|
86 |
-
'hsv', 'i18n_multibytetoutf8',
|
87 |
-
'i18n_multibytetowidechar', 'i18n_utf8tomultibyte',
|
88 |
-
'i18n_widechartomultibyte',
|
89 |
-
'ibeta', 'icontour', 'iconvertcoord', 'idelete', 'identity',
|
90 |
-
'idl_base64', 'idl_container', 'idl_validname',
|
91 |
-
'idlexbr_assistant', 'idlitsys_createtool',
|
92 |
-
'idlunit', 'iellipse', 'igamma', 'igetcurrent', 'igetdata',
|
93 |
-
'igetid', 'igetproperty', 'iimage', 'image', 'image_cont',
|
94 |
-
'image_statistics', 'image_threshold', 'imaginary', 'imap', 'indgen',
|
95 |
-
'int_2d', 'int_3d', 'int_tabulated', 'intarr', 'interpol',
|
96 |
-
'interpolate', 'interval_volume', 'invert', 'ioctl', 'iopen',
|
97 |
-
'ir_filter', 'iplot', 'ipolygon', 'ipolyline', 'iputdata',
|
98 |
-
'iregister', 'ireset', 'iresolve', 'irotate', 'isa',
|
99 |
-
'isave', 'iscale', 'isetcurrent', 'isetproperty', 'ishft',
|
100 |
-
'isocontour', 'isosurface', 'isurface', 'itext', 'itranslate',
|
101 |
-
'ivector', 'ivolume', 'izoom', 'journal', 'json_parse',
|
102 |
-
'json_serialize', 'jul2greg', 'julday', 'keyword_set', 'krig2d',
|
103 |
-
'kurtosis', 'kw_test', 'l64indgen', 'la_choldc', 'la_cholmprove',
|
104 |
-
'la_cholsol', 'la_determ', 'la_eigenproblem', 'la_eigenql', 'la_eigenvec',
|
105 |
-
'la_elmhes', 'la_gm_linear_model', 'la_hqr', 'la_invert',
|
106 |
-
'la_least_square_equality', 'la_least_squares', 'la_linear_equation',
|
107 |
-
'la_ludc', 'la_lumprove', 'la_lusol',
|
108 |
-
'la_svd', 'la_tridc', 'la_trimprove', 'la_triql', 'la_trired',
|
109 |
-
'la_trisol', 'label_date', 'label_region', 'ladfit', 'laguerre',
|
110 |
-
'lambda', 'lambdap', 'lambertw', 'laplacian', 'least_squares_filter',
|
111 |
-
'leefilt', 'legend', 'legendre', 'linbcg', 'lindgen',
|
112 |
-
'linfit', 'linkimage', 'list', 'll_arc_distance', 'lmfit',
|
113 |
-
'lmgr', 'lngamma', 'lnp_test', 'loadct', 'locale_get',
|
114 |
-
'logical_and', 'logical_or', 'logical_true', 'lon64arr', 'lonarr',
|
115 |
-
'long', 'long64', 'lsode', 'lu_complex', 'ludc',
|
116 |
-
'lumprove', 'lusol', 'm_correlate', 'machar', 'make_array',
|
117 |
-
'make_dll', 'make_rt', 'map', 'mapcontinents', 'mapgrid',
|
118 |
-
'map_2points', 'map_continents', 'map_grid', 'map_image', 'map_patch',
|
119 |
-
'map_proj_forward', 'map_proj_image', 'map_proj_info',
|
120 |
-
'map_proj_init', 'map_proj_inverse',
|
121 |
-
'map_set', 'matrix_multiply', 'matrix_power', 'max', 'md_test',
|
122 |
-
'mean', 'meanabsdev', 'mean_filter', 'median', 'memory',
|
123 |
-
'mesh_clip', 'mesh_decimate', 'mesh_issolid',
|
124 |
-
'mesh_merge', 'mesh_numtriangles',
|
125 |
-
'mesh_obj', 'mesh_smooth', 'mesh_surfacearea',
|
126 |
-
'mesh_validate', 'mesh_volume',
|
127 |
-
'message', 'min', 'min_curve_surf', 'mk_html_help', 'modifyct',
|
128 |
-
'moment', 'morph_close', 'morph_distance',
|
129 |
-
'morph_gradient', 'morph_hitormiss',
|
130 |
-
'morph_open', 'morph_thin', 'morph_tophat', 'multi', 'n_elements',
|
131 |
-
'n_params', 'n_tags', 'ncdf', 'newton', 'noise_hurl',
|
132 |
-
'noise_pick', 'noise_scatter', 'noise_slur', 'norm', 'obj_class',
|
133 |
-
'obj_destroy', 'obj_hasmethod', 'obj_isa', 'obj_new', 'obj_valid',
|
134 |
-
'objarr', 'on_error', 'on_ioerror', 'online_help', 'openr',
|
135 |
-
'openu', 'openw', 'oplot', 'oploterr', 'orderedhash',
|
136 |
-
'p_correlate', 'parse_url', 'particle_trace', 'path_cache', 'path_sep',
|
137 |
-
'pcomp', 'plot', 'plot3d', 'plot', 'plot_3dbox',
|
138 |
-
'plot_field', 'ploterr', 'plots', 'polar_contour', 'polar_surface',
|
139 |
-
'polyfill', 'polyshade', 'pnt_line', 'point_lun', 'polarplot',
|
140 |
-
'poly', 'poly_2d', 'poly_area', 'poly_fit', 'polyfillv',
|
141 |
-
'polygon', 'polyline', 'polywarp', 'popd', 'powell',
|
142 |
-
'pref_commit', 'pref_get', 'pref_set', 'prewitt', 'primes',
|
143 |
-
'print', 'printf', 'printd', 'pro', 'product',
|
144 |
-
'profile', 'profiler', 'profiles', 'project_vol', 'ps_show_fonts',
|
145 |
-
'psafm', 'pseudo', 'ptr_free', 'ptr_new', 'ptr_valid',
|
146 |
-
'ptrarr', 'pushd', 'qgrid3', 'qhull', 'qromb',
|
147 |
-
'qromo', 'qsimp', 'query_*', 'query_ascii', 'query_bmp',
|
148 |
-
'query_csv', 'query_dicom', 'query_gif', 'query_image', 'query_jpeg',
|
149 |
-
'query_jpeg2000', 'query_mrsid', 'query_pict', 'query_png', 'query_ppm',
|
150 |
-
'query_srf', 'query_tiff', 'query_video', 'query_wav', 'r_correlate',
|
151 |
-
'r_test', 'radon', 'randomn', 'randomu', 'ranks',
|
152 |
-
'rdpix', 'read', 'readf', 'read_ascii', 'read_binary',
|
153 |
-
'read_bmp', 'read_csv', 'read_dicom', 'read_gif', 'read_image',
|
154 |
-
'read_interfile', 'read_jpeg', 'read_jpeg2000', 'read_mrsid', 'read_pict',
|
155 |
-
'read_png', 'read_ppm', 'read_spr', 'read_srf', 'read_sylk',
|
156 |
-
'read_tiff', 'read_video', 'read_wav', 'read_wave', 'read_x11_bitmap',
|
157 |
-
'read_xwd', 'reads', 'readu', 'real_part', 'rebin',
|
158 |
-
'recall_commands', 'recon3', 'reduce_colors', 'reform', 'region_grow',
|
159 |
-
'register_cursor', 'regress', 'replicate',
|
160 |
-
'replicate_inplace', 'resolve_all',
|
161 |
-
'resolve_routine', 'restore', 'retall', 'return', 'reverse',
|
162 |
-
'rk4', 'roberts', 'rot', 'rotate', 'round',
|
163 |
-
'routine_filepath', 'routine_info', 'rs_test', 's_test', 'save',
|
164 |
-
'savgol', 'scale3', 'scale3d', 'scatterplot', 'scatterplot3d',
|
165 |
-
'scope_level', 'scope_traceback', 'scope_varfetch',
|
166 |
-
'scope_varname', 'search2d',
|
167 |
-
'search3d', 'sem_create', 'sem_delete', 'sem_lock', 'sem_release',
|
168 |
-
'set_plot', 'set_shading', 'setenv', 'sfit', 'shade_surf',
|
169 |
-
'shade_surf_irr', 'shade_volume', 'shift', 'shift_diff', 'shmdebug',
|
170 |
-
'shmmap', 'shmunmap', 'shmvar', 'show3', 'showfont',
|
171 |
-
'signum', 'simplex', 'sin', 'sindgen', 'sinh',
|
172 |
-
'size', 'skewness', 'skip_lun', 'slicer3', 'slide_image',
|
173 |
-
'smooth', 'sobel', 'socket', 'sort', 'spawn',
|
174 |
-
'sph_4pnt', 'sph_scat', 'spher_harm', 'spl_init', 'spl_interp',
|
175 |
-
'spline', 'spline_p', 'sprsab', 'sprsax', 'sprsin',
|
176 |
-
'sprstp', 'sqrt', 'standardize', 'stddev', 'stop',
|
177 |
-
'strarr', 'strcmp', 'strcompress', 'streamline', 'streamline',
|
178 |
-
'stregex', 'stretch', 'string', 'strjoin', 'strlen',
|
179 |
-
'strlowcase', 'strmatch', 'strmessage', 'strmid', 'strpos',
|
180 |
-
'strput', 'strsplit', 'strtrim', 'struct_assign', 'struct_hide',
|
181 |
-
'strupcase', 'surface', 'surface', 'surfr', 'svdc',
|
182 |
-
'svdfit', 'svsol', 'swap_endian', 'swap_endian_inplace', 'symbol',
|
183 |
-
'systime', 't_cvf', 't_pdf', 't3d', 'tag_names',
|
184 |
-
'tan', 'tanh', 'tek_color', 'temporary', 'terminal_size',
|
185 |
-
'tetra_clip', 'tetra_surface', 'tetra_volume', 'text', 'thin',
|
186 |
-
'thread', 'threed', 'tic', 'time_test2', 'timegen',
|
187 |
-
'timer', 'timestamp', 'timestamptovalues', 'tm_test', 'toc',
|
188 |
-
'total', 'trace', 'transpose', 'tri_surf', 'triangulate',
|
189 |
-
'trigrid', 'triql', 'trired', 'trisol', 'truncate_lun',
|
190 |
-
'ts_coef', 'ts_diff', 'ts_fcast', 'ts_smooth', 'tv',
|
191 |
-
'tvcrs', 'tvlct', 'tvrd', 'tvscl', 'typename',
|
192 |
-
'uindgen', 'uint', 'uintarr', 'ul64indgen', 'ulindgen',
|
193 |
-
'ulon64arr', 'ulonarr', 'ulong', 'ulong64', 'uniq',
|
194 |
-
'unsharp_mask', 'usersym', 'value_locate', 'variance', 'vector',
|
195 |
-
'vector_field', 'vel', 'velovect', 'vert_t3d', 'voigt',
|
196 |
-
'volume', 'voronoi', 'voxel_proj', 'wait', 'warp_tri',
|
197 |
-
'watershed', 'wdelete', 'wf_draw', 'where', 'widget_base',
|
198 |
-
'widget_button', 'widget_combobox', 'widget_control',
|
199 |
-
'widget_displaycontextmenu', 'widget_draw',
|
200 |
-
'widget_droplist', 'widget_event', 'widget_info',
|
201 |
-
'widget_label', 'widget_list',
|
202 |
-
'widget_propertysheet', 'widget_slider', 'widget_tab',
|
203 |
-
'widget_table', 'widget_text',
|
204 |
-
'widget_tree', 'widget_tree_move', 'widget_window',
|
205 |
-
'wiener_filter', 'window',
|
206 |
-
'window', 'write_bmp', 'write_csv', 'write_gif', 'write_image',
|
207 |
-
'write_jpeg', 'write_jpeg2000', 'write_nrif', 'write_pict', 'write_png',
|
208 |
-
'write_ppm', 'write_spr', 'write_srf', 'write_sylk', 'write_tiff',
|
209 |
-
'write_video', 'write_wav', 'write_wave', 'writeu', 'wset',
|
210 |
-
'wshow', 'wtn', 'wv_applet', 'wv_cwt', 'wv_cw_wavelet',
|
211 |
-
'wv_denoise', 'wv_dwt', 'wv_fn_coiflet',
|
212 |
-
'wv_fn_daubechies', 'wv_fn_gaussian',
|
213 |
-
'wv_fn_haar', 'wv_fn_morlet', 'wv_fn_paul',
|
214 |
-
'wv_fn_symlet', 'wv_import_data',
|
215 |
-
'wv_import_wavelet', 'wv_plot3d_wps', 'wv_plot_multires',
|
216 |
-
'wv_pwt', 'wv_tool_denoise',
|
217 |
-
'xbm_edit', 'xdisplayfile', 'xdxf', 'xfont', 'xinteranimate',
|
218 |
-
'xloadct', 'xmanager', 'xmng_tmpl', 'xmtool', 'xobjview',
|
219 |
-
'xobjview_rotate', 'xobjview_write_image',
|
220 |
-
'xpalette', 'xpcolor', 'xplot3d',
|
221 |
-
'xregistered', 'xroi', 'xsq_test', 'xsurface', 'xvaredit',
|
222 |
-
'xvolume', 'xvolume_rotate', 'xvolume_write_image',
|
223 |
-
'xyouts', 'zlib_compress', 'zlib_uncompress', 'zoom', 'zoom_24'
|
224 |
-
];
|
225 |
-
var builtins = wordRegexp(builtinArray);
|
226 |
-
|
227 |
-
var keywordArray = [
|
228 |
-
'begin', 'end', 'endcase', 'endfor',
|
229 |
-
'endwhile', 'endif', 'endrep', 'endforeach',
|
230 |
-
'break', 'case', 'continue', 'for',
|
231 |
-
'foreach', 'goto', 'if', 'then', 'else',
|
232 |
-
'repeat', 'until', 'switch', 'while',
|
233 |
-
'do', 'pro', 'function'
|
234 |
-
];
|
235 |
-
var keywords = wordRegexp(keywordArray);
|
236 |
-
|
237 |
-
CodeMirror.registerHelper("hintWords", "idl", builtinArray.concat(keywordArray));
|
238 |
-
|
239 |
-
var identifiers = new RegExp('^[_a-z\xa1-\uffff][_a-z0-9\xa1-\uffff]*', 'i');
|
240 |
-
|
241 |
-
var singleOperators = /[+\-*&=<>\/@#~$]/;
|
242 |
-
var boolOperators = new RegExp('(and|or|eq|lt|le|gt|ge|ne|not)', 'i');
|
243 |
-
|
244 |
-
function tokenBase(stream) {
|
245 |
-
// whitespaces
|
246 |
-
if (stream.eatSpace()) return null;
|
247 |
-
|
248 |
-
// Handle one line Comments
|
249 |
-
if (stream.match(';')) {
|
250 |
-
stream.skipToEnd();
|
251 |
-
return 'comment';
|
252 |
-
}
|
253 |
-
|
254 |
-
// Handle Number Literals
|
255 |
-
if (stream.match(/^[0-9\.+-]/, false)) {
|
256 |
-
if (stream.match(/^[+-]?0x[0-9a-fA-F]+/))
|
257 |
-
return 'number';
|
258 |
-
if (stream.match(/^[+-]?\d*\.\d+([EeDd][+-]?\d+)?/))
|
259 |
-
return 'number';
|
260 |
-
if (stream.match(/^[+-]?\d+([EeDd][+-]?\d+)?/))
|
261 |
-
return 'number';
|
262 |
-
}
|
263 |
-
|
264 |
-
// Handle Strings
|
265 |
-
if (stream.match(/^"([^"]|(""))*"/)) { return 'string'; }
|
266 |
-
if (stream.match(/^'([^']|(''))*'/)) { return 'string'; }
|
267 |
-
|
268 |
-
// Handle words
|
269 |
-
if (stream.match(keywords)) { return 'keyword'; }
|
270 |
-
if (stream.match(builtins)) { return 'builtin'; }
|
271 |
-
if (stream.match(identifiers)) { return 'variable'; }
|
272 |
-
|
273 |
-
if (stream.match(singleOperators) || stream.match(boolOperators)) {
|
274 |
-
return 'operator'; }
|
275 |
-
|
276 |
-
// Handle non-detected items
|
277 |
-
stream.next();
|
278 |
-
return null;
|
279 |
-
};
|
280 |
-
|
281 |
-
CodeMirror.defineMode('idl', function() {
|
282 |
-
return {
|
283 |
-
token: function(stream) {
|
284 |
-
return tokenBase(stream);
|
285 |
-
}
|
286 |
-
};
|
287 |
-
});
|
288 |
-
|
289 |
-
CodeMirror.defineMIME('text/x-idl', 'idl');
|
290 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/idl/index.html
DELETED
@@ -1,64 +0,0 @@
|
|
1 |
-
<!doctype html>
|
2 |
-
|
3 |
-
<title>CodeMirror: IDL mode</title>
|
4 |
-
<meta charset="utf-8"/>
|
5 |
-
<link rel=stylesheet href="../../doc/docs.css">
|
6 |
-
|
7 |
-
<link rel="stylesheet" href="../../lib/codemirror.css">
|
8 |
-
<script src="../../lib/codemirror.js"></script>
|
9 |
-
<script src="idl.js"></script>
|
10 |
-
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
11 |
-
<div id=nav>
|
12 |
-
<a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
13 |
-
|
14 |
-
<ul>
|
15 |
-
<li><a href="../../index.html">Home</a>
|
16 |
-
<li><a href="../../doc/manual.html">Manual</a>
|
17 |
-
<li><a href="https://github.com/codemirror/codemirror">Code</a>
|
18 |
-
</ul>
|
19 |
-
<ul>
|
20 |
-
<li><a href="../index.html">Language modes</a>
|
21 |
-
<li><a class=active href="#">IDL</a>
|
22 |
-
</ul>
|
23 |
-
</div>
|
24 |
-
|
25 |
-
<article>
|
26 |
-
<h2>IDL mode</h2>
|
27 |
-
|
28 |
-
<div><textarea id="code" name="code">
|
29 |
-
;; Example IDL code
|
30 |
-
FUNCTION mean_and_stddev,array
|
31 |
-
;; This program reads in an array of numbers
|
32 |
-
;; and returns a structure containing the
|
33 |
-
;; average and standard deviation
|
34 |
-
|
35 |
-
ave = 0.0
|
36 |
-
count = 0.0
|
37 |
-
|
38 |
-
for i=0,N_ELEMENTS(array)-1 do begin
|
39 |
-
ave = ave + array[i]
|
40 |
-
count = count + 1
|
41 |
-
endfor
|
42 |
-
|
43 |
-
ave = ave/count
|
44 |
-
|
45 |
-
std = stddev(array)
|
46 |
-
|
47 |
-
return, {average:ave,std:std}
|
48 |
-
|
49 |
-
END
|
50 |
-
|
51 |
-
</textarea></div>
|
52 |
-
<script>
|
53 |
-
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
|
54 |
-
mode: {name: "idl",
|
55 |
-
version: 1,
|
56 |
-
singleLineStringErrors: false},
|
57 |
-
lineNumbers: true,
|
58 |
-
indentUnit: 4,
|
59 |
-
matchBrackets: true
|
60 |
-
});
|
61 |
-
</script>
|
62 |
-
|
63 |
-
<p><strong>MIME types defined:</strong> <code>text/x-idl</code>.</p>
|
64 |
-
</article>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/jade/index.html
DELETED
@@ -1,70 +0,0 @@
|
|
1 |
-
<!doctype html>
|
2 |
-
|
3 |
-
<title>CodeMirror: Jade Templating Mode</title>
|
4 |
-
<meta charset="utf-8"/>
|
5 |
-
<link rel=stylesheet href="../../doc/docs.css">
|
6 |
-
|
7 |
-
<link rel="stylesheet" href="../../lib/codemirror.css">
|
8 |
-
<script src="../../lib/codemirror.js"></script>
|
9 |
-
<script src="../javascript/javascript.js"></script>
|
10 |
-
<script src="../css/css.js"></script>
|
11 |
-
<script src="../xml/xml.js"></script>
|
12 |
-
<script src="../htmlmixed/htmlmixed.js"></script>
|
13 |
-
<script src="jade.js"></script>
|
14 |
-
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
15 |
-
<div id=nav>
|
16 |
-
<a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
17 |
-
|
18 |
-
<ul>
|
19 |
-
<li><a href="../../index.html">Home</a>
|
20 |
-
<li><a href="../../doc/manual.html">Manual</a>
|
21 |
-
<li><a href="https://github.com/codemirror/codemirror">Code</a>
|
22 |
-
</ul>
|
23 |
-
<ul>
|
24 |
-
<li><a href="../index.html">Language modes</a>
|
25 |
-
<li><a class=active href="#">Jade Templating Mode</a>
|
26 |
-
</ul>
|
27 |
-
</div>
|
28 |
-
|
29 |
-
<article>
|
30 |
-
<h2>Jade Templating Mode</h2>
|
31 |
-
<form><textarea id="code" name="code">
|
32 |
-
doctype html
|
33 |
-
html
|
34 |
-
head
|
35 |
-
title= "Jade Templating CodeMirror Mode Example"
|
36 |
-
link(rel='stylesheet', href='/css/bootstrap.min.css')
|
37 |
-
link(rel='stylesheet', href='/css/index.css')
|
38 |
-
script(type='text/javascript', src='/js/jquery-1.9.1.min.js')
|
39 |
-
script(type='text/javascript', src='/js/bootstrap.min.js')
|
40 |
-
body
|
41 |
-
div.header
|
42 |
-
h1 Welcome to this Example
|
43 |
-
div.spots
|
44 |
-
if locals.spots
|
45 |
-
each spot in spots
|
46 |
-
div.spot.well
|
47 |
-
div
|
48 |
-
if spot.logo
|
49 |
-
img.img-rounded.logo(src=spot.logo)
|
50 |
-
else
|
51 |
-
img.img-rounded.logo(src="img/placeholder.png")
|
52 |
-
h3
|
53 |
-
a(href=spot.hash) ##{spot.hash}
|
54 |
-
if spot.title
|
55 |
-
span.title #{spot.title}
|
56 |
-
if spot.desc
|
57 |
-
div #{spot.desc}
|
58 |
-
else
|
59 |
-
h3 There are no spots currently available.
|
60 |
-
</textarea></form>
|
61 |
-
<script>
|
62 |
-
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
|
63 |
-
mode: {name: "jade", alignCDATA: true},
|
64 |
-
lineNumbers: true
|
65 |
-
});
|
66 |
-
</script>
|
67 |
-
<h3>The Jade Templating Mode</h3>
|
68 |
-
<p> Created by Forbes Lindesay. Managed as part of a Brackets extension at <a href="https://github.com/ForbesLindesay/jade-brackets">https://github.com/ForbesLindesay/jade-brackets</a>.</p>
|
69 |
-
<p><strong>MIME type defined:</strong> <code>text/x-jade</code>.</p>
|
70 |
-
</article>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/jade/jade.js
DELETED
@@ -1,590 +0,0 @@
|
|
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("../javascript/javascript"), require("../css/css"), require("../htmlmixed/htmlmixed"));
|
7 |
-
else if (typeof define == "function" && define.amd) // AMD
|
8 |
-
define(["../../lib/codemirror", "../javascript/javascript", "../css/css", "../htmlmixed/htmlmixed"], mod);
|
9 |
-
else // Plain browser env
|
10 |
-
mod(CodeMirror);
|
11 |
-
})(function(CodeMirror) {
|
12 |
-
"use strict";
|
13 |
-
|
14 |
-
CodeMirror.defineMode('jade', function (config) {
|
15 |
-
// token types
|
16 |
-
var KEYWORD = 'keyword';
|
17 |
-
var DOCTYPE = 'meta';
|
18 |
-
var ID = 'builtin';
|
19 |
-
var CLASS = 'qualifier';
|
20 |
-
|
21 |
-
var ATTRS_NEST = {
|
22 |
-
'{': '}',
|
23 |
-
'(': ')',
|
24 |
-
'[': ']'
|
25 |
-
};
|
26 |
-
|
27 |
-
var jsMode = CodeMirror.getMode(config, 'javascript');
|
28 |
-
|
29 |
-
function State() {
|
30 |
-
this.javaScriptLine = false;
|
31 |
-
this.javaScriptLineExcludesColon = false;
|
32 |
-
|
33 |
-
this.javaScriptArguments = false;
|
34 |
-
this.javaScriptArgumentsDepth = 0;
|
35 |
-
|
36 |
-
this.isInterpolating = false;
|
37 |
-
this.interpolationNesting = 0;
|
38 |
-
|
39 |
-
this.jsState = jsMode.startState();
|
40 |
-
|
41 |
-
this.restOfLine = '';
|
42 |
-
|
43 |
-
this.isIncludeFiltered = false;
|
44 |
-
this.isEach = false;
|
45 |
-
|
46 |
-
this.lastTag = '';
|
47 |
-
this.scriptType = '';
|
48 |
-
|
49 |
-
// Attributes Mode
|
50 |
-
this.isAttrs = false;
|
51 |
-
this.attrsNest = [];
|
52 |
-
this.inAttributeName = true;
|
53 |
-
this.attributeIsType = false;
|
54 |
-
this.attrValue = '';
|
55 |
-
|
56 |
-
// Indented Mode
|
57 |
-
this.indentOf = Infinity;
|
58 |
-
this.indentToken = '';
|
59 |
-
|
60 |
-
this.innerMode = null;
|
61 |
-
this.innerState = null;
|
62 |
-
|
63 |
-
this.innerModeForLine = false;
|
64 |
-
}
|
65 |
-
/**
|
66 |
-
* Safely copy a state
|
67 |
-
*
|
68 |
-
* @return {State}
|
69 |
-
*/
|
70 |
-
State.prototype.copy = function () {
|
71 |
-
var res = new State();
|
72 |
-
res.javaScriptLine = this.javaScriptLine;
|
73 |
-
res.javaScriptLineExcludesColon = this.javaScriptLineExcludesColon;
|
74 |
-
res.javaScriptArguments = this.javaScriptArguments;
|
75 |
-
res.javaScriptArgumentsDepth = this.javaScriptArgumentsDepth;
|
76 |
-
res.isInterpolating = this.isInterpolating;
|
77 |
-
res.interpolationNesting = this.intpolationNesting;
|
78 |
-
|
79 |
-
res.jsState = CodeMirror.copyState(jsMode, this.jsState);
|
80 |
-
|
81 |
-
res.innerMode = this.innerMode;
|
82 |
-
if (this.innerMode && this.innerState) {
|
83 |
-
res.innerState = CodeMirror.copyState(this.innerMode, this.innerState);
|
84 |
-
}
|
85 |
-
|
86 |
-
res.restOfLine = this.restOfLine;
|
87 |
-
|
88 |
-
res.isIncludeFiltered = this.isIncludeFiltered;
|
89 |
-
res.isEach = this.isEach;
|
90 |
-
res.lastTag = this.lastTag;
|
91 |
-
res.scriptType = this.scriptType;
|
92 |
-
res.isAttrs = this.isAttrs;
|
93 |
-
res.attrsNest = this.attrsNest.slice();
|
94 |
-
res.inAttributeName = this.inAttributeName;
|
95 |
-
res.attributeIsType = this.attributeIsType;
|
96 |
-
res.attrValue = this.attrValue;
|
97 |
-
res.indentOf = this.indentOf;
|
98 |
-
res.indentToken = this.indentToken;
|
99 |
-
|
100 |
-
res.innerModeForLine = this.innerModeForLine;
|
101 |
-
|
102 |
-
return res;
|
103 |
-
};
|
104 |
-
|
105 |
-
function javaScript(stream, state) {
|
106 |
-
if (stream.sol()) {
|
107 |
-
// if javaScriptLine was set at end of line, ignore it
|
108 |
-
state.javaScriptLine = false;
|
109 |
-
state.javaScriptLineExcludesColon = false;
|
110 |
-
}
|
111 |
-
if (state.javaScriptLine) {
|
112 |
-
if (state.javaScriptLineExcludesColon && stream.peek() === ':') {
|
113 |
-
state.javaScriptLine = false;
|
114 |
-
state.javaScriptLineExcludesColon = false;
|
115 |
-
return;
|
116 |
-
}
|
117 |
-
var tok = jsMode.token(stream, state.jsState);
|
118 |
-
if (stream.eol()) state.javaScriptLine = false;
|
119 |
-
return tok || true;
|
120 |
-
}
|
121 |
-
}
|
122 |
-
function javaScriptArguments(stream, state) {
|
123 |
-
if (state.javaScriptArguments) {
|
124 |
-
if (state.javaScriptArgumentsDepth === 0 && stream.peek() !== '(') {
|
125 |
-
state.javaScriptArguments = false;
|
126 |
-
return;
|
127 |
-
}
|
128 |
-
if (stream.peek() === '(') {
|
129 |
-
state.javaScriptArgumentsDepth++;
|
130 |
-
} else if (stream.peek() === ')') {
|
131 |
-
state.javaScriptArgumentsDepth--;
|
132 |
-
}
|
133 |
-
if (state.javaScriptArgumentsDepth === 0) {
|
134 |
-
state.javaScriptArguments = false;
|
135 |
-
return;
|
136 |
-
}
|
137 |
-
|
138 |
-
var tok = jsMode.token(stream, state.jsState);
|
139 |
-
return tok || true;
|
140 |
-
}
|
141 |
-
}
|
142 |
-
|
143 |
-
function yieldStatement(stream) {
|
144 |
-
if (stream.match(/^yield\b/)) {
|
145 |
-
return 'keyword';
|
146 |
-
}
|
147 |
-
}
|
148 |
-
|
149 |
-
function doctype(stream) {
|
150 |
-
if (stream.match(/^(?:doctype) *([^\n]+)?/)) {
|
151 |
-
return DOCTYPE;
|
152 |
-
}
|
153 |
-
}
|
154 |
-
|
155 |
-
function interpolation(stream, state) {
|
156 |
-
if (stream.match('#{')) {
|
157 |
-
state.isInterpolating = true;
|
158 |
-
state.interpolationNesting = 0;
|
159 |
-
return 'punctuation';
|
160 |
-
}
|
161 |
-
}
|
162 |
-
|
163 |
-
function interpolationContinued(stream, state) {
|
164 |
-
if (state.isInterpolating) {
|
165 |
-
if (stream.peek() === '}') {
|
166 |
-
state.interpolationNesting--;
|
167 |
-
if (state.interpolationNesting < 0) {
|
168 |
-
stream.next();
|
169 |
-
state.isInterpolating = false;
|
170 |
-
return 'puncutation';
|
171 |
-
}
|
172 |
-
} else if (stream.peek() === '{') {
|
173 |
-
state.interpolationNesting++;
|
174 |
-
}
|
175 |
-
return jsMode.token(stream, state.jsState) || true;
|
176 |
-
}
|
177 |
-
}
|
178 |
-
|
179 |
-
function caseStatement(stream, state) {
|
180 |
-
if (stream.match(/^case\b/)) {
|
181 |
-
state.javaScriptLine = true;
|
182 |
-
return KEYWORD;
|
183 |
-
}
|
184 |
-
}
|
185 |
-
|
186 |
-
function when(stream, state) {
|
187 |
-
if (stream.match(/^when\b/)) {
|
188 |
-
state.javaScriptLine = true;
|
189 |
-
state.javaScriptLineExcludesColon = true;
|
190 |
-
return KEYWORD;
|
191 |
-
}
|
192 |
-
}
|
193 |
-
|
194 |
-
function defaultStatement(stream) {
|
195 |
-
if (stream.match(/^default\b/)) {
|
196 |
-
return KEYWORD;
|
197 |
-
}
|
198 |
-
}
|
199 |
-
|
200 |
-
function extendsStatement(stream, state) {
|
201 |
-
if (stream.match(/^extends?\b/)) {
|
202 |
-
state.restOfLine = 'string';
|
203 |
-
return KEYWORD;
|
204 |
-
}
|
205 |
-
}
|
206 |
-
|
207 |
-
function append(stream, state) {
|
208 |
-
if (stream.match(/^append\b/)) {
|
209 |
-
state.restOfLine = 'variable';
|
210 |
-
return KEYWORD;
|
211 |
-
}
|
212 |
-
}
|
213 |
-
function prepend(stream, state) {
|
214 |
-
if (stream.match(/^prepend\b/)) {
|
215 |
-
state.restOfLine = 'variable';
|
216 |
-
return KEYWORD;
|
217 |
-
}
|
218 |
-
}
|
219 |
-
function block(stream, state) {
|
220 |
-
if (stream.match(/^block\b *(?:(prepend|append)\b)?/)) {
|
221 |
-
state.restOfLine = 'variable';
|
222 |
-
return KEYWORD;
|
223 |
-
}
|
224 |
-
}
|
225 |
-
|
226 |
-
function include(stream, state) {
|
227 |
-
if (stream.match(/^include\b/)) {
|
228 |
-
state.restOfLine = 'string';
|
229 |
-
return KEYWORD;
|
230 |
-
}
|
231 |
-
}
|
232 |
-
|
233 |
-
function includeFiltered(stream, state) {
|
234 |
-
if (stream.match(/^include:([a-zA-Z0-9\-]+)/, false) && stream.match('include')) {
|
235 |
-
state.isIncludeFiltered = true;
|
236 |
-
return KEYWORD;
|
237 |
-
}
|
238 |
-
}
|
239 |
-
|
240 |
-
function includeFilteredContinued(stream, state) {
|
241 |
-
if (state.isIncludeFiltered) {
|
242 |
-
var tok = filter(stream, state);
|
243 |
-
state.isIncludeFiltered = false;
|
244 |
-
state.restOfLine = 'string';
|
245 |
-
return tok;
|
246 |
-
}
|
247 |
-
}
|
248 |
-
|
249 |
-
function mixin(stream, state) {
|
250 |
-
if (stream.match(/^mixin\b/)) {
|
251 |
-
state.javaScriptLine = true;
|
252 |
-
return KEYWORD;
|
253 |
-
}
|
254 |
-
}
|
255 |
-
|
256 |
-
function call(stream, state) {
|
257 |
-
if (stream.match(/^\+([-\w]+)/)) {
|
258 |
-
if (!stream.match(/^\( *[-\w]+ *=/, false)) {
|
259 |
-
state.javaScriptArguments = true;
|
260 |
-
state.javaScriptArgumentsDepth = 0;
|
261 |
-
}
|
262 |
-
return 'variable';
|
263 |
-
}
|
264 |
-
if (stream.match(/^\+#{/, false)) {
|
265 |
-
stream.next();
|
266 |
-
state.mixinCallAfter = true;
|
267 |
-
return interpolation(stream, state);
|
268 |
-
}
|
269 |
-
}
|
270 |
-
function callArguments(stream, state) {
|
271 |
-
if (state.mixinCallAfter) {
|
272 |
-
state.mixinCallAfter = false;
|
273 |
-
if (!stream.match(/^\( *[-\w]+ *=/, false)) {
|
274 |
-
state.javaScriptArguments = true;
|
275 |
-
state.javaScriptArgumentsDepth = 0;
|
276 |
-
}
|
277 |
-
return true;
|
278 |
-
}
|
279 |
-
}
|
280 |
-
|
281 |
-
function conditional(stream, state) {
|
282 |
-
if (stream.match(/^(if|unless|else if|else)\b/)) {
|
283 |
-
state.javaScriptLine = true;
|
284 |
-
return KEYWORD;
|
285 |
-
}
|
286 |
-
}
|
287 |
-
|
288 |
-
function each(stream, state) {
|
289 |
-
if (stream.match(/^(- *)?(each|for)\b/)) {
|
290 |
-
state.isEach = true;
|
291 |
-
return KEYWORD;
|
292 |
-
}
|
293 |
-
}
|
294 |
-
function eachContinued(stream, state) {
|
295 |
-
if (state.isEach) {
|
296 |
-
if (stream.match(/^ in\b/)) {
|
297 |
-
state.javaScriptLine = true;
|
298 |
-
state.isEach = false;
|
299 |
-
return KEYWORD;
|
300 |
-
} else if (stream.sol() || stream.eol()) {
|
301 |
-
state.isEach = false;
|
302 |
-
} else if (stream.next()) {
|
303 |
-
while (!stream.match(/^ in\b/, false) && stream.next());
|
304 |
-
return 'variable';
|
305 |
-
}
|
306 |
-
}
|
307 |
-
}
|
308 |
-
|
309 |
-
function whileStatement(stream, state) {
|
310 |
-
if (stream.match(/^while\b/)) {
|
311 |
-
state.javaScriptLine = true;
|
312 |
-
return KEYWORD;
|
313 |
-
}
|
314 |
-
}
|
315 |
-
|
316 |
-
function tag(stream, state) {
|
317 |
-
var captures;
|
318 |
-
if (captures = stream.match(/^(\w(?:[-:\w]*\w)?)\/?/)) {
|
319 |
-
state.lastTag = captures[1].toLowerCase();
|
320 |
-
if (state.lastTag === 'script') {
|
321 |
-
state.scriptType = 'application/javascript';
|
322 |
-
}
|
323 |
-
return 'tag';
|
324 |
-
}
|
325 |
-
}
|
326 |
-
|
327 |
-
function filter(stream, state) {
|
328 |
-
if (stream.match(/^:([\w\-]+)/)) {
|
329 |
-
var innerMode;
|
330 |
-
if (config && config.innerModes) {
|
331 |
-
innerMode = config.innerModes(stream.current().substring(1));
|
332 |
-
}
|
333 |
-
if (!innerMode) {
|
334 |
-
innerMode = stream.current().substring(1);
|
335 |
-
}
|
336 |
-
if (typeof innerMode === 'string') {
|
337 |
-
innerMode = CodeMirror.getMode(config, innerMode);
|
338 |
-
}
|
339 |
-
setInnerMode(stream, state, innerMode);
|
340 |
-
return 'atom';
|
341 |
-
}
|
342 |
-
}
|
343 |
-
|
344 |
-
function code(stream, state) {
|
345 |
-
if (stream.match(/^(!?=|-)/)) {
|
346 |
-
state.javaScriptLine = true;
|
347 |
-
return 'punctuation';
|
348 |
-
}
|
349 |
-
}
|
350 |
-
|
351 |
-
function id(stream) {
|
352 |
-
if (stream.match(/^#([\w-]+)/)) {
|
353 |
-
return ID;
|
354 |
-
}
|
355 |
-
}
|
356 |
-
|
357 |
-
function className(stream) {
|
358 |
-
if (stream.match(/^\.([\w-]+)/)) {
|
359 |
-
return CLASS;
|
360 |
-
}
|
361 |
-
}
|
362 |
-
|
363 |
-
function attrs(stream, state) {
|
364 |
-
if (stream.peek() == '(') {
|
365 |
-
stream.next();
|
366 |
-
state.isAttrs = true;
|
367 |
-
state.attrsNest = [];
|
368 |
-
state.inAttributeName = true;
|
369 |
-
state.attrValue = '';
|
370 |
-
state.attributeIsType = false;
|
371 |
-
return 'punctuation';
|
372 |
-
}
|
373 |
-
}
|
374 |
-
|
375 |
-
function attrsContinued(stream, state) {
|
376 |
-
if (state.isAttrs) {
|
377 |
-
if (ATTRS_NEST[stream.peek()]) {
|
378 |
-
state.attrsNest.push(ATTRS_NEST[stream.peek()]);
|
379 |
-
}
|
380 |
-
if (state.attrsNest[state.attrsNest.length - 1] === stream.peek()) {
|
381 |
-
state.attrsNest.pop();
|
382 |
-
} else if (stream.eat(')')) {
|
383 |
-
state.isAttrs = false;
|
384 |
-
return 'punctuation';
|
385 |
-
}
|
386 |
-
if (state.inAttributeName && stream.match(/^[^=,\)!]+/)) {
|
387 |
-
if (stream.peek() === '=' || stream.peek() === '!') {
|
388 |
-
state.inAttributeName = false;
|
389 |
-
state.jsState = jsMode.startState();
|
390 |
-
if (state.lastTag === 'script' && stream.current().trim().toLowerCase() === 'type') {
|
391 |
-
state.attributeIsType = true;
|
392 |
-
} else {
|
393 |
-
state.attributeIsType = false;
|
394 |
-
}
|
395 |
-
}
|
396 |
-
return 'attribute';
|
397 |
-
}
|
398 |
-
|
399 |
-
var tok = jsMode.token(stream, state.jsState);
|
400 |
-
if (state.attributeIsType && tok === 'string') {
|
401 |
-
state.scriptType = stream.current().toString();
|
402 |
-
}
|
403 |
-
if (state.attrsNest.length === 0 && (tok === 'string' || tok === 'variable' || tok === 'keyword')) {
|
404 |
-
try {
|
405 |
-
Function('', 'var x ' + state.attrValue.replace(/,\s*$/, '').replace(/^!/, ''));
|
406 |
-
state.inAttributeName = true;
|
407 |
-
state.attrValue = '';
|
408 |
-
stream.backUp(stream.current().length);
|
409 |
-
return attrsContinued(stream, state);
|
410 |
-
} catch (ex) {
|
411 |
-
//not the end of an attribute
|
412 |
-
}
|
413 |
-
}
|
414 |
-
state.attrValue += stream.current();
|
415 |
-
return tok || true;
|
416 |
-
}
|
417 |
-
}
|
418 |
-
|
419 |
-
function attributesBlock(stream, state) {
|
420 |
-
if (stream.match(/^&attributes\b/)) {
|
421 |
-
state.javaScriptArguments = true;
|
422 |
-
state.javaScriptArgumentsDepth = 0;
|
423 |
-
return 'keyword';
|
424 |
-
}
|
425 |
-
}
|
426 |
-
|
427 |
-
function indent(stream) {
|
428 |
-
if (stream.sol() && stream.eatSpace()) {
|
429 |
-
return 'indent';
|
430 |
-
}
|
431 |
-
}
|
432 |
-
|
433 |
-
function comment(stream, state) {
|
434 |
-
if (stream.match(/^ *\/\/(-)?([^\n]*)/)) {
|
435 |
-
state.indentOf = stream.indentation();
|
436 |
-
state.indentToken = 'comment';
|
437 |
-
return 'comment';
|
438 |
-
}
|
439 |
-
}
|
440 |
-
|
441 |
-
function colon(stream) {
|
442 |
-
if (stream.match(/^: */)) {
|
443 |
-
return 'colon';
|
444 |
-
}
|
445 |
-
}
|
446 |
-
|
447 |
-
function text(stream, state) {
|
448 |
-
if (stream.match(/^(?:\| ?| )([^\n]+)/)) {
|
449 |
-
return 'string';
|
450 |
-
}
|
451 |
-
if (stream.match(/^(<[^\n]*)/, false)) {
|
452 |
-
// html string
|
453 |
-
setInnerMode(stream, state, 'htmlmixed');
|
454 |
-
state.innerModeForLine = true;
|
455 |
-
return innerMode(stream, state, true);
|
456 |
-
}
|
457 |
-
}
|
458 |
-
|
459 |
-
function dot(stream, state) {
|
460 |
-
if (stream.eat('.')) {
|
461 |
-
var innerMode = null;
|
462 |
-
if (state.lastTag === 'script' && state.scriptType.toLowerCase().indexOf('javascript') != -1) {
|
463 |
-
innerMode = state.scriptType.toLowerCase().replace(/"|'/g, '');
|
464 |
-
} else if (state.lastTag === 'style') {
|
465 |
-
innerMode = 'css';
|
466 |
-
}
|
467 |
-
setInnerMode(stream, state, innerMode);
|
468 |
-
return 'dot';
|
469 |
-
}
|
470 |
-
}
|
471 |
-
|
472 |
-
function fail(stream) {
|
473 |
-
stream.next();
|
474 |
-
return null;
|
475 |
-
}
|
476 |
-
|
477 |
-
|
478 |
-
function setInnerMode(stream, state, mode) {
|
479 |
-
mode = CodeMirror.mimeModes[mode] || mode;
|
480 |
-
mode = config.innerModes ? config.innerModes(mode) || mode : mode;
|
481 |
-
mode = CodeMirror.mimeModes[mode] || mode;
|
482 |
-
mode = CodeMirror.getMode(config, mode);
|
483 |
-
state.indentOf = stream.indentation();
|
484 |
-
|
485 |
-
if (mode && mode.name !== 'null') {
|
486 |
-
state.innerMode = mode;
|
487 |
-
} else {
|
488 |
-
state.indentToken = 'string';
|
489 |
-
}
|
490 |
-
}
|
491 |
-
function innerMode(stream, state, force) {
|
492 |
-
if (stream.indentation() > state.indentOf || (state.innerModeForLine && !stream.sol()) || force) {
|
493 |
-
if (state.innerMode) {
|
494 |
-
if (!state.innerState) {
|
495 |
-
state.innerState = state.innerMode.startState ? state.innerMode.startState(stream.indentation()) : {};
|
496 |
-
}
|
497 |
-
return stream.hideFirstChars(state.indentOf + 2, function () {
|
498 |
-
return state.innerMode.token(stream, state.innerState) || true;
|
499 |
-
});
|
500 |
-
} else {
|
501 |
-
stream.skipToEnd();
|
502 |
-
return state.indentToken;
|
503 |
-
}
|
504 |
-
} else if (stream.sol()) {
|
505 |
-
state.indentOf = Infinity;
|
506 |
-
state.indentToken = null;
|
507 |
-
state.innerMode = null;
|
508 |
-
state.innerState = null;
|
509 |
-
}
|
510 |
-
}
|
511 |
-
function restOfLine(stream, state) {
|
512 |
-
if (stream.sol()) {
|
513 |
-
// if restOfLine was set at end of line, ignore it
|
514 |
-
state.restOfLine = '';
|
515 |
-
}
|
516 |
-
if (state.restOfLine) {
|
517 |
-
stream.skipToEnd();
|
518 |
-
var tok = state.restOfLine;
|
519 |
-
state.restOfLine = '';
|
520 |
-
return tok;
|
521 |
-
}
|
522 |
-
}
|
523 |
-
|
524 |
-
|
525 |
-
function startState() {
|
526 |
-
return new State();
|
527 |
-
}
|
528 |
-
function copyState(state) {
|
529 |
-
return state.copy();
|
530 |
-
}
|
531 |
-
/**
|
532 |
-
* Get the next token in the stream
|
533 |
-
*
|
534 |
-
* @param {Stream} stream
|
535 |
-
* @param {State} state
|
536 |
-
*/
|
537 |
-
function nextToken(stream, state) {
|
538 |
-
var tok = innerMode(stream, state)
|
539 |
-
|| restOfLine(stream, state)
|
540 |
-
|| interpolationContinued(stream, state)
|
541 |
-
|| includeFilteredContinued(stream, state)
|
542 |
-
|| eachContinued(stream, state)
|
543 |
-
|| attrsContinued(stream, state)
|
544 |
-
|| javaScript(stream, state)
|
545 |
-
|| javaScriptArguments(stream, state)
|
546 |
-
|| callArguments(stream, state)
|
547 |
-
|
548 |
-
|| yieldStatement(stream, state)
|
549 |
-
|| doctype(stream, state)
|
550 |
-
|| interpolation(stream, state)
|
551 |
-
|| caseStatement(stream, state)
|
552 |
-
|| when(stream, state)
|
553 |
-
|| defaultStatement(stream, state)
|
554 |
-
|| extendsStatement(stream, state)
|
555 |
-
|| append(stream, state)
|
556 |
-
|| prepend(stream, state)
|
557 |
-
|| block(stream, state)
|
558 |
-
|| include(stream, state)
|
559 |
-
|| includeFiltered(stream, state)
|
560 |
-
|| mixin(stream, state)
|
561 |
-
|| call(stream, state)
|
562 |
-
|| conditional(stream, state)
|
563 |
-
|| each(stream, state)
|
564 |
-
|| whileStatement(stream, state)
|
565 |
-
|| tag(stream, state)
|
566 |
-
|| filter(stream, state)
|
567 |
-
|| code(stream, state)
|
568 |
-
|| id(stream, state)
|
569 |
-
|| className(stream, state)
|
570 |
-
|| attrs(stream, state)
|
571 |
-
|| attributesBlock(stream, state)
|
572 |
-
|| indent(stream, state)
|
573 |
-
|| text(stream, state)
|
574 |
-
|| comment(stream, state)
|
575 |
-
|| colon(stream, state)
|
576 |
-
|| dot(stream, state)
|
577 |
-
|| fail(stream, state);
|
578 |
-
|
579 |
-
return tok === true ? null : tok;
|
580 |
-
}
|
581 |
-
return {
|
582 |
-
startState: startState,
|
583 |
-
copyState: copyState,
|
584 |
-
token: nextToken
|
585 |
-
};
|
586 |
-
});
|
587 |
-
|
588 |
-
CodeMirror.defineMIME('text/x-jade', 'jade');
|
589 |
-
|
590 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/jinja2/index.html
DELETED
@@ -1,54 +0,0 @@
|
|
1 |
-
<!doctype html>
|
2 |
-
|
3 |
-
<title>CodeMirror: Jinja2 mode</title>
|
4 |
-
<meta charset="utf-8"/>
|
5 |
-
<link rel=stylesheet href="../../doc/docs.css">
|
6 |
-
|
7 |
-
<link rel="stylesheet" href="../../lib/codemirror.css">
|
8 |
-
<script src="../../lib/codemirror.js"></script>
|
9 |
-
<script src="jinja2.js"></script>
|
10 |
-
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
11 |
-
<div id=nav>
|
12 |
-
<a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
13 |
-
|
14 |
-
<ul>
|
15 |
-
<li><a href="../../index.html">Home</a>
|
16 |
-
<li><a href="../../doc/manual.html">Manual</a>
|
17 |
-
<li><a href="https://github.com/codemirror/codemirror">Code</a>
|
18 |
-
</ul>
|
19 |
-
<ul>
|
20 |
-
<li><a href="../index.html">Language modes</a>
|
21 |
-
<li><a class=active href="#">Jinja2</a>
|
22 |
-
</ul>
|
23 |
-
</div>
|
24 |
-
|
25 |
-
<article>
|
26 |
-
<h2>Jinja2 mode</h2>
|
27 |
-
<form><textarea id="code" name="code">
|
28 |
-
{# this is a comment #}
|
29 |
-
{%- for item in li -%}
|
30 |
-
<li>{{ item.label }}</li>
|
31 |
-
{% endfor -%}
|
32 |
-
{{ item.sand == true and item.keyword == false ? 1 : 0 }}
|
33 |
-
{{ app.get(55, 1.2, true) }}
|
34 |
-
{% if app.get('_route') == ('_home') %}home{% endif %}
|
35 |
-
{% if app.session.flashbag.has('message') %}
|
36 |
-
{% for message in app.session.flashbag.get('message') %}
|
37 |
-
{{ message.content }}
|
38 |
-
{% endfor %}
|
39 |
-
{% endif %}
|
40 |
-
{{ path('_home', {'section': app.request.get('section')}) }}
|
41 |
-
{{ path('_home', {
|
42 |
-
'section': app.request.get('section'),
|
43 |
-
'boolean': true,
|
44 |
-
'number': 55.33
|
45 |
-
})
|
46 |
-
}}
|
47 |
-
{% include ('test.incl.html.twig') %}
|
48 |
-
</textarea></form>
|
49 |
-
<script>
|
50 |
-
var editor =
|
51 |
-
CodeMirror.fromTextArea(document.getElementById("code"), {mode:
|
52 |
-
{name: "jinja2", htmlMode: true}});
|
53 |
-
</script>
|
54 |
-
</article>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/jinja2/jinja2.js
DELETED
@@ -1,142 +0,0 @@
|
|
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("jinja2", function() {
|
15 |
-
var keywords = ["and", "as", "block", "endblock", "by", "cycle", "debug", "else", "elif",
|
16 |
-
"extends", "filter", "endfilter", "firstof", "for",
|
17 |
-
"endfor", "if", "endif", "ifchanged", "endifchanged",
|
18 |
-
"ifequal", "endifequal", "ifnotequal",
|
19 |
-
"endifnotequal", "in", "include", "load", "not", "now", "or",
|
20 |
-
"parsed", "regroup", "reversed", "spaceless",
|
21 |
-
"endspaceless", "ssi", "templatetag", "openblock",
|
22 |
-
"closeblock", "openvariable", "closevariable",
|
23 |
-
"openbrace", "closebrace", "opencomment",
|
24 |
-
"closecomment", "widthratio", "url", "with", "endwith",
|
25 |
-
"get_current_language", "trans", "endtrans", "noop", "blocktrans",
|
26 |
-
"endblocktrans", "get_available_languages",
|
27 |
-
"get_current_language_bidi", "plural"],
|
28 |
-
operator = /^[+\-*&%=<>!?|~^]/,
|
29 |
-
sign = /^[:\[\(\{]/,
|
30 |
-
atom = ["true", "false"],
|
31 |
-
number = /^(\d[+\-\*\/])?\d+(\.\d+)?/;
|
32 |
-
|
33 |
-
keywords = new RegExp("((" + keywords.join(")|(") + "))\\b");
|
34 |
-
atom = new RegExp("((" + atom.join(")|(") + "))\\b");
|
35 |
-
|
36 |
-
function tokenBase (stream, state) {
|
37 |
-
var ch = stream.peek();
|
38 |
-
|
39 |
-
//Comment
|
40 |
-
if (state.incomment) {
|
41 |
-
if(!stream.skipTo("#}")) {
|
42 |
-
stream.skipToEnd();
|
43 |
-
} else {
|
44 |
-
stream.eatWhile(/\#|}/);
|
45 |
-
state.incomment = false;
|
46 |
-
}
|
47 |
-
return "comment";
|
48 |
-
//Tag
|
49 |
-
} else if (state.intag) {
|
50 |
-
//After operator
|
51 |
-
if(state.operator) {
|
52 |
-
state.operator = false;
|
53 |
-
if(stream.match(atom)) {
|
54 |
-
return "atom";
|
55 |
-
}
|
56 |
-
if(stream.match(number)) {
|
57 |
-
return "number";
|
58 |
-
}
|
59 |
-
}
|
60 |
-
//After sign
|
61 |
-
if(state.sign) {
|
62 |
-
state.sign = false;
|
63 |
-
if(stream.match(atom)) {
|
64 |
-
return "atom";
|
65 |
-
}
|
66 |
-
if(stream.match(number)) {
|
67 |
-
return "number";
|
68 |
-
}
|
69 |
-
}
|
70 |
-
|
71 |
-
if(state.instring) {
|
72 |
-
if(ch == state.instring) {
|
73 |
-
state.instring = false;
|
74 |
-
}
|
75 |
-
stream.next();
|
76 |
-
return "string";
|
77 |
-
} else if(ch == "'" || ch == '"') {
|
78 |
-
state.instring = ch;
|
79 |
-
stream.next();
|
80 |
-
return "string";
|
81 |
-
} else if(stream.match(state.intag + "}") || stream.eat("-") && stream.match(state.intag + "}")) {
|
82 |
-
state.intag = false;
|
83 |
-
return "tag";
|
84 |
-
} else if(stream.match(operator)) {
|
85 |
-
state.operator = true;
|
86 |
-
return "operator";
|
87 |
-
} else if(stream.match(sign)) {
|
88 |
-
state.sign = true;
|
89 |
-
} else {
|
90 |
-
if(stream.eat(" ") || stream.sol()) {
|
91 |
-
if(stream.match(keywords)) {
|
92 |
-
return "keyword";
|
93 |
-
}
|
94 |
-
if(stream.match(atom)) {
|
95 |
-
return "atom";
|
96 |
-
}
|
97 |
-
if(stream.match(number)) {
|
98 |
-
return "number";
|
99 |
-
}
|
100 |
-
if(stream.sol()) {
|
101 |
-
stream.next();
|
102 |
-
}
|
103 |
-
} else {
|
104 |
-
stream.next();
|
105 |
-
}
|
106 |
-
|
107 |
-
}
|
108 |
-
return "variable";
|
109 |
-
} else if (stream.eat("{")) {
|
110 |
-
if (ch = stream.eat("#")) {
|
111 |
-
state.incomment = true;
|
112 |
-
if(!stream.skipTo("#}")) {
|
113 |
-
stream.skipToEnd();
|
114 |
-
} else {
|
115 |
-
stream.eatWhile(/\#|}/);
|
116 |
-
state.incomment = false;
|
117 |
-
}
|
118 |
-
return "comment";
|
119 |
-
//Open tag
|
120 |
-
} else if (ch = stream.eat(/\{|%/)) {
|
121 |
-
//Cache close tag
|
122 |
-
state.intag = ch;
|
123 |
-
if(ch == "{") {
|
124 |
-
state.intag = "}";
|
125 |
-
}
|
126 |
-
stream.eat("-");
|
127 |
-
return "tag";
|
128 |
-
}
|
129 |
-
}
|
130 |
-
stream.next();
|
131 |
-
};
|
132 |
-
|
133 |
-
return {
|
134 |
-
startState: function () {
|
135 |
-
return {tokenize: tokenBase};
|
136 |
-
},
|
137 |
-
token: function (stream, state) {
|
138 |
-
return state.tokenize(stream, state);
|
139 |
-
}
|
140 |
-
};
|
141 |
-
});
|
142 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/julia/index.html
DELETED
@@ -1,195 +0,0 @@
|
|
1 |
-
<!doctype html>
|
2 |
-
|
3 |
-
<title>CodeMirror: Julia mode</title>
|
4 |
-
<meta charset="utf-8"/>
|
5 |
-
<link rel=stylesheet href="../../doc/docs.css">
|
6 |
-
|
7 |
-
<link rel="stylesheet" href="../../lib/codemirror.css">
|
8 |
-
<script src="../../lib/codemirror.js"></script>
|
9 |
-
<script src="julia.js"></script>
|
10 |
-
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
11 |
-
<div id=nav>
|
12 |
-
<a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
13 |
-
|
14 |
-
<ul>
|
15 |
-
<li><a href="../../index.html">Home</a>
|
16 |
-
<li><a href="../../doc/manual.html">Manual</a>
|
17 |
-
<li><a href="https://github.com/codemirror/codemirror">Code</a>
|
18 |
-
</ul>
|
19 |
-
<ul>
|
20 |
-
<li><a href="../index.html">Language modes</a>
|
21 |
-
<li><a class=active href="#">Julia</a>
|
22 |
-
</ul>
|
23 |
-
</div>
|
24 |
-
|
25 |
-
<article>
|
26 |
-
<h2>Julia mode</h2>
|
27 |
-
|
28 |
-
<div><textarea id="code" name="code">
|
29 |
-
#numbers
|
30 |
-
1234
|
31 |
-
1234im
|
32 |
-
.234
|
33 |
-
.234im
|
34 |
-
2.23im
|
35 |
-
2.3f3
|
36 |
-
23e2
|
37 |
-
0x234
|
38 |
-
|
39 |
-
#strings
|
40 |
-
'a'
|
41 |
-
"asdf"
|
42 |
-
r"regex"
|
43 |
-
b"bytestring"
|
44 |
-
|
45 |
-
"""
|
46 |
-
multiline string
|
47 |
-
"""
|
48 |
-
|
49 |
-
#identifiers
|
50 |
-
a
|
51 |
-
as123
|
52 |
-
function_name!
|
53 |
-
|
54 |
-
#unicode identifiers
|
55 |
-
# a = x\ddot
|
56 |
-
a⃗ = ẍ
|
57 |
-
# a = v\dot
|
58 |
-
a⃗ = v̇
|
59 |
-
#F\vec = m \cdotp a\vec
|
60 |
-
F⃗ = m·a⃗
|
61 |
-
|
62 |
-
#literal identifier multiples
|
63 |
-
3x
|
64 |
-
4[1, 2, 3]
|
65 |
-
|
66 |
-
#dicts and indexing
|
67 |
-
x=[1, 2, 3]
|
68 |
-
x[end-1]
|
69 |
-
x={"julia"=>"language of technical computing"}
|
70 |
-
|
71 |
-
|
72 |
-
#exception handling
|
73 |
-
try
|
74 |
-
f()
|
75 |
-
catch
|
76 |
-
@printf "Error"
|
77 |
-
finally
|
78 |
-
g()
|
79 |
-
end
|
80 |
-
|
81 |
-
#types
|
82 |
-
immutable Color{T<:Number}
|
83 |
-
r::T
|
84 |
-
g::T
|
85 |
-
b::T
|
86 |
-
end
|
87 |
-
|
88 |
-
#functions
|
89 |
-
function change!(x::Vector{Float64})
|
90 |
-
for i = 1:length(x)
|
91 |
-
x[i] *= 2
|
92 |
-
end
|
93 |
-
end
|
94 |
-
|
95 |
-
#function invocation
|
96 |
-
f('b', (2, 3)...)
|
97 |
-
|
98 |
-
#operators
|
99 |
-
|=
|
100 |
-
&=
|
101 |
-
^=
|
102 |
-
\-
|
103 |
-
%=
|
104 |
-
*=
|
105 |
-
+=
|
106 |
-
-=
|
107 |
-
<=
|
108 |
-
>=
|
109 |
-
!=
|
110 |
-
==
|
111 |
-
%
|
112 |
-
*
|
113 |
-
+
|
114 |
-
-
|
115 |
-
<
|
116 |
-
>
|
117 |
-
!
|
118 |
-
=
|
119 |
-
|
|
120 |
-
&
|
121 |
-
^
|
122 |
-
\
|
123 |
-
?
|
124 |
-
~
|
125 |
-
:
|
126 |
-
$
|
127 |
-
<:
|
128 |
-
.<
|
129 |
-
.>
|
130 |
-
<<
|
131 |
-
<<=
|
132 |
-
>>
|
133 |
-
>>>>
|
134 |
-
>>=
|
135 |
-
>>>=
|
136 |
-
<<=
|
137 |
-
<<<=
|
138 |
-
.<=
|
139 |
-
.>=
|
140 |
-
.==
|
141 |
-
->
|
142 |
-
//
|
143 |
-
in
|
144 |
-
...
|
145 |
-
//
|
146 |
-
:=
|
147 |
-
.//=
|
148 |
-
.*=
|
149 |
-
./=
|
150 |
-
.^=
|
151 |
-
.%=
|
152 |
-
.+=
|
153 |
-
.-=
|
154 |
-
\=
|
155 |
-
\\=
|
156 |
-
||
|
157 |
-
===
|
158 |
-
&&
|
159 |
-
|=
|
160 |
-
.|=
|
161 |
-
<:
|
162 |
-
>:
|
163 |
-
|>
|
164 |
-
<|
|
165 |
-
::
|
166 |
-
x ? y : z
|
167 |
-
|
168 |
-
#macros
|
169 |
-
@spawnat 2 1+1
|
170 |
-
@eval(:x)
|
171 |
-
|
172 |
-
#keywords and operators
|
173 |
-
if else elseif while for
|
174 |
-
begin let end do
|
175 |
-
try catch finally return break continue
|
176 |
-
global local const
|
177 |
-
export import importall using
|
178 |
-
function macro module baremodule
|
179 |
-
type immutable quote
|
180 |
-
true false enumerate
|
181 |
-
|
182 |
-
|
183 |
-
</textarea></div>
|
184 |
-
<script>
|
185 |
-
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
|
186 |
-
mode: {name: "julia",
|
187 |
-
},
|
188 |
-
lineNumbers: true,
|
189 |
-
indentUnit: 4,
|
190 |
-
matchBrackets: true
|
191 |
-
});
|
192 |
-
</script>
|
193 |
-
|
194 |
-
<p><strong>MIME types defined:</strong> <code>text/x-julia</code>.</p>
|
195 |
-
</article>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/julia/julia.js
DELETED
@@ -1,299 +0,0 @@
|
|
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("julia", function(_conf, parserConf) {
|
15 |
-
var ERRORCLASS = 'error';
|
16 |
-
|
17 |
-
function wordRegexp(words) {
|
18 |
-
return new RegExp("^((" + words.join(")|(") + "))\\b");
|
19 |
-
}
|
20 |
-
|
21 |
-
var operators = parserConf.operators || /^\.?[|&^\\%*+\-<>!=\/]=?|\?|~|:|\$|\.[<>]|<<=?|>>>?=?|\.[<>=]=|->?|\/\/|\bin\b/;
|
22 |
-
var delimiters = parserConf.delimiters || /^[;,()[\]{}]/;
|
23 |
-
var identifiers = parserConf.identifiers|| /^[_A-Za-z\u00A1-\uFFFF][_A-Za-z0-9\u00A1-\uFFFF]*!*/;
|
24 |
-
var blockOpeners = ["begin", "function", "type", "immutable", "let", "macro", "for", "while", "quote", "if", "else", "elseif", "try", "finally", "catch", "do"];
|
25 |
-
var blockClosers = ["end", "else", "elseif", "catch", "finally"];
|
26 |
-
var keywordList = ['if', 'else', 'elseif', 'while', 'for', 'begin', 'let', 'end', 'do', 'try', 'catch', 'finally', 'return', 'break', 'continue', 'global', 'local', 'const', 'export', 'import', 'importall', 'using', 'function', 'macro', 'module', 'baremodule', 'type', 'immutable', 'quote', 'typealias', 'abstract', 'bitstype', 'ccall'];
|
27 |
-
var builtinList = ['true', 'false', 'enumerate', 'open', 'close', 'nothing', 'NaN', 'Inf', 'print', 'println', 'Int', 'Int8', 'Uint8', 'Int16', 'Uint16', 'Int32', 'Uint32', 'Int64', 'Uint64', 'Int128', 'Uint128', 'Bool', 'Char', 'Float16', 'Float32', 'Float64', 'Array', 'Vector', 'Matrix', 'String', 'UTF8String', 'ASCIIString', 'error', 'warn', 'info', '@printf'];
|
28 |
-
|
29 |
-
//var stringPrefixes = new RegExp("^[br]?('|\")")
|
30 |
-
var stringPrefixes = /^(`|'|"{3}|([br]?"))/;
|
31 |
-
var keywords = wordRegexp(keywordList);
|
32 |
-
var builtins = wordRegexp(builtinList);
|
33 |
-
var openers = wordRegexp(blockOpeners);
|
34 |
-
var closers = wordRegexp(blockClosers);
|
35 |
-
var macro = /^@[_A-Za-z][_A-Za-z0-9]*/;
|
36 |
-
var symbol = /^:[_A-Za-z][_A-Za-z0-9]*/;
|
37 |
-
|
38 |
-
function in_array(state) {
|
39 |
-
var ch = cur_scope(state);
|
40 |
-
if(ch=="[" || ch=="{") {
|
41 |
-
return true;
|
42 |
-
}
|
43 |
-
else {
|
44 |
-
return false;
|
45 |
-
}
|
46 |
-
}
|
47 |
-
|
48 |
-
function cur_scope(state) {
|
49 |
-
if(state.scopes.length==0) {
|
50 |
-
return null;
|
51 |
-
}
|
52 |
-
return state.scopes[state.scopes.length - 1];
|
53 |
-
}
|
54 |
-
|
55 |
-
// tokenizers
|
56 |
-
function tokenBase(stream, state) {
|
57 |
-
// Handle scope changes
|
58 |
-
var leaving_expr = state.leaving_expr;
|
59 |
-
if(stream.sol()) {
|
60 |
-
leaving_expr = false;
|
61 |
-
}
|
62 |
-
state.leaving_expr = false;
|
63 |
-
if(leaving_expr) {
|
64 |
-
if(stream.match(/^'+/)) {
|
65 |
-
return 'operator';
|
66 |
-
}
|
67 |
-
|
68 |
-
}
|
69 |
-
|
70 |
-
if(stream.match(/^\.{2,3}/)) {
|
71 |
-
return 'operator';
|
72 |
-
}
|
73 |
-
|
74 |
-
if (stream.eatSpace()) {
|
75 |
-
return null;
|
76 |
-
}
|
77 |
-
|
78 |
-
var ch = stream.peek();
|
79 |
-
// Handle Comments
|
80 |
-
if (ch === '#') {
|
81 |
-
stream.skipToEnd();
|
82 |
-
return 'comment';
|
83 |
-
}
|
84 |
-
if(ch==='[') {
|
85 |
-
state.scopes.push("[");
|
86 |
-
}
|
87 |
-
|
88 |
-
if(ch==='{') {
|
89 |
-
state.scopes.push("{");
|
90 |
-
}
|
91 |
-
|
92 |
-
var scope=cur_scope(state);
|
93 |
-
|
94 |
-
if(scope==='[' && ch===']') {
|
95 |
-
state.scopes.pop();
|
96 |
-
state.leaving_expr=true;
|
97 |
-
}
|
98 |
-
|
99 |
-
if(scope==='{' && ch==='}') {
|
100 |
-
state.scopes.pop();
|
101 |
-
state.leaving_expr=true;
|
102 |
-
}
|
103 |
-
|
104 |
-
if(ch===')') {
|
105 |
-
state.leaving_expr = true;
|
106 |
-
}
|
107 |
-
|
108 |
-
var match;
|
109 |
-
if(!in_array(state) && (match=stream.match(openers, false))) {
|
110 |
-
state.scopes.push(match);
|
111 |
-
}
|
112 |
-
|
113 |
-
if(!in_array(state) && stream.match(closers, false)) {
|
114 |
-
state.scopes.pop();
|
115 |
-
}
|
116 |
-
|
117 |
-
if(in_array(state)) {
|
118 |
-
if(stream.match(/^end/)) {
|
119 |
-
return 'number';
|
120 |
-
}
|
121 |
-
|
122 |
-
}
|
123 |
-
|
124 |
-
if(stream.match(/^=>/)) {
|
125 |
-
return 'operator';
|
126 |
-
}
|
127 |
-
|
128 |
-
|
129 |
-
// Handle Number Literals
|
130 |
-
if (stream.match(/^[0-9\.]/, false)) {
|
131 |
-
var imMatcher = RegExp(/^im\b/);
|
132 |
-
var floatLiteral = false;
|
133 |
-
// Floats
|
134 |
-
if (stream.match(/^\d*\.(?!\.)\d+([ef][\+\-]?\d+)?/i)) { floatLiteral = true; }
|
135 |
-
if (stream.match(/^\d+\.(?!\.)\d*/)) { floatLiteral = true; }
|
136 |
-
if (stream.match(/^\.\d+/)) { floatLiteral = true; }
|
137 |
-
if (floatLiteral) {
|
138 |
-
// Float literals may be "imaginary"
|
139 |
-
stream.match(imMatcher);
|
140 |
-
state.leaving_expr = true;
|
141 |
-
return 'number';
|
142 |
-
}
|
143 |
-
// Integers
|
144 |
-
var intLiteral = false;
|
145 |
-
// Hex
|
146 |
-
if (stream.match(/^0x[0-9a-f]+/i)) { intLiteral = true; }
|
147 |
-
// Binary
|
148 |
-
if (stream.match(/^0b[01]+/i)) { intLiteral = true; }
|
149 |
-
// Octal
|
150 |
-
if (stream.match(/^0o[0-7]+/i)) { intLiteral = true; }
|
151 |
-
// Decimal
|
152 |
-
if (stream.match(/^[1-9]\d*(e[\+\-]?\d+)?/)) {
|
153 |
-
intLiteral = true;
|
154 |
-
}
|
155 |
-
// Zero by itself with no other piece of number.
|
156 |
-
if (stream.match(/^0(?![\dx])/i)) { intLiteral = true; }
|
157 |
-
if (intLiteral) {
|
158 |
-
// Integer literals may be "long"
|
159 |
-
stream.match(imMatcher);
|
160 |
-
state.leaving_expr = true;
|
161 |
-
return 'number';
|
162 |
-
}
|
163 |
-
}
|
164 |
-
|
165 |
-
if(stream.match(/^(::)|(<:)/)) {
|
166 |
-
return 'operator';
|
167 |
-
}
|
168 |
-
|
169 |
-
// Handle symbols
|
170 |
-
if(!leaving_expr && stream.match(symbol)) {
|
171 |
-
return 'string';
|
172 |
-
}
|
173 |
-
|
174 |
-
// Handle operators and Delimiters
|
175 |
-
if (stream.match(operators)) {
|
176 |
-
return 'operator';
|
177 |
-
}
|
178 |
-
|
179 |
-
|
180 |
-
// Handle Strings
|
181 |
-
if (stream.match(stringPrefixes)) {
|
182 |
-
state.tokenize = tokenStringFactory(stream.current());
|
183 |
-
return state.tokenize(stream, state);
|
184 |
-
}
|
185 |
-
|
186 |
-
if (stream.match(macro)) {
|
187 |
-
return 'meta';
|
188 |
-
}
|
189 |
-
|
190 |
-
|
191 |
-
if (stream.match(delimiters)) {
|
192 |
-
return null;
|
193 |
-
}
|
194 |
-
|
195 |
-
if (stream.match(keywords)) {
|
196 |
-
return 'keyword';
|
197 |
-
}
|
198 |
-
|
199 |
-
if (stream.match(builtins)) {
|
200 |
-
return 'builtin';
|
201 |
-
}
|
202 |
-
|
203 |
-
|
204 |
-
if (stream.match(identifiers)) {
|
205 |
-
state.leaving_expr=true;
|
206 |
-
return 'variable';
|
207 |
-
}
|
208 |
-
// Handle non-detected items
|
209 |
-
stream.next();
|
210 |
-
return ERRORCLASS;
|
211 |
-
}
|
212 |
-
|
213 |
-
function tokenStringFactory(delimiter) {
|
214 |
-
while ('rub'.indexOf(delimiter.charAt(0).toLowerCase()) >= 0) {
|
215 |
-
delimiter = delimiter.substr(1);
|
216 |
-
}
|
217 |
-
var singleline = delimiter.length == 1;
|
218 |
-
var OUTCLASS = 'string';
|
219 |
-
|
220 |
-
function tokenString(stream, state) {
|
221 |
-
while (!stream.eol()) {
|
222 |
-
stream.eatWhile(/[^'"\\]/);
|
223 |
-
if (stream.eat('\\')) {
|
224 |
-
stream.next();
|
225 |
-
if (singleline && stream.eol()) {
|
226 |
-
return OUTCLASS;
|
227 |
-
}
|
228 |
-
} else if (stream.match(delimiter)) {
|
229 |
-
state.tokenize = tokenBase;
|
230 |
-
return OUTCLASS;
|
231 |
-
} else {
|
232 |
-
stream.eat(/['"]/);
|
233 |
-
}
|
234 |
-
}
|
235 |
-
if (singleline) {
|
236 |
-
if (parserConf.singleLineStringErrors) {
|
237 |
-
return ERRORCLASS;
|
238 |
-
} else {
|
239 |
-
state.tokenize = tokenBase;
|
240 |
-
}
|
241 |
-
}
|
242 |
-
return OUTCLASS;
|
243 |
-
}
|
244 |
-
tokenString.isString = true;
|
245 |
-
return tokenString;
|
246 |
-
}
|
247 |
-
|
248 |
-
function tokenLexer(stream, state) {
|
249 |
-
var style = state.tokenize(stream, state);
|
250 |
-
var current = stream.current();
|
251 |
-
|
252 |
-
// Handle '.' connected identifiers
|
253 |
-
if (current === '.') {
|
254 |
-
style = stream.match(identifiers, false) ? null : ERRORCLASS;
|
255 |
-
if (style === null && state.lastStyle === 'meta') {
|
256 |
-
// Apply 'meta' style to '.' connected identifiers when
|
257 |
-
// appropriate.
|
258 |
-
style = 'meta';
|
259 |
-
}
|
260 |
-
return style;
|
261 |
-
}
|
262 |
-
|
263 |
-
return style;
|
264 |
-
}
|
265 |
-
|
266 |
-
var external = {
|
267 |
-
startState: function() {
|
268 |
-
return {
|
269 |
-
tokenize: tokenBase,
|
270 |
-
scopes: [],
|
271 |
-
leaving_expr: false
|
272 |
-
};
|
273 |
-
},
|
274 |
-
|
275 |
-
token: function(stream, state) {
|
276 |
-
var style = tokenLexer(stream, state);
|
277 |
-
state.lastStyle = style;
|
278 |
-
return style;
|
279 |
-
},
|
280 |
-
|
281 |
-
indent: function(state, textAfter) {
|
282 |
-
var delta = 0;
|
283 |
-
if(textAfter=="end" || textAfter=="]" || textAfter=="}" || textAfter=="else" || textAfter=="elseif" || textAfter=="catch" || textAfter=="finally") {
|
284 |
-
delta = -1;
|
285 |
-
}
|
286 |
-
return (state.scopes.length + delta) * _conf.indentUnit;
|
287 |
-
},
|
288 |
-
|
289 |
-
lineComment: "#",
|
290 |
-
fold: "indent",
|
291 |
-
electricChars: "edlsifyh]}"
|
292 |
-
};
|
293 |
-
return external;
|
294 |
-
});
|
295 |
-
|
296 |
-
|
297 |
-
CodeMirror.defineMIME("text/x-julia", "julia");
|
298 |
-
|
299 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/livescript/index.html
DELETED
@@ -1,459 +0,0 @@
|
|
1 |
-
<!doctype html>
|
2 |
-
|
3 |
-
<title>CodeMirror: LiveScript mode</title>
|
4 |
-
<meta charset="utf-8"/>
|
5 |
-
<link rel=stylesheet href="../../doc/docs.css">
|
6 |
-
|
7 |
-
<link rel="stylesheet" href="../../lib/codemirror.css">
|
8 |
-
<link rel="stylesheet" href="../../theme/solarized.css">
|
9 |
-
<script src="../../lib/codemirror.js"></script>
|
10 |
-
<script src="livescript.js"></script>
|
11 |
-
<style>.CodeMirror {font-size: 80%;border-top: 1px solid silver; border-bottom: 1px solid silver;}</style>
|
12 |
-
<div id=nav>
|
13 |
-
<a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
14 |
-
|
15 |
-
<ul>
|
16 |
-
<li><a href="../../index.html">Home</a>
|
17 |
-
<li><a href="../../doc/manual.html">Manual</a>
|
18 |
-
<li><a href="https://github.com/codemirror/codemirror">Code</a>
|
19 |
-
</ul>
|
20 |
-
<ul>
|
21 |
-
<li><a href="../index.html">Language modes</a>
|
22 |
-
<li><a class=active href="#">LiveScript</a>
|
23 |
-
</ul>
|
24 |
-
</div>
|
25 |
-
|
26 |
-
<article>
|
27 |
-
<h2>LiveScript mode</h2>
|
28 |
-
<form><textarea id="code" name="code">
|
29 |
-
# LiveScript mode for CodeMirror
|
30 |
-
# The following script, prelude.ls, is used to
|
31 |
-
# demonstrate LiveScript mode for CodeMirror.
|
32 |
-
# https://github.com/gkz/prelude-ls
|
33 |
-
|
34 |
-
export objToFunc = objToFunc = (obj) ->
|
35 |
-
(key) -> obj[key]
|
36 |
-
|
37 |
-
export each = (f, xs) -->
|
38 |
-
if typeof! xs is \Object
|
39 |
-
for , x of xs then f x
|
40 |
-
else
|
41 |
-
for x in xs then f x
|
42 |
-
xs
|
43 |
-
|
44 |
-
export map = (f, xs) -->
|
45 |
-
f = objToFunc f if typeof! f isnt \Function
|
46 |
-
type = typeof! xs
|
47 |
-
if type is \Object
|
48 |
-
{[key, f x] for key, x of xs}
|
49 |
-
else
|
50 |
-
result = [f x for x in xs]
|
51 |
-
if type is \String then result * '' else result
|
52 |
-
|
53 |
-
export filter = (f, xs) -->
|
54 |
-
f = objToFunc f if typeof! f isnt \Function
|
55 |
-
type = typeof! xs
|
56 |
-
if type is \Object
|
57 |
-
{[key, x] for key, x of xs when f x}
|
58 |
-
else
|
59 |
-
result = [x for x in xs when f x]
|
60 |
-
if type is \String then result * '' else result
|
61 |
-
|
62 |
-
export reject = (f, xs) -->
|
63 |
-
f = objToFunc f if typeof! f isnt \Function
|
64 |
-
type = typeof! xs
|
65 |
-
if type is \Object
|
66 |
-
{[key, x] for key, x of xs when not f x}
|
67 |
-
else
|
68 |
-
result = [x for x in xs when not f x]
|
69 |
-
if type is \String then result * '' else result
|
70 |
-
|
71 |
-
export partition = (f, xs) -->
|
72 |
-
f = objToFunc f if typeof! f isnt \Function
|
73 |
-
type = typeof! xs
|
74 |
-
if type is \Object
|
75 |
-
passed = {}
|
76 |
-
failed = {}
|
77 |
-
for key, x of xs
|
78 |
-
(if f x then passed else failed)[key] = x
|
79 |
-
else
|
80 |
-
passed = []
|
81 |
-
failed = []
|
82 |
-
for x in xs
|
83 |
-
(if f x then passed else failed)push x
|
84 |
-
if type is \String
|
85 |
-
passed *= ''
|
86 |
-
failed *= ''
|
87 |
-
[passed, failed]
|
88 |
-
|
89 |
-
export find = (f, xs) -->
|
90 |
-
f = objToFunc f if typeof! f isnt \Function
|
91 |
-
if typeof! xs is \Object
|
92 |
-
for , x of xs when f x then return x
|
93 |
-
else
|
94 |
-
for x in xs when f x then return x
|
95 |
-
void
|
96 |
-
|
97 |
-
export head = export first = (xs) ->
|
98 |
-
return void if not xs.length
|
99 |
-
xs.0
|
100 |
-
|
101 |
-
export tail = (xs) ->
|
102 |
-
return void if not xs.length
|
103 |
-
xs.slice 1
|
104 |
-
|
105 |
-
export last = (xs) ->
|
106 |
-
return void if not xs.length
|
107 |
-
xs[*-1]
|
108 |
-
|
109 |
-
export initial = (xs) ->
|
110 |
-
return void if not xs.length
|
111 |
-
xs.slice 0 xs.length - 1
|
112 |
-
|
113 |
-
export empty = (xs) ->
|
114 |
-
if typeof! xs is \Object
|
115 |
-
for x of xs then return false
|
116 |
-
return yes
|
117 |
-
not xs.length
|
118 |
-
|
119 |
-
export values = (obj) ->
|
120 |
-
[x for , x of obj]
|
121 |
-
|
122 |
-
export keys = (obj) ->
|
123 |
-
[x for x of obj]
|
124 |
-
|
125 |
-
export len = (xs) ->
|
126 |
-
xs = values xs if typeof! xs is \Object
|
127 |
-
xs.length
|
128 |
-
|
129 |
-
export cons = (x, xs) -->
|
130 |
-
if typeof! xs is \String then x + xs else [x] ++ xs
|
131 |
-
|
132 |
-
export append = (xs, ys) -->
|
133 |
-
if typeof! ys is \String then xs + ys else xs ++ ys
|
134 |
-
|
135 |
-
export join = (sep, xs) -->
|
136 |
-
xs = values xs if typeof! xs is \Object
|
137 |
-
xs.join sep
|
138 |
-
|
139 |
-
export reverse = (xs) ->
|
140 |
-
if typeof! xs is \String
|
141 |
-
then (xs / '')reverse! * ''
|
142 |
-
else xs.slice!reverse!
|
143 |
-
|
144 |
-
export fold = export foldl = (f, memo, xs) -->
|
145 |
-
if typeof! xs is \Object
|
146 |
-
for , x of xs then memo = f memo, x
|
147 |
-
else
|
148 |
-
for x in xs then memo = f memo, x
|
149 |
-
memo
|
150 |
-
|
151 |
-
export fold1 = export foldl1 = (f, xs) --> fold f, xs.0, xs.slice 1
|
152 |
-
|
153 |
-
export foldr = (f, memo, xs) --> fold f, memo, xs.slice!reverse!
|
154 |
-
|
155 |
-
export foldr1 = (f, xs) -->
|
156 |
-
xs.=slice!reverse!
|
157 |
-
fold f, xs.0, xs.slice 1
|
158 |
-
|
159 |
-
export unfoldr = export unfold = (f, b) -->
|
160 |
-
if (f b)?
|
161 |
-
[that.0] ++ unfoldr f, that.1
|
162 |
-
else
|
163 |
-
[]
|
164 |
-
|
165 |
-
export andList = (xs) ->
|
166 |
-
for x in xs when not x
|
167 |
-
return false
|
168 |
-
true
|
169 |
-
|
170 |
-
export orList = (xs) ->
|
171 |
-
for x in xs when x
|
172 |
-
return true
|
173 |
-
false
|
174 |
-
|
175 |
-
export any = (f, xs) -->
|
176 |
-
f = objToFunc f if typeof! f isnt \Function
|
177 |
-
for x in xs when f x
|
178 |
-
return yes
|
179 |
-
no
|
180 |
-
|
181 |
-
export all = (f, xs) -->
|
182 |
-
f = objToFunc f if typeof! f isnt \Function
|
183 |
-
for x in xs when not f x
|
184 |
-
return no
|
185 |
-
yes
|
186 |
-
|
187 |
-
export unique = (xs) ->
|
188 |
-
result = []
|
189 |
-
if typeof! xs is \Object
|
190 |
-
for , x of xs when x not in result then result.push x
|
191 |
-
else
|
192 |
-
for x in xs when x not in result then result.push x
|
193 |
-
if typeof! xs is \String then result * '' else result
|
194 |
-
|
195 |
-
export sort = (xs) ->
|
196 |
-
xs.concat!sort (x, y) ->
|
197 |
-
| x > y => 1
|
198 |
-
| x < y => -1
|
199 |
-
| _ => 0
|
200 |
-
|
201 |
-
export sortBy = (f, xs) -->
|
202 |
-
return [] unless xs.length
|
203 |
-
xs.concat!sort f
|
204 |
-
|
205 |
-
export compare = (f, x, y) -->
|
206 |
-
| (f x) > (f y) => 1
|
207 |
-
| (f x) < (f y) => -1
|
208 |
-
| otherwise => 0
|
209 |
-
|
210 |
-
export sum = (xs) ->
|
211 |
-
result = 0
|
212 |
-
if typeof! xs is \Object
|
213 |
-
for , x of xs then result += x
|
214 |
-
else
|
215 |
-
for x in xs then result += x
|
216 |
-
result
|
217 |
-
|
218 |
-
export product = (xs) ->
|
219 |
-
result = 1
|
220 |
-
if typeof! xs is \Object
|
221 |
-
for , x of xs then result *= x
|
222 |
-
else
|
223 |
-
for x in xs then result *= x
|
224 |
-
result
|
225 |
-
|
226 |
-
export mean = export average = (xs) -> (sum xs) / len xs
|
227 |
-
|
228 |
-
export concat = (xss) -> fold append, [], xss
|
229 |
-
|
230 |
-
export concatMap = (f, xs) --> fold ((memo, x) -> append memo, f x), [], xs
|
231 |
-
|
232 |
-
export listToObj = (xs) ->
|
233 |
-
{[x.0, x.1] for x in xs}
|
234 |
-
|
235 |
-
export maximum = (xs) -> fold1 (>?), xs
|
236 |
-
|
237 |
-
export minimum = (xs) -> fold1 (<?), xs
|
238 |
-
|
239 |
-
export scan = export scanl = (f, memo, xs) -->
|
240 |
-
last = memo
|
241 |
-
if typeof! xs is \Object
|
242 |
-
then [memo] ++ [last = f last, x for , x of xs]
|
243 |
-
else [memo] ++ [last = f last, x for x in xs]
|
244 |
-
|
245 |
-
export scan1 = export scanl1 = (f, xs) --> scan f, xs.0, xs.slice 1
|
246 |
-
|
247 |
-
export scanr = (f, memo, xs) -->
|
248 |
-
xs.=slice!reverse!
|
249 |
-
scan f, memo, xs .reverse!
|
250 |
-
|
251 |
-
export scanr1 = (f, xs) -->
|
252 |
-
xs.=slice!reverse!
|
253 |
-
scan f, xs.0, xs.slice 1 .reverse!
|
254 |
-
|
255 |
-
export replicate = (n, x) -->
|
256 |
-
result = []
|
257 |
-
i = 0
|
258 |
-
while i < n, ++i then result.push x
|
259 |
-
result
|
260 |
-
|
261 |
-
export take = (n, xs) -->
|
262 |
-
| n <= 0
|
263 |
-
if typeof! xs is \String then '' else []
|
264 |
-
| not xs.length => xs
|
265 |
-
| otherwise => xs.slice 0, n
|
266 |
-
|
267 |
-
export drop = (n, xs) -->
|
268 |
-
| n <= 0 => xs
|
269 |
-
| not xs.length => xs
|
270 |
-
| otherwise => xs.slice n
|
271 |
-
|
272 |
-
export splitAt = (n, xs) --> [(take n, xs), (drop n, xs)]
|
273 |
-
|
274 |
-
export takeWhile = (p, xs) -->
|
275 |
-
return xs if not xs.length
|
276 |
-
p = objToFunc p if typeof! p isnt \Function
|
277 |
-
result = []
|
278 |
-
for x in xs
|
279 |
-
break if not p x
|
280 |
-
result.push x
|
281 |
-
if typeof! xs is \String then result * '' else result
|
282 |
-
|
283 |
-
export dropWhile = (p, xs) -->
|
284 |
-
return xs if not xs.length
|
285 |
-
p = objToFunc p if typeof! p isnt \Function
|
286 |
-
i = 0
|
287 |
-
for x in xs
|
288 |
-
break if not p x
|
289 |
-
++i
|
290 |
-
drop i, xs
|
291 |
-
|
292 |
-
export span = (p, xs) --> [(takeWhile p, xs), (dropWhile p, xs)]
|
293 |
-
|
294 |
-
export breakIt = (p, xs) --> span (not) << p, xs
|
295 |
-
|
296 |
-
export zip = (xs, ys) -->
|
297 |
-
result = []
|
298 |
-
for zs, i in [xs, ys]
|
299 |
-
for z, j in zs
|
300 |
-
result.push [] if i is 0
|
301 |
-
result[j]?push z
|
302 |
-
result
|
303 |
-
|
304 |
-
export zipWith = (f,xs, ys) -->
|
305 |
-
f = objToFunc f if typeof! f isnt \Function
|
306 |
-
if not xs.length or not ys.length
|
307 |
-
[]
|
308 |
-
else
|
309 |
-
[f.apply this, zs for zs in zip.call this, xs, ys]
|
310 |
-
|
311 |
-
export zipAll = (...xss) ->
|
312 |
-
result = []
|
313 |
-
for xs, i in xss
|
314 |
-
for x, j in xs
|
315 |
-
result.push [] if i is 0
|
316 |
-
result[j]?push x
|
317 |
-
result
|
318 |
-
|
319 |
-
export zipAllWith = (f, ...xss) ->
|
320 |
-
f = objToFunc f if typeof! f isnt \Function
|
321 |
-
if not xss.0.length or not xss.1.length
|
322 |
-
[]
|
323 |
-
else
|
324 |
-
[f.apply this, xs for xs in zipAll.apply this, xss]
|
325 |
-
|
326 |
-
export compose = (...funcs) ->
|
327 |
-
->
|
328 |
-
args = arguments
|
329 |
-
for f in funcs
|
330 |
-
args = [f.apply this, args]
|
331 |
-
args.0
|
332 |
-
|
333 |
-
export curry = (f) ->
|
334 |
-
curry$ f # using util method curry$ from livescript
|
335 |
-
|
336 |
-
export id = (x) -> x
|
337 |
-
|
338 |
-
export flip = (f, x, y) --> f y, x
|
339 |
-
|
340 |
-
export fix = (f) ->
|
341 |
-
( (g, x) -> -> f(g g) ...arguments ) do
|
342 |
-
(g, x) -> -> f(g g) ...arguments
|
343 |
-
|
344 |
-
export lines = (str) ->
|
345 |
-
return [] if not str.length
|
346 |
-
str / \\n
|
347 |
-
|
348 |
-
export unlines = (strs) -> strs * \\n
|
349 |
-
|
350 |
-
export words = (str) ->
|
351 |
-
return [] if not str.length
|
352 |
-
str / /[ ]+/
|
353 |
-
|
354 |
-
export unwords = (strs) -> strs * ' '
|
355 |
-
|
356 |
-
export max = (>?)
|
357 |
-
|
358 |
-
export min = (<?)
|
359 |
-
|
360 |
-
export negate = (x) -> -x
|
361 |
-
|
362 |
-
export abs = Math.abs
|
363 |
-
|
364 |
-
export signum = (x) ->
|
365 |
-
| x < 0 => -1
|
366 |
-
| x > 0 => 1
|
367 |
-
| otherwise => 0
|
368 |
-
|
369 |
-
export quot = (x, y) --> ~~(x / y)
|
370 |
-
|
371 |
-
export rem = (%)
|
372 |
-
|
373 |
-
export div = (x, y) --> Math.floor x / y
|
374 |
-
|
375 |
-
export mod = (%%)
|
376 |
-
|
377 |
-
export recip = (1 /)
|
378 |
-
|
379 |
-
export pi = Math.PI
|
380 |
-
|
381 |
-
export tau = pi * 2
|
382 |
-
|
383 |
-
export exp = Math.exp
|
384 |
-
|
385 |
-
export sqrt = Math.sqrt
|
386 |
-
|
387 |
-
# changed from log as log is a
|
388 |
-
# common function for logging things
|
389 |
-
export ln = Math.log
|
390 |
-
|
391 |
-
export pow = (^)
|
392 |
-
|
393 |
-
export sin = Math.sin
|
394 |
-
|
395 |
-
export tan = Math.tan
|
396 |
-
|
397 |
-
export cos = Math.cos
|
398 |
-
|
399 |
-
export asin = Math.asin
|
400 |
-
|
401 |
-
export acos = Math.acos
|
402 |
-
|
403 |
-
export atan = Math.atan
|
404 |
-
|
405 |
-
export atan2 = (x, y) --> Math.atan2 x, y
|
406 |
-
|
407 |
-
# sinh
|
408 |
-
# tanh
|
409 |
-
# cosh
|
410 |
-
# asinh
|
411 |
-
# atanh
|
412 |
-
# acosh
|
413 |
-
|
414 |
-
export truncate = (x) -> ~~x
|
415 |
-
|
416 |
-
export round = Math.round
|
417 |
-
|
418 |
-
export ceiling = Math.ceil
|
419 |
-
|
420 |
-
export floor = Math.floor
|
421 |
-
|
422 |
-
export isItNaN = (x) -> x isnt x
|
423 |
-
|
424 |
-
export even = (x) -> x % 2 == 0
|
425 |
-
|
426 |
-
export odd = (x) -> x % 2 != 0
|
427 |
-
|
428 |
-
export gcd = (x, y) -->
|
429 |
-
x = Math.abs x
|
430 |
-
y = Math.abs y
|
431 |
-
until y is 0
|
432 |
-
z = x % y
|
433 |
-
x = y
|
434 |
-
y = z
|
435 |
-
x
|
436 |
-
|
437 |
-
export lcm = (x, y) -->
|
438 |
-
Math.abs Math.floor (x / (gcd x, y) * y)
|
439 |
-
|
440 |
-
# meta
|
441 |
-
export installPrelude = !(target) ->
|
442 |
-
unless target.prelude?isInstalled
|
443 |
-
target <<< out$ # using out$ generated by livescript
|
444 |
-
target <<< target.prelude.isInstalled = true
|
445 |
-
|
446 |
-
export prelude = out$
|
447 |
-
</textarea></form>
|
448 |
-
<script>
|
449 |
-
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
|
450 |
-
theme: "solarized light",
|
451 |
-
lineNumbers: true
|
452 |
-
});
|
453 |
-
</script>
|
454 |
-
|
455 |
-
<p><strong>MIME types defined:</strong> <code>text/x-livescript</code>.</p>
|
456 |
-
|
457 |
-
<p>The LiveScript mode was written by Kenneth Bentley.</p>
|
458 |
-
|
459 |
-
</article>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/livescript/livescript.js
DELETED
@@ -1,280 +0,0 @@
|
|
1 |
-
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
2 |
-
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
3 |
-
|
4 |
-
/**
|
5 |
-
* Link to the project's GitHub page:
|
6 |
-
* https://github.com/duralog/CodeMirror
|
7 |
-
*/
|
8 |
-
|
9 |
-
(function(mod) {
|
10 |
-
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
11 |
-
mod(require("../../lib/codemirror"));
|
12 |
-
else if (typeof define == "function" && define.amd) // AMD
|
13 |
-
define(["../../lib/codemirror"], mod);
|
14 |
-
else // Plain browser env
|
15 |
-
mod(CodeMirror);
|
16 |
-
})(function(CodeMirror) {
|
17 |
-
"use strict";
|
18 |
-
|
19 |
-
CodeMirror.defineMode('livescript', function(){
|
20 |
-
var tokenBase = function(stream, state) {
|
21 |
-
var next_rule = state.next || "start";
|
22 |
-
if (next_rule) {
|
23 |
-
state.next = state.next;
|
24 |
-
var nr = Rules[next_rule];
|
25 |
-
if (nr.splice) {
|
26 |
-
for (var i$ = 0; i$ < nr.length; ++i$) {
|
27 |
-
var r = nr[i$];
|
28 |
-
if (r.regex && stream.match(r.regex)) {
|
29 |
-
state.next = r.next || state.next;
|
30 |
-
return r.token;
|
31 |
-
}
|
32 |
-
}
|
33 |
-
stream.next();
|
34 |
-
return 'error';
|
35 |
-
}
|
36 |
-
if (stream.match(r = Rules[next_rule])) {
|
37 |
-
if (r.regex && stream.match(r.regex)) {
|
38 |
-
state.next = r.next;
|
39 |
-
return r.token;
|
40 |
-
} else {
|
41 |
-
stream.next();
|
42 |
-
return 'error';
|
43 |
-
}
|
44 |
-
}
|
45 |
-
}
|
46 |
-
stream.next();
|
47 |
-
return 'error';
|
48 |
-
};
|
49 |
-
var external = {
|
50 |
-
startState: function(){
|
51 |
-
return {
|
52 |
-
next: 'start',
|
53 |
-
lastToken: null
|
54 |
-
};
|
55 |
-
},
|
56 |
-
token: function(stream, state){
|
57 |
-
while (stream.pos == stream.start)
|
58 |
-
var style = tokenBase(stream, state);
|
59 |
-
state.lastToken = {
|
60 |
-
style: style,
|
61 |
-
indent: stream.indentation(),
|
62 |
-
content: stream.current()
|
63 |
-
};
|
64 |
-
return style.replace(/\./g, ' ');
|
65 |
-
},
|
66 |
-
indent: function(state){
|
67 |
-
var indentation = state.lastToken.indent;
|
68 |
-
if (state.lastToken.content.match(indenter)) {
|
69 |
-
indentation += 2;
|
70 |
-
}
|
71 |
-
return indentation;
|
72 |
-
}
|
73 |
-
};
|
74 |
-
return external;
|
75 |
-
});
|
76 |
-
|
77 |
-
var identifier = '(?![\\d\\s])[$\\w\\xAA-\\uFFDC](?:(?!\\s)[$\\w\\xAA-\\uFFDC]|-[A-Za-z])*';
|
78 |
-
var indenter = RegExp('(?:[({[=:]|[-~]>|\\b(?:e(?:lse|xport)|d(?:o|efault)|t(?:ry|hen)|finally|import(?:\\s*all)?|const|var|let|new|catch(?:\\s*' + identifier + ')?))\\s*$');
|
79 |
-
var keywordend = '(?![$\\w]|-[A-Za-z]|\\s*:(?![:=]))';
|
80 |
-
var stringfill = {
|
81 |
-
token: 'string',
|
82 |
-
regex: '.+'
|
83 |
-
};
|
84 |
-
var Rules = {
|
85 |
-
start: [
|
86 |
-
{
|
87 |
-
token: 'comment.doc',
|
88 |
-
regex: '/\\*',
|
89 |
-
next: 'comment'
|
90 |
-
}, {
|
91 |
-
token: 'comment',
|
92 |
-
regex: '#.*'
|
93 |
-
}, {
|
94 |
-
token: 'keyword',
|
95 |
-
regex: '(?:t(?:h(?:is|row|en)|ry|ypeof!?)|c(?:on(?:tinue|st)|a(?:se|tch)|lass)|i(?:n(?:stanceof)?|mp(?:ort(?:\\s+all)?|lements)|[fs])|d(?:e(?:fault|lete|bugger)|o)|f(?:or(?:\\s+own)?|inally|unction)|s(?:uper|witch)|e(?:lse|x(?:tends|port)|val)|a(?:nd|rguments)|n(?:ew|ot)|un(?:less|til)|w(?:hile|ith)|o[fr]|return|break|let|var|loop)' + keywordend
|
96 |
-
}, {
|
97 |
-
token: 'constant.language',
|
98 |
-
regex: '(?:true|false|yes|no|on|off|null|void|undefined)' + keywordend
|
99 |
-
}, {
|
100 |
-
token: 'invalid.illegal',
|
101 |
-
regex: '(?:p(?:ackage|r(?:ivate|otected)|ublic)|i(?:mplements|nterface)|enum|static|yield)' + keywordend
|
102 |
-
}, {
|
103 |
-
token: 'language.support.class',
|
104 |
-
regex: '(?:R(?:e(?:gExp|ferenceError)|angeError)|S(?:tring|yntaxError)|E(?:rror|valError)|Array|Boolean|Date|Function|Number|Object|TypeError|URIError)' + keywordend
|
105 |
-
}, {
|
106 |
-
token: 'language.support.function',
|
107 |
-
regex: '(?:is(?:NaN|Finite)|parse(?:Int|Float)|Math|JSON|(?:en|de)codeURI(?:Component)?)' + keywordend
|
108 |
-
}, {
|
109 |
-
token: 'variable.language',
|
110 |
-
regex: '(?:t(?:hat|il|o)|f(?:rom|allthrough)|it|by|e)' + keywordend
|
111 |
-
}, {
|
112 |
-
token: 'identifier',
|
113 |
-
regex: identifier + '\\s*:(?![:=])'
|
114 |
-
}, {
|
115 |
-
token: 'variable',
|
116 |
-
regex: identifier
|
117 |
-
}, {
|
118 |
-
token: 'keyword.operator',
|
119 |
-
regex: '(?:\\.{3}|\\s+\\?)'
|
120 |
-
}, {
|
121 |
-
token: 'keyword.variable',
|
122 |
-
regex: '(?:@+|::|\\.\\.)',
|
123 |
-
next: 'key'
|
124 |
-
}, {
|
125 |
-
token: 'keyword.operator',
|
126 |
-
regex: '\\.\\s*',
|
127 |
-
next: 'key'
|
128 |
-
}, {
|
129 |
-
token: 'string',
|
130 |
-
regex: '\\\\\\S[^\\s,;)}\\]]*'
|
131 |
-
}, {
|
132 |
-
token: 'string.doc',
|
133 |
-
regex: '\'\'\'',
|
134 |
-
next: 'qdoc'
|
135 |
-
}, {
|
136 |
-
token: 'string.doc',
|
137 |
-
regex: '"""',
|
138 |
-
next: 'qqdoc'
|
139 |
-
}, {
|
140 |
-
token: 'string',
|
141 |
-
regex: '\'',
|
142 |
-
next: 'qstring'
|
143 |
-
}, {
|
144 |
-
token: 'string',
|
145 |
-
regex: '"',
|
146 |
-
next: 'qqstring'
|
147 |
-
}, {
|
148 |
-
token: 'string',
|
149 |
-
regex: '`',
|
150 |
-
next: 'js'
|
151 |
-
}, {
|
152 |
-
token: 'string',
|
153 |
-
regex: '<\\[',
|
154 |
-
next: 'words'
|
155 |
-
}, {
|
156 |
-
token: 'string.regex',
|
157 |
-
regex: '//',
|
158 |
-
next: 'heregex'
|
159 |
-
}, {
|
160 |
-
token: 'string.regex',
|
161 |
-
regex: '\\/(?:[^[\\/\\n\\\\]*(?:(?:\\\\.|\\[[^\\]\\n\\\\]*(?:\\\\.[^\\]\\n\\\\]*)*\\])[^[\\/\\n\\\\]*)*)\\/[gimy$]{0,4}',
|
162 |
-
next: 'key'
|
163 |
-
}, {
|
164 |
-
token: 'constant.numeric',
|
165 |
-
regex: '(?:0x[\\da-fA-F][\\da-fA-F_]*|(?:[2-9]|[12]\\d|3[0-6])r[\\da-zA-Z][\\da-zA-Z_]*|(?:\\d[\\d_]*(?:\\.\\d[\\d_]*)?|\\.\\d[\\d_]*)(?:e[+-]?\\d[\\d_]*)?[\\w$]*)'
|
166 |
-
}, {
|
167 |
-
token: 'lparen',
|
168 |
-
regex: '[({[]'
|
169 |
-
}, {
|
170 |
-
token: 'rparen',
|
171 |
-
regex: '[)}\\]]',
|
172 |
-
next: 'key'
|
173 |
-
}, {
|
174 |
-
token: 'keyword.operator',
|
175 |
-
regex: '\\S+'
|
176 |
-
}, {
|
177 |
-
token: 'text',
|
178 |
-
regex: '\\s+'
|
179 |
-
}
|
180 |
-
],
|
181 |
-
heregex: [
|
182 |
-
{
|
183 |
-
token: 'string.regex',
|
184 |
-
regex: '.*?//[gimy$?]{0,4}',
|
185 |
-
next: 'start'
|
186 |
-
}, {
|
187 |
-
token: 'string.regex',
|
188 |
-
regex: '\\s*#{'
|
189 |
-
}, {
|
190 |
-
token: 'comment.regex',
|
191 |
-
regex: '\\s+(?:#.*)?'
|
192 |
-
}, {
|
193 |
-
token: 'string.regex',
|
194 |
-
regex: '\\S+'
|
195 |
-
}
|
196 |
-
],
|
197 |
-
key: [
|
198 |
-
{
|
199 |
-
token: 'keyword.operator',
|
200 |
-
regex: '[.?@!]+'
|
201 |
-
}, {
|
202 |
-
token: 'identifier',
|
203 |
-
regex: identifier,
|
204 |
-
next: 'start'
|
205 |
-
}, {
|
206 |
-
token: 'text',
|
207 |
-
regex: '',
|
208 |
-
next: 'start'
|
209 |
-
}
|
210 |
-
],
|
211 |
-
comment: [
|
212 |
-
{
|
213 |
-
token: 'comment.doc',
|
214 |
-
regex: '.*?\\*/',
|
215 |
-
next: 'start'
|
216 |
-
}, {
|
217 |
-
token: 'comment.doc',
|
218 |
-
regex: '.+'
|
219 |
-
}
|
220 |
-
],
|
221 |
-
qdoc: [
|
222 |
-
{
|
223 |
-
token: 'string',
|
224 |
-
regex: ".*?'''",
|
225 |
-
next: 'key'
|
226 |
-
}, stringfill
|
227 |
-
],
|
228 |
-
qqdoc: [
|
229 |
-
{
|
230 |
-
token: 'string',
|
231 |
-
regex: '.*?"""',
|
232 |
-
next: 'key'
|
233 |
-
}, stringfill
|
234 |
-
],
|
235 |
-
qstring: [
|
236 |
-
{
|
237 |
-
token: 'string',
|
238 |
-
regex: '[^\\\\\']*(?:\\\\.[^\\\\\']*)*\'',
|
239 |
-
next: 'key'
|
240 |
-
}, stringfill
|
241 |
-
],
|
242 |
-
qqstring: [
|
243 |
-
{
|
244 |
-
token: 'string',
|
245 |
-
regex: '[^\\\\"]*(?:\\\\.[^\\\\"]*)*"',
|
246 |
-
next: 'key'
|
247 |
-
}, stringfill
|
248 |
-
],
|
249 |
-
js: [
|
250 |
-
{
|
251 |
-
token: 'string',
|
252 |
-
regex: '[^\\\\`]*(?:\\\\.[^\\\\`]*)*`',
|
253 |
-
next: 'key'
|
254 |
-
}, stringfill
|
255 |
-
],
|
256 |
-
words: [
|
257 |
-
{
|
258 |
-
token: 'string',
|
259 |
-
regex: '.*?\\]>',
|
260 |
-
next: 'key'
|
261 |
-
}, stringfill
|
262 |
-
]
|
263 |
-
};
|
264 |
-
for (var idx in Rules) {
|
265 |
-
var r = Rules[idx];
|
266 |
-
if (r.splice) {
|
267 |
-
for (var i = 0, len = r.length; i < len; ++i) {
|
268 |
-
var rr = r[i];
|
269 |
-
if (typeof rr.regex === 'string') {
|
270 |
-
Rules[idx][i].regex = new RegExp('^' + rr.regex);
|
271 |
-
}
|
272 |
-
}
|
273 |
-
} else if (typeof rr.regex === 'string') {
|
274 |
-
Rules[idx].regex = new RegExp('^' + r.regex);
|
275 |
-
}
|
276 |
-
}
|
277 |
-
|
278 |
-
CodeMirror.defineMIME('text/x-livescript', 'livescript');
|
279 |
-
|
280 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/lua/index.html
DELETED
@@ -1,85 +0,0 @@
|
|
1 |
-
<!doctype html>
|
2 |
-
|
3 |
-
<title>CodeMirror: Lua mode</title>
|
4 |
-
<meta charset="utf-8"/>
|
5 |
-
<link rel=stylesheet href="../../doc/docs.css">
|
6 |
-
|
7 |
-
<link rel="stylesheet" href="../../lib/codemirror.css">
|
8 |
-
<link rel="stylesheet" href="../../theme/neat.css">
|
9 |
-
<script src="../../addon/edit/matchbrackets.js"></script>
|
10 |
-
<script src="../../lib/codemirror.js"></script>
|
11 |
-
<script src="lua.js"></script>
|
12 |
-
<style>.CodeMirror {border: 1px solid black;}</style>
|
13 |
-
<div id=nav>
|
14 |
-
<a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
15 |
-
|
16 |
-
<ul>
|
17 |
-
<li><a href="../../index.html">Home</a>
|
18 |
-
<li><a href="../../doc/manual.html">Manual</a>
|
19 |
-
<li><a href="https://github.com/codemirror/codemirror">Code</a>
|
20 |
-
</ul>
|
21 |
-
<ul>
|
22 |
-
<li><a href="../index.html">Language modes</a>
|
23 |
-
<li><a class=active href="#">Lua</a>
|
24 |
-
</ul>
|
25 |
-
</div>
|
26 |
-
|
27 |
-
<article>
|
28 |
-
<h2>Lua mode</h2>
|
29 |
-
<form><textarea id="code" name="code">
|
30 |
-
--[[
|
31 |
-
example useless code to show lua syntax highlighting
|
32 |
-
this is multiline comment
|
33 |
-
]]
|
34 |
-
|
35 |
-
function blahblahblah(x)
|
36 |
-
|
37 |
-
local table = {
|
38 |
-
"asd" = 123,
|
39 |
-
"x" = 0.34,
|
40 |
-
}
|
41 |
-
if x ~= 3 then
|
42 |
-
print( x )
|
43 |
-
elseif x == "string"
|
44 |
-
my_custom_function( 0x34 )
|
45 |
-
else
|
46 |
-
unknown_function( "some string" )
|
47 |
-
end
|
48 |
-
|
49 |
-
--single line comment
|
50 |
-
|
51 |
-
end
|
52 |
-
|
53 |
-
function blablabla3()
|
54 |
-
|
55 |
-
for k,v in ipairs( table ) do
|
56 |
-
--abcde..
|
57 |
-
y=[=[
|
58 |
-
x=[[
|
59 |
-
x is a multi line string
|
60 |
-
]]
|
61 |
-
but its definition is iside a highest level string!
|
62 |
-
]=]
|
63 |
-
print(" \"\" ")
|
64 |
-
|
65 |
-
s = math.sin( x )
|
66 |
-
end
|
67 |
-
|
68 |
-
end
|
69 |
-
</textarea></form>
|
70 |
-
<script>
|
71 |
-
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
|
72 |
-
matchBrackets: true,
|
73 |
-
theme: "neat"
|
74 |
-
});
|
75 |
-
</script>
|
76 |
-
|
77 |
-
<p>Loosely based on Franciszek
|
78 |
-
Wawrzak's <a href="http://codemirror.net/1/contrib/lua">CodeMirror
|
79 |
-
1 mode</a>. One configuration parameter is
|
80 |
-
supported, <code>specials</code>, to which you can provide an
|
81 |
-
array of strings to have those identifiers highlighted with
|
82 |
-
the <code>lua-special</code> style.</p>
|
83 |
-
<p><strong>MIME types defined:</strong> <code>text/x-lua</code>.</p>
|
84 |
-
|
85 |
-
</article>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/lua/lua.js
DELETED
@@ -1,159 +0,0 @@
|
|
1 |
-
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
2 |
-
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
3 |
-
|
4 |
-
// LUA mode. Ported to CodeMirror 2 from Franciszek Wawrzak's
|
5 |
-
// CodeMirror 1 mode.
|
6 |
-
// highlights keywords, strings, comments (no leveling supported! ("[==[")), tokens, basic indenting
|
7 |
-
|
8 |
-
(function(mod) {
|
9 |
-
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
10 |
-
mod(require("../../lib/codemirror"));
|
11 |
-
else if (typeof define == "function" && define.amd) // AMD
|
12 |
-
define(["../../lib/codemirror"], mod);
|
13 |
-
else // Plain browser env
|
14 |
-
mod(CodeMirror);
|
15 |
-
})(function(CodeMirror) {
|
16 |
-
"use strict";
|
17 |
-
|
18 |
-
CodeMirror.defineMode("lua", function(config, parserConfig) {
|
19 |
-
var indentUnit = config.indentUnit;
|
20 |
-
|
21 |
-
function prefixRE(words) {
|
22 |
-
return new RegExp("^(?:" + words.join("|") + ")", "i");
|
23 |
-
}
|
24 |
-
function wordRE(words) {
|
25 |
-
return new RegExp("^(?:" + words.join("|") + ")$", "i");
|
26 |
-
}
|
27 |
-
var specials = wordRE(parserConfig.specials || []);
|
28 |
-
|
29 |
-
// long list of standard functions from lua manual
|
30 |
-
var builtins = wordRE([
|
31 |
-
"_G","_VERSION","assert","collectgarbage","dofile","error","getfenv","getmetatable","ipairs","load",
|
32 |
-
"loadfile","loadstring","module","next","pairs","pcall","print","rawequal","rawget","rawset","require",
|
33 |
-
"select","setfenv","setmetatable","tonumber","tostring","type","unpack","xpcall",
|
34 |
-
|
35 |
-
"coroutine.create","coroutine.resume","coroutine.running","coroutine.status","coroutine.wrap","coroutine.yield",
|
36 |
-
|
37 |
-
"debug.debug","debug.getfenv","debug.gethook","debug.getinfo","debug.getlocal","debug.getmetatable",
|
38 |
-
"debug.getregistry","debug.getupvalue","debug.setfenv","debug.sethook","debug.setlocal","debug.setmetatable",
|
39 |
-
"debug.setupvalue","debug.traceback",
|
40 |
-
|
41 |
-
"close","flush","lines","read","seek","setvbuf","write",
|
42 |
-
|
43 |
-
"io.close","io.flush","io.input","io.lines","io.open","io.output","io.popen","io.read","io.stderr","io.stdin",
|
44 |
-
"io.stdout","io.tmpfile","io.type","io.write",
|
45 |
-
|
46 |
-
"math.abs","math.acos","math.asin","math.atan","math.atan2","math.ceil","math.cos","math.cosh","math.deg",
|
47 |
-
"math.exp","math.floor","math.fmod","math.frexp","math.huge","math.ldexp","math.log","math.log10","math.max",
|
48 |
-
"math.min","math.modf","math.pi","math.pow","math.rad","math.random","math.randomseed","math.sin","math.sinh",
|
49 |
-
"math.sqrt","math.tan","math.tanh",
|
50 |
-
|
51 |
-
"os.clock","os.date","os.difftime","os.execute","os.exit","os.getenv","os.remove","os.rename","os.setlocale",
|
52 |
-
"os.time","os.tmpname",
|
53 |
-
|
54 |
-
"package.cpath","package.loaded","package.loaders","package.loadlib","package.path","package.preload",
|
55 |
-
"package.seeall",
|
56 |
-
|
57 |
-
"string.byte","string.char","string.dump","string.find","string.format","string.gmatch","string.gsub",
|
58 |
-
"string.len","string.lower","string.match","string.rep","string.reverse","string.sub","string.upper",
|
59 |
-
|
60 |
-
"table.concat","table.insert","table.maxn","table.remove","table.sort"
|
61 |
-
]);
|
62 |
-
var keywords = wordRE(["and","break","elseif","false","nil","not","or","return",
|
63 |
-
"true","function", "end", "if", "then", "else", "do",
|
64 |
-
"while", "repeat", "until", "for", "in", "local" ]);
|
65 |
-
|
66 |
-
var indentTokens = wordRE(["function", "if","repeat","do", "\\(", "{"]);
|
67 |
-
var dedentTokens = wordRE(["end", "until", "\\)", "}"]);
|
68 |
-
var dedentPartial = prefixRE(["end", "until", "\\)", "}", "else", "elseif"]);
|
69 |
-
|
70 |
-
function readBracket(stream) {
|
71 |
-
var level = 0;
|
72 |
-
while (stream.eat("=")) ++level;
|
73 |
-
stream.eat("[");
|
74 |
-
return level;
|
75 |
-
}
|
76 |
-
|
77 |
-
function normal(stream, state) {
|
78 |
-
var ch = stream.next();
|
79 |
-
if (ch == "-" && stream.eat("-")) {
|
80 |
-
if (stream.eat("[") && stream.eat("["))
|
81 |
-
return (state.cur = bracketed(readBracket(stream), "comment"))(stream, state);
|
82 |
-
stream.skipToEnd();
|
83 |
-
return "comment";
|
84 |
-
}
|
85 |
-
if (ch == "\"" || ch == "'")
|
86 |
-
return (state.cur = string(ch))(stream, state);
|
87 |
-
if (ch == "[" && /[\[=]/.test(stream.peek()))
|
88 |
-
return (state.cur = bracketed(readBracket(stream), "string"))(stream, state);
|
89 |
-
if (/\d/.test(ch)) {
|
90 |
-
stream.eatWhile(/[\w.%]/);
|
91 |
-
return "number";
|
92 |
-
}
|
93 |
-
if (/[\w_]/.test(ch)) {
|
94 |
-
stream.eatWhile(/[\w\\\-_.]/);
|
95 |
-
return "variable";
|
96 |
-
}
|
97 |
-
return null;
|
98 |
-
}
|
99 |
-
|
100 |
-
function bracketed(level, style) {
|
101 |
-
return function(stream, state) {
|
102 |
-
var curlev = null, ch;
|
103 |
-
while ((ch = stream.next()) != null) {
|
104 |
-
if (curlev == null) {if (ch == "]") curlev = 0;}
|
105 |
-
else if (ch == "=") ++curlev;
|
106 |
-
else if (ch == "]" && curlev == level) { state.cur = normal; break; }
|
107 |
-
else curlev = null;
|
108 |
-
}
|
109 |
-
return style;
|
110 |
-
};
|
111 |
-
}
|
112 |
-
|
113 |
-
function string(quote) {
|
114 |
-
return function(stream, state) {
|
115 |
-
var escaped = false, ch;
|
116 |
-
while ((ch = stream.next()) != null) {
|
117 |
-
if (ch == quote && !escaped) break;
|
118 |
-
escaped = !escaped && ch == "\\";
|
119 |
-
}
|
120 |
-
if (!escaped) state.cur = normal;
|
121 |
-
return "string";
|
122 |
-
};
|
123 |
-
}
|
124 |
-
|
125 |
-
return {
|
126 |
-
startState: function(basecol) {
|
127 |
-
return {basecol: basecol || 0, indentDepth: 0, cur: normal};
|
128 |
-
},
|
129 |
-
|
130 |
-
token: function(stream, state) {
|
131 |
-
if (stream.eatSpace()) return null;
|
132 |
-
var style = state.cur(stream, state);
|
133 |
-
var word = stream.current();
|
134 |
-
if (style == "variable") {
|
135 |
-
if (keywords.test(word)) style = "keyword";
|
136 |
-
else if (builtins.test(word)) style = "builtin";
|
137 |
-
else if (specials.test(word)) style = "variable-2";
|
138 |
-
}
|
139 |
-
if ((style != "comment") && (style != "string")){
|
140 |
-
if (indentTokens.test(word)) ++state.indentDepth;
|
141 |
-
else if (dedentTokens.test(word)) --state.indentDepth;
|
142 |
-
}
|
143 |
-
return style;
|
144 |
-
},
|
145 |
-
|
146 |
-
indent: function(state, textAfter) {
|
147 |
-
var closing = dedentPartial.test(textAfter);
|
148 |
-
return state.basecol + indentUnit * (state.indentDepth - (closing ? 1 : 0));
|
149 |
-
},
|
150 |
-
|
151 |
-
lineComment: "--",
|
152 |
-
blockCommentStart: "--[[",
|
153 |
-
blockCommentEnd: "]]"
|
154 |
-
};
|
155 |
-
});
|
156 |
-
|
157 |
-
CodeMirror.defineMIME("text/x-lua", "lua");
|
158 |
-
|
159 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/mathematica/index.html
DELETED
@@ -1,72 +0,0 @@
|
|
1 |
-
<!doctype html>
|
2 |
-
|
3 |
-
<title>CodeMirror: Mathematica mode</title>
|
4 |
-
<meta charset="utf-8"/>
|
5 |
-
<link rel=stylesheet href="../../doc/docs.css">
|
6 |
-
|
7 |
-
<link rel=stylesheet href=../../lib/codemirror.css>
|
8 |
-
<script src=../../lib/codemirror.js></script>
|
9 |
-
<script src=../../addon/edit/matchbrackets.js></script>
|
10 |
-
<script src=mathematica.js></script>
|
11 |
-
<style type=text/css>
|
12 |
-
.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}
|
13 |
-
</style>
|
14 |
-
<div id=nav>
|
15 |
-
<a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
16 |
-
|
17 |
-
<ul>
|
18 |
-
<li><a href="../../index.html">Home</a>
|
19 |
-
<li><a href="../../doc/manual.html">Manual</a>
|
20 |
-
<li><a href="https://github.com/codemirror/codemirror">Code</a>
|
21 |
-
</ul>
|
22 |
-
<ul>
|
23 |
-
<li><a href="../index.html">Language modes</a>
|
24 |
-
<li><a class=active href="#">Mathematica</a>
|
25 |
-
</ul>
|
26 |
-
</div>
|
27 |
-
|
28 |
-
<article>
|
29 |
-
<h2>Mathematica mode</h2>
|
30 |
-
|
31 |
-
|
32 |
-
<textarea id="mathematicaCode">
|
33 |
-
(* example Mathematica code *)
|
34 |
-
(* Dualisiert wird anhand einer Polarität an einer
|
35 |
-
Quadrik $x^t Q x = 0$ mit regulärer Matrix $Q$ (also
|
36 |
-
mit $det(Q) \neq 0$), z.B. die Identitätsmatrix.
|
37 |
-
$p$ ist eine Liste von Polynomen - ein Ideal. *)
|
38 |
-
dualize::"singular" = "Q must be regular: found Det[Q]==0.";
|
39 |
-
dualize[ Q_, p_ ] := Block[
|
40 |
-
{ m, n, xv, lv, uv, vars, polys, dual },
|
41 |
-
If[Det[Q] == 0,
|
42 |
-
Message[dualize::"singular"],
|
43 |
-
m = Length[p];
|
44 |
-
n = Length[Q] - 1;
|
45 |
-
xv = Table[Subscript[x, i], {i, 0, n}];
|
46 |
-
lv = Table[Subscript[l, i], {i, 1, m}];
|
47 |
-
uv = Table[Subscript[u, i], {i, 0, n}];
|
48 |
-
(* Konstruiere Ideal polys. *)
|
49 |
-
If[m == 0,
|
50 |
-
polys = Q.uv,
|
51 |
-
polys = Join[p, Q.uv - Transpose[Outer[D, p, xv]].lv]
|
52 |
-
];
|
53 |
-
(* Eliminiere die ersten n + 1 + m Variablen xv und lv
|
54 |
-
aus dem Ideal polys. *)
|
55 |
-
vars = Join[xv, lv];
|
56 |
-
dual = GroebnerBasis[polys, uv, vars];
|
57 |
-
(* Ersetze u mit x im Ergebnis. *)
|
58 |
-
ReplaceAll[dual, Rule[u, x]]
|
59 |
-
]
|
60 |
-
]
|
61 |
-
</textarea>
|
62 |
-
|
63 |
-
<script>
|
64 |
-
var mathematicaEditor = CodeMirror.fromTextArea(document.getElementById('mathematicaCode'), {
|
65 |
-
mode: 'text/x-mathematica',
|
66 |
-
lineNumbers: true,
|
67 |
-
matchBrackets: true
|
68 |
-
});
|
69 |
-
</script>
|
70 |
-
|
71 |
-
<p><strong>MIME types defined:</strong> <code>text/x-mathematica</code> (Mathematica).</p>
|
72 |
-
</article>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/mathematica/mathematica.js
DELETED
@@ -1,175 +0,0 @@
|
|
1 |
-
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
2 |
-
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
3 |
-
|
4 |
-
// Mathematica mode copyright (c) 2015 by Calin Barbat
|
5 |
-
// Based on code by Patrick Scheibe (halirutan)
|
6 |
-
// See: https://github.com/halirutan/Mathematica-Source-Highlighting/tree/master/src/lang-mma.js
|
7 |
-
|
8 |
-
(function(mod) {
|
9 |
-
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
10 |
-
mod(require("../../lib/codemirror"));
|
11 |
-
else if (typeof define == "function" && define.amd) // AMD
|
12 |
-
define(["../../lib/codemirror"], mod);
|
13 |
-
else // Plain browser env
|
14 |
-
mod(CodeMirror);
|
15 |
-
})(function(CodeMirror) {
|
16 |
-
"use strict";
|
17 |
-
|
18 |
-
CodeMirror.defineMode('mathematica', function(_config, _parserConfig) {
|
19 |
-
|
20 |
-
// used pattern building blocks
|
21 |
-
var Identifier = '[a-zA-Z\\$][a-zA-Z0-9\\$]*';
|
22 |
-
var pBase = "(?:\\d+)";
|
23 |
-
var pFloat = "(?:\\.\\d+|\\d+\\.\\d*|\\d+)";
|
24 |
-
var pFloatBase = "(?:\\.\\w+|\\w+\\.\\w*|\\w+)";
|
25 |
-
var pPrecision = "(?:`(?:`?"+pFloat+")?)";
|
26 |
-
|
27 |
-
// regular expressions
|
28 |
-
var reBaseForm = new RegExp('(?:'+pBase+'(?:\\^\\^'+pFloatBase+pPrecision+'?(?:\\*\\^[+-]?\\d+)?))');
|
29 |
-
var reFloatForm = new RegExp('(?:' + pFloat + pPrecision + '?(?:\\*\\^[+-]?\\d+)?)');
|
30 |
-
var reIdInContext = new RegExp('(?:`?)(?:' + Identifier + ')(?:`(?:' + Identifier + '))*(?:`?)');
|
31 |
-
|
32 |
-
function tokenBase(stream, state) {
|
33 |
-
var ch;
|
34 |
-
|
35 |
-
// get next character
|
36 |
-
ch = stream.next();
|
37 |
-
|
38 |
-
// string
|
39 |
-
if (ch === '"') {
|
40 |
-
state.tokenize = tokenString;
|
41 |
-
return state.tokenize(stream, state);
|
42 |
-
}
|
43 |
-
|
44 |
-
// comment
|
45 |
-
if (ch === '(') {
|
46 |
-
if (stream.eat('*')) {
|
47 |
-
state.commentLevel++;
|
48 |
-
state.tokenize = tokenComment;
|
49 |
-
return state.tokenize(stream, state);
|
50 |
-
}
|
51 |
-
}
|
52 |
-
|
53 |
-
// go back one character
|
54 |
-
stream.backUp(1);
|
55 |
-
|
56 |
-
// look for numbers
|
57 |
-
// Numbers in a baseform
|
58 |
-
if (stream.match(reBaseForm, true, false)) {
|
59 |
-
return 'number';
|
60 |
-
}
|
61 |
-
|
62 |
-
// Mathematica numbers. Floats (1.2, .2, 1.) can have optionally a precision (`float) or an accuracy definition
|
63 |
-
// (``float). Note: while 1.2` is possible 1.2`` is not. At the end an exponent (float*^+12) can follow.
|
64 |
-
if (stream.match(reFloatForm, true, false)) {
|
65 |
-
return 'number';
|
66 |
-
}
|
67 |
-
|
68 |
-
/* In[23] and Out[34] */
|
69 |
-
if (stream.match(/(?:In|Out)\[[0-9]*\]/, true, false)) {
|
70 |
-
return 'atom';
|
71 |
-
}
|
72 |
-
|
73 |
-
// usage
|
74 |
-
if (stream.match(/([a-zA-Z\$]+(?:`?[a-zA-Z0-9\$])*::usage)/, true, false)) {
|
75 |
-
return 'meta';
|
76 |
-
}
|
77 |
-
|
78 |
-
// message
|
79 |
-
if (stream.match(/([a-zA-Z\$]+(?:`?[a-zA-Z0-9\$])*::[a-zA-Z\$][a-zA-Z0-9\$]*):?/, true, false)) {
|
80 |
-
return 'string-2';
|
81 |
-
}
|
82 |
-
|
83 |
-
// this makes a look-ahead match for something like variable:{_Integer}
|
84 |
-
// the match is then forwarded to the mma-patterns tokenizer.
|
85 |
-
if (stream.match(/([a-zA-Z\$][a-zA-Z0-9\$]*\s*:)(?:(?:[a-zA-Z\$][a-zA-Z0-9\$]*)|(?:[^:=>~@\^\&\*\)\[\]'\?,\|])).*/, true, false)) {
|
86 |
-
return 'variable-2';
|
87 |
-
}
|
88 |
-
|
89 |
-
// catch variables which are used together with Blank (_), BlankSequence (__) or BlankNullSequence (___)
|
90 |
-
// Cannot start with a number, but can have numbers at any other position. Examples
|
91 |
-
// blub__Integer, a1_, b34_Integer32
|
92 |
-
if (stream.match(/[a-zA-Z\$][a-zA-Z0-9\$]*_+[a-zA-Z\$][a-zA-Z0-9\$]*/, true, false)) {
|
93 |
-
return 'variable-2';
|
94 |
-
}
|
95 |
-
if (stream.match(/[a-zA-Z\$][a-zA-Z0-9\$]*_+/, true, false)) {
|
96 |
-
return 'variable-2';
|
97 |
-
}
|
98 |
-
if (stream.match(/_+[a-zA-Z\$][a-zA-Z0-9\$]*/, true, false)) {
|
99 |
-
return 'variable-2';
|
100 |
-
}
|
101 |
-
|
102 |
-
// Named characters in Mathematica, like \[Gamma].
|
103 |
-
if (stream.match(/\\\[[a-zA-Z\$][a-zA-Z0-9\$]*\]/, true, false)) {
|
104 |
-
return 'variable-3';
|
105 |
-
}
|
106 |
-
|
107 |
-
// Match all braces separately
|
108 |
-
if (stream.match(/(?:\[|\]|{|}|\(|\))/, true, false)) {
|
109 |
-
return 'bracket';
|
110 |
-
}
|
111 |
-
|
112 |
-
// Catch Slots (#, ##, #3, ##9 and the V10 named slots #name). I have never seen someone using more than one digit after #, so we match
|
113 |
-
// only one.
|
114 |
-
if (stream.match(/(?:#[a-zA-Z\$][a-zA-Z0-9\$]*|#+[0-9]?)/, true, false)) {
|
115 |
-
return 'variable-2';
|
116 |
-
}
|
117 |
-
|
118 |
-
// Literals like variables, keywords, functions
|
119 |
-
if (stream.match(reIdInContext, true, false)) {
|
120 |
-
return 'keyword';
|
121 |
-
}
|
122 |
-
|
123 |
-
// operators. Note that operators like @@ or /; are matched separately for each symbol.
|
124 |
-
if (stream.match(/(?:\\|\+|\-|\*|\/|,|;|\.|:|@|~|=|>|<|&|\||_|`|'|\^|\?|!|%)/, true, false)) {
|
125 |
-
return 'operator';
|
126 |
-
}
|
127 |
-
|
128 |
-
// everything else is an error
|
129 |
-
return 'error';
|
130 |
-
}
|
131 |
-
|
132 |
-
function tokenString(stream, state) {
|
133 |
-
var next, end = false, escaped = false;
|
134 |
-
while ((next = stream.next()) != null) {
|
135 |
-
if (next === '"' && !escaped) {
|
136 |
-
end = true;
|
137 |
-
break;
|
138 |
-
}
|
139 |
-
escaped = !escaped && next === '\\';
|
140 |
-
}
|
141 |
-
if (end && !escaped) {
|
142 |
-
state.tokenize = tokenBase;
|
143 |
-
}
|
144 |
-
return 'string';
|
145 |
-
};
|
146 |
-
|
147 |
-
function tokenComment(stream, state) {
|
148 |
-
var prev, next;
|
149 |
-
while(state.commentLevel > 0 && (next = stream.next()) != null) {
|
150 |
-
if (prev === '(' && next === '*') state.commentLevel++;
|
151 |
-
if (prev === '*' && next === ')') state.commentLevel--;
|
152 |
-
prev = next;
|
153 |
-
}
|
154 |
-
if (state.commentLevel <= 0) {
|
155 |
-
state.tokenize = tokenBase;
|
156 |
-
}
|
157 |
-
return 'comment';
|
158 |
-
}
|
159 |
-
|
160 |
-
return {
|
161 |
-
startState: function() {return {tokenize: tokenBase, commentLevel: 0};},
|
162 |
-
token: function(stream, state) {
|
163 |
-
if (stream.eatSpace()) return null;
|
164 |
-
return state.tokenize(stream, state);
|
165 |
-
},
|
166 |
-
blockCommentStart: "(*",
|
167 |
-
blockCommentEnd: "*)"
|
168 |
-
};
|
169 |
-
});
|
170 |
-
|
171 |
-
CodeMirror.defineMIME('text/x-mathematica', {
|
172 |
-
name: 'mathematica'
|
173 |
-
});
|
174 |
-
|
175 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/mirc/index.html
DELETED
@@ -1,160 +0,0 @@
|
|
1 |
-
<!doctype html>
|
2 |
-
|
3 |
-
<title>CodeMirror: mIRC mode</title>
|
4 |
-
<meta charset="utf-8"/>
|
5 |
-
<link rel=stylesheet href="../../doc/docs.css">
|
6 |
-
|
7 |
-
<link rel="stylesheet" href="../../lib/codemirror.css">
|
8 |
-
<link rel="stylesheet" href="../../theme/twilight.css">
|
9 |
-
<script src="../../lib/codemirror.js"></script>
|
10 |
-
<script src="mirc.js"></script>
|
11 |
-
<style>.CodeMirror {border: 1px solid black;}</style>
|
12 |
-
<div id=nav>
|
13 |
-
<a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
14 |
-
|
15 |
-
<ul>
|
16 |
-
<li><a href="../../index.html">Home</a>
|
17 |
-
<li><a href="../../doc/manual.html">Manual</a>
|
18 |
-
<li><a href="https://github.com/codemirror/codemirror">Code</a>
|
19 |
-
</ul>
|
20 |
-
<ul>
|
21 |
-
<li><a href="../index.html">Language modes</a>
|
22 |
-
<li><a class=active href="#">mIRC</a>
|
23 |
-
</ul>
|
24 |
-
</div>
|
25 |
-
|
26 |
-
<article>
|
27 |
-
<h2>mIRC mode</h2>
|
28 |
-
<form><textarea id="code" name="code">
|
29 |
-
;AKA Nick Tracker by Ford_Lawnmower irc.GeekShed.net #Script-Help
|
30 |
-
;*****************************************************************************;
|
31 |
-
;**Start Setup
|
32 |
-
;Change JoinDisplay, below, for On Join AKA Display. On = 1 - Off = 0
|
33 |
-
alias -l JoinDisplay { return 1 }
|
34 |
-
;Change MaxNicks, below, to the number of nicknames you want to store for each hostmask. I wouldn't go over 400 with this ;/
|
35 |
-
alias -l MaxNicks { return 20 }
|
36 |
-
;Change AKALogo, below, To the text you want displayed before each AKA result.
|
37 |
-
alias -l AKALogo { return 06 05A06K07A 06 }
|
38 |
-
;**End Setup
|
39 |
-
;*****************************************************************************;
|
40 |
-
On *:Join:#: {
|
41 |
-
if ($nick == $me) { .timer 1 1 ialupdateCheck $chan }
|
42 |
-
NickNamesAdd $nick $+($network,$wildsite)
|
43 |
-
if ($JoinDisplay) { .timerNickNames $+ $nick 1 2 NickNames.display $nick $chan $network $wildsite }
|
44 |
-
}
|
45 |
-
on *:Nick: { NickNamesAdd $newnick $+($network,$wildsite) $nick }
|
46 |
-
alias -l NickNames.display {
|
47 |
-
if ($gettok($hget(NickNames,$+($3,$4)),0,126) > 1) {
|
48 |
-
echo -g $2 $AKALogo $+(09,$1) $AKALogo 07 $mid($replace($hget(NickNames,$+($3,$4)),$chr(126),$chr(44)),2,-1)
|
49 |
-
}
|
50 |
-
}
|
51 |
-
alias -l NickNamesAdd {
|
52 |
-
if ($hget(NickNames,$2)) {
|
53 |
-
if (!$regex($hget(NickNames,$2),/~\Q $+ $replacecs($1,\E,\E\\E\Q) $+ \E~/i)) {
|
54 |
-
if ($gettok($hget(NickNames,$2),0,126) <= $MaxNicks) {
|
55 |
-
hadd NickNames $2 $+($hget(NickNames,$2),$1,~)
|
56 |
-
}
|
57 |
-
else {
|
58 |
-
hadd NickNames $2 $+($mid($hget(NickNames,$2),$pos($hget(NickNames,$2),~,2)),$1,~)
|
59 |
-
}
|
60 |
-
}
|
61 |
-
}
|
62 |
-
else {
|
63 |
-
hadd -m NickNames $2 $+(~,$1,~,$iif($3,$+($3,~)))
|
64 |
-
}
|
65 |
-
}
|
66 |
-
alias -l Fix.All.MindUser {
|
67 |
-
var %Fix.Count = $hfind(NickNames,/[^~]+[0-9]{4}~/,0,r).data
|
68 |
-
while (%Fix.Count) {
|
69 |
-
if ($Fix.MindUser($hget(NickNames,$hfind(NickNames,/[^~]+[0-9]{4}~/,%Fix.Count,r).data))) {
|
70 |
-
echo -ag Record %Fix.Count - $v1 - Was Cleaned
|
71 |
-
hadd NickNames $hfind(NickNames,/[^~]+[0-9]{4}~/,%Fix.Count,r).data $v1
|
72 |
-
}
|
73 |
-
dec %Fix.Count
|
74 |
-
}
|
75 |
-
}
|
76 |
-
alias -l Fix.MindUser { return $regsubex($1,/[^~]+[0-9]{4}~/g,$null) }
|
77 |
-
menu nicklist,query {
|
78 |
-
-
|
79 |
-
.AKA
|
80 |
-
..Check $$1: {
|
81 |
-
if ($gettok($hget(NickNames,$+($network,$address($1,2))),0,126) > 1) {
|
82 |
-
NickNames.display $1 $active $network $address($1,2)
|
83 |
-
}
|
84 |
-
else { echo -ag $AKALogo $+(09,$1) 07has not been known by any other nicknames while I have been watching. }
|
85 |
-
}
|
86 |
-
..Cleanup $$1:hadd NickNames $+($network,$address($1,2)) $fix.minduser($hget(NickNames,$+($network,$address($1,2))))
|
87 |
-
..Clear $$1:hadd NickNames $+($network,$address($1,2)) $+(~,$1,~)
|
88 |
-
..AKA Search Dialog:dialog $iif($dialog(AKA_Search),-v,-m) AKA_Search AKA_Search
|
89 |
-
-
|
90 |
-
}
|
91 |
-
menu status,channel {
|
92 |
-
-
|
93 |
-
.AKA
|
94 |
-
..AKA Search Dialog:dialog $iif($dialog(AKA_Search),-v,-m) AKA_Search AKA_Search
|
95 |
-
..Clean All Records:Fix.All.Minduser
|
96 |
-
-
|
97 |
-
}
|
98 |
-
dialog AKA_Search {
|
99 |
-
title "AKA Search Engine"
|
100 |
-
size -1 -1 206 221
|
101 |
-
option dbu
|
102 |
-
edit "", 1, 8 5 149 10, autohs
|
103 |
-
button "Search", 2, 163 4 32 12
|
104 |
-
radio "Search HostMask", 4, 61 22 55 10
|
105 |
-
radio "Search Nicknames", 5, 123 22 56 10
|
106 |
-
list 6, 8 38 190 169, sort extsel vsbar
|
107 |
-
button "Check Selected", 7, 67 206 40 12
|
108 |
-
button "Close", 8, 160 206 38 12, cancel
|
109 |
-
box "Search Type", 3, 11 17 183 18
|
110 |
-
button "Copy to Clipboard", 9, 111 206 46 12
|
111 |
-
}
|
112 |
-
On *:Dialog:Aka_Search:init:*: { did -c $dname 5 }
|
113 |
-
On *:Dialog:Aka_Search:Sclick:2,7,9: {
|
114 |
-
if ($did == 2) && ($did($dname,1)) {
|
115 |
-
did -r $dname 6
|
116 |
-
var %search $+(*,$v1,*), %type $iif($did($dname,5).state,data,item), %matches = $hfind(NickNames,%search,0,w). [ $+ [ %type ] ]
|
117 |
-
while (%matches) {
|
118 |
-
did -a $dname 6 $hfind(NickNames,%search,%matches,w). [ $+ [ %type ] ]
|
119 |
-
dec %matches
|
120 |
-
}
|
121 |
-
did -c $dname 6 1
|
122 |
-
}
|
123 |
-
elseif ($did == 7) && ($did($dname,6).seltext) { echo -ga $AKALogo 07 $mid($replace($hget(NickNames,$v1),$chr(126),$chr(44)),2,-1) }
|
124 |
-
elseif ($did == 9) && ($did($dname,6).seltext) { clipboard $mid($v1,$pos($v1,*,1)) }
|
125 |
-
}
|
126 |
-
On *:Start:{
|
127 |
-
if (!$hget(NickNames)) { hmake NickNames 10 }
|
128 |
-
if ($isfile(NickNames.hsh)) { hload NickNames NickNames.hsh }
|
129 |
-
}
|
130 |
-
On *:Exit: { if ($hget(NickNames)) { hsave NickNames NickNames.hsh } }
|
131 |
-
On *:Disconnect: { if ($hget(NickNames)) { hsave NickNames NickNames.hsh } }
|
132 |
-
On *:Unload: { hfree NickNames }
|
133 |
-
alias -l ialupdateCheck {
|
134 |
-
inc -z $+(%,ialupdateCheck,$network) $calc($nick($1,0) / 4)
|
135 |
-
;If your ial is already being updated on join .who $1 out.
|
136 |
-
;If you are using /names to update ial you will still need this line.
|
137 |
-
.who $1
|
138 |
-
}
|
139 |
-
Raw 352:*: {
|
140 |
-
if ($($+(%,ialupdateCheck,$network),2)) haltdef
|
141 |
-
NickNamesAdd $6 $+($network,$address($6,2))
|
142 |
-
}
|
143 |
-
Raw 315:*: {
|
144 |
-
if ($($+(%,ialupdateCheck,$network),2)) haltdef
|
145 |
-
}
|
146 |
-
|
147 |
-
</textarea></form>
|
148 |
-
<script>
|
149 |
-
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
|
150 |
-
theme: "twilight",
|
151 |
-
lineNumbers: true,
|
152 |
-
matchBrackets: true,
|
153 |
-
indentUnit: 4,
|
154 |
-
mode: "text/mirc"
|
155 |
-
});
|
156 |
-
</script>
|
157 |
-
|
158 |
-
<p><strong>MIME types defined:</strong> <code>text/mirc</code>.</p>
|
159 |
-
|
160 |
-
</article>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/mirc/mirc.js
DELETED
@@ -1,193 +0,0 @@
|
|
1 |
-
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
2 |
-
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
3 |
-
|
4 |
-
//mIRC mode by Ford_Lawnmower :: Based on Velocity mode by Steve O'Hara
|
5 |
-
|
6 |
-
(function(mod) {
|
7 |
-
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
8 |
-
mod(require("../../lib/codemirror"));
|
9 |
-
else if (typeof define == "function" && define.amd) // AMD
|
10 |
-
define(["../../lib/codemirror"], mod);
|
11 |
-
else // Plain browser env
|
12 |
-
mod(CodeMirror);
|
13 |
-
})(function(CodeMirror) {
|
14 |
-
"use strict";
|
15 |
-
|
16 |
-
CodeMirror.defineMIME("text/mirc", "mirc");
|
17 |
-
CodeMirror.defineMode("mirc", function() {
|
18 |
-
function parseWords(str) {
|
19 |
-
var obj = {}, words = str.split(" ");
|
20 |
-
for (var i = 0; i < words.length; ++i) obj[words[i]] = true;
|
21 |
-
return obj;
|
22 |
-
}
|
23 |
-
var specials = parseWords("$! $$ $& $? $+ $abook $abs $active $activecid " +
|
24 |
-
"$activewid $address $addtok $agent $agentname $agentstat $agentver " +
|
25 |
-
"$alias $and $anick $ansi2mirc $aop $appactive $appstate $asc $asctime " +
|
26 |
-
"$asin $atan $avoice $away $awaymsg $awaytime $banmask $base $bfind " +
|
27 |
-
"$binoff $biton $bnick $bvar $bytes $calc $cb $cd $ceil $chan $chanmodes " +
|
28 |
-
"$chantypes $chat $chr $cid $clevel $click $cmdbox $cmdline $cnick $color " +
|
29 |
-
"$com $comcall $comchan $comerr $compact $compress $comval $cos $count " +
|
30 |
-
"$cr $crc $creq $crlf $ctime $ctimer $ctrlenter $date $day $daylight " +
|
31 |
-
"$dbuh $dbuw $dccignore $dccport $dde $ddename $debug $decode $decompress " +
|
32 |
-
"$deltok $devent $dialog $did $didreg $didtok $didwm $disk $dlevel $dll " +
|
33 |
-
"$dllcall $dname $dns $duration $ebeeps $editbox $emailaddr $encode $error " +
|
34 |
-
"$eval $event $exist $feof $ferr $fgetc $file $filename $filtered $finddir " +
|
35 |
-
"$finddirn $findfile $findfilen $findtok $fline $floor $fopen $fread $fserve " +
|
36 |
-
"$fulladdress $fulldate $fullname $fullscreen $get $getdir $getdot $gettok $gmt " +
|
37 |
-
"$group $halted $hash $height $hfind $hget $highlight $hnick $hotline " +
|
38 |
-
"$hotlinepos $ial $ialchan $ibl $idle $iel $ifmatch $ignore $iif $iil " +
|
39 |
-
"$inelipse $ini $inmidi $inpaste $inpoly $input $inrect $inroundrect " +
|
40 |
-
"$insong $instok $int $inwave $ip $isalias $isbit $isdde $isdir $isfile " +
|
41 |
-
"$isid $islower $istok $isupper $keychar $keyrpt $keyval $knick $lactive " +
|
42 |
-
"$lactivecid $lactivewid $left $len $level $lf $line $lines $link $lock " +
|
43 |
-
"$lock $locked $log $logstamp $logstampfmt $longfn $longip $lower $ltimer " +
|
44 |
-
"$maddress $mask $matchkey $matchtok $md5 $me $menu $menubar $menucontext " +
|
45 |
-
"$menutype $mid $middir $mircdir $mircexe $mircini $mklogfn $mnick $mode " +
|
46 |
-
"$modefirst $modelast $modespl $mouse $msfile $network $newnick $nick $nofile " +
|
47 |
-
"$nopath $noqt $not $notags $notify $null $numeric $numok $oline $onpoly " +
|
48 |
-
"$opnick $or $ord $os $passivedcc $pic $play $pnick $port $portable $portfree " +
|
49 |
-
"$pos $prefix $prop $protect $puttok $qt $query $rand $r $rawmsg $read $readomo " +
|
50 |
-
"$readn $regex $regml $regsub $regsubex $remove $remtok $replace $replacex " +
|
51 |
-
"$reptok $result $rgb $right $round $scid $scon $script $scriptdir $scriptline " +
|
52 |
-
"$sdir $send $server $serverip $sfile $sha1 $shortfn $show $signal $sin " +
|
53 |
-
"$site $sline $snick $snicks $snotify $sock $sockbr $sockerr $sockname " +
|
54 |
-
"$sorttok $sound $sqrt $ssl $sreq $sslready $status $strip $str $stripped " +
|
55 |
-
"$syle $submenu $switchbar $tan $target $ticks $time $timer $timestamp " +
|
56 |
-
"$timestampfmt $timezone $tip $titlebar $toolbar $treebar $trust $ulevel " +
|
57 |
-
"$ulist $upper $uptime $url $usermode $v1 $v2 $var $vcmd $vcmdstat $vcmdver " +
|
58 |
-
"$version $vnick $vol $wid $width $wildsite $wildtok $window $wrap $xor");
|
59 |
-
var keywords = parseWords("abook ajinvite alias aline ame amsg anick aop auser autojoin avoice " +
|
60 |
-
"away background ban bcopy beep bread break breplace bset btrunc bunset bwrite " +
|
61 |
-
"channel clear clearall cline clipboard close cnick color comclose comopen " +
|
62 |
-
"comreg continue copy creq ctcpreply ctcps dcc dccserver dde ddeserver " +
|
63 |
-
"debug dec describe dialog did didtok disable disconnect dlevel dline dll " +
|
64 |
-
"dns dqwindow drawcopy drawdot drawfill drawline drawpic drawrect drawreplace " +
|
65 |
-
"drawrot drawsave drawscroll drawtext ebeeps echo editbox emailaddr enable " +
|
66 |
-
"events exit fclose filter findtext finger firewall flash flist flood flush " +
|
67 |
-
"flushini font fopen fseek fsend fserve fullname fwrite ghide gload gmove " +
|
68 |
-
"gopts goto gplay gpoint gqreq groups gshow gsize gstop gtalk gunload hadd " +
|
69 |
-
"halt haltdef hdec hdel help hfree hinc hload hmake hop hsave ial ialclear " +
|
70 |
-
"ialmark identd if ignore iline inc invite iuser join kick linesep links list " +
|
71 |
-
"load loadbuf localinfo log mdi me menubar mkdir mnick mode msg nick noop notice " +
|
72 |
-
"notify omsg onotice part partall pdcc perform play playctrl pop protect pvoice " +
|
73 |
-
"qme qmsg query queryn quit raw reload remini remote remove rename renwin " +
|
74 |
-
"reseterror resetidle return rlevel rline rmdir run ruser save savebuf saveini " +
|
75 |
-
"say scid scon server set showmirc signam sline sockaccept sockclose socklist " +
|
76 |
-
"socklisten sockmark sockopen sockpause sockread sockrename sockudp sockwrite " +
|
77 |
-
"sound speak splay sreq strip switchbar timer timestamp titlebar tnick tokenize " +
|
78 |
-
"toolbar topic tray treebar ulist unload unset unsetall updatenl url uwho " +
|
79 |
-
"var vcadd vcmd vcrem vol while whois window winhelp write writeint if isalnum " +
|
80 |
-
"isalpha isaop isavoice isban ischan ishop isignore isin isincs isletter islower " +
|
81 |
-
"isnotify isnum ison isop isprotect isreg isupper isvoice iswm iswmcs " +
|
82 |
-
"elseif else goto menu nicklist status title icon size option text edit " +
|
83 |
-
"button check radio box scroll list combo link tab item");
|
84 |
-
var functions = parseWords("if elseif else and not or eq ne in ni for foreach while switch");
|
85 |
-
var isOperatorChar = /[+\-*&%=<>!?^\/\|]/;
|
86 |
-
function chain(stream, state, f) {
|
87 |
-
state.tokenize = f;
|
88 |
-
return f(stream, state);
|
89 |
-
}
|
90 |
-
function tokenBase(stream, state) {
|
91 |
-
var beforeParams = state.beforeParams;
|
92 |
-
state.beforeParams = false;
|
93 |
-
var ch = stream.next();
|
94 |
-
if (/[\[\]{}\(\),\.]/.test(ch)) {
|
95 |
-
if (ch == "(" && beforeParams) state.inParams = true;
|
96 |
-
else if (ch == ")") state.inParams = false;
|
97 |
-
return null;
|
98 |
-
}
|
99 |
-
else if (/\d/.test(ch)) {
|
100 |
-
stream.eatWhile(/[\w\.]/);
|
101 |
-
return "number";
|
102 |
-
}
|
103 |
-
else if (ch == "\\") {
|
104 |
-
stream.eat("\\");
|
105 |
-
stream.eat(/./);
|
106 |
-
return "number";
|
107 |
-
}
|
108 |
-
else if (ch == "/" && stream.eat("*")) {
|
109 |
-
return chain(stream, state, tokenComment);
|
110 |
-
}
|
111 |
-
else if (ch == ";" && stream.match(/ *\( *\(/)) {
|
112 |
-
return chain(stream, state, tokenUnparsed);
|
113 |
-
}
|
114 |
-
else if (ch == ";" && !state.inParams) {
|
115 |
-
stream.skipToEnd();
|
116 |
-
return "comment";
|
117 |
-
}
|
118 |
-
else if (ch == '"') {
|
119 |
-
stream.eat(/"/);
|
120 |
-
return "keyword";
|
121 |
-
}
|
122 |
-
else if (ch == "$") {
|
123 |
-
stream.eatWhile(/[$_a-z0-9A-Z\.:]/);
|
124 |
-
if (specials && specials.propertyIsEnumerable(stream.current().toLowerCase())) {
|
125 |
-
return "keyword";
|
126 |
-
}
|
127 |
-
else {
|
128 |
-
state.beforeParams = true;
|
129 |
-
return "builtin";
|
130 |
-
}
|
131 |
-
}
|
132 |
-
else if (ch == "%") {
|
133 |
-
stream.eatWhile(/[^,^\s^\(^\)]/);
|
134 |
-
state.beforeParams = true;
|
135 |
-
return "string";
|
136 |
-
}
|
137 |
-
else if (isOperatorChar.test(ch)) {
|
138 |
-
stream.eatWhile(isOperatorChar);
|
139 |
-
return "operator";
|
140 |
-
}
|
141 |
-
else {
|
142 |
-
stream.eatWhile(/[\w\$_{}]/);
|
143 |
-
var word = stream.current().toLowerCase();
|
144 |
-
if (keywords && keywords.propertyIsEnumerable(word))
|
145 |
-
return "keyword";
|
146 |
-
if (functions && functions.propertyIsEnumerable(word)) {
|
147 |
-
state.beforeParams = true;
|
148 |
-
return "keyword";
|
149 |
-
}
|
150 |
-
return null;
|
151 |
-
}
|
152 |
-
}
|
153 |
-
function tokenComment(stream, state) {
|
154 |
-
var maybeEnd = false, ch;
|
155 |
-
while (ch = stream.next()) {
|
156 |
-
if (ch == "/" && maybeEnd) {
|
157 |
-
state.tokenize = tokenBase;
|
158 |
-
break;
|
159 |
-
}
|
160 |
-
maybeEnd = (ch == "*");
|
161 |
-
}
|
162 |
-
return "comment";
|
163 |
-
}
|
164 |
-
function tokenUnparsed(stream, state) {
|
165 |
-
var maybeEnd = 0, ch;
|
166 |
-
while (ch = stream.next()) {
|
167 |
-
if (ch == ";" && maybeEnd == 2) {
|
168 |
-
state.tokenize = tokenBase;
|
169 |
-
break;
|
170 |
-
}
|
171 |
-
if (ch == ")")
|
172 |
-
maybeEnd++;
|
173 |
-
else if (ch != " ")
|
174 |
-
maybeEnd = 0;
|
175 |
-
}
|
176 |
-
return "meta";
|
177 |
-
}
|
178 |
-
return {
|
179 |
-
startState: function() {
|
180 |
-
return {
|
181 |
-
tokenize: tokenBase,
|
182 |
-
beforeParams: false,
|
183 |
-
inParams: false
|
184 |
-
};
|
185 |
-
},
|
186 |
-
token: function(stream, state) {
|
187 |
-
if (stream.eatSpace()) return null;
|
188 |
-
return state.tokenize(stream, state);
|
189 |
-
}
|
190 |
-
};
|
191 |
-
});
|
192 |
-
|
193 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/mllike/index.html
DELETED
@@ -1,179 +0,0 @@
|
|
1 |
-
<!doctype html>
|
2 |
-
|
3 |
-
<title>CodeMirror: ML-like mode</title>
|
4 |
-
<meta charset="utf-8"/>
|
5 |
-
<link rel=stylesheet href="../../doc/docs.css">
|
6 |
-
|
7 |
-
<link rel=stylesheet href=../../lib/codemirror.css>
|
8 |
-
<script src=../../lib/codemirror.js></script>
|
9 |
-
<script src=../../addon/edit/matchbrackets.js></script>
|
10 |
-
<script src=mllike.js></script>
|
11 |
-
<style type=text/css>
|
12 |
-
.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}
|
13 |
-
</style>
|
14 |
-
<div id=nav>
|
15 |
-
<a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
16 |
-
|
17 |
-
<ul>
|
18 |
-
<li><a href="../../index.html">Home</a>
|
19 |
-
<li><a href="../../doc/manual.html">Manual</a>
|
20 |
-
<li><a href="https://github.com/codemirror/codemirror">Code</a>
|
21 |
-
</ul>
|
22 |
-
<ul>
|
23 |
-
<li><a href="../index.html">Language modes</a>
|
24 |
-
<li><a class=active href="#">ML-like</a>
|
25 |
-
</ul>
|
26 |
-
</div>
|
27 |
-
|
28 |
-
<article>
|
29 |
-
<h2>OCaml mode</h2>
|
30 |
-
|
31 |
-
|
32 |
-
<textarea id="ocamlCode">
|
33 |
-
(* Summing a list of integers *)
|
34 |
-
let rec sum xs =
|
35 |
-
match xs with
|
36 |
-
| [] -> 0
|
37 |
-
| x :: xs' -> x + sum xs'
|
38 |
-
|
39 |
-
(* Quicksort *)
|
40 |
-
let rec qsort = function
|
41 |
-
| [] -> []
|
42 |
-
| pivot :: rest ->
|
43 |
-
let is_less x = x < pivot in
|
44 |
-
let left, right = List.partition is_less rest in
|
45 |
-
qsort left @ [pivot] @ qsort right
|
46 |
-
|
47 |
-
(* Fibonacci Sequence *)
|
48 |
-
let rec fib_aux n a b =
|
49 |
-
match n with
|
50 |
-
| 0 -> a
|
51 |
-
| _ -> fib_aux (n - 1) (a + b) a
|
52 |
-
let fib n = fib_aux n 0 1
|
53 |
-
|
54 |
-
(* Birthday paradox *)
|
55 |
-
let year_size = 365.
|
56 |
-
|
57 |
-
let rec birthday_paradox prob people =
|
58 |
-
let prob' = (year_size -. float people) /. year_size *. prob in
|
59 |
-
if prob' < 0.5 then
|
60 |
-
Printf.printf "answer = %d\n" (people+1)
|
61 |
-
else
|
62 |
-
birthday_paradox prob' (people+1) ;;
|
63 |
-
|
64 |
-
birthday_paradox 1.0 1
|
65 |
-
|
66 |
-
(* Church numerals *)
|
67 |
-
let zero f x = x
|
68 |
-
let succ n f x = f (n f x)
|
69 |
-
let one = succ zero
|
70 |
-
let two = succ (succ zero)
|
71 |
-
let add n1 n2 f x = n1 f (n2 f x)
|
72 |
-
let to_string n = n (fun k -> "S" ^ k) "0"
|
73 |
-
let _ = to_string (add (succ two) two)
|
74 |
-
|
75 |
-
(* Elementary functions *)
|
76 |
-
let square x = x * x;;
|
77 |
-
let rec fact x =
|
78 |
-
if x <= 1 then 1 else x * fact (x - 1);;
|
79 |
-
|
80 |
-
(* Automatic memory management *)
|
81 |
-
let l = 1 :: 2 :: 3 :: [];;
|
82 |
-
[1; 2; 3];;
|
83 |
-
5 :: l;;
|
84 |
-
|
85 |
-
(* Polymorphism: sorting lists *)
|
86 |
-
let rec sort = function
|
87 |
-
| [] -> []
|
88 |
-
| x :: l -> insert x (sort l)
|
89 |
-
|
90 |
-
and insert elem = function
|
91 |
-
| [] -> [elem]
|
92 |
-
| x :: l ->
|
93 |
-
if elem < x then elem :: x :: l else x :: insert elem l;;
|
94 |
-
|
95 |
-
(* Imperative features *)
|
96 |
-
let add_polynom p1 p2 =
|
97 |
-
let n1 = Array.length p1
|
98 |
-
and n2 = Array.length p2 in
|
99 |
-
let result = Array.create (max n1 n2) 0 in
|
100 |
-
for i = 0 to n1 - 1 do result.(i) <- p1.(i) done;
|
101 |
-
for i = 0 to n2 - 1 do result.(i) <- result.(i) + p2.(i) done;
|
102 |
-
result;;
|
103 |
-
add_polynom [| 1; 2 |] [| 1; 2; 3 |];;
|
104 |
-
|
105 |
-
(* We may redefine fact using a reference cell and a for loop *)
|
106 |
-
let fact n =
|
107 |
-
let result = ref 1 in
|
108 |
-
for i = 2 to n do
|
109 |
-
result := i * !result
|
110 |
-
done;
|
111 |
-
!result;;
|
112 |
-
fact 5;;
|
113 |
-
|
114 |
-
(* Triangle (graphics) *)
|
115 |
-
let () =
|
116 |
-
ignore( Glut.init Sys.argv );
|
117 |
-
Glut.initDisplayMode ~double_buffer:true ();
|
118 |
-
ignore (Glut.createWindow ~title:"OpenGL Demo");
|
119 |
-
let angle t = 10. *. t *. t in
|
120 |
-
let render () =
|
121 |
-
GlClear.clear [ `color ];
|
122 |
-
GlMat.load_identity ();
|
123 |
-
GlMat.rotate ~angle: (angle (Sys.time ())) ~z:1. ();
|
124 |
-
GlDraw.begins `triangles;
|
125 |
-
List.iter GlDraw.vertex2 [-1., -1.; 0., 1.; 1., -1.];
|
126 |
-
GlDraw.ends ();
|
127 |
-
Glut.swapBuffers () in
|
128 |
-
GlMat.mode `modelview;
|
129 |
-
Glut.displayFunc ~cb:render;
|
130 |
-
Glut.idleFunc ~cb:(Some Glut.postRedisplay);
|
131 |
-
Glut.mainLoop ()
|
132 |
-
|
133 |
-
(* A Hundred Lines of Caml - http://caml.inria.fr/about/taste.en.html *)
|
134 |
-
(* OCaml page on Wikipedia - http://en.wikipedia.org/wiki/OCaml *)
|
135 |
-
</textarea>
|
136 |
-
|
137 |
-
<h2>F# mode</h2>
|
138 |
-
<textarea id="fsharpCode">
|
139 |
-
module CodeMirror.FSharp
|
140 |
-
|
141 |
-
let rec fib = function
|
142 |
-
| 0 -> 0
|
143 |
-
| 1 -> 1
|
144 |
-
| n -> fib (n - 1) + fib (n - 2)
|
145 |
-
|
146 |
-
type Point =
|
147 |
-
{
|
148 |
-
x : int
|
149 |
-
y : int
|
150 |
-
}
|
151 |
-
|
152 |
-
type Color =
|
153 |
-
| Red
|
154 |
-
| Green
|
155 |
-
| Blue
|
156 |
-
|
157 |
-
[0 .. 10]
|
158 |
-
|> List.map ((+) 2)
|
159 |
-
|> List.fold (fun x y -> x + y) 0
|
160 |
-
|> printf "%i"
|
161 |
-
</textarea>
|
162 |
-
|
163 |
-
|
164 |
-
<script>
|
165 |
-
var ocamlEditor = CodeMirror.fromTextArea(document.getElementById('ocamlCode'), {
|
166 |
-
mode: 'text/x-ocaml',
|
167 |
-
lineNumbers: true,
|
168 |
-
matchBrackets: true
|
169 |
-
});
|
170 |
-
|
171 |
-
var fsharpEditor = CodeMirror.fromTextArea(document.getElementById('fsharpCode'), {
|
172 |
-
mode: 'text/x-fsharp',
|
173 |
-
lineNumbers: true,
|
174 |
-
matchBrackets: true
|
175 |
-
});
|
176 |
-
</script>
|
177 |
-
|
178 |
-
<p><strong>MIME types defined:</strong> <code>text/x-ocaml</code> (OCaml) and <code>text/x-fsharp</code> (F#).</p>
|
179 |
-
</article>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/mllike/mllike.js
DELETED
@@ -1,205 +0,0 @@
|
|
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('mllike', function(_config, parserConfig) {
|
15 |
-
var words = {
|
16 |
-
'let': 'keyword',
|
17 |
-
'rec': 'keyword',
|
18 |
-
'in': 'keyword',
|
19 |
-
'of': 'keyword',
|
20 |
-
'and': 'keyword',
|
21 |
-
'if': 'keyword',
|
22 |
-
'then': 'keyword',
|
23 |
-
'else': 'keyword',
|
24 |
-
'for': 'keyword',
|
25 |
-
'to': 'keyword',
|
26 |
-
'while': 'keyword',
|
27 |
-
'do': 'keyword',
|
28 |
-
'done': 'keyword',
|
29 |
-
'fun': 'keyword',
|
30 |
-
'function': 'keyword',
|
31 |
-
'val': 'keyword',
|
32 |
-
'type': 'keyword',
|
33 |
-
'mutable': 'keyword',
|
34 |
-
'match': 'keyword',
|
35 |
-
'with': 'keyword',
|
36 |
-
'try': 'keyword',
|
37 |
-
'open': 'builtin',
|
38 |
-
'ignore': 'builtin',
|
39 |
-
'begin': 'keyword',
|
40 |
-
'end': 'keyword'
|
41 |
-
};
|
42 |
-
|
43 |
-
var extraWords = parserConfig.extraWords || {};
|
44 |
-
for (var prop in extraWords) {
|
45 |
-
if (extraWords.hasOwnProperty(prop)) {
|
46 |
-
words[prop] = parserConfig.extraWords[prop];
|
47 |
-
}
|
48 |
-
}
|
49 |
-
|
50 |
-
function tokenBase(stream, state) {
|
51 |
-
var ch = stream.next();
|
52 |
-
|
53 |
-
if (ch === '"') {
|
54 |
-
state.tokenize = tokenString;
|
55 |
-
return state.tokenize(stream, state);
|
56 |
-
}
|
57 |
-
if (ch === '(') {
|
58 |
-
if (stream.eat('*')) {
|
59 |
-
state.commentLevel++;
|
60 |
-
state.tokenize = tokenComment;
|
61 |
-
return state.tokenize(stream, state);
|
62 |
-
}
|
63 |
-
}
|
64 |
-
if (ch === '~') {
|
65 |
-
stream.eatWhile(/\w/);
|
66 |
-
return 'variable-2';
|
67 |
-
}
|
68 |
-
if (ch === '`') {
|
69 |
-
stream.eatWhile(/\w/);
|
70 |
-
return 'quote';
|
71 |
-
}
|
72 |
-
if (ch === '/' && parserConfig.slashComments && stream.eat('/')) {
|
73 |
-
stream.skipToEnd();
|
74 |
-
return 'comment';
|
75 |
-
}
|
76 |
-
if (/\d/.test(ch)) {
|
77 |
-
stream.eatWhile(/[\d]/);
|
78 |
-
if (stream.eat('.')) {
|
79 |
-
stream.eatWhile(/[\d]/);
|
80 |
-
}
|
81 |
-
return 'number';
|
82 |
-
}
|
83 |
-
if ( /[+\-*&%=<>!?|]/.test(ch)) {
|
84 |
-
return 'operator';
|
85 |
-
}
|
86 |
-
stream.eatWhile(/\w/);
|
87 |
-
var cur = stream.current();
|
88 |
-
return words.hasOwnProperty(cur) ? words[cur] : 'variable';
|
89 |
-
}
|
90 |
-
|
91 |
-
function tokenString(stream, state) {
|
92 |
-
var next, end = false, escaped = false;
|
93 |
-
while ((next = stream.next()) != null) {
|
94 |
-
if (next === '"' && !escaped) {
|
95 |
-
end = true;
|
96 |
-
break;
|
97 |
-
}
|
98 |
-
escaped = !escaped && next === '\\';
|
99 |
-
}
|
100 |
-
if (end && !escaped) {
|
101 |
-
state.tokenize = tokenBase;
|
102 |
-
}
|
103 |
-
return 'string';
|
104 |
-
};
|
105 |
-
|
106 |
-
function tokenComment(stream, state) {
|
107 |
-
var prev, next;
|
108 |
-
while(state.commentLevel > 0 && (next = stream.next()) != null) {
|
109 |
-
if (prev === '(' && next === '*') state.commentLevel++;
|
110 |
-
if (prev === '*' && next === ')') state.commentLevel--;
|
111 |
-
prev = next;
|
112 |
-
}
|
113 |
-
if (state.commentLevel <= 0) {
|
114 |
-
state.tokenize = tokenBase;
|
115 |
-
}
|
116 |
-
return 'comment';
|
117 |
-
}
|
118 |
-
|
119 |
-
return {
|
120 |
-
startState: function() {return {tokenize: tokenBase, commentLevel: 0};},
|
121 |
-
token: function(stream, state) {
|
122 |
-
if (stream.eatSpace()) return null;
|
123 |
-
return state.tokenize(stream, state);
|
124 |
-
},
|
125 |
-
|
126 |
-
blockCommentStart: "(*",
|
127 |
-
blockCommentEnd: "*)",
|
128 |
-
lineComment: parserConfig.slashComments ? "//" : null
|
129 |
-
};
|
130 |
-
});
|
131 |
-
|
132 |
-
CodeMirror.defineMIME('text/x-ocaml', {
|
133 |
-
name: 'mllike',
|
134 |
-
extraWords: {
|
135 |
-
'succ': 'keyword',
|
136 |
-
'trace': 'builtin',
|
137 |
-
'exit': 'builtin',
|
138 |
-
'print_string': 'builtin',
|
139 |
-
'print_endline': 'builtin',
|
140 |
-
'true': 'atom',
|
141 |
-
'false': 'atom',
|
142 |
-
'raise': 'keyword'
|
143 |
-
}
|
144 |
-
});
|
145 |
-
|
146 |
-
CodeMirror.defineMIME('text/x-fsharp', {
|
147 |
-
name: 'mllike',
|
148 |
-
extraWords: {
|
149 |
-
'abstract': 'keyword',
|
150 |
-
'as': 'keyword',
|
151 |
-
'assert': 'keyword',
|
152 |
-
'base': 'keyword',
|
153 |
-
'class': 'keyword',
|
154 |
-
'default': 'keyword',
|
155 |
-
'delegate': 'keyword',
|
156 |
-
'downcast': 'keyword',
|
157 |
-
'downto': 'keyword',
|
158 |
-
'elif': 'keyword',
|
159 |
-
'exception': 'keyword',
|
160 |
-
'extern': 'keyword',
|
161 |
-
'finally': 'keyword',
|
162 |
-
'global': 'keyword',
|
163 |
-
'inherit': 'keyword',
|
164 |
-
'inline': 'keyword',
|
165 |
-
'interface': 'keyword',
|
166 |
-
'internal': 'keyword',
|
167 |
-
'lazy': 'keyword',
|
168 |
-
'let!': 'keyword',
|
169 |
-
'member' : 'keyword',
|
170 |
-
'module': 'keyword',
|
171 |
-
'namespace': 'keyword',
|
172 |
-
'new': 'keyword',
|
173 |
-
'null': 'keyword',
|
174 |
-
'override': 'keyword',
|
175 |
-
'private': 'keyword',
|
176 |
-
'public': 'keyword',
|
177 |
-
'return': 'keyword',
|
178 |
-
'return!': 'keyword',
|
179 |
-
'select': 'keyword',
|
180 |
-
'static': 'keyword',
|
181 |
-
'struct': 'keyword',
|
182 |
-
'upcast': 'keyword',
|
183 |
-
'use': 'keyword',
|
184 |
-
'use!': 'keyword',
|
185 |
-
'val': 'keyword',
|
186 |
-
'when': 'keyword',
|
187 |
-
'yield': 'keyword',
|
188 |
-
'yield!': 'keyword',
|
189 |
-
|
190 |
-
'List': 'builtin',
|
191 |
-
'Seq': 'builtin',
|
192 |
-
'Map': 'builtin',
|
193 |
-
'Set': 'builtin',
|
194 |
-
'int': 'builtin',
|
195 |
-
'string': 'builtin',
|
196 |
-
'raise': 'builtin',
|
197 |
-
'failwith': 'builtin',
|
198 |
-
'not': 'builtin',
|
199 |
-
'true': 'builtin',
|
200 |
-
'false': 'builtin'
|
201 |
-
},
|
202 |
-
slashComments: true
|
203 |
-
});
|
204 |
-
|
205 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/modelica/index.html
DELETED
@@ -1,67 +0,0 @@
|
|
1 |
-
<!doctype html>
|
2 |
-
|
3 |
-
<title>CodeMirror: Modelica mode</title>
|
4 |
-
<meta charset="utf-8"/>
|
5 |
-
<link rel=stylesheet href="../../doc/docs.css">
|
6 |
-
|
7 |
-
<link rel="stylesheet" href="../../lib/codemirror.css">
|
8 |
-
<script src="../../lib/codemirror.js"></script>
|
9 |
-
<script src="../../addon/edit/matchbrackets.js"></script>
|
10 |
-
<link rel="stylesheet" href="../../addon/hint/show-hint.css">
|
11 |
-
<script src="../../addon/hint/show-hint.js"></script>
|
12 |
-
<script src="modelica.js"></script>
|
13 |
-
<style>.CodeMirror {border: 2px inset #dee;}</style>
|
14 |
-
<div id=nav>
|
15 |
-
<a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
16 |
-
|
17 |
-
<ul>
|
18 |
-
<li><a href="../../index.html">Home</a>
|
19 |
-
<li><a href="../../doc/manual.html">Manual</a>
|
20 |
-
<li><a href="https://github.com/codemirror/codemirror">Code</a>
|
21 |
-
</ul>
|
22 |
-
<ul>
|
23 |
-
<li><a href="../index.html">Language modes</a>
|
24 |
-
<li><a class=active href="#">Modelica</a>
|
25 |
-
</ul>
|
26 |
-
</div>
|
27 |
-
|
28 |
-
<article>
|
29 |
-
<h2>Modelica mode</h2>
|
30 |
-
|
31 |
-
<div><textarea id="modelica">
|
32 |
-
model BouncingBall
|
33 |
-
parameter Real e = 0.7;
|
34 |
-
parameter Real g = 9.81;
|
35 |
-
Real h(start=1);
|
36 |
-
Real v;
|
37 |
-
Boolean flying(start=true);
|
38 |
-
Boolean impact;
|
39 |
-
Real v_new;
|
40 |
-
equation
|
41 |
-
impact = h <= 0.0;
|
42 |
-
der(v) = if flying then -g else 0;
|
43 |
-
der(h) = v;
|
44 |
-
when {h <= 0.0 and v <= 0.0, impact} then
|
45 |
-
v_new = if edge(impact) then -e*pre(v) else 0;
|
46 |
-
flying = v_new > 0;
|
47 |
-
reinit(v, v_new);
|
48 |
-
end when;
|
49 |
-
annotation (uses(Modelica(version="3.2")));
|
50 |
-
end BouncingBall;
|
51 |
-
</textarea></div>
|
52 |
-
|
53 |
-
<script>
|
54 |
-
var modelicaEditor = CodeMirror.fromTextArea(document.getElementById("modelica"), {
|
55 |
-
lineNumbers: true,
|
56 |
-
matchBrackets: true,
|
57 |
-
mode: "text/x-modelica"
|
58 |
-
});
|
59 |
-
var mac = CodeMirror.keyMap.default == CodeMirror.keyMap.macDefault;
|
60 |
-
CodeMirror.keyMap.default[(mac ? "Cmd" : "Ctrl") + "-Space"] = "autocomplete";
|
61 |
-
</script>
|
62 |
-
|
63 |
-
<p>Simple mode that tries to handle Modelica as well as it can.</p>
|
64 |
-
|
65 |
-
<p><strong>MIME types defined:</strong> <code>text/x-modelica</code>
|
66 |
-
(Modlica code).</p>
|
67 |
-
</article>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/modelica/modelica.js
DELETED
@@ -1,245 +0,0 @@
|
|
1 |
-
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
2 |
-
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
3 |
-
|
4 |
-
// Modelica support for CodeMirror, copyright (c) by Lennart Ochel
|
5 |
-
|
6 |
-
(function(mod) {
|
7 |
-
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
8 |
-
mod(require("../../lib/codemirror"));
|
9 |
-
else if (typeof define == "function" && define.amd) // AMD
|
10 |
-
define(["../../lib/codemirror"], mod);
|
11 |
-
else // Plain browser env
|
12 |
-
mod(CodeMirror);
|
13 |
-
})
|
14 |
-
|
15 |
-
(function(CodeMirror) {
|
16 |
-
"use strict";
|
17 |
-
|
18 |
-
CodeMirror.defineMode("modelica", function(config, parserConfig) {
|
19 |
-
|
20 |
-
var indentUnit = config.indentUnit;
|
21 |
-
var keywords = parserConfig.keywords || {};
|
22 |
-
var builtin = parserConfig.builtin || {};
|
23 |
-
var atoms = parserConfig.atoms || {};
|
24 |
-
|
25 |
-
var isSingleOperatorChar = /[;=\(:\),{}.*<>+\-\/^\[\]]/;
|
26 |
-
var isDoubleOperatorChar = /(:=|<=|>=|==|<>|\.\+|\.\-|\.\*|\.\/|\.\^)/;
|
27 |
-
var isDigit = /[0-9]/;
|
28 |
-
var isNonDigit = /[_a-zA-Z]/;
|
29 |
-
|
30 |
-
function tokenLineComment(stream, state) {
|
31 |
-
stream.skipToEnd();
|
32 |
-
state.tokenize = null;
|
33 |
-
return "comment";
|
34 |
-
}
|
35 |
-
|
36 |
-
function tokenBlockComment(stream, state) {
|
37 |
-
var maybeEnd = false, ch;
|
38 |
-
while (ch = stream.next()) {
|
39 |
-
if (maybeEnd && ch == "/") {
|
40 |
-
state.tokenize = null;
|
41 |
-
break;
|
42 |
-
}
|
43 |
-
maybeEnd = (ch == "*");
|
44 |
-
}
|
45 |
-
return "comment";
|
46 |
-
}
|
47 |
-
|
48 |
-
function tokenString(stream, state) {
|
49 |
-
var escaped = false, ch;
|
50 |
-
while ((ch = stream.next()) != null) {
|
51 |
-
if (ch == '"' && !escaped) {
|
52 |
-
state.tokenize = null;
|
53 |
-
state.sol = false;
|
54 |
-
break;
|
55 |
-
}
|
56 |
-
escaped = !escaped && ch == "\\";
|
57 |
-
}
|
58 |
-
|
59 |
-
return "string";
|
60 |
-
}
|
61 |
-
|
62 |
-
function tokenIdent(stream, state) {
|
63 |
-
stream.eatWhile(isDigit);
|
64 |
-
while (stream.eat(isDigit) || stream.eat(isNonDigit)) { }
|
65 |
-
|
66 |
-
|
67 |
-
var cur = stream.current();
|
68 |
-
|
69 |
-
if(state.sol && (cur == "package" || cur == "model" || cur == "when" || cur == "connector")) state.level++;
|
70 |
-
else if(state.sol && cur == "end" && state.level > 0) state.level--;
|
71 |
-
|
72 |
-
state.tokenize = null;
|
73 |
-
state.sol = false;
|
74 |
-
|
75 |
-
if (keywords.propertyIsEnumerable(cur)) return "keyword";
|
76 |
-
else if (builtin.propertyIsEnumerable(cur)) return "builtin";
|
77 |
-
else if (atoms.propertyIsEnumerable(cur)) return "atom";
|
78 |
-
else return "variable";
|
79 |
-
}
|
80 |
-
|
81 |
-
function tokenQIdent(stream, state) {
|
82 |
-
while (stream.eat(/[^']/)) { }
|
83 |
-
|
84 |
-
state.tokenize = null;
|
85 |
-
state.sol = false;
|
86 |
-
|
87 |
-
if(stream.eat("'"))
|
88 |
-
return "variable";
|
89 |
-
else
|
90 |
-
return "error";
|
91 |
-
}
|
92 |
-
|
93 |
-
function tokenUnsignedNuber(stream, state) {
|
94 |
-
stream.eatWhile(isDigit);
|
95 |
-
if (stream.eat('.')) {
|
96 |
-
stream.eatWhile(isDigit);
|
97 |
-
}
|
98 |
-
if (stream.eat('e') || stream.eat('E')) {
|
99 |
-
if (!stream.eat('-'))
|
100 |
-
stream.eat('+');
|
101 |
-
stream.eatWhile(isDigit);
|
102 |
-
}
|
103 |
-
|
104 |
-
state.tokenize = null;
|
105 |
-
state.sol = false;
|
106 |
-
return "number";
|
107 |
-
}
|
108 |
-
|
109 |
-
// Interface
|
110 |
-
return {
|
111 |
-
startState: function() {
|
112 |
-
return {
|
113 |
-
tokenize: null,
|
114 |
-
level: 0,
|
115 |
-
sol: true
|
116 |
-
};
|
117 |
-
},
|
118 |
-
|
119 |
-
token: function(stream, state) {
|
120 |
-
if(state.tokenize != null) {
|
121 |
-
return state.tokenize(stream, state);
|
122 |
-
}
|
123 |
-
|
124 |
-
if(stream.sol()) {
|
125 |
-
state.sol = true;
|
126 |
-
}
|
127 |
-
|
128 |
-
// WHITESPACE
|
129 |
-
if(stream.eatSpace()) {
|
130 |
-
state.tokenize = null;
|
131 |
-
return null;
|
132 |
-
}
|
133 |
-
|
134 |
-
var ch = stream.next();
|
135 |
-
|
136 |
-
// LINECOMMENT
|
137 |
-
if(ch == '/' && stream.eat('/')) {
|
138 |
-
state.tokenize = tokenLineComment;
|
139 |
-
}
|
140 |
-
// BLOCKCOMMENT
|
141 |
-
else if(ch == '/' && stream.eat('*')) {
|
142 |
-
state.tokenize = tokenBlockComment;
|
143 |
-
}
|
144 |
-
// TWO SYMBOL TOKENS
|
145 |
-
else if(isDoubleOperatorChar.test(ch+stream.peek())) {
|
146 |
-
stream.next();
|
147 |
-
state.tokenize = null;
|
148 |
-
return "operator";
|
149 |
-
}
|
150 |
-
// SINGLE SYMBOL TOKENS
|
151 |
-
else if(isSingleOperatorChar.test(ch)) {
|
152 |
-
state.tokenize = null;
|
153 |
-
return "operator";
|
154 |
-
}
|
155 |
-
// IDENT
|
156 |
-
else if(isNonDigit.test(ch)) {
|
157 |
-
state.tokenize = tokenIdent;
|
158 |
-
}
|
159 |
-
// Q-IDENT
|
160 |
-
else if(ch == "'" && stream.peek() && stream.peek() != "'") {
|
161 |
-
state.tokenize = tokenQIdent;
|
162 |
-
}
|
163 |
-
// STRING
|
164 |
-
else if(ch == '"') {
|
165 |
-
state.tokenize = tokenString;
|
166 |
-
}
|
167 |
-
// UNSIGNED_NUBER
|
168 |
-
else if(isDigit.test(ch)) {
|
169 |
-
state.tokenize = tokenUnsignedNuber;
|
170 |
-
}
|
171 |
-
// ERROR
|
172 |
-
else {
|
173 |
-
state.tokenize = null;
|
174 |
-
return "error";
|
175 |
-
}
|
176 |
-
|
177 |
-
return state.tokenize(stream, state);
|
178 |
-
},
|
179 |
-
|
180 |
-
indent: function(state, textAfter) {
|
181 |
-
if (state.tokenize != null) return CodeMirror.Pass;
|
182 |
-
|
183 |
-
var level = state.level;
|
184 |
-
if(/(algorithm)/.test(textAfter)) level--;
|
185 |
-
if(/(equation)/.test(textAfter)) level--;
|
186 |
-
if(/(initial algorithm)/.test(textAfter)) level--;
|
187 |
-
if(/(initial equation)/.test(textAfter)) level--;
|
188 |
-
if(/(end)/.test(textAfter)) level--;
|
189 |
-
|
190 |
-
if(level > 0)
|
191 |
-
return indentUnit*level;
|
192 |
-
else
|
193 |
-
return 0;
|
194 |
-
},
|
195 |
-
|
196 |
-
blockCommentStart: "/*",
|
197 |
-
blockCommentEnd: "*/",
|
198 |
-
lineComment: "//"
|
199 |
-
};
|
200 |
-
});
|
201 |
-
|
202 |
-
function words(str) {
|
203 |
-
var obj = {}, words = str.split(" ");
|
204 |
-
for (var i=0; i<words.length; ++i)
|
205 |
-
obj[words[i]] = true;
|
206 |
-
return obj;
|
207 |
-
}
|
208 |
-
|
209 |
-
var modelicaKeywords = "algorithm and annotation assert block break class connect connector constant constrainedby der discrete each else elseif elsewhen encapsulated end enumeration equation expandable extends external false final flow for function if import impure in initial inner input loop model not operator or outer output package parameter partial protected public pure record redeclare replaceable return stream then true type when while within";
|
210 |
-
var modelicaBuiltin = "abs acos actualStream asin atan atan2 cardinality ceil cos cosh delay div edge exp floor getInstanceName homotopy inStream integer log log10 mod pre reinit rem semiLinear sign sin sinh spatialDistribution sqrt tan tanh";
|
211 |
-
var modelicaAtoms = "Real Boolean Integer String";
|
212 |
-
|
213 |
-
function def(mimes, mode) {
|
214 |
-
if (typeof mimes == "string")
|
215 |
-
mimes = [mimes];
|
216 |
-
|
217 |
-
var words = [];
|
218 |
-
|
219 |
-
function add(obj) {
|
220 |
-
if (obj)
|
221 |
-
for (var prop in obj)
|
222 |
-
if (obj.hasOwnProperty(prop))
|
223 |
-
words.push(prop);
|
224 |
-
}
|
225 |
-
|
226 |
-
add(mode.keywords);
|
227 |
-
add(mode.builtin);
|
228 |
-
add(mode.atoms);
|
229 |
-
|
230 |
-
if (words.length) {
|
231 |
-
mode.helperType = mimes[0];
|
232 |
-
CodeMirror.registerHelper("hintWords", mimes[0], words);
|
233 |
-
}
|
234 |
-
|
235 |
-
for (var i=0; i<mimes.length; ++i)
|
236 |
-
CodeMirror.defineMIME(mimes[i], mode);
|
237 |
-
}
|
238 |
-
|
239 |
-
def(["text/x-modelica"], {
|
240 |
-
name: "modelica",
|
241 |
-
keywords: words(modelicaKeywords),
|
242 |
-
builtin: words(modelicaBuiltin),
|
243 |
-
atoms: words(modelicaAtoms)
|
244 |
-
});
|
245 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/mscgen/index.html
DELETED
@@ -1,65 +0,0 @@
|
|
1 |
-
<!doctype html>
|
2 |
-
|
3 |
-
<title>CodeMirror: Oz mode</title>
|
4 |
-
<meta charset="utf-8"/>
|
5 |
-
<link rel=stylesheet href="../../doc/docs.css">
|
6 |
-
|
7 |
-
<link rel="stylesheet" href="../../lib/codemirror.css">
|
8 |
-
<script src="../../lib/codemirror.js"></script>
|
9 |
-
<script src="mscgen.js"></script>
|
10 |
-
<style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
11 |
-
<div id=nav>
|
12 |
-
<a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
13 |
-
<ul>
|
14 |
-
<li><a href="../../index.html">Home</a>
|
15 |
-
<li><a href="../../doc/manual.html">Manual</a>
|
16 |
-
<li><a href="https://github.com/codemirror/codemirror">Code</a>
|
17 |
-
</ul>
|
18 |
-
<ul>
|
19 |
-
<li><a href="../index.html">Language modes</a>
|
20 |
-
<li><a class=active href="#">MscGen</a>
|
21 |
-
</ul>
|
22 |
-
</div>
|
23 |
-
|
24 |
-
<article>
|
25 |
-
<h2>MscGen mode</h2>
|
26 |
-
|
27 |
-
<div><textarea id="code">
|
28 |
-
# Sample mscgen program
|
29 |
-
# See http://www.mcternan.me.uk/mscgen or
|
30 |
-
# https://sverweij.github.io/mscgen_js for more samples
|
31 |
-
|
32 |
-
msc {
|
33 |
-
# options
|
34 |
-
hscale="1.2";
|
35 |
-
|
36 |
-
# entities/ lifelines
|
37 |
-
a [label="Entity A"],
|
38 |
-
b [label="Entity B", linecolor="red", arclinecolor="red", textbgcolor="pink"],
|
39 |
-
c [label="Entity C"];
|
40 |
-
|
41 |
-
# arcs/ messages
|
42 |
-
a => c [label="doSomething(args)"];
|
43 |
-
b => c [label="doSomething(args)"];
|
44 |
-
c >> * [label="everyone asked me", arcskip="1"];
|
45 |
-
c =>> c [label="doing something"];
|
46 |
-
c -x * [label="report back", arcskip="1"];
|
47 |
-
|||;
|
48 |
-
--- [label="shows's over, however ..."];
|
49 |
-
b => a [label="did you see c doing something?"];
|
50 |
-
a -> b [label="nope"];
|
51 |
-
b :> a [label="shall we ask again?"];
|
52 |
-
a => b [label="naah"];
|
53 |
-
...;
|
54 |
-
}
|
55 |
-
</textarea></div>
|
56 |
-
|
57 |
-
<script>
|
58 |
-
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
|
59 |
-
lineNumbers: true,
|
60 |
-
mode: "mscgen",
|
61 |
-
});
|
62 |
-
</script>
|
63 |
-
|
64 |
-
<p><strong>MIME types defined:</strong> <code>text/x-mscgen</code></p>
|
65 |
-
</article>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/mscgen/index_msgenny.html
DELETED
@@ -1,44 +0,0 @@
|
|
1 |
-
<!doctype html>
|
2 |
-
<html>
|
3 |
-
<head>
|
4 |
-
<meta charset="utf-8">
|
5 |
-
<title>CodeMirror: msgenny mode</title>
|
6 |
-
<link rel="stylesheet" href="../../lib/codemirror.css">
|
7 |
-
<script src="../../lib/codemirror.js"></script>
|
8 |
-
<script src="mscgen.js"></script>
|
9 |
-
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
10 |
-
</head>
|
11 |
-
<body>
|
12 |
-
<h1>CodeMirror: msgenny mode</h1>
|
13 |
-
|
14 |
-
<div><textarea id="code">
|
15 |
-
# Sample msgenny program
|
16 |
-
# https://sverweij.github.io/mscgen_js for more samples
|
17 |
-
|
18 |
-
a -> b : a -> b (signal);
|
19 |
-
a => b : a => b (method);
|
20 |
-
b >> a : b >> a (return value);
|
21 |
-
a =>> b : a =>> b (callback);
|
22 |
-
a -x b : a -x b (lost);
|
23 |
-
a :> b : a :> b (emphasis);
|
24 |
-
a .. b : a .. b (dotted);
|
25 |
-
a -- b : "a -- b straight line";
|
26 |
-
a note a : a note a\n(note),
|
27 |
-
b box b : b box b\n(action);
|
28 |
-
a rbox a : a rbox a\n(reference),
|
29 |
-
b abox b : b abox b\n(state/ condition);
|
30 |
-
||| : ||| (empty row);
|
31 |
-
... : ... (omitted row);
|
32 |
-
--- : --- (comment);
|
33 |
-
</textarea></div>
|
34 |
-
|
35 |
-
<script>
|
36 |
-
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
|
37 |
-
lineNumbers: true,
|
38 |
-
mode: "msgenny",
|
39 |
-
});
|
40 |
-
</script>
|
41 |
-
|
42 |
-
<p><strong>MIME types defined:</strong> <code>text/x-msgenny</code></p>
|
43 |
-
</body>
|
44 |
-
</html>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/mscgen/index_xu.html
DELETED
@@ -1,70 +0,0 @@
|
|
1 |
-
<!doctype html>
|
2 |
-
<html>
|
3 |
-
<head>
|
4 |
-
<meta charset="utf-8">
|
5 |
-
<title>CodeMirror: xu mode</title>
|
6 |
-
<link rel="stylesheet" href="../../lib/codemirror.css">
|
7 |
-
<script src="../../lib/codemirror.js"></script>
|
8 |
-
<script src="mscgen.js"></script>
|
9 |
-
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
10 |
-
</head>
|
11 |
-
<body>
|
12 |
-
<h1>CodeMirror: xù mode</h1>
|
13 |
-
|
14 |
-
<div><textarea id="code">
|
15 |
-
# test50 - expansions to mscgen to support inline expressions
|
16 |
-
# for now in a separate language: xù
|
17 |
-
msc {
|
18 |
-
|
19 |
-
hscale="0.8",
|
20 |
-
width="700";
|
21 |
-
|
22 |
-
a,
|
23 |
-
b [label="change store"],
|
24 |
-
c,
|
25 |
-
d [label="necro queue"],
|
26 |
-
e [label="natalis queue"],
|
27 |
-
f;
|
28 |
-
|
29 |
-
a =>> b [label="get change list()"];
|
30 |
-
a alt f [label="changes found"] { /* alt is a xu specific keyword*/
|
31 |
-
b >> a [label="list of changes"];
|
32 |
-
a =>> c [label="cull old stuff (list of changes)"];
|
33 |
-
b loop e [label="for each change"] { // loop is xu specific as well...
|
34 |
-
/*
|
35 |
-
* Here interesting stuff happens.
|
36 |
-
* TBD
|
37 |
-
*/
|
38 |
-
c =>> b [label="get change()"];
|
39 |
-
b >> c [label="change"];
|
40 |
-
c alt e [label="change too old"] {
|
41 |
-
c =>> d [label="queue(change)"];
|
42 |
-
--- [label="change newer than latest run"];
|
43 |
-
c =>> e [label="queue(change)"];
|
44 |
-
--- [label="all other cases"];
|
45 |
-
||| [label="leave well alone"];
|
46 |
-
};
|
47 |
-
};
|
48 |
-
|
49 |
-
|
50 |
-
c >> a [label="done
|
51 |
-
processing"];
|
52 |
-
|
53 |
-
/* shucks! nothing found ...*/
|
54 |
-
--- [label="nothing found"];
|
55 |
-
b >> a [label="nothing"];
|
56 |
-
a note a [label="silent exit"];
|
57 |
-
};
|
58 |
-
}
|
59 |
-
</textarea></div>
|
60 |
-
|
61 |
-
<script>
|
62 |
-
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
|
63 |
-
lineNumbers: true,
|
64 |
-
mode: "xu",
|
65 |
-
});
|
66 |
-
</script>
|
67 |
-
|
68 |
-
<p><strong>MIME types defined:</strong> <code>text/x-xu</code></p>
|
69 |
-
</body>
|
70 |
-
</html>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/mscgen/mscgen.js
DELETED
@@ -1,169 +0,0 @@
|
|
1 |
-
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
2 |
-
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
3 |
-
|
4 |
-
// mode(s) for the sequence chart dsl's mscgen, xù and msgenny
|
5 |
-
// For more information on mscgen, see the site of the original author:
|
6 |
-
// http://www.mcternan.me.uk/mscgen
|
7 |
-
//
|
8 |
-
// This mode for mscgen and the two derivative languages were
|
9 |
-
// originally made for use in the mscgen_js interpreter
|
10 |
-
// (https://sverweij.github.io/mscgen_js)
|
11 |
-
|
12 |
-
(function(mod) {
|
13 |
-
if ( typeof exports == "object" && typeof module == "object")// CommonJS
|
14 |
-
mod(require("../../lib/codemirror"));
|
15 |
-
else if ( typeof define == "function" && define.amd)// AMD
|
16 |
-
define(["../../lib/codemirror"], mod);
|
17 |
-
else// Plain browser env
|
18 |
-
mod(CodeMirror);
|
19 |
-
})(function(CodeMirror) {
|
20 |
-
"use strict";
|
21 |
-
|
22 |
-
var languages = {
|
23 |
-
mscgen: {
|
24 |
-
"keywords" : ["msc"],
|
25 |
-
"options" : ["hscale", "width", "arcgradient", "wordwraparcs"],
|
26 |
-
"attributes" : ["label", "idurl", "id", "url", "linecolor", "linecolour", "textcolor", "textcolour", "textbgcolor", "textbgcolour", "arclinecolor", "arclinecolour", "arctextcolor", "arctextcolour", "arctextbgcolor", "arctextbgcolour", "arcskip"],
|
27 |
-
"brackets" : ["\\{", "\\}"], // [ and ] are brackets too, but these get handled in with lists
|
28 |
-
"arcsWords" : ["note", "abox", "rbox", "box"],
|
29 |
-
"arcsOthers" : ["\\|\\|\\|", "\\.\\.\\.", "---", "--", "<->", "==", "<<=>>", "<=>", "\\.\\.", "<<>>", "::", "<:>", "->", "=>>", "=>", ">>", ":>", "<-", "<<=", "<=", "<<", "<:", "x-", "-x"],
|
30 |
-
"singlecomment" : ["//", "#"],
|
31 |
-
"operators" : ["="]
|
32 |
-
},
|
33 |
-
xu: {
|
34 |
-
"keywords" : ["msc"],
|
35 |
-
"options" : ["hscale", "width", "arcgradient", "wordwraparcs", "watermark"],
|
36 |
-
"attributes" : ["label", "idurl", "id", "url", "linecolor", "linecolour", "textcolor", "textcolour", "textbgcolor", "textbgcolour", "arclinecolor", "arclinecolour", "arctextcolor", "arctextcolour", "arctextbgcolor", "arctextbgcolour", "arcskip"],
|
37 |
-
"brackets" : ["\\{", "\\}"], // [ and ] are brackets too, but these get handled in with lists
|
38 |
-
"arcsWords" : ["note", "abox", "rbox", "box", "alt", "else", "opt", "break", "par", "seq", "strict", "neg", "critical", "ignore", "consider", "assert", "loop", "ref", "exc"],
|
39 |
-
"arcsOthers" : ["\\|\\|\\|", "\\.\\.\\.", "---", "--", "<->", "==", "<<=>>", "<=>", "\\.\\.", "<<>>", "::", "<:>", "->", "=>>", "=>", ">>", ":>", "<-", "<<=", "<=", "<<", "<:", "x-", "-x"],
|
40 |
-
"singlecomment" : ["//", "#"],
|
41 |
-
"operators" : ["="]
|
42 |
-
},
|
43 |
-
msgenny: {
|
44 |
-
"keywords" : null,
|
45 |
-
"options" : ["hscale", "width", "arcgradient", "wordwraparcs", "watermark"],
|
46 |
-
"attributes" : null,
|
47 |
-
"brackets" : ["\\{", "\\}"],
|
48 |
-
"arcsWords" : ["note", "abox", "rbox", "box", "alt", "else", "opt", "break", "par", "seq", "strict", "neg", "critical", "ignore", "consider", "assert", "loop", "ref", "exc"],
|
49 |
-
"arcsOthers" : ["\\|\\|\\|", "\\.\\.\\.", "---", "--", "<->", "==", "<<=>>", "<=>", "\\.\\.", "<<>>", "::", "<:>", "->", "=>>", "=>", ">>", ":>", "<-", "<<=", "<=", "<<", "<:", "x-", "-x"],
|
50 |
-
"singlecomment" : ["//", "#"],
|
51 |
-
"operators" : ["="]
|
52 |
-
}
|
53 |
-
}
|
54 |
-
|
55 |
-
CodeMirror.defineMode("mscgen", function(_, modeConfig) {
|
56 |
-
var language = languages[modeConfig && modeConfig.language || "mscgen"]
|
57 |
-
return {
|
58 |
-
startState: startStateFn,
|
59 |
-
copyState: copyStateFn,
|
60 |
-
token: produceTokenFunction(language),
|
61 |
-
lineComment : "#",
|
62 |
-
blockCommentStart : "/*",
|
63 |
-
blockCommentEnd : "*/"
|
64 |
-
};
|
65 |
-
});
|
66 |
-
|
67 |
-
CodeMirror.defineMIME("text/x-mscgen", "mscgen");
|
68 |
-
CodeMirror.defineMIME("text/x-xu", {name: "mscgen", language: "xu"});
|
69 |
-
CodeMirror.defineMIME("text/x-msgenny", {name: "mscgen", language: "msgenny"});
|
70 |
-
|
71 |
-
function wordRegexpBoundary(pWords) {
|
72 |
-
return new RegExp("\\b((" + pWords.join(")|(") + "))\\b", "i");
|
73 |
-
}
|
74 |
-
|
75 |
-
function wordRegexp(pWords) {
|
76 |
-
return new RegExp("((" + pWords.join(")|(") + "))", "i");
|
77 |
-
}
|
78 |
-
|
79 |
-
function startStateFn() {
|
80 |
-
return {
|
81 |
-
inComment : false,
|
82 |
-
inString : false,
|
83 |
-
inAttributeList : false,
|
84 |
-
inScript : false
|
85 |
-
};
|
86 |
-
}
|
87 |
-
|
88 |
-
function copyStateFn(pState) {
|
89 |
-
return {
|
90 |
-
inComment : pState.inComment,
|
91 |
-
inString : pState.inString,
|
92 |
-
inAttributeList : pState.inAttributeList,
|
93 |
-
inScript : pState.inScript
|
94 |
-
};
|
95 |
-
}
|
96 |
-
|
97 |
-
function produceTokenFunction(pConfig) {
|
98 |
-
|
99 |
-
return function(pStream, pState) {
|
100 |
-
if (pStream.match(wordRegexp(pConfig.brackets), true, true)) {
|
101 |
-
return "bracket";
|
102 |
-
}
|
103 |
-
/* comments */
|
104 |
-
if (!pState.inComment) {
|
105 |
-
if (pStream.match(/\/\*[^\*\/]*/, true, true)) {
|
106 |
-
pState.inComment = true;
|
107 |
-
return "comment";
|
108 |
-
}
|
109 |
-
if (pStream.match(wordRegexp(pConfig.singlecomment), true, true)) {
|
110 |
-
pStream.skipToEnd();
|
111 |
-
return "comment";
|
112 |
-
}
|
113 |
-
}
|
114 |
-
if (pState.inComment) {
|
115 |
-
if (pStream.match(/[^\*\/]*\*\//, true, true))
|
116 |
-
pState.inComment = false;
|
117 |
-
else
|
118 |
-
pStream.skipToEnd();
|
119 |
-
return "comment";
|
120 |
-
}
|
121 |
-
/* strings */
|
122 |
-
if (!pState.inString && pStream.match(/\"(\\\"|[^\"])*/, true, true)) {
|
123 |
-
pState.inString = true;
|
124 |
-
return "string";
|
125 |
-
}
|
126 |
-
if (pState.inString) {
|
127 |
-
if (pStream.match(/[^\"]*\"/, true, true))
|
128 |
-
pState.inString = false;
|
129 |
-
else
|
130 |
-
pStream.skipToEnd();
|
131 |
-
return "string";
|
132 |
-
}
|
133 |
-
/* keywords & operators */
|
134 |
-
if (!!pConfig.keywords && pStream.match(wordRegexpBoundary(pConfig.keywords), true, true))
|
135 |
-
return "keyword";
|
136 |
-
|
137 |
-
if (pStream.match(wordRegexpBoundary(pConfig.options), true, true))
|
138 |
-
return "keyword";
|
139 |
-
|
140 |
-
if (pStream.match(wordRegexpBoundary(pConfig.arcsWords), true, true))
|
141 |
-
return "keyword";
|
142 |
-
|
143 |
-
if (pStream.match(wordRegexp(pConfig.arcsOthers), true, true))
|
144 |
-
return "keyword";
|
145 |
-
|
146 |
-
if (!!pConfig.operators && pStream.match(wordRegexp(pConfig.operators), true, true))
|
147 |
-
return "operator";
|
148 |
-
|
149 |
-
/* attribute lists */
|
150 |
-
if (!pConfig.inAttributeList && !!pConfig.attributes && pStream.match(/\[/, true, true)) {
|
151 |
-
pConfig.inAttributeList = true;
|
152 |
-
return "bracket";
|
153 |
-
}
|
154 |
-
if (pConfig.inAttributeList) {
|
155 |
-
if (pConfig.attributes !== null && pStream.match(wordRegexpBoundary(pConfig.attributes), true, true)) {
|
156 |
-
return "attribute";
|
157 |
-
}
|
158 |
-
if (pStream.match(/]/, true, true)) {
|
159 |
-
pConfig.inAttributeList = false;
|
160 |
-
return "bracket";
|
161 |
-
}
|
162 |
-
}
|
163 |
-
|
164 |
-
pStream.next();
|
165 |
-
return "base";
|
166 |
-
};
|
167 |
-
}
|
168 |
-
|
169 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/mscgen/mscgen_test.js
DELETED
@@ -1,75 +0,0 @@
|
|
1 |
-
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
2 |
-
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
3 |
-
|
4 |
-
(function() {
|
5 |
-
var mode = CodeMirror.getMode({indentUnit: 2}, "mscgen");
|
6 |
-
function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); }
|
7 |
-
|
8 |
-
MT("empty chart",
|
9 |
-
"[keyword msc][bracket {]",
|
10 |
-
"[base ]",
|
11 |
-
"[bracket }]"
|
12 |
-
);
|
13 |
-
|
14 |
-
MT("comments",
|
15 |
-
"[comment // a single line comment]",
|
16 |
-
"[comment # another single line comment /* and */ ignored here]",
|
17 |
-
"[comment /* A multi-line comment even though it contains]",
|
18 |
-
"[comment msc keywords and \"quoted text\"*/]");
|
19 |
-
|
20 |
-
MT("strings",
|
21 |
-
"[string \"// a string\"]",
|
22 |
-
"[string \"a string running over]",
|
23 |
-
"[string two lines\"]",
|
24 |
-
"[string \"with \\\"escaped quote\"]"
|
25 |
-
);
|
26 |
-
|
27 |
-
MT("xù/ msgenny keywords classify as 'base'",
|
28 |
-
"[base watermark]",
|
29 |
-
"[base alt loop opt ref else break par seq assert]"
|
30 |
-
);
|
31 |
-
|
32 |
-
MT("mscgen options classify as keyword",
|
33 |
-
"[keyword hscale]", "[keyword width]", "[keyword arcgradient]", "[keyword wordwraparcs]"
|
34 |
-
);
|
35 |
-
|
36 |
-
MT("mscgen arcs classify as keyword",
|
37 |
-
"[keyword note]","[keyword abox]","[keyword rbox]","[keyword box]",
|
38 |
-
"[keyword |||...---]", "[keyword ..--==::]",
|
39 |
-
"[keyword ->]", "[keyword <-]", "[keyword <->]",
|
40 |
-
"[keyword =>]", "[keyword <=]", "[keyword <=>]",
|
41 |
-
"[keyword =>>]", "[keyword <<=]", "[keyword <<=>>]",
|
42 |
-
"[keyword >>]", "[keyword <<]", "[keyword <<>>]",
|
43 |
-
"[keyword -x]", "[keyword x-]", "[keyword -X]", "[keyword X-]",
|
44 |
-
"[keyword :>]", "[keyword <:]", "[keyword <:>]"
|
45 |
-
);
|
46 |
-
|
47 |
-
MT("within an attribute list, attributes classify as attribute",
|
48 |
-
"[bracket [[][attribute label]",
|
49 |
-
"[attribute id]","[attribute url]","[attribute idurl]",
|
50 |
-
"[attribute linecolor]","[attribute linecolour]","[attribute textcolor]","[attribute textcolour]","[attribute textbgcolor]","[attribute textbgcolour]",
|
51 |
-
"[attribute arclinecolor]","[attribute arclinecolour]","[attribute arctextcolor]","[attribute arctextcolour]","[attribute arctextbgcolor]","[attribute arctextbgcolour]",
|
52 |
-
"[attribute arcskip][bracket ]]]"
|
53 |
-
);
|
54 |
-
|
55 |
-
MT("outside an attribute list, attributes classify as base",
|
56 |
-
"[base label]",
|
57 |
-
"[base id]","[base url]","[base idurl]",
|
58 |
-
"[base linecolor]","[base linecolour]","[base textcolor]","[base textcolour]","[base textbgcolor]","[base textbgcolour]",
|
59 |
-
"[base arclinecolor]","[base arclinecolour]","[base arctextcolor]","[base arctextcolour]","[base arctextbgcolor]","[base arctextbgcolour]",
|
60 |
-
"[base arcskip]"
|
61 |
-
);
|
62 |
-
|
63 |
-
MT("a typical program",
|
64 |
-
"[comment # typical mscgen program]",
|
65 |
-
"[keyword msc][base ][bracket {]",
|
66 |
-
"[keyword wordwraparcs][operator =][string \"true\"][base , ][keyword hscale][operator =][string \"0.8\"][keyword arcgradient][operator =][base 30;]",
|
67 |
-
"[base a][bracket [[][attribute label][operator =][string \"Entity A\"][bracket ]]][base ,]",
|
68 |
-
"[base b][bracket [[][attribute label][operator =][string \"Entity B\"][bracket ]]][base ,]",
|
69 |
-
"[base c][bracket [[][attribute label][operator =][string \"Entity C\"][bracket ]]][base ;]",
|
70 |
-
"[base a ][keyword =>>][base b][bracket [[][attribute label][operator =][string \"Hello entity B\"][bracket ]]][base ;]",
|
71 |
-
"[base a ][keyword <<][base b][bracket [[][attribute label][operator =][string \"Here's an answer dude!\"][bracket ]]][base ;]",
|
72 |
-
"[base c ][keyword :>][base *][bracket [[][attribute label][operator =][string \"What about me?\"][base , ][attribute textcolor][operator =][base red][bracket ]]][base ;]",
|
73 |
-
"[bracket }]"
|
74 |
-
);
|
75 |
-
})();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/mscgen/msgenny_test.js
DELETED
@@ -1,71 +0,0 @@
|
|
1 |
-
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
2 |
-
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
3 |
-
|
4 |
-
(function() {
|
5 |
-
var mode = CodeMirror.getMode({indentUnit: 2}, "text/x-msgenny");
|
6 |
-
function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1), "msgenny"); }
|
7 |
-
|
8 |
-
MT("comments",
|
9 |
-
"[comment // a single line comment]",
|
10 |
-
"[comment # another single line comment /* and */ ignored here]",
|
11 |
-
"[comment /* A multi-line comment even though it contains]",
|
12 |
-
"[comment msc keywords and \"quoted text\"*/]");
|
13 |
-
|
14 |
-
MT("strings",
|
15 |
-
"[string \"// a string\"]",
|
16 |
-
"[string \"a string running over]",
|
17 |
-
"[string two lines\"]",
|
18 |
-
"[string \"with \\\"escaped quote\"]"
|
19 |
-
);
|
20 |
-
|
21 |
-
MT("xù/ msgenny keywords classify as 'keyword'",
|
22 |
-
"[keyword watermark]",
|
23 |
-
"[keyword alt]","[keyword loop]","[keyword opt]","[keyword ref]","[keyword else]","[keyword break]","[keyword par]","[keyword seq]","[keyword assert]"
|
24 |
-
);
|
25 |
-
|
26 |
-
MT("mscgen options classify as keyword",
|
27 |
-
"[keyword hscale]", "[keyword width]", "[keyword arcgradient]", "[keyword wordwraparcs]"
|
28 |
-
);
|
29 |
-
|
30 |
-
MT("mscgen arcs classify as keyword",
|
31 |
-
"[keyword note]","[keyword abox]","[keyword rbox]","[keyword box]",
|
32 |
-
"[keyword |||...---]", "[keyword ..--==::]",
|
33 |
-
"[keyword ->]", "[keyword <-]", "[keyword <->]",
|
34 |
-
"[keyword =>]", "[keyword <=]", "[keyword <=>]",
|
35 |
-
"[keyword =>>]", "[keyword <<=]", "[keyword <<=>>]",
|
36 |
-
"[keyword >>]", "[keyword <<]", "[keyword <<>>]",
|
37 |
-
"[keyword -x]", "[keyword x-]", "[keyword -X]", "[keyword X-]",
|
38 |
-
"[keyword :>]", "[keyword <:]", "[keyword <:>]"
|
39 |
-
);
|
40 |
-
|
41 |
-
MT("within an attribute list, mscgen/ xù attributes classify as base",
|
42 |
-
"[base [[label]",
|
43 |
-
"[base idurl id url]",
|
44 |
-
"[base linecolor linecolour textcolor textcolour textbgcolor textbgcolour]",
|
45 |
-
"[base arclinecolor arclinecolour arctextcolor arctextcolour arctextbgcolor arctextbgcolour]",
|
46 |
-
"[base arcskip]]]"
|
47 |
-
);
|
48 |
-
|
49 |
-
MT("outside an attribute list, mscgen/ xù attributes classify as base",
|
50 |
-
"[base label]",
|
51 |
-
"[base idurl id url]",
|
52 |
-
"[base linecolor linecolour textcolor textcolour textbgcolor textbgcolour]",
|
53 |
-
"[base arclinecolor arclinecolour arctextcolor arctextcolour arctextbgcolor arctextbgcolour]",
|
54 |
-
"[base arcskip]"
|
55 |
-
);
|
56 |
-
|
57 |
-
MT("a typical program",
|
58 |
-
"[comment # typical msgenny program]",
|
59 |
-
"[keyword wordwraparcs][operator =][string \"true\"][base , ][keyword hscale][operator =][string \"0.8\"][base , ][keyword arcgradient][operator =][base 30;]",
|
60 |
-
"[base a : ][string \"Entity A\"][base ,]",
|
61 |
-
"[base b : Entity B,]",
|
62 |
-
"[base c : Entity C;]",
|
63 |
-
"[base a ][keyword =>>][base b: ][string \"Hello entity B\"][base ;]",
|
64 |
-
"[base a ][keyword alt][base c][bracket {]",
|
65 |
-
"[base a ][keyword <<][base b: ][string \"Here's an answer dude!\"][base ;]",
|
66 |
-
"[keyword ---][base : ][string \"sorry, won't march - comm glitch\"]",
|
67 |
-
"[base a ][keyword x-][base b: ][string \"Here's an answer dude! (won't arrive...)\"][base ;]",
|
68 |
-
"[bracket }]",
|
69 |
-
"[base c ][keyword :>][base *: What about me?;]"
|
70 |
-
);
|
71 |
-
})();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/mscgen/xu_test.js
DELETED
@@ -1,75 +0,0 @@
|
|
1 |
-
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
2 |
-
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
3 |
-
|
4 |
-
(function() {
|
5 |
-
var mode = CodeMirror.getMode({indentUnit: 2}, "text/x-xu");
|
6 |
-
function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1), "xu"); }
|
7 |
-
|
8 |
-
MT("empty chart",
|
9 |
-
"[keyword msc][bracket {]",
|
10 |
-
"[base ]",
|
11 |
-
"[bracket }]"
|
12 |
-
);
|
13 |
-
|
14 |
-
MT("comments",
|
15 |
-
"[comment // a single line comment]",
|
16 |
-
"[comment # another single line comment /* and */ ignored here]",
|
17 |
-
"[comment /* A multi-line comment even though it contains]",
|
18 |
-
"[comment msc keywords and \"quoted text\"*/]");
|
19 |
-
|
20 |
-
MT("strings",
|
21 |
-
"[string \"// a string\"]",
|
22 |
-
"[string \"a string running over]",
|
23 |
-
"[string two lines\"]",
|
24 |
-
"[string \"with \\\"escaped quote\"]"
|
25 |
-
);
|
26 |
-
|
27 |
-
MT("xù/ msgenny keywords classify as 'keyword'",
|
28 |
-
"[keyword watermark]",
|
29 |
-
"[keyword alt]","[keyword loop]","[keyword opt]","[keyword ref]","[keyword else]","[keyword break]","[keyword par]","[keyword seq]","[keyword assert]"
|
30 |
-
);
|
31 |
-
|
32 |
-
MT("mscgen options classify as keyword",
|
33 |
-
"[keyword hscale]", "[keyword width]", "[keyword arcgradient]", "[keyword wordwraparcs]"
|
34 |
-
);
|
35 |
-
|
36 |
-
MT("mscgen arcs classify as keyword",
|
37 |
-
"[keyword note]","[keyword abox]","[keyword rbox]","[keyword box]",
|
38 |
-
"[keyword |||...---]", "[keyword ..--==::]",
|
39 |
-
"[keyword ->]", "[keyword <-]", "[keyword <->]",
|
40 |
-
"[keyword =>]", "[keyword <=]", "[keyword <=>]",
|
41 |
-
"[keyword =>>]", "[keyword <<=]", "[keyword <<=>>]",
|
42 |
-
"[keyword >>]", "[keyword <<]", "[keyword <<>>]",
|
43 |
-
"[keyword -x]", "[keyword x-]", "[keyword -X]", "[keyword X-]",
|
44 |
-
"[keyword :>]", "[keyword <:]", "[keyword <:>]"
|
45 |
-
);
|
46 |
-
|
47 |
-
MT("within an attribute list, attributes classify as attribute",
|
48 |
-
"[bracket [[][attribute label]",
|
49 |
-
"[attribute id]","[attribute url]","[attribute idurl]",
|
50 |
-
"[attribute linecolor]","[attribute linecolour]","[attribute textcolor]","[attribute textcolour]","[attribute textbgcolor]","[attribute textbgcolour]",
|
51 |
-
"[attribute arclinecolor]","[attribute arclinecolour]","[attribute arctextcolor]","[attribute arctextcolour]","[attribute arctextbgcolor]","[attribute arctextbgcolour]",
|
52 |
-
"[attribute arcskip][bracket ]]]"
|
53 |
-
);
|
54 |
-
|
55 |
-
MT("outside an attribute list, attributes classify as base",
|
56 |
-
"[base label]",
|
57 |
-
"[base id]","[base url]","[base idurl]",
|
58 |
-
"[base linecolor]","[base linecolour]","[base textcolor]","[base textcolour]","[base textbgcolor]","[base textbgcolour]",
|
59 |
-
"[base arclinecolor]","[base arclinecolour]","[base arctextcolor]","[base arctextcolour]","[base arctextbgcolor]","[base arctextbgcolour]",
|
60 |
-
"[base arcskip]"
|
61 |
-
);
|
62 |
-
|
63 |
-
MT("a typical program",
|
64 |
-
"[comment # typical mscgen program]",
|
65 |
-
"[keyword msc][base ][bracket {]",
|
66 |
-
"[keyword wordwraparcs][operator =][string \"true\"][keyword hscale][operator =][string \"0.8\"][keyword arcgradient][operator =][base 30;]",
|
67 |
-
"[base a][bracket [[][attribute label][operator =][string \"Entity A\"][bracket ]]][base ,]",
|
68 |
-
"[base b][bracket [[][attribute label][operator =][string \"Entity B\"][bracket ]]][base ,]",
|
69 |
-
"[base c][bracket [[][attribute label][operator =][string \"Entity C\"][bracket ]]][base ;]",
|
70 |
-
"[base a ][keyword =>>][base b][bracket [[][attribute label][operator =][string \"Hello entity B\"][bracket ]]][base ;]",
|
71 |
-
"[base a ][keyword <<][base b][bracket [[][attribute label][operator =][string \"Here's an answer dude!\"][bracket ]]][base ;]",
|
72 |
-
"[base c ][keyword :>][base *][bracket [[][attribute label][operator =][string \"What about me?\"][base , ][attribute textcolor][operator =][base red][bracket ]]][base ;]",
|
73 |
-
"[bracket }]"
|
74 |
-
);
|
75 |
-
})();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/mumps/index.html
DELETED
@@ -1,85 +0,0 @@
|
|
1 |
-
<!doctype html>
|
2 |
-
|
3 |
-
<title>CodeMirror: MUMPS mode</title>
|
4 |
-
<meta charset="utf-8"/>
|
5 |
-
<link rel=stylesheet href="../../doc/docs.css">
|
6 |
-
|
7 |
-
<link rel="stylesheet" href="../../lib/codemirror.css">
|
8 |
-
<script src="../../lib/codemirror.js"></script>
|
9 |
-
<script src="mumps.js"></script>
|
10 |
-
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
11 |
-
<div id=nav>
|
12 |
-
<a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
13 |
-
|
14 |
-
<ul>
|
15 |
-
<li><a href="../../index.html">Home</a>
|
16 |
-
<li><a href="../../doc/manual.html">Manual</a>
|
17 |
-
<li><a href="https://github.com/codemirror/codemirror">Code</a>
|
18 |
-
</ul>
|
19 |
-
<ul>
|
20 |
-
<li><a href="../index.html">Language modes</a>
|
21 |
-
<li><a class=active href="#">MUMPS</a>
|
22 |
-
</ul>
|
23 |
-
</div>
|
24 |
-
|
25 |
-
<article>
|
26 |
-
<h2>MUMPS mode</h2>
|
27 |
-
|
28 |
-
|
29 |
-
<div><textarea id="code" name="code">
|
30 |
-
; Lloyd Milligan
|
31 |
-
; 03-30-2015
|
32 |
-
;
|
33 |
-
; MUMPS support for Code Mirror - Excerpts below from routine ^XUS
|
34 |
-
;
|
35 |
-
CHECKAV(X1) ;Check A/V code return DUZ or Zero. (Called from XUSRB)
|
36 |
-
N %,%1,X,Y,IEN,DA,DIK
|
37 |
-
S IEN=0
|
38 |
-
;Start CCOW
|
39 |
-
I $E(X1,1,7)="~~TOK~~" D Q:IEN>0 IEN
|
40 |
-
. I $E(X1,8,9)="~1" S IEN=$$CHKASH^XUSRB4($E(X1,8,255))
|
41 |
-
. I $E(X1,8,9)="~2" S IEN=$$CHKCCOW^XUSRB4($E(X1,8,255))
|
42 |
-
. Q
|
43 |
-
;End CCOW
|
44 |
-
S X1=$$UP(X1) S:X1[":" XUTT=1,X1=$TR(X1,":")
|
45 |
-
S X=$P(X1,";") Q:X="^" -1 S:XUF %1="Access: "_X
|
46 |
-
Q:X'?1.20ANP 0
|
47 |
-
S X=$$EN^XUSHSH(X) I '$D(^VA(200,"A",X)) D LBAV Q 0
|
48 |
-
S %1="",IEN=$O(^VA(200,"A",X,0)),XUF(.3)=IEN D USER(IEN)
|
49 |
-
S X=$P(X1,";",2) S:XUF %1="Verify: "_X S X=$$EN^XUSHSH(X)
|
50 |
-
I $P(XUSER(1),"^",2)'=X D LBAV Q 0
|
51 |
-
I $G(XUFAC(1)) S DIK="^XUSEC(4,",DA=XUFAC(1) D ^DIK
|
52 |
-
Q IEN
|
53 |
-
;
|
54 |
-
; Spell out commands
|
55 |
-
;
|
56 |
-
SET2() ;EF. Return error code (also called from XUSRB)
|
57 |
-
NEW %,X
|
58 |
-
SET XUNOW=$$HTFM^XLFDT($H),DT=$P(XUNOW,".")
|
59 |
-
KILL DUZ,XUSER
|
60 |
-
SET (DUZ,DUZ(2))=0,(DUZ(0),DUZ("AG"),XUSER(0),XUSER(1),XUTT,%UCI)=""
|
61 |
-
SET %=$$INHIBIT^XUSRB() IF %>0 QUIT %
|
62 |
-
SET X=$G(^%ZIS(1,XUDEV,"XUS")),XU1=$G(^(1))
|
63 |
-
IF $L(X) FOR I=1:1:15 IF $L($P(X,U,I)) SET $P(XOPT,U,I)=$P(X,U,I)
|
64 |
-
SET DTIME=600
|
65 |
-
IF '$P(XOPT,U,11),$D(^%ZIS(1,XUDEV,90)),^(90)>2800000,^(90)'>DT QUIT 8
|
66 |
-
QUIT 0
|
67 |
-
;
|
68 |
-
; Spell out commands and functions
|
69 |
-
;
|
70 |
-
IF $PIECE(XUSER(0),U,11),$PIECE(XUSER(0),U,11)'>DT QUIT 11 ;Terminated
|
71 |
-
IF $DATA(DUZ("ASH")) QUIT 0 ;If auto handle, Allow to sign-on p434
|
72 |
-
IF $PIECE(XUSER(0),U,7) QUIT 5 ;Disuser flag set
|
73 |
-
IF '$LENGTH($PIECE(XUSER(1),U,2)) QUIT 21 ;p419, p434
|
74 |
-
Q 0
|
75 |
-
;
|
76 |
-
</textarea>
|
77 |
-
<script>
|
78 |
-
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
|
79 |
-
mode: "mumps",
|
80 |
-
lineNumbers: true,
|
81 |
-
lineWrapping: true
|
82 |
-
});
|
83 |
-
</script>
|
84 |
-
|
85 |
-
</article>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/mumps/mumps.js
DELETED
@@ -1,148 +0,0 @@
|
|
1 |
-
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
2 |
-
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
3 |
-
|
4 |
-
/*
|
5 |
-
This MUMPS Language script was constructed using vbscript.js as a template.
|
6 |
-
*/
|
7 |
-
|
8 |
-
(function(mod) {
|
9 |
-
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
10 |
-
mod(require("../../lib/codemirror"));
|
11 |
-
else if (typeof define == "function" && define.amd) // AMD
|
12 |
-
define(["../../lib/codemirror"], mod);
|
13 |
-
else // Plain browser env
|
14 |
-
mod(CodeMirror);
|
15 |
-
})(function(CodeMirror) {
|
16 |
-
"use strict";
|
17 |
-
|
18 |
-
CodeMirror.defineMode("mumps", function() {
|
19 |
-
function wordRegexp(words) {
|
20 |
-
return new RegExp("^((" + words.join(")|(") + "))\\b", "i");
|
21 |
-
}
|
22 |
-
|
23 |
-
var singleOperators = new RegExp("^[\\+\\-\\*/&#!_?\\\\<>=\\'\\[\\]]");
|
24 |
-
var doubleOperators = new RegExp("^(('=)|(<=)|(>=)|('>)|('<)|([[)|(]])|(^$))");
|
25 |
-
var singleDelimiters = new RegExp("^[\\.,:]");
|
26 |
-
var brackets = new RegExp("[()]");
|
27 |
-
var identifiers = new RegExp("^[%A-Za-z][A-Za-z0-9]*");
|
28 |
-
var commandKeywords = ["break","close","do","else","for","goto", "halt", "hang", "if", "job","kill","lock","merge","new","open", "quit", "read", "set", "tcommit", "trollback", "tstart", "use", "view", "write", "xecute", "b","c","d","e","f","g", "h", "i", "j","k","l","m","n","o", "q", "r", "s", "tc", "tro", "ts", "u", "v", "w", "x"];
|
29 |
-
// The following list includes instrinsic functions _and_ special variables
|
30 |
-
var intrinsicFuncsWords = ["\\$ascii", "\\$char", "\\$data", "\\$ecode", "\\$estack", "\\$etrap", "\\$extract", "\\$find", "\\$fnumber", "\\$get", "\\$horolog", "\\$io", "\\$increment", "\\$job", "\\$justify", "\\$length", "\\$name", "\\$next", "\\$order", "\\$piece", "\\$qlength", "\\$qsubscript", "\\$query", "\\$quit", "\\$random", "\\$reverse", "\\$select", "\\$stack", "\\$test", "\\$text", "\\$translate", "\\$view", "\\$x", "\\$y", "\\$a", "\\$c", "\\$d", "\\$e", "\\$ec", "\\$es", "\\$et", "\\$f", "\\$fn", "\\$g", "\\$h", "\\$i", "\\$j", "\\$l", "\\$n", "\\$na", "\\$o", "\\$p", "\\$q", "\\$ql", "\\$qs", "\\$r", "\\$re", "\\$s", "\\$st", "\\$t", "\\$tr", "\\$v", "\\$z"];
|
31 |
-
var intrinsicFuncs = wordRegexp(intrinsicFuncsWords);
|
32 |
-
var command = wordRegexp(commandKeywords);
|
33 |
-
|
34 |
-
function tokenBase(stream, state) {
|
35 |
-
if (stream.sol()) {
|
36 |
-
state.label = true;
|
37 |
-
state.commandMode = 0;
|
38 |
-
}
|
39 |
-
|
40 |
-
// The <space> character has meaning in MUMPS. Ignoring consecutive
|
41 |
-
// spaces would interfere with interpreting whether the next non-space
|
42 |
-
// character belongs to the command or argument context.
|
43 |
-
|
44 |
-
// Examine each character and update a mode variable whose interpretation is:
|
45 |
-
// >0 => command 0 => argument <0 => command post-conditional
|
46 |
-
var ch = stream.peek();
|
47 |
-
|
48 |
-
if (ch == " " || ch == "\t") { // Pre-process <space>
|
49 |
-
state.label = false;
|
50 |
-
if (state.commandMode == 0)
|
51 |
-
state.commandMode = 1;
|
52 |
-
else if ((state.commandMode < 0) || (state.commandMode == 2))
|
53 |
-
state.commandMode = 0;
|
54 |
-
} else if ((ch != ".") && (state.commandMode > 0)) {
|
55 |
-
if (ch == ":")
|
56 |
-
state.commandMode = -1; // SIS - Command post-conditional
|
57 |
-
else
|
58 |
-
state.commandMode = 2;
|
59 |
-
}
|
60 |
-
|
61 |
-
// Do not color parameter list as line tag
|
62 |
-
if ((ch === "(") || (ch === "\u0009"))
|
63 |
-
state.label = false;
|
64 |
-
|
65 |
-
// MUMPS comment starts with ";"
|
66 |
-
if (ch === ";") {
|
67 |
-
stream.skipToEnd();
|
68 |
-
return "comment";
|
69 |
-
}
|
70 |
-
|
71 |
-
// Number Literals // SIS/RLM - MUMPS permits canonic number followed by concatenate operator
|
72 |
-
if (stream.match(/^[-+]?\d+(\.\d+)?([eE][-+]?\d+)?/))
|
73 |
-
return "number";
|
74 |
-
|
75 |
-
// Handle Strings
|
76 |
-
if (ch == '"') {
|
77 |
-
if (stream.skipTo('"')) {
|
78 |
-
stream.next();
|
79 |
-
return "string";
|
80 |
-
} else {
|
81 |
-
stream.skipToEnd();
|
82 |
-
return "error";
|
83 |
-
}
|
84 |
-
}
|
85 |
-
|
86 |
-
// Handle operators and Delimiters
|
87 |
-
if (stream.match(doubleOperators) || stream.match(singleOperators))
|
88 |
-
return "operator";
|
89 |
-
|
90 |
-
// Prevents leading "." in DO block from falling through to error
|
91 |
-
if (stream.match(singleDelimiters))
|
92 |
-
return null;
|
93 |
-
|
94 |
-
if (brackets.test(ch)) {
|
95 |
-
stream.next();
|
96 |
-
return "bracket";
|
97 |
-
}
|
98 |
-
|
99 |
-
if (state.commandMode > 0 && stream.match(command))
|
100 |
-
return "variable-2";
|
101 |
-
|
102 |
-
if (stream.match(intrinsicFuncs))
|
103 |
-
return "builtin";
|
104 |
-
|
105 |
-
if (stream.match(identifiers))
|
106 |
-
return "variable";
|
107 |
-
|
108 |
-
// Detect dollar-sign when not a documented intrinsic function
|
109 |
-
// "^" may introduce a GVN or SSVN - Color same as function
|
110 |
-
if (ch === "$" || ch === "^") {
|
111 |
-
stream.next();
|
112 |
-
return "builtin";
|
113 |
-
}
|
114 |
-
|
115 |
-
// MUMPS Indirection
|
116 |
-
if (ch === "@") {
|
117 |
-
stream.next();
|
118 |
-
return "string-2";
|
119 |
-
}
|
120 |
-
|
121 |
-
if (/[\w%]/.test(ch)) {
|
122 |
-
stream.eatWhile(/[\w%]/);
|
123 |
-
return "variable";
|
124 |
-
}
|
125 |
-
|
126 |
-
// Handle non-detected items
|
127 |
-
stream.next();
|
128 |
-
return "error";
|
129 |
-
}
|
130 |
-
|
131 |
-
return {
|
132 |
-
startState: function() {
|
133 |
-
return {
|
134 |
-
label: false,
|
135 |
-
commandMode: 0
|
136 |
-
};
|
137 |
-
},
|
138 |
-
|
139 |
-
token: function(stream, state) {
|
140 |
-
var style = tokenBase(stream, state);
|
141 |
-
if (state.label) return "tag";
|
142 |
-
return style;
|
143 |
-
}
|
144 |
-
};
|
145 |
-
});
|
146 |
-
|
147 |
-
CodeMirror.defineMIME("text/x-mumps", "mumps");
|
148 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/nginx/index.html
DELETED
@@ -1,181 +0,0 @@
|
|
1 |
-
<!doctype html>
|
2 |
-
|
3 |
-
<title>CodeMirror: NGINX mode</title>
|
4 |
-
<meta charset="utf-8"/>
|
5 |
-
<link rel=stylesheet href="../../doc/docs.css">
|
6 |
-
|
7 |
-
<link rel="stylesheet" href="../../lib/codemirror.css">
|
8 |
-
<script src="../../lib/codemirror.js"></script>
|
9 |
-
<script src="nginx.js"></script>
|
10 |
-
<style>.CodeMirror {background: #f8f8f8;}</style>
|
11 |
-
<link rel="stylesheet" href="../../doc/docs.css">
|
12 |
-
</head>
|
13 |
-
|
14 |
-
<style>
|
15 |
-
body {
|
16 |
-
margin: 0em auto;
|
17 |
-
}
|
18 |
-
|
19 |
-
.CodeMirror, .CodeMirror-scroll {
|
20 |
-
height: 600px;
|
21 |
-
}
|
22 |
-
</style>
|
23 |
-
<div id=nav>
|
24 |
-
<a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
25 |
-
|
26 |
-
<ul>
|
27 |
-
<li><a href="../../index.html">Home</a>
|
28 |
-
<li><a href="../../doc/manual.html">Manual</a>
|
29 |
-
<li><a href="https://github.com/codemirror/codemirror">Code</a>
|
30 |
-
</ul>
|
31 |
-
<ul>
|
32 |
-
<li><a href="../index.html">Language modes</a>
|
33 |
-
<li><a class=active href="#">NGINX</a>
|
34 |
-
</ul>
|
35 |
-
</div>
|
36 |
-
|
37 |
-
<article>
|
38 |
-
<h2>NGINX mode</h2>
|
39 |
-
<form><textarea id="code" name="code" style="height: 800px;">
|
40 |
-
server {
|
41 |
-
listen 173.255.219.235:80;
|
42 |
-
server_name website.com.au;
|
43 |
-
rewrite / $scheme://www.$host$request_uri permanent; ## Forcibly prepend a www
|
44 |
-
}
|
45 |
-
|
46 |
-
server {
|
47 |
-
listen 173.255.219.235:443;
|
48 |
-
server_name website.com.au;
|
49 |
-
rewrite / $scheme://www.$host$request_uri permanent; ## Forcibly prepend a www
|
50 |
-
}
|
51 |
-
|
52 |
-
server {
|
53 |
-
|
54 |
-
listen 173.255.219.235:80;
|
55 |
-
server_name www.website.com.au;
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
root /data/www;
|
60 |
-
index index.html index.php;
|
61 |
-
|
62 |
-
location / {
|
63 |
-
index index.html index.php; ## Allow a static html file to be shown first
|
64 |
-
try_files $uri $uri/ @handler; ## If missing pass the URI to Magento's front handler
|
65 |
-
expires 30d; ## Assume all files are cachable
|
66 |
-
}
|
67 |
-
|
68 |
-
## These locations would be hidden by .htaccess normally
|
69 |
-
location /app/ { deny all; }
|
70 |
-
location /includes/ { deny all; }
|
71 |
-
location /lib/ { deny all; }
|
72 |
-
location /media/downloadable/ { deny all; }
|
73 |
-
location /pkginfo/ { deny all; }
|
74 |
-
location /report/config.xml { deny all; }
|
75 |
-
location /var/ { deny all; }
|
76 |
-
|
77 |
-
location /var/export/ { ## Allow admins only to view export folder
|
78 |
-
auth_basic "Restricted"; ## Message shown in login window
|
79 |
-
auth_basic_user_file /rs/passwords/testfile; ## See /etc/nginx/htpassword
|
80 |
-
autoindex on;
|
81 |
-
}
|
82 |
-
|
83 |
-
location /. { ## Disable .htaccess and other hidden files
|
84 |
-
return 404;
|
85 |
-
}
|
86 |
-
|
87 |
-
location @handler { ## Magento uses a common front handler
|
88 |
-
rewrite / /index.php;
|
89 |
-
}
|
90 |
-
|
91 |
-
location ~ .php/ { ## Forward paths like /js/index.php/x.js to relevant handler
|
92 |
-
rewrite ^/(.*.php)/ /$1 last;
|
93 |
-
}
|
94 |
-
|
95 |
-
location ~ \.php$ {
|
96 |
-
if (!-e $request_filename) { rewrite / /index.php last; } ## Catch 404s that try_files miss
|
97 |
-
|
98 |
-
fastcgi_pass 127.0.0.1:9000;
|
99 |
-
fastcgi_index index.php;
|
100 |
-
fastcgi_param PATH_INFO $fastcgi_script_name;
|
101 |
-
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
102 |
-
include /rs/confs/nginx/fastcgi_params;
|
103 |
-
}
|
104 |
-
|
105 |
-
}
|
106 |
-
|
107 |
-
|
108 |
-
server {
|
109 |
-
|
110 |
-
listen 173.255.219.235:443;
|
111 |
-
server_name website.com.au www.website.com.au;
|
112 |
-
|
113 |
-
root /data/www;
|
114 |
-
index index.html index.php;
|
115 |
-
|
116 |
-
ssl on;
|
117 |
-
ssl_certificate /rs/ssl/ssl.crt;
|
118 |
-
ssl_certificate_key /rs/ssl/ssl.key;
|
119 |
-
|
120 |
-
ssl_session_timeout 5m;
|
121 |
-
|
122 |
-
ssl_protocols SSLv2 SSLv3 TLSv1;
|
123 |
-
ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
|
124 |
-
ssl_prefer_server_ciphers on;
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
location / {
|
129 |
-
index index.html index.php; ## Allow a static html file to be shown first
|
130 |
-
try_files $uri $uri/ @handler; ## If missing pass the URI to Magento's front handler
|
131 |
-
expires 30d; ## Assume all files are cachable
|
132 |
-
}
|
133 |
-
|
134 |
-
## These locations would be hidden by .htaccess normally
|
135 |
-
location /app/ { deny all; }
|
136 |
-
location /includes/ { deny all; }
|
137 |
-
location /lib/ { deny all; }
|
138 |
-
location /media/downloadable/ { deny all; }
|
139 |
-
location /pkginfo/ { deny all; }
|
140 |
-
location /report/config.xml { deny all; }
|
141 |
-
location /var/ { deny all; }
|
142 |
-
|
143 |
-
location /var/export/ { ## Allow admins only to view export folder
|
144 |
-
auth_basic "Restricted"; ## Message shown in login window
|
145 |
-
auth_basic_user_file htpasswd; ## See /etc/nginx/htpassword
|
146 |
-
autoindex on;
|
147 |
-
}
|
148 |
-
|
149 |
-
location /. { ## Disable .htaccess and other hidden files
|
150 |
-
return 404;
|
151 |
-
}
|
152 |
-
|
153 |
-
location @handler { ## Magento uses a common front handler
|
154 |
-
rewrite / /index.php;
|
155 |
-
}
|
156 |
-
|
157 |
-
location ~ .php/ { ## Forward paths like /js/index.php/x.js to relevant handler
|
158 |
-
rewrite ^/(.*.php)/ /$1 last;
|
159 |
-
}
|
160 |
-
|
161 |
-
location ~ .php$ { ## Execute PHP scripts
|
162 |
-
if (!-e $request_filename) { rewrite /index.php last; } ## Catch 404s that try_files miss
|
163 |
-
|
164 |
-
fastcgi_pass 127.0.0.1:9000;
|
165 |
-
fastcgi_index index.php;
|
166 |
-
fastcgi_param PATH_INFO $fastcgi_script_name;
|
167 |
-
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
168 |
-
include /rs/confs/nginx/fastcgi_params;
|
169 |
-
|
170 |
-
fastcgi_param HTTPS on;
|
171 |
-
}
|
172 |
-
|
173 |
-
}
|
174 |
-
</textarea></form>
|
175 |
-
<script>
|
176 |
-
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {});
|
177 |
-
</script>
|
178 |
-
|
179 |
-
<p><strong>MIME types defined:</strong> <code>text/nginx</code>.</p>
|
180 |
-
|
181 |
-
</article>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/nginx/nginx.js
DELETED
@@ -1,178 +0,0 @@
|
|
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("nginx", function(config) {
|
15 |
-
|
16 |
-
function words(str) {
|
17 |
-
var obj = {}, words = str.split(" ");
|
18 |
-
for (var i = 0; i < words.length; ++i) obj[words[i]] = true;
|
19 |
-
return obj;
|
20 |
-
}
|
21 |
-
|
22 |
-
var keywords = words(
|
23 |
-
/* ngxDirectiveControl */ "break return rewrite set" +
|
24 |
-
/* ngxDirective */ " accept_mutex accept_mutex_delay access_log add_after_body add_before_body add_header addition_types aio alias allow ancient_browser ancient_browser_value auth_basic auth_basic_user_file auth_http auth_http_header auth_http_timeout autoindex autoindex_exact_size autoindex_localtime charset charset_types client_body_buffer_size client_body_in_file_only client_body_in_single_buffer client_body_temp_path client_body_timeout client_header_buffer_size client_header_timeout client_max_body_size connection_pool_size create_full_put_path daemon dav_access dav_methods debug_connection debug_points default_type degradation degrade deny devpoll_changes devpoll_events directio directio_alignment empty_gif env epoll_events error_log eventport_events expires fastcgi_bind fastcgi_buffer_size fastcgi_buffers fastcgi_busy_buffers_size fastcgi_cache fastcgi_cache_key fastcgi_cache_methods fastcgi_cache_min_uses fastcgi_cache_path fastcgi_cache_use_stale fastcgi_cache_valid fastcgi_catch_stderr fastcgi_connect_timeout fastcgi_hide_header fastcgi_ignore_client_abort fastcgi_ignore_headers fastcgi_index fastcgi_intercept_errors fastcgi_max_temp_file_size fastcgi_next_upstream fastcgi_param fastcgi_pass_header fastcgi_pass_request_body fastcgi_pass_request_headers fastcgi_read_timeout fastcgi_send_lowat fastcgi_send_timeout fastcgi_split_path_info fastcgi_store fastcgi_store_access fastcgi_temp_file_write_size fastcgi_temp_path fastcgi_upstream_fail_timeout fastcgi_upstream_max_fails flv geoip_city geoip_country google_perftools_profiles gzip gzip_buffers gzip_comp_level gzip_disable gzip_hash gzip_http_version gzip_min_length gzip_no_buffer gzip_proxied gzip_static gzip_types gzip_vary gzip_window if_modified_since ignore_invalid_headers image_filter image_filter_buffer image_filter_jpeg_quality image_filter_transparency imap_auth imap_capabilities imap_client_buffer index ip_hash keepalive_requests keepalive_timeout kqueue_changes kqueue_events large_client_header_buffers limit_conn limit_conn_log_level limit_rate limit_rate_after limit_req limit_req_log_level limit_req_zone limit_zone lingering_time lingering_timeout lock_file log_format log_not_found log_subrequest map_hash_bucket_size map_hash_max_size master_process memcached_bind memcached_buffer_size memcached_connect_timeout memcached_next_upstream memcached_read_timeout memcached_send_timeout memcached_upstream_fail_timeout memcached_upstream_max_fails merge_slashes min_delete_depth modern_browser modern_browser_value msie_padding msie_refresh multi_accept open_file_cache open_file_cache_errors open_file_cache_events open_file_cache_min_uses open_file_cache_valid open_log_file_cache output_buffers override_charset perl perl_modules perl_require perl_set pid pop3_auth pop3_capabilities port_in_redirect postpone_gzipping postpone_output protocol proxy proxy_bind proxy_buffer proxy_buffer_size proxy_buffering proxy_buffers proxy_busy_buffers_size proxy_cache proxy_cache_key proxy_cache_methods proxy_cache_min_uses proxy_cache_path proxy_cache_use_stale proxy_cache_valid proxy_connect_timeout proxy_headers_hash_bucket_size proxy_headers_hash_max_size proxy_hide_header proxy_ignore_client_abort proxy_ignore_headers proxy_intercept_errors proxy_max_temp_file_size proxy_method proxy_next_upstream proxy_pass_error_message proxy_pass_header proxy_pass_request_body proxy_pass_request_headers proxy_read_timeout proxy_redirect proxy_send_lowat proxy_send_timeout proxy_set_body proxy_set_header proxy_ssl_session_reuse proxy_store proxy_store_access proxy_temp_file_write_size proxy_temp_path proxy_timeout proxy_upstream_fail_timeout proxy_upstream_max_fails random_index read_ahead real_ip_header recursive_error_pages request_pool_size reset_timedout_connection resolver resolver_timeout rewrite_log rtsig_overflow_events rtsig_overflow_test rtsig_overflow_threshold rtsig_signo satisfy secure_link_secret send_lowat send_timeout sendfile sendfile_max_chunk server_name_in_redirect server_names_hash_bucket_size server_names_hash_max_size server_tokens set_real_ip_from smtp_auth smtp_capabilities smtp_client_buffer smtp_greeting_delay so_keepalive source_charset ssi ssi_ignore_recycled_buffers ssi_min_file_chunk ssi_silent_errors ssi_types ssi_value_length ssl ssl_certificate ssl_certificate_key ssl_ciphers ssl_client_certificate ssl_crl ssl_dhparam ssl_engine ssl_prefer_server_ciphers ssl_protocols ssl_session_cache ssl_session_timeout ssl_verify_client ssl_verify_depth starttls stub_status sub_filter sub_filter_once sub_filter_types tcp_nodelay tcp_nopush thread_stack_size timeout timer_resolution types_hash_bucket_size types_hash_max_size underscores_in_headers uninitialized_variable_warn use user userid userid_domain userid_expires userid_mark userid_name userid_p3p userid_path userid_service valid_referers variables_hash_bucket_size variables_hash_max_size worker_connections worker_cpu_affinity worker_priority worker_processes worker_rlimit_core worker_rlimit_nofile worker_rlimit_sigpending worker_threads working_directory xclient xml_entities xslt_stylesheet xslt_typesdrew@li229-23"
|
25 |
-
);
|
26 |
-
|
27 |
-
var keywords_block = words(
|
28 |
-
/* ngxDirectiveBlock */ "http mail events server types location upstream charset_map limit_except if geo map"
|
29 |
-
);
|
30 |
-
|
31 |
-
var keywords_important = words(
|
32 |
-
/* ngxDirectiveImportant */ "include root server server_name listen internal proxy_pass memcached_pass fastcgi_pass try_files"
|
33 |
-
);
|
34 |
-
|
35 |
-
var indentUnit = config.indentUnit, type;
|
36 |
-
function ret(style, tp) {type = tp; return style;}
|
37 |
-
|
38 |
-
function tokenBase(stream, state) {
|
39 |
-
|
40 |
-
|
41 |
-
stream.eatWhile(/[\w\$_]/);
|
42 |
-
|
43 |
-
var cur = stream.current();
|
44 |
-
|
45 |
-
|
46 |
-
if (keywords.propertyIsEnumerable(cur)) {
|
47 |
-
return "keyword";
|
48 |
-
}
|
49 |
-
else if (keywords_block.propertyIsEnumerable(cur)) {
|
50 |
-
return "variable-2";
|
51 |
-
}
|
52 |
-
else if (keywords_important.propertyIsEnumerable(cur)) {
|
53 |
-
return "string-2";
|
54 |
-
}
|
55 |
-
/**/
|
56 |
-
|
57 |
-
var ch = stream.next();
|
58 |
-
if (ch == "@") {stream.eatWhile(/[\w\\\-]/); return ret("meta", stream.current());}
|
59 |
-
else if (ch == "/" && stream.eat("*")) {
|
60 |
-
state.tokenize = tokenCComment;
|
61 |
-
return tokenCComment(stream, state);
|
62 |
-
}
|
63 |
-
else if (ch == "<" && stream.eat("!")) {
|
64 |
-
state.tokenize = tokenSGMLComment;
|
65 |
-
return tokenSGMLComment(stream, state);
|
66 |
-
}
|
67 |
-
else if (ch == "=") ret(null, "compare");
|
68 |
-
else if ((ch == "~" || ch == "|") && stream.eat("=")) return ret(null, "compare");
|
69 |
-
else if (ch == "\"" || ch == "'") {
|
70 |
-
state.tokenize = tokenString(ch);
|
71 |
-
return state.tokenize(stream, state);
|
72 |
-
}
|
73 |
-
else if (ch == "#") {
|
74 |
-
stream.skipToEnd();
|
75 |
-
return ret("comment", "comment");
|
76 |
-
}
|
77 |
-
else if (ch == "!") {
|
78 |
-
stream.match(/^\s*\w*/);
|
79 |
-
return ret("keyword", "important");
|
80 |
-
}
|
81 |
-
else if (/\d/.test(ch)) {
|
82 |
-
stream.eatWhile(/[\w.%]/);
|
83 |
-
return ret("number", "unit");
|
84 |
-
}
|
85 |
-
else if (/[,.+>*\/]/.test(ch)) {
|
86 |
-
return ret(null, "select-op");
|
87 |
-
}
|
88 |
-
else if (/[;{}:\[\]]/.test(ch)) {
|
89 |
-
return ret(null, ch);
|
90 |
-
}
|
91 |
-
else {
|
92 |
-
stream.eatWhile(/[\w\\\-]/);
|
93 |
-
return ret("variable", "variable");
|
94 |
-
}
|
95 |
-
}
|
96 |
-
|
97 |
-
function tokenCComment(stream, state) {
|
98 |
-
var maybeEnd = false, ch;
|
99 |
-
while ((ch = stream.next()) != null) {
|
100 |
-
if (maybeEnd && ch == "/") {
|
101 |
-
state.tokenize = tokenBase;
|
102 |
-
break;
|
103 |
-
}
|
104 |
-
maybeEnd = (ch == "*");
|
105 |
-
}
|
106 |
-
return ret("comment", "comment");
|
107 |
-
}
|
108 |
-
|
109 |
-
function tokenSGMLComment(stream, state) {
|
110 |
-
var dashes = 0, ch;
|
111 |
-
while ((ch = stream.next()) != null) {
|
112 |
-
if (dashes >= 2 && ch == ">") {
|
113 |
-
state.tokenize = tokenBase;
|
114 |
-
break;
|
115 |
-
}
|
116 |
-
dashes = (ch == "-") ? dashes + 1 : 0;
|
117 |
-
}
|
118 |
-
return ret("comment", "comment");
|
119 |
-
}
|
120 |
-
|
121 |
-
function tokenString(quote) {
|
122 |
-
return function(stream, state) {
|
123 |
-
var escaped = false, ch;
|
124 |
-
while ((ch = stream.next()) != null) {
|
125 |
-
if (ch == quote && !escaped)
|
126 |
-
break;
|
127 |
-
escaped = !escaped && ch == "\\";
|
128 |
-
}
|
129 |
-
if (!escaped) state.tokenize = tokenBase;
|
130 |
-
return ret("string", "string");
|
131 |
-
};
|
132 |
-
}
|
133 |
-
|
134 |
-
return {
|
135 |
-
startState: function(base) {
|
136 |
-
return {tokenize: tokenBase,
|
137 |
-
baseIndent: base || 0,
|
138 |
-
stack: []};
|
139 |
-
},
|
140 |
-
|
141 |
-
token: function(stream, state) {
|
142 |
-
if (stream.eatSpace()) return null;
|
143 |
-
type = null;
|
144 |
-
var style = state.tokenize(stream, state);
|
145 |
-
|
146 |
-
var context = state.stack[state.stack.length-1];
|
147 |
-
if (type == "hash" && context == "rule") style = "atom";
|
148 |
-
else if (style == "variable") {
|
149 |
-
if (context == "rule") style = "number";
|
150 |
-
else if (!context || context == "@media{") style = "tag";
|
151 |
-
}
|
152 |
-
|
153 |
-
if (context == "rule" && /^[\{\};]$/.test(type))
|
154 |
-
state.stack.pop();
|
155 |
-
if (type == "{") {
|
156 |
-
if (context == "@media") state.stack[state.stack.length-1] = "@media{";
|
157 |
-
else state.stack.push("{");
|
158 |
-
}
|
159 |
-
else if (type == "}") state.stack.pop();
|
160 |
-
else if (type == "@media") state.stack.push("@media");
|
161 |
-
else if (context == "{" && type != "comment") state.stack.push("rule");
|
162 |
-
return style;
|
163 |
-
},
|
164 |
-
|
165 |
-
indent: function(state, textAfter) {
|
166 |
-
var n = state.stack.length;
|
167 |
-
if (/^\}/.test(textAfter))
|
168 |
-
n -= state.stack[state.stack.length-1] == "rule" ? 2 : 1;
|
169 |
-
return state.baseIndent + n * indentUnit;
|
170 |
-
},
|
171 |
-
|
172 |
-
electricChars: "}"
|
173 |
-
};
|
174 |
-
});
|
175 |
-
|
176 |
-
CodeMirror.defineMIME("text/nginx", "text/x-nginx-conf");
|
177 |
-
|
178 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/nsis/index.html
DELETED
@@ -1,80 +0,0 @@
|
|
1 |
-
<!doctype html>
|
2 |
-
|
3 |
-
<title>CodeMirror: NSIS mode</title>
|
4 |
-
<meta charset="utf-8"/>
|
5 |
-
<link rel=stylesheet href="../../doc/docs.css">
|
6 |
-
|
7 |
-
<link rel=stylesheet href=../../lib/codemirror.css>
|
8 |
-
<script src=../../lib/codemirror.js></script>
|
9 |
-
<script src="../../addon/mode/simple.js"></script>
|
10 |
-
<script src="../../addon/edit/matchbrackets.js"></script>
|
11 |
-
<script src=nsis.js></script>
|
12 |
-
<style type=text/css>
|
13 |
-
.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}
|
14 |
-
</style>
|
15 |
-
<div id=nav>
|
16 |
-
<a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
17 |
-
|
18 |
-
<ul>
|
19 |
-
<li><a href="../../index.html">Home</a>
|
20 |
-
<li><a href="../../doc/manual.html">Manual</a>
|
21 |
-
<li><a href="https://github.com/codemirror/codemirror">Code</a>
|
22 |
-
</ul>
|
23 |
-
<ul>
|
24 |
-
<li><a href="../index.html">Language modes</a>
|
25 |
-
<li><a class=active href="#">NSIS</a>
|
26 |
-
</ul>
|
27 |
-
</div>
|
28 |
-
|
29 |
-
<article>
|
30 |
-
<h2>NSIS mode</h2>
|
31 |
-
|
32 |
-
|
33 |
-
<textarea id=code>
|
34 |
-
; This is a comment
|
35 |
-
!ifdef ERROR
|
36 |
-
!error "Something went wrong"
|
37 |
-
!endif
|
38 |
-
|
39 |
-
OutFile "demo.exe"
|
40 |
-
RequestExecutionLevel user
|
41 |
-
SetDetailsPrint listonly
|
42 |
-
|
43 |
-
!include "LogicLib.nsh"
|
44 |
-
!include "WinVer.nsh"
|
45 |
-
|
46 |
-
Section -mandatory
|
47 |
-
|
48 |
-
Call logWinVer
|
49 |
-
|
50 |
-
${If} 1 > 0
|
51 |
-
MessageBox MB_OK "Hello world"
|
52 |
-
${EndIf}
|
53 |
-
|
54 |
-
SectionEnd
|
55 |
-
|
56 |
-
Function logWinVer
|
57 |
-
|
58 |
-
${If} ${IsWin10}
|
59 |
-
DetailPrint "Windows 10!"
|
60 |
-
${ElseIf} ${AtLeastWinVista}
|
61 |
-
DetailPrint "We're post-XP"
|
62 |
-
${Else}
|
63 |
-
DetailPrint "Legacy system"
|
64 |
-
${EndIf}
|
65 |
-
|
66 |
-
FunctionEnd
|
67 |
-
</textarea>
|
68 |
-
|
69 |
-
<script>
|
70 |
-
var editor = CodeMirror.fromTextArea(document.getElementById('code'), {
|
71 |
-
mode: 'nsis',
|
72 |
-
indentWithTabs: true,
|
73 |
-
smartIndent: true,
|
74 |
-
lineNumbers: true,
|
75 |
-
matchBrackets: true
|
76 |
-
});
|
77 |
-
</script>
|
78 |
-
|
79 |
-
<p><strong>MIME types defined:</strong> <code>text/x-nsis</code>.</p>
|
80 |
-
</article>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/nsis/nsis.js
DELETED
@@ -1,95 +0,0 @@
|
|
1 |
-
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
2 |
-
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
3 |
-
|
4 |
-
// Author: Jan T. Sott (http://github.com/idleberg)
|
5 |
-
|
6 |
-
(function(mod) {
|
7 |
-
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
8 |
-
mod(require("../../lib/codemirror"), require("../../addon/mode/simple"));
|
9 |
-
else if (typeof define == "function" && define.amd) // AMD
|
10 |
-
define(["../../lib/codemirror", "../../addon/mode/simple"], mod);
|
11 |
-
else // Plain browser env
|
12 |
-
mod(CodeMirror);
|
13 |
-
})(function(CodeMirror) {
|
14 |
-
"use strict";
|
15 |
-
|
16 |
-
CodeMirror.defineSimpleMode("nsis",{
|
17 |
-
start:[
|
18 |
-
// Numbers
|
19 |
-
{regex: /(?:[+-]?)(?:0x[\d,a-f]+)|(?:0o[0-7]+)|(?:0b[0,1]+)|(?:\d+.?\d*)/, token: "number"},
|
20 |
-
|
21 |
-
// Strings
|
22 |
-
{ regex: /"(?:[^\\"]|\\.)*"?/, token: "string" },
|
23 |
-
{ regex: /'(?:[^\\']|\\.)*'?/, token: "string" },
|
24 |
-
{ regex: /`(?:[^\\`]|\\.)*`?/, token: "string" },
|
25 |
-
|
26 |
-
// Compile Time Commands
|
27 |
-
{regex: /(?:\!(include|addincludedir|addplugindir|appendfile|cd|delfile|echo|error|execute|packhdr|finalize|getdllversion|system|tempfile|warning|verbose|define|undef|insertmacro|makensis|searchparse|searchreplace))\b/, token: "keyword"},
|
28 |
-
|
29 |
-
// Conditional Compilation
|
30 |
-
{regex: /(?:\!(if(?:n?def)?|ifmacron?def|macro))\b/, token: "keyword", indent: true},
|
31 |
-
{regex: /(?:\!(else|endif|macroend))\b/, token: "keyword", dedent: true},
|
32 |
-
|
33 |
-
// Runtime Commands
|
34 |
-
{regex: /\b(?:Abort|AddBrandingImage|AddSize|AllowRootDirInstall|AllowSkipFiles|AutoCloseWindow|BGFont|BGGradient|BrandingText|BringToFront|Call|CallInstDLL|Caption|ChangeUI|CheckBitmap|ClearErrors|CompletedText|ComponentText|CopyFiles|CRCCheck|CreateDirectory|CreateFont|CreateShortCut|Delete|DeleteINISec|DeleteINIStr|DeleteRegKey|DeleteRegValue|DetailPrint|DetailsButtonText|DirText|DirVar|DirVerify|EnableWindow|EnumRegKey|EnumRegValue|Exch|Exec|ExecShell|ExecWait|ExpandEnvStrings|File|FileBufSize|FileClose|FileErrorText|FileOpen|FileRead|FileReadByte|FileReadUTF16LE|FileReadWord|FileWriteUTF16LE|FileSeek|FileWrite|FileWriteByte|FileWriteWord|FindClose|FindFirst|FindNext|FindWindow|FlushINI|GetCurInstType|GetCurrentAddress|GetDlgItem|GetDLLVersion|GetDLLVersionLocal|GetErrorLevel|GetFileTime|GetFileTimeLocal|GetFullPathName|GetFunctionAddress|GetInstDirError|GetLabelAddress|GetTempFileName|Goto|HideWindow|Icon|IfAbort|IfErrors|IfFileExists|IfRebootFlag|IfSilent|InitPluginsDir|InstallButtonText|InstallColors|InstallDir|InstallDirRegKey|InstProgressFlags|InstType|InstTypeGetText|InstTypeSetText|IntCmp|IntCmpU|IntFmt|IntOp|IsWindow|LangString|LicenseBkColor|LicenseData|LicenseForceSelection|LicenseLangString|LicenseText|LoadLanguageFile|LockWindow|LogSet|LogText|ManifestDPIAware|ManifestSupportedOS|MessageBox|MiscButtonText|Name|Nop|OutFile|Page|PageCallbacks|Pop|Push|Quit|ReadEnvStr|ReadINIStr|ReadRegDWORD|ReadRegStr|Reboot|RegDLL|Rename|RequestExecutionLevel|ReserveFile|Return|RMDir|SearchPath|SectionGetFlags|SectionGetInstTypes|SectionGetSize|SectionGetText|SectionIn|SectionSetFlags|SectionSetInstTypes|SectionSetSize|SectionSetText|SendMessage|SetAutoClose|SetBrandingImage|SetCompress|SetCompressor|SetCompressorDictSize|SetCtlColors|SetCurInstType|SetDatablockOptimize|SetDateSave|SetDetailsPrint|SetDetailsView|SetErrorLevel|SetErrors|SetFileAttributes|SetFont|SetOutPath|SetOverwrite|SetPluginUnload|SetRebootFlag|SetRegView|SetShellVarContext|SetSilent|ShowInstDetails|ShowUninstDetails|ShowWindow|SilentInstall|SilentUnInstall|Sleep|SpaceTexts|StrCmp|StrCmpS|StrCpy|StrLen|SubCaption|Unicode|UninstallButtonText|UninstallCaption|UninstallIcon|UninstallSubCaption|UninstallText|UninstPage|UnRegDLL|Var|VIAddVersionKey|VIFileVersion|VIProductVersion|WindowIcon|WriteINIStr|WriteRegBin|WriteRegDWORD|WriteRegExpandStr|WriteRegStr|WriteUninstaller|XPStyle)\b/, token: "keyword"},
|
35 |
-
{regex: /\b(?:Function|PageEx|Section(?:Group)?)\b/, token: "keyword", indent: true},
|
36 |
-
{regex: /\b(?:(Function|PageEx|Section(?:Group)?)End)\b/, token: "keyword", dedent: true},
|
37 |
-
|
38 |
-
// Command Options
|
39 |
-
{regex: /\b(?:ARCHIVE|FILE_ATTRIBUTE_ARCHIVE|FILE_ATTRIBUTE_HIDDEN|FILE_ATTRIBUTE_NORMAL|FILE_ATTRIBUTE_OFFLINE|FILE_ATTRIBUTE_READONLY|FILE_ATTRIBUTE_SYSTEM|FILE_ATTRIBUTE_TEMPORARY|HIDDEN|HKCC|HKCR|HKCU|HKDD|HKEY_CLASSES_ROOT|HKEY_CURRENT_CONFIG|HKEY_CURRENT_USER|HKEY_DYN_DATA|HKEY_LOCAL_MACHINE|HKEY_PERFORMANCE_DATA|HKEY_USERS|HKLM|HKPD|HKU|IDABORT|IDCANCEL|IDD_DIR|IDD_INST|IDD_INSTFILES|IDD_LICENSE|IDD_SELCOM|IDD_UNINST|IDD_VERIFY|IDIGNORE|IDNO|IDOK|IDRETRY|IDYES|MB_ABORTRETRYIGNORE|MB_DEFBUTTON1|MB_DEFBUTTON2|MB_DEFBUTTON3|MB_DEFBUTTON4|MB_ICONEXCLAMATION|MB_ICONINFORMATION|MB_ICONQUESTION|MB_ICONSTOP|MB_OK|MB_OKCANCEL|MB_RETRYCANCEL|MB_RIGHT|MB_RTLREADING|MB_SETFOREGROUND|MB_TOPMOST|MB_USERICON|MB_YESNO|MB_YESNOCANCEL|NORMAL|OFFLINE|READONLY|SHCTX|SHELL_CONTEXT|SW_HIDE|SW_SHOWDEFAULT|SW_SHOWMAXIMIZED|SW_SHOWMINIMIZED|SW_SHOWNORMAL|SYSTEM|TEMPORARY)\b/, token: "atom"},
|
40 |
-
{regex: /\b(?:admin|all|auto|both|bottom|bzip2|components|current|custom|directory|force|hide|highest|ifdiff|ifnewer|instfiles|lastused|leave|left|license|listonly|lzma|nevershow|none|normal|notset|right|show|silent|silentlog|textonly|top|try|un\.components|un\.custom|un\.directory|un\.instfiles|un\.license|uninstConfirm|user|Win10|Win7|Win8|WinVista|zlib)\b/, token: "builtin"},
|
41 |
-
|
42 |
-
// LogicLib.nsh
|
43 |
-
{regex: /\$\{(?:And(?:If(?:Not)?|Unless)|Break|Case(?:Else)?|Continue|Default|Do(?:Until|While)?|Else(?:If(?:Not)?|Unless)?|End(?:If|Select|Switch)|Exit(?:Do|For|While)|For(?:Each)?|If(?:Cmd|Not(?:Then)?|Then)?|Loop(?:Until|While)?|Or(?:If(?:Not)?|Unless)|Select|Switch|Unless|While)\}/, token: "variable-2", indent: true},
|
44 |
-
|
45 |
-
// FileFunc.nsh
|
46 |
-
{regex: /\$\{(?:BannerTrimPath|DirState|DriveSpace|Get(BaseName|Drives|ExeName|ExePath|FileAttributes|FileExt|FileName|FileVersion|Options|OptionsS|Parameters|Parent|Root|Size|Time)|Locate|RefreshShellIcons)\}/, token: "variable-2", dedent: true},
|
47 |
-
|
48 |
-
// Memento.nsh
|
49 |
-
{regex: /\$\{(?:Memento(?:Section(?:Done|End|Restore|Save)?|UnselectedSection))\}/, token: "variable-2", dedent: true},
|
50 |
-
|
51 |
-
// TextFunc.nsh
|
52 |
-
{regex: /\$\{(?:Config(?:Read|ReadS|Write|WriteS)|File(?:Join|ReadFromEnd|Recode)|Line(?:Find|Read|Sum)|Text(?:Compare|CompareS)|TrimNewLines)\}/, token: "variable-2", dedent: true},
|
53 |
-
|
54 |
-
// WinVer.nsh
|
55 |
-
{regex: /\$\{(?:(?:At(?:Least|Most)|Is)(?:ServicePack|Win(?:7|8|10|95|98|200(?:0|3|8(?:R2)?)|ME|NT4|Vista|XP))|Is(?:NT|Server))\}/, token: "variable", dedent: true},
|
56 |
-
|
57 |
-
// WordFunc.nsh
|
58 |
-
{regex: /\$\{(?:StrFilterS?|Version(?:Compare|Convert)|Word(?:AddS?|Find(?:(?:2|3)X)?S?|InsertS?|ReplaceS?))\}/, token: "variable-2", dedent: true},
|
59 |
-
|
60 |
-
// x64.nsh
|
61 |
-
{regex: /\$\{(?:RunningX64)\}/, token: "variable", dedent: true},
|
62 |
-
{regex: /\$\{(?:Disable|Enable)X64FSRedirection\}/, token: "variable-2", dedent: true},
|
63 |
-
|
64 |
-
// Line Comment
|
65 |
-
{regex: /(#|;).*/, token: "comment"},
|
66 |
-
|
67 |
-
// Block Comment
|
68 |
-
{regex: /\/\*/, token: "comment", next: "comment"},
|
69 |
-
|
70 |
-
// Operator
|
71 |
-
{regex: /[-+\/*=<>!]+/, token: "operator"},
|
72 |
-
|
73 |
-
// Variable
|
74 |
-
{regex: /\$[\w]+/, token: "variable"},
|
75 |
-
|
76 |
-
// Constant
|
77 |
-
{regex: /\${[\w]+}/,token: "variable-2"},
|
78 |
-
|
79 |
-
// Language String
|
80 |
-
{regex: /\$\([\w]+\)/,token: "variable-3"}
|
81 |
-
],
|
82 |
-
comment: [
|
83 |
-
{regex: /.*?\*\//, token: "comment", next: "start"},
|
84 |
-
{regex: /.*/, token: "comment"}
|
85 |
-
],
|
86 |
-
meta: {
|
87 |
-
electricInput: /^\s*((Function|PageEx|Section|Section(Group)?)End|(\!(endif|macroend))|\$\{(End(If|Unless|While)|Loop(Until)|Next)\})$/,
|
88 |
-
blockCommentStart: "/*",
|
89 |
-
blockCommentEnd: "*/",
|
90 |
-
lineComment: ["#", ";"]
|
91 |
-
}
|
92 |
-
});
|
93 |
-
|
94 |
-
CodeMirror.defineMIME("text/x-nsis", "nsis");
|
95 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/ntriples/index.html
DELETED
@@ -1,45 +0,0 @@
|
|
1 |
-
<!doctype html>
|
2 |
-
|
3 |
-
<title>CodeMirror: NTriples mode</title>
|
4 |
-
<meta charset="utf-8"/>
|
5 |
-
<link rel=stylesheet href="../../doc/docs.css">
|
6 |
-
|
7 |
-
<link rel="stylesheet" href="../../lib/codemirror.css">
|
8 |
-
<script src="../../lib/codemirror.js"></script>
|
9 |
-
<script src="ntriples.js"></script>
|
10 |
-
<style type="text/css">
|
11 |
-
.CodeMirror {
|
12 |
-
border: 1px solid #eee;
|
13 |
-
}
|
14 |
-
</style>
|
15 |
-
<div id=nav>
|
16 |
-
<a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
17 |
-
|
18 |
-
<ul>
|
19 |
-
<li><a href="../../index.html">Home</a>
|
20 |
-
<li><a href="../../doc/manual.html">Manual</a>
|
21 |
-
<li><a href="https://github.com/codemirror/codemirror">Code</a>
|
22 |
-
</ul>
|
23 |
-
<ul>
|
24 |
-
<li><a href="../index.html">Language modes</a>
|
25 |
-
<li><a class=active href="#">NTriples</a>
|
26 |
-
</ul>
|
27 |
-
</div>
|
28 |
-
|
29 |
-
<article>
|
30 |
-
<h2>NTriples mode</h2>
|
31 |
-
<form>
|
32 |
-
<textarea id="ntriples" name="ntriples">
|
33 |
-
<http://Sub1> <http://pred1> <http://obj> .
|
34 |
-
<http://Sub2> <http://pred2#an2> "literal 1" .
|
35 |
-
<http://Sub3#an3> <http://pred3> _:bnode3 .
|
36 |
-
_:bnode4 <http://pred4> "literal 2"@lang .
|
37 |
-
_:bnode5 <http://pred5> "literal 3"^^<http://type> .
|
38 |
-
</textarea>
|
39 |
-
</form>
|
40 |
-
|
41 |
-
<script>
|
42 |
-
var editor = CodeMirror.fromTextArea(document.getElementById("ntriples"), {});
|
43 |
-
</script>
|
44 |
-
<p><strong>MIME types defined:</strong> <code>text/n-triples</code>.</p>
|
45 |
-
</article>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/ntriples/ntriples.js
DELETED
@@ -1,186 +0,0 @@
|
|
1 |
-
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
2 |
-
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
3 |
-
|
4 |
-
/**********************************************************
|
5 |
-
* This script provides syntax highlighting support for
|
6 |
-
* the Ntriples format.
|
7 |
-
* Ntriples format specification:
|
8 |
-
* http://www.w3.org/TR/rdf-testcases/#ntriples
|
9 |
-
***********************************************************/
|
10 |
-
|
11 |
-
/*
|
12 |
-
The following expression defines the defined ASF grammar transitions.
|
13 |
-
|
14 |
-
pre_subject ->
|
15 |
-
{
|
16 |
-
( writing_subject_uri | writing_bnode_uri )
|
17 |
-
-> pre_predicate
|
18 |
-
-> writing_predicate_uri
|
19 |
-
-> pre_object
|
20 |
-
-> writing_object_uri | writing_object_bnode |
|
21 |
-
(
|
22 |
-
writing_object_literal
|
23 |
-
-> writing_literal_lang | writing_literal_type
|
24 |
-
)
|
25 |
-
-> post_object
|
26 |
-
-> BEGIN
|
27 |
-
} otherwise {
|
28 |
-
-> ERROR
|
29 |
-
}
|
30 |
-
*/
|
31 |
-
|
32 |
-
(function(mod) {
|
33 |
-
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
34 |
-
mod(require("../../lib/codemirror"));
|
35 |
-
else if (typeof define == "function" && define.amd) // AMD
|
36 |
-
define(["../../lib/codemirror"], mod);
|
37 |
-
else // Plain browser env
|
38 |
-
mod(CodeMirror);
|
39 |
-
})(function(CodeMirror) {
|
40 |
-
"use strict";
|
41 |
-
|
42 |
-
CodeMirror.defineMode("ntriples", function() {
|
43 |
-
|
44 |
-
var Location = {
|
45 |
-
PRE_SUBJECT : 0,
|
46 |
-
WRITING_SUB_URI : 1,
|
47 |
-
WRITING_BNODE_URI : 2,
|
48 |
-
PRE_PRED : 3,
|
49 |
-
WRITING_PRED_URI : 4,
|
50 |
-
PRE_OBJ : 5,
|
51 |
-
WRITING_OBJ_URI : 6,
|
52 |
-
WRITING_OBJ_BNODE : 7,
|
53 |
-
WRITING_OBJ_LITERAL : 8,
|
54 |
-
WRITING_LIT_LANG : 9,
|
55 |
-
WRITING_LIT_TYPE : 10,
|
56 |
-
POST_OBJ : 11,
|
57 |
-
ERROR : 12
|
58 |
-
};
|
59 |
-
function transitState(currState, c) {
|
60 |
-
var currLocation = currState.location;
|
61 |
-
var ret;
|
62 |
-
|
63 |
-
// Opening.
|
64 |
-
if (currLocation == Location.PRE_SUBJECT && c == '<') ret = Location.WRITING_SUB_URI;
|
65 |
-
else if(currLocation == Location.PRE_SUBJECT && c == '_') ret = Location.WRITING_BNODE_URI;
|
66 |
-
else if(currLocation == Location.PRE_PRED && c == '<') ret = Location.WRITING_PRED_URI;
|
67 |
-
else if(currLocation == Location.PRE_OBJ && c == '<') ret = Location.WRITING_OBJ_URI;
|
68 |
-
else if(currLocation == Location.PRE_OBJ && c == '_') ret = Location.WRITING_OBJ_BNODE;
|
69 |
-
else if(currLocation == Location.PRE_OBJ && c == '"') ret = Location.WRITING_OBJ_LITERAL;
|
70 |
-
|
71 |
-
// Closing.
|
72 |
-
else if(currLocation == Location.WRITING_SUB_URI && c == '>') ret = Location.PRE_PRED;
|
73 |
-
else if(currLocation == Location.WRITING_BNODE_URI && c == ' ') ret = Location.PRE_PRED;
|
74 |
-
else if(currLocation == Location.WRITING_PRED_URI && c == '>') ret = Location.PRE_OBJ;
|
75 |
-
else if(currLocation == Location.WRITING_OBJ_URI && c == '>') ret = Location.POST_OBJ;
|
76 |
-
else if(currLocation == Location.WRITING_OBJ_BNODE && c == ' ') ret = Location.POST_OBJ;
|
77 |
-
else if(currLocation == Location.WRITING_OBJ_LITERAL && c == '"') ret = Location.POST_OBJ;
|
78 |
-
else if(currLocation == Location.WRITING_LIT_LANG && c == ' ') ret = Location.POST_OBJ;
|
79 |
-
else if(currLocation == Location.WRITING_LIT_TYPE && c == '>') ret = Location.POST_OBJ;
|
80 |
-
|
81 |
-
// Closing typed and language literal.
|
82 |
-
else if(currLocation == Location.WRITING_OBJ_LITERAL && c == '@') ret = Location.WRITING_LIT_LANG;
|
83 |
-
else if(currLocation == Location.WRITING_OBJ_LITERAL && c == '^') ret = Location.WRITING_LIT_TYPE;
|
84 |
-
|
85 |
-
// Spaces.
|
86 |
-
else if( c == ' ' &&
|
87 |
-
(
|
88 |
-
currLocation == Location.PRE_SUBJECT ||
|
89 |
-
currLocation == Location.PRE_PRED ||
|
90 |
-
currLocation == Location.PRE_OBJ ||
|
91 |
-
currLocation == Location.POST_OBJ
|
92 |
-
)
|
93 |
-
) ret = currLocation;
|
94 |
-
|
95 |
-
// Reset.
|
96 |
-
else if(currLocation == Location.POST_OBJ && c == '.') ret = Location.PRE_SUBJECT;
|
97 |
-
|
98 |
-
// Error
|
99 |
-
else ret = Location.ERROR;
|
100 |
-
|
101 |
-
currState.location=ret;
|
102 |
-
}
|
103 |
-
|
104 |
-
return {
|
105 |
-
startState: function() {
|
106 |
-
return {
|
107 |
-
location : Location.PRE_SUBJECT,
|
108 |
-
uris : [],
|
109 |
-
anchors : [],
|
110 |
-
bnodes : [],
|
111 |
-
langs : [],
|
112 |
-
types : []
|
113 |
-
};
|
114 |
-
},
|
115 |
-
token: function(stream, state) {
|
116 |
-
var ch = stream.next();
|
117 |
-
if(ch == '<') {
|
118 |
-
transitState(state, ch);
|
119 |
-
var parsedURI = '';
|
120 |
-
stream.eatWhile( function(c) { if( c != '#' && c != '>' ) { parsedURI += c; return true; } return false;} );
|
121 |
-
state.uris.push(parsedURI);
|
122 |
-
if( stream.match('#', false) ) return 'variable';
|
123 |
-
stream.next();
|
124 |
-
transitState(state, '>');
|
125 |
-
return 'variable';
|
126 |
-
}
|
127 |
-
if(ch == '#') {
|
128 |
-
var parsedAnchor = '';
|
129 |
-
stream.eatWhile(function(c) { if(c != '>' && c != ' ') { parsedAnchor+= c; return true; } return false;});
|
130 |
-
state.anchors.push(parsedAnchor);
|
131 |
-
return 'variable-2';
|
132 |
-
}
|
133 |
-
if(ch == '>') {
|
134 |
-
transitState(state, '>');
|
135 |
-
return 'variable';
|
136 |
-
}
|
137 |
-
if(ch == '_') {
|
138 |
-
transitState(state, ch);
|
139 |
-
var parsedBNode = '';
|
140 |
-
stream.eatWhile(function(c) { if( c != ' ' ) { parsedBNode += c; return true; } return false;});
|
141 |
-
state.bnodes.push(parsedBNode);
|
142 |
-
stream.next();
|
143 |
-
transitState(state, ' ');
|
144 |
-
return 'builtin';
|
145 |
-
}
|
146 |
-
if(ch == '"') {
|
147 |
-
transitState(state, ch);
|
148 |
-
stream.eatWhile( function(c) { return c != '"'; } );
|
149 |
-
stream.next();
|
150 |
-
if( stream.peek() != '@' && stream.peek() != '^' ) {
|
151 |
-
transitState(state, '"');
|
152 |
-
}
|
153 |
-
return 'string';
|
154 |
-
}
|
155 |
-
if( ch == '@' ) {
|
156 |
-
transitState(state, '@');
|
157 |
-
var parsedLang = '';
|
158 |
-
stream.eatWhile(function(c) { if( c != ' ' ) { parsedLang += c; return true; } return false;});
|
159 |
-
state.langs.push(parsedLang);
|
160 |
-
stream.next();
|
161 |
-
transitState(state, ' ');
|
162 |
-
return 'string-2';
|
163 |
-
}
|
164 |
-
if( ch == '^' ) {
|
165 |
-
stream.next();
|
166 |
-
transitState(state, '^');
|
167 |
-
var parsedType = '';
|
168 |
-
stream.eatWhile(function(c) { if( c != '>' ) { parsedType += c; return true; } return false;} );
|
169 |
-
state.types.push(parsedType);
|
170 |
-
stream.next();
|
171 |
-
transitState(state, '>');
|
172 |
-
return 'variable';
|
173 |
-
}
|
174 |
-
if( ch == ' ' ) {
|
175 |
-
transitState(state, ch);
|
176 |
-
}
|
177 |
-
if( ch == '.' ) {
|
178 |
-
transitState(state, ch);
|
179 |
-
}
|
180 |
-
}
|
181 |
-
};
|
182 |
-
});
|
183 |
-
|
184 |
-
CodeMirror.defineMIME("text/n-triples", "ntriples");
|
185 |
-
|
186 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/octave/index.html
DELETED
@@ -1,83 +0,0 @@
|
|
1 |
-
<!doctype html>
|
2 |
-
|
3 |
-
<title>CodeMirror: Octave mode</title>
|
4 |
-
<meta charset="utf-8"/>
|
5 |
-
<link rel=stylesheet href="../../doc/docs.css">
|
6 |
-
|
7 |
-
<link rel="stylesheet" href="../../lib/codemirror.css">
|
8 |
-
<script src="../../lib/codemirror.js"></script>
|
9 |
-
<script src="octave.js"></script>
|
10 |
-
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
11 |
-
<div id=nav>
|
12 |
-
<a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
13 |
-
|
14 |
-
<ul>
|
15 |
-
<li><a href="../../index.html">Home</a>
|
16 |
-
<li><a href="../../doc/manual.html">Manual</a>
|
17 |
-
<li><a href="https://github.com/codemirror/codemirror">Code</a>
|
18 |
-
</ul>
|
19 |
-
<ul>
|
20 |
-
<li><a href="../index.html">Language modes</a>
|
21 |
-
<li><a class=active href="#">Octave</a>
|
22 |
-
</ul>
|
23 |
-
</div>
|
24 |
-
|
25 |
-
<article>
|
26 |
-
<h2>Octave mode</h2>
|
27 |
-
|
28 |
-
<div><textarea id="code" name="code">
|
29 |
-
%numbers
|
30 |
-
[1234 1234i 1234j]
|
31 |
-
[.234 .234j 2.23i]
|
32 |
-
[23e2 12E1j 123D-4 0x234]
|
33 |
-
|
34 |
-
%strings
|
35 |
-
'asda''a'
|
36 |
-
"asda""a"
|
37 |
-
|
38 |
-
%identifiers
|
39 |
-
a + as123 - __asd__
|
40 |
-
|
41 |
-
%operators
|
42 |
-
-
|
43 |
-
+
|
44 |
-
=
|
45 |
-
==
|
46 |
-
>
|
47 |
-
<
|
48 |
-
>=
|
49 |
-
<=
|
50 |
-
&
|
51 |
-
~
|
52 |
-
...
|
53 |
-
break zeros default margin round ones rand
|
54 |
-
ceil floor size clear zeros eye mean std cov
|
55 |
-
error eval function
|
56 |
-
abs acos atan asin cos cosh exp log prod sum
|
57 |
-
log10 max min sign sin sinh sqrt tan reshape
|
58 |
-
return
|
59 |
-
case switch
|
60 |
-
else elseif end if otherwise
|
61 |
-
do for while
|
62 |
-
try catch
|
63 |
-
classdef properties events methods
|
64 |
-
global persistent
|
65 |
-
|
66 |
-
%one line comment
|
67 |
-
%{ multi
|
68 |
-
line commment %}
|
69 |
-
|
70 |
-
</textarea></div>
|
71 |
-
<script>
|
72 |
-
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
|
73 |
-
mode: {name: "octave",
|
74 |
-
version: 2,
|
75 |
-
singleLineStringErrors: false},
|
76 |
-
lineNumbers: true,
|
77 |
-
indentUnit: 4,
|
78 |
-
matchBrackets: true
|
79 |
-
});
|
80 |
-
</script>
|
81 |
-
|
82 |
-
<p><strong>MIME types defined:</strong> <code>text/x-octave</code>.</p>
|
83 |
-
</article>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/octave/octave.js
DELETED
@@ -1,135 +0,0 @@
|
|
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("octave", function() {
|
15 |
-
function wordRegexp(words) {
|
16 |
-
return new RegExp("^((" + words.join(")|(") + "))\\b");
|
17 |
-
}
|
18 |
-
|
19 |
-
var singleOperators = new RegExp("^[\\+\\-\\*/&|\\^~<>!@'\\\\]");
|
20 |
-
var singleDelimiters = new RegExp('^[\\(\\[\\{\\},:=;]');
|
21 |
-
var doubleOperators = new RegExp("^((==)|(~=)|(<=)|(>=)|(<<)|(>>)|(\\.[\\+\\-\\*/\\^\\\\]))");
|
22 |
-
var doubleDelimiters = new RegExp("^((!=)|(\\+=)|(\\-=)|(\\*=)|(/=)|(&=)|(\\|=)|(\\^=))");
|
23 |
-
var tripleDelimiters = new RegExp("^((>>=)|(<<=))");
|
24 |
-
var expressionEnd = new RegExp("^[\\]\\)]");
|
25 |
-
var identifiers = new RegExp("^[_A-Za-z\xa1-\uffff][_A-Za-z0-9\xa1-\uffff]*");
|
26 |
-
|
27 |
-
var builtins = wordRegexp([
|
28 |
-
'error', 'eval', 'function', 'abs', 'acos', 'atan', 'asin', 'cos',
|
29 |
-
'cosh', 'exp', 'log', 'prod', 'sum', 'log10', 'max', 'min', 'sign', 'sin', 'sinh',
|
30 |
-
'sqrt', 'tan', 'reshape', 'break', 'zeros', 'default', 'margin', 'round', 'ones',
|
31 |
-
'rand', 'syn', 'ceil', 'floor', 'size', 'clear', 'zeros', 'eye', 'mean', 'std', 'cov',
|
32 |
-
'det', 'eig', 'inv', 'norm', 'rank', 'trace', 'expm', 'logm', 'sqrtm', 'linspace', 'plot',
|
33 |
-
'title', 'xlabel', 'ylabel', 'legend', 'text', 'grid', 'meshgrid', 'mesh', 'num2str',
|
34 |
-
'fft', 'ifft', 'arrayfun', 'cellfun', 'input', 'fliplr', 'flipud', 'ismember'
|
35 |
-
]);
|
36 |
-
|
37 |
-
var keywords = wordRegexp([
|
38 |
-
'return', 'case', 'switch', 'else', 'elseif', 'end', 'endif', 'endfunction',
|
39 |
-
'if', 'otherwise', 'do', 'for', 'while', 'try', 'catch', 'classdef', 'properties', 'events',
|
40 |
-
'methods', 'global', 'persistent', 'endfor', 'endwhile', 'printf', 'sprintf', 'disp', 'until',
|
41 |
-
'continue', 'pkg'
|
42 |
-
]);
|
43 |
-
|
44 |
-
|
45 |
-
// tokenizers
|
46 |
-
function tokenTranspose(stream, state) {
|
47 |
-
if (!stream.sol() && stream.peek() === '\'') {
|
48 |
-
stream.next();
|
49 |
-
state.tokenize = tokenBase;
|
50 |
-
return 'operator';
|
51 |
-
}
|
52 |
-
state.tokenize = tokenBase;
|
53 |
-
return tokenBase(stream, state);
|
54 |
-
}
|
55 |
-
|
56 |
-
|
57 |
-
function tokenComment(stream, state) {
|
58 |
-
if (stream.match(/^.*%}/)) {
|
59 |
-
state.tokenize = tokenBase;
|
60 |
-
return 'comment';
|
61 |
-
};
|
62 |
-
stream.skipToEnd();
|
63 |
-
return 'comment';
|
64 |
-
}
|
65 |
-
|
66 |
-
function tokenBase(stream, state) {
|
67 |
-
// whitespaces
|
68 |
-
if (stream.eatSpace()) return null;
|
69 |
-
|
70 |
-
// Handle one line Comments
|
71 |
-
if (stream.match('%{')){
|
72 |
-
state.tokenize = tokenComment;
|
73 |
-
stream.skipToEnd();
|
74 |
-
return 'comment';
|
75 |
-
}
|
76 |
-
|
77 |
-
if (stream.match(/^[%#]/)){
|
78 |
-
stream.skipToEnd();
|
79 |
-
return 'comment';
|
80 |
-
}
|
81 |
-
|
82 |
-
// Handle Number Literals
|
83 |
-
if (stream.match(/^[0-9\.+-]/, false)) {
|
84 |
-
if (stream.match(/^[+-]?0x[0-9a-fA-F]+[ij]?/)) {
|
85 |
-
stream.tokenize = tokenBase;
|
86 |
-
return 'number'; };
|
87 |
-
if (stream.match(/^[+-]?\d*\.\d+([EeDd][+-]?\d+)?[ij]?/)) { return 'number'; };
|
88 |
-
if (stream.match(/^[+-]?\d+([EeDd][+-]?\d+)?[ij]?/)) { return 'number'; };
|
89 |
-
}
|
90 |
-
if (stream.match(wordRegexp(['nan','NaN','inf','Inf']))) { return 'number'; };
|
91 |
-
|
92 |
-
// Handle Strings
|
93 |
-
if (stream.match(/^"([^"]|(""))*"/)) { return 'string'; } ;
|
94 |
-
if (stream.match(/^'([^']|(''))*'/)) { return 'string'; } ;
|
95 |
-
|
96 |
-
// Handle words
|
97 |
-
if (stream.match(keywords)) { return 'keyword'; } ;
|
98 |
-
if (stream.match(builtins)) { return 'builtin'; } ;
|
99 |
-
if (stream.match(identifiers)) { return 'variable'; } ;
|
100 |
-
|
101 |
-
if (stream.match(singleOperators) || stream.match(doubleOperators)) { return 'operator'; };
|
102 |
-
if (stream.match(singleDelimiters) || stream.match(doubleDelimiters) || stream.match(tripleDelimiters)) { return null; };
|
103 |
-
|
104 |
-
if (stream.match(expressionEnd)) {
|
105 |
-
state.tokenize = tokenTranspose;
|
106 |
-
return null;
|
107 |
-
};
|
108 |
-
|
109 |
-
|
110 |
-
// Handle non-detected items
|
111 |
-
stream.next();
|
112 |
-
return 'error';
|
113 |
-
};
|
114 |
-
|
115 |
-
|
116 |
-
return {
|
117 |
-
startState: function() {
|
118 |
-
return {
|
119 |
-
tokenize: tokenBase
|
120 |
-
};
|
121 |
-
},
|
122 |
-
|
123 |
-
token: function(stream, state) {
|
124 |
-
var style = state.tokenize(stream, state);
|
125 |
-
if (style === 'number' || style === 'variable'){
|
126 |
-
state.tokenize = tokenTranspose;
|
127 |
-
}
|
128 |
-
return style;
|
129 |
-
}
|
130 |
-
};
|
131 |
-
});
|
132 |
-
|
133 |
-
CodeMirror.defineMIME("text/x-octave", "octave");
|
134 |
-
|
135 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/oz/index.html
DELETED
@@ -1,59 +0,0 @@
|
|
1 |
-
<!doctype html>
|
2 |
-
|
3 |
-
<title>CodeMirror: Oz mode</title>
|
4 |
-
<meta charset="utf-8"/>
|
5 |
-
<link rel=stylesheet href="../../doc/docs.css">
|
6 |
-
|
7 |
-
<link rel="stylesheet" href="../../lib/codemirror.css">
|
8 |
-
<script src="../../lib/codemirror.js"></script>
|
9 |
-
<script src="oz.js"></script>
|
10 |
-
<script type="text/javascript" src="../../addon/runmode/runmode.js"></script>
|
11 |
-
<style>
|
12 |
-
.CodeMirror {border: 1px solid #aaa;}
|
13 |
-
</style>
|
14 |
-
<div id=nav>
|
15 |
-
<a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
16 |
-
<ul>
|
17 |
-
<li><a href="../../index.html">Home</a>
|
18 |
-
<li><a href="../../doc/manual.html">Manual</a>
|
19 |
-
<li><a href="https://github.com/codemirror/codemirror">Code</a>
|
20 |
-
</ul>
|
21 |
-
<ul>
|
22 |
-
<li><a href="../index.html">Language modes</a>
|
23 |
-
<li><a class=active href="#">Oz</a>
|
24 |
-
</ul>
|
25 |
-
</div>
|
26 |
-
|
27 |
-
<article>
|
28 |
-
<h2>Oz mode</h2>
|
29 |
-
<textarea id="code" name="code">
|
30 |
-
declare
|
31 |
-
fun {Ints N Max}
|
32 |
-
if N == Max then nil
|
33 |
-
else
|
34 |
-
{Delay 1000}
|
35 |
-
N|{Ints N+1 Max}
|
36 |
-
end
|
37 |
-
end
|
38 |
-
|
39 |
-
fun {Sum S Stream}
|
40 |
-
case Stream of nil then S
|
41 |
-
[] H|T then S|{Sum H+S T} end
|
42 |
-
end
|
43 |
-
|
44 |
-
local X Y in
|
45 |
-
thread X = {Ints 0 1000} end
|
46 |
-
thread Y = {Sum 0 X} end
|
47 |
-
{Browse Y}
|
48 |
-
end
|
49 |
-
</textarea>
|
50 |
-
<p>MIME type defined: <code>text/x-oz</code>.</p>
|
51 |
-
|
52 |
-
<script type="text/javascript">
|
53 |
-
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
|
54 |
-
lineNumbers: true,
|
55 |
-
mode: "text/x-oz",
|
56 |
-
readOnly: false
|
57 |
-
});
|
58 |
-
</script>
|
59 |
-
</article>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/oz/oz.js
DELETED
@@ -1,252 +0,0 @@
|
|
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("oz", function (conf) {
|
15 |
-
|
16 |
-
function wordRegexp(words) {
|
17 |
-
return new RegExp("^((" + words.join(")|(") + "))\\b");
|
18 |
-
}
|
19 |
-
|
20 |
-
var singleOperators = /[\^@!\|<>#~\.\*\-\+\\/,=]/;
|
21 |
-
var doubleOperators = /(<-)|(:=)|(=<)|(>=)|(<=)|(<:)|(>:)|(=:)|(\\=)|(\\=:)|(!!)|(==)|(::)/;
|
22 |
-
var tripleOperators = /(:::)|(\.\.\.)|(=<:)|(>=:)/;
|
23 |
-
|
24 |
-
var middle = ["in", "then", "else", "of", "elseof", "elsecase", "elseif", "catch",
|
25 |
-
"finally", "with", "require", "prepare", "import", "export", "define", "do"];
|
26 |
-
var end = ["end"];
|
27 |
-
|
28 |
-
var atoms = wordRegexp(["true", "false", "nil", "unit"]);
|
29 |
-
var commonKeywords = wordRegexp(["andthen", "at", "attr", "declare", "feat", "from", "lex",
|
30 |
-
"mod", "mode", "orelse", "parser", "prod", "prop", "scanner", "self", "syn", "token"]);
|
31 |
-
var openingKeywords = wordRegexp(["local", "proc", "fun", "case", "class", "if", "cond", "or", "dis",
|
32 |
-
"choice", "not", "thread", "try", "raise", "lock", "for", "suchthat", "meth", "functor"]);
|
33 |
-
var middleKeywords = wordRegexp(middle);
|
34 |
-
var endKeywords = wordRegexp(end);
|
35 |
-
|
36 |
-
// Tokenizers
|
37 |
-
function tokenBase(stream, state) {
|
38 |
-
if (stream.eatSpace()) {
|
39 |
-
return null;
|
40 |
-
}
|
41 |
-
|
42 |
-
// Brackets
|
43 |
-
if(stream.match(/[{}]/)) {
|
44 |
-
return "bracket";
|
45 |
-
}
|
46 |
-
|
47 |
-
// Special [] keyword
|
48 |
-
if (stream.match(/(\[])/)) {
|
49 |
-
return "keyword"
|
50 |
-
}
|
51 |
-
|
52 |
-
// Operators
|
53 |
-
if (stream.match(tripleOperators) || stream.match(doubleOperators)) {
|
54 |
-
return "operator";
|
55 |
-
}
|
56 |
-
|
57 |
-
// Atoms
|
58 |
-
if(stream.match(atoms)) {
|
59 |
-
return 'atom';
|
60 |
-
}
|
61 |
-
|
62 |
-
// Opening keywords
|
63 |
-
var matched = stream.match(openingKeywords);
|
64 |
-
if (matched) {
|
65 |
-
if (!state.doInCurrentLine)
|
66 |
-
state.currentIndent++;
|
67 |
-
else
|
68 |
-
state.doInCurrentLine = false;
|
69 |
-
|
70 |
-
// Special matching for signatures
|
71 |
-
if(matched[0] == "proc" || matched[0] == "fun")
|
72 |
-
state.tokenize = tokenFunProc;
|
73 |
-
else if(matched[0] == "class")
|
74 |
-
state.tokenize = tokenClass;
|
75 |
-
else if(matched[0] == "meth")
|
76 |
-
state.tokenize = tokenMeth;
|
77 |
-
|
78 |
-
return 'keyword';
|
79 |
-
}
|
80 |
-
|
81 |
-
// Middle and other keywords
|
82 |
-
if (stream.match(middleKeywords) || stream.match(commonKeywords)) {
|
83 |
-
return "keyword"
|
84 |
-
}
|
85 |
-
|
86 |
-
// End keywords
|
87 |
-
if (stream.match(endKeywords)) {
|
88 |
-
state.currentIndent--;
|
89 |
-
return 'keyword';
|
90 |
-
}
|
91 |
-
|
92 |
-
// Eat the next char for next comparisons
|
93 |
-
var ch = stream.next();
|
94 |
-
|
95 |
-
// Strings
|
96 |
-
if (ch == '"' || ch == "'") {
|
97 |
-
state.tokenize = tokenString(ch);
|
98 |
-
return state.tokenize(stream, state);
|
99 |
-
}
|
100 |
-
|
101 |
-
// Numbers
|
102 |
-
if (/[~\d]/.test(ch)) {
|
103 |
-
if (ch == "~") {
|
104 |
-
if(! /^[0-9]/.test(stream.peek()))
|
105 |
-
return null;
|
106 |
-
else if (( stream.next() == "0" && stream.match(/^[xX][0-9a-fA-F]+/)) || stream.match(/^[0-9]*(\.[0-9]+)?([eE][~+]?[0-9]+)?/))
|
107 |
-
return "number";
|
108 |
-
}
|
109 |
-
|
110 |
-
if ((ch == "0" && stream.match(/^[xX][0-9a-fA-F]+/)) || stream.match(/^[0-9]*(\.[0-9]+)?([eE][~+]?[0-9]+)?/))
|
111 |
-
return "number";
|
112 |
-
|
113 |
-
return null;
|
114 |
-
}
|
115 |
-
|
116 |
-
// Comments
|
117 |
-
if (ch == "%") {
|
118 |
-
stream.skipToEnd();
|
119 |
-
return 'comment';
|
120 |
-
}
|
121 |
-
else if (ch == "/") {
|
122 |
-
if (stream.eat("*")) {
|
123 |
-
state.tokenize = tokenComment;
|
124 |
-
return tokenComment(stream, state);
|
125 |
-
}
|
126 |
-
}
|
127 |
-
|
128 |
-
// Single operators
|
129 |
-
if(singleOperators.test(ch)) {
|
130 |
-
return "operator";
|
131 |
-
}
|
132 |
-
|
133 |
-
// If nothing match, we skip the entire alphanumerical block
|
134 |
-
stream.eatWhile(/\w/);
|
135 |
-
|
136 |
-
return "variable";
|
137 |
-
}
|
138 |
-
|
139 |
-
function tokenClass(stream, state) {
|
140 |
-
if (stream.eatSpace()) {
|
141 |
-
return null;
|
142 |
-
}
|
143 |
-
stream.match(/([A-Z][A-Za-z0-9_]*)|(`.+`)/);
|
144 |
-
state.tokenize = tokenBase;
|
145 |
-
return "variable-3"
|
146 |
-
}
|
147 |
-
|
148 |
-
function tokenMeth(stream, state) {
|
149 |
-
if (stream.eatSpace()) {
|
150 |
-
return null;
|
151 |
-
}
|
152 |
-
stream.match(/([a-zA-Z][A-Za-z0-9_]*)|(`.+`)/);
|
153 |
-
state.tokenize = tokenBase;
|
154 |
-
return "def"
|
155 |
-
}
|
156 |
-
|
157 |
-
function tokenFunProc(stream, state) {
|
158 |
-
if (stream.eatSpace()) {
|
159 |
-
return null;
|
160 |
-
}
|
161 |
-
|
162 |
-
if(!state.hasPassedFirstStage && stream.eat("{")) {
|
163 |
-
state.hasPassedFirstStage = true;
|
164 |
-
return "bracket";
|
165 |
-
}
|
166 |
-
else if(state.hasPassedFirstStage) {
|
167 |
-
stream.match(/([A-Z][A-Za-z0-9_]*)|(`.+`)|\$/);
|
168 |
-
state.hasPassedFirstStage = false;
|
169 |
-
state.tokenize = tokenBase;
|
170 |
-
return "def"
|
171 |
-
}
|
172 |
-
else {
|
173 |
-
state.tokenize = tokenBase;
|
174 |
-
return null;
|
175 |
-
}
|
176 |
-
}
|
177 |
-
|
178 |
-
function tokenComment(stream, state) {
|
179 |
-
var maybeEnd = false, ch;
|
180 |
-
while (ch = stream.next()) {
|
181 |
-
if (ch == "/" && maybeEnd) {
|
182 |
-
state.tokenize = tokenBase;
|
183 |
-
break;
|
184 |
-
}
|
185 |
-
maybeEnd = (ch == "*");
|
186 |
-
}
|
187 |
-
return "comment";
|
188 |
-
}
|
189 |
-
|
190 |
-
function tokenString(quote) {
|
191 |
-
return function (stream, state) {
|
192 |
-
var escaped = false, next, end = false;
|
193 |
-
while ((next = stream.next()) != null) {
|
194 |
-
if (next == quote && !escaped) {
|
195 |
-
end = true;
|
196 |
-
break;
|
197 |
-
}
|
198 |
-
escaped = !escaped && next == "\\";
|
199 |
-
}
|
200 |
-
if (end || !escaped)
|
201 |
-
state.tokenize = tokenBase;
|
202 |
-
return "string";
|
203 |
-
};
|
204 |
-
}
|
205 |
-
|
206 |
-
function buildElectricInputRegEx() {
|
207 |
-
// Reindentation should occur on [] or on a match of any of
|
208 |
-
// the block closing keywords, at the end of a line.
|
209 |
-
var allClosings = middle.concat(end);
|
210 |
-
return new RegExp("[\\[\\]]|(" + allClosings.join("|") + ")$");
|
211 |
-
}
|
212 |
-
|
213 |
-
return {
|
214 |
-
|
215 |
-
startState: function () {
|
216 |
-
return {
|
217 |
-
tokenize: tokenBase,
|
218 |
-
currentIndent: 0,
|
219 |
-
doInCurrentLine: false,
|
220 |
-
hasPassedFirstStage: false
|
221 |
-
};
|
222 |
-
},
|
223 |
-
|
224 |
-
token: function (stream, state) {
|
225 |
-
if (stream.sol())
|
226 |
-
state.doInCurrentLine = 0;
|
227 |
-
|
228 |
-
return state.tokenize(stream, state);
|
229 |
-
},
|
230 |
-
|
231 |
-
indent: function (state, textAfter) {
|
232 |
-
var trueText = textAfter.replace(/^\s+|\s+$/g, '');
|
233 |
-
|
234 |
-
if (trueText.match(endKeywords) || trueText.match(middleKeywords) || trueText.match(/(\[])/))
|
235 |
-
return conf.indentUnit * (state.currentIndent - 1);
|
236 |
-
|
237 |
-
if (state.currentIndent < 0)
|
238 |
-
return 0;
|
239 |
-
|
240 |
-
return state.currentIndent * conf.indentUnit;
|
241 |
-
},
|
242 |
-
fold: "indent",
|
243 |
-
electricInput: buildElectricInputRegEx(),
|
244 |
-
lineComment: "%",
|
245 |
-
blockCommentStart: "/*",
|
246 |
-
blockCommentEnd: "*/"
|
247 |
-
};
|
248 |
-
});
|
249 |
-
|
250 |
-
CodeMirror.defineMIME("text/x-oz", "oz");
|
251 |
-
|
252 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/pascal/index.html
DELETED
@@ -1,61 +0,0 @@
|
|
1 |
-
<!doctype html>
|
2 |
-
|
3 |
-
<title>CodeMirror: Pascal mode</title>
|
4 |
-
<meta charset="utf-8"/>
|
5 |
-
<link rel=stylesheet href="../../doc/docs.css">
|
6 |
-
|
7 |
-
<link rel="stylesheet" href="../../lib/codemirror.css">
|
8 |
-
<script src="../../lib/codemirror.js"></script>
|
9 |
-
<script src="pascal.js"></script>
|
10 |
-
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
11 |
-
<div id=nav>
|
12 |
-
<a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
13 |
-
|
14 |
-
<ul>
|
15 |
-
<li><a href="../../index.html">Home</a>
|
16 |
-
<li><a href="../../doc/manual.html">Manual</a>
|
17 |
-
<li><a href="https://github.com/codemirror/codemirror">Code</a>
|
18 |
-
</ul>
|
19 |
-
<ul>
|
20 |
-
<li><a href="../index.html">Language modes</a>
|
21 |
-
<li><a class=active href="#">Pascal</a>
|
22 |
-
</ul>
|
23 |
-
</div>
|
24 |
-
|
25 |
-
<article>
|
26 |
-
<h2>Pascal mode</h2>
|
27 |
-
|
28 |
-
|
29 |
-
<div><textarea id="code" name="code">
|
30 |
-
(* Example Pascal code *)
|
31 |
-
|
32 |
-
while a <> b do writeln('Waiting');
|
33 |
-
|
34 |
-
if a > b then
|
35 |
-
writeln('Condition met')
|
36 |
-
else
|
37 |
-
writeln('Condition not met');
|
38 |
-
|
39 |
-
for i := 1 to 10 do
|
40 |
-
writeln('Iteration: ', i:1);
|
41 |
-
|
42 |
-
repeat
|
43 |
-
a := a + 1
|
44 |
-
until a = 10;
|
45 |
-
|
46 |
-
case i of
|
47 |
-
0: write('zero');
|
48 |
-
1: write('one');
|
49 |
-
2: write('two')
|
50 |
-
end;
|
51 |
-
</textarea></div>
|
52 |
-
|
53 |
-
<script>
|
54 |
-
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
|
55 |
-
lineNumbers: true,
|
56 |
-
mode: "text/x-pascal"
|
57 |
-
});
|
58 |
-
</script>
|
59 |
-
|
60 |
-
<p><strong>MIME types defined:</strong> <code>text/x-pascal</code>.</p>
|
61 |
-
</article>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/pascal/pascal.js
DELETED
@@ -1,109 +0,0 @@
|
|
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("pascal", function() {
|
15 |
-
function words(str) {
|
16 |
-
var obj = {}, words = str.split(" ");
|
17 |
-
for (var i = 0; i < words.length; ++i) obj[words[i]] = true;
|
18 |
-
return obj;
|
19 |
-
}
|
20 |
-
var keywords = words("and array begin case const div do downto else end file for forward integer " +
|
21 |
-
"boolean char function goto if in label mod nil not of or packed procedure " +
|
22 |
-
"program record repeat set string then to type until var while with");
|
23 |
-
var atoms = {"null": true};
|
24 |
-
|
25 |
-
var isOperatorChar = /[+\-*&%=<>!?|\/]/;
|
26 |
-
|
27 |
-
function tokenBase(stream, state) {
|
28 |
-
var ch = stream.next();
|
29 |
-
if (ch == "#" && state.startOfLine) {
|
30 |
-
stream.skipToEnd();
|
31 |
-
return "meta";
|
32 |
-
}
|
33 |
-
if (ch == '"' || ch == "'") {
|
34 |
-
state.tokenize = tokenString(ch);
|
35 |
-
return state.tokenize(stream, state);
|
36 |
-
}
|
37 |
-
if (ch == "(" && stream.eat("*")) {
|
38 |
-
state.tokenize = tokenComment;
|
39 |
-
return tokenComment(stream, state);
|
40 |
-
}
|
41 |
-
if (/[\[\]{}\(\),;\:\.]/.test(ch)) {
|
42 |
-
return null;
|
43 |
-
}
|
44 |
-
if (/\d/.test(ch)) {
|
45 |
-
stream.eatWhile(/[\w\.]/);
|
46 |
-
return "number";
|
47 |
-
}
|
48 |
-
if (ch == "/") {
|
49 |
-
if (stream.eat("/")) {
|
50 |
-
stream.skipToEnd();
|
51 |
-
return "comment";
|
52 |
-
}
|
53 |
-
}
|
54 |
-
if (isOperatorChar.test(ch)) {
|
55 |
-
stream.eatWhile(isOperatorChar);
|
56 |
-
return "operator";
|
57 |
-
}
|
58 |
-
stream.eatWhile(/[\w\$_]/);
|
59 |
-
var cur = stream.current();
|
60 |
-
if (keywords.propertyIsEnumerable(cur)) return "keyword";
|
61 |
-
if (atoms.propertyIsEnumerable(cur)) return "atom";
|
62 |
-
return "variable";
|
63 |
-
}
|
64 |
-
|
65 |
-
function tokenString(quote) {
|
66 |
-
return function(stream, state) {
|
67 |
-
var escaped = false, next, end = false;
|
68 |
-
while ((next = stream.next()) != null) {
|
69 |
-
if (next == quote && !escaped) {end = true; break;}
|
70 |
-
escaped = !escaped && next == "\\";
|
71 |
-
}
|
72 |
-
if (end || !escaped) state.tokenize = null;
|
73 |
-
return "string";
|
74 |
-
};
|
75 |
-
}
|
76 |
-
|
77 |
-
function tokenComment(stream, state) {
|
78 |
-
var maybeEnd = false, ch;
|
79 |
-
while (ch = stream.next()) {
|
80 |
-
if (ch == ")" && maybeEnd) {
|
81 |
-
state.tokenize = null;
|
82 |
-
break;
|
83 |
-
}
|
84 |
-
maybeEnd = (ch == "*");
|
85 |
-
}
|
86 |
-
return "comment";
|
87 |
-
}
|
88 |
-
|
89 |
-
// Interface
|
90 |
-
|
91 |
-
return {
|
92 |
-
startState: function() {
|
93 |
-
return {tokenize: null};
|
94 |
-
},
|
95 |
-
|
96 |
-
token: function(stream, state) {
|
97 |
-
if (stream.eatSpace()) return null;
|
98 |
-
var style = (state.tokenize || tokenBase)(stream, state);
|
99 |
-
if (style == "comment" || style == "meta") return style;
|
100 |
-
return style;
|
101 |
-
},
|
102 |
-
|
103 |
-
electricChars: "{}"
|
104 |
-
};
|
105 |
-
});
|
106 |
-
|
107 |
-
CodeMirror.defineMIME("text/x-pascal", "pascal");
|
108 |
-
|
109 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/pegjs/index.html
DELETED
@@ -1,66 +0,0 @@
|
|
1 |
-
<!doctype html>
|
2 |
-
<html>
|
3 |
-
<head>
|
4 |
-
<title>CodeMirror: PEG.js Mode</title>
|
5 |
-
<meta charset="utf-8"/>
|
6 |
-
<link rel=stylesheet href="../../doc/docs.css">
|
7 |
-
|
8 |
-
<link rel="stylesheet" href="../../lib/codemirror.css">
|
9 |
-
<script src="../../lib/codemirror.js"></script>
|
10 |
-
<script src="../javascript/javascript.js"></script>
|
11 |
-
<script src="pegjs.js"></script>
|
12 |
-
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
13 |
-
</head>
|
14 |
-
<body>
|
15 |
-
<div id=nav>
|
16 |
-
<a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
17 |
-
|
18 |
-
<ul>
|
19 |
-
<li><a href="../../index.html">Home</a>
|
20 |
-
<li><a href="../../doc/manual.html">Manual</a>
|
21 |
-
<li><a href="https://github.com/codemirror/codemirror">Code</a>
|
22 |
-
</ul>
|
23 |
-
<ul>
|
24 |
-
<li><a href="../index.html">Language modes</a>
|
25 |
-
<li><a class=active href="#">PEG.js Mode</a>
|
26 |
-
</ul>
|
27 |
-
</div>
|
28 |
-
|
29 |
-
<article>
|
30 |
-
<h2>PEG.js Mode</h2>
|
31 |
-
<form><textarea id="code" name="code">
|
32 |
-
/*
|
33 |
-
* Classic example grammar, which recognizes simple arithmetic expressions like
|
34 |
-
* "2*(3+4)". The parser generated from this grammar then computes their value.
|
35 |
-
*/
|
36 |
-
|
37 |
-
start
|
38 |
-
= additive
|
39 |
-
|
40 |
-
additive
|
41 |
-
= left:multiplicative "+" right:additive { return left + right; }
|
42 |
-
/ multiplicative
|
43 |
-
|
44 |
-
multiplicative
|
45 |
-
= left:primary "*" right:multiplicative { return left * right; }
|
46 |
-
/ primary
|
47 |
-
|
48 |
-
primary
|
49 |
-
= integer
|
50 |
-
/ "(" additive:additive ")" { return additive; }
|
51 |
-
|
52 |
-
integer "integer"
|
53 |
-
= digits:[0-9]+ { return parseInt(digits.join(""), 10); }
|
54 |
-
|
55 |
-
letter = [a-z]+</textarea></form>
|
56 |
-
<script>
|
57 |
-
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
|
58 |
-
mode: {name: "pegjs"},
|
59 |
-
lineNumbers: true
|
60 |
-
});
|
61 |
-
</script>
|
62 |
-
<h3>The PEG.js Mode</h3>
|
63 |
-
<p> Created by Forbes Lindesay.</p>
|
64 |
-
</article>
|
65 |
-
</body>
|
66 |
-
</html>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/pegjs/pegjs.js
DELETED
@@ -1,114 +0,0 @@
|
|
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("../javascript/javascript"));
|
7 |
-
else if (typeof define == "function" && define.amd) // AMD
|
8 |
-
define(["../../lib/codemirror", "../javascript/javascript"], mod);
|
9 |
-
else // Plain browser env
|
10 |
-
mod(CodeMirror);
|
11 |
-
})(function(CodeMirror) {
|
12 |
-
"use strict";
|
13 |
-
|
14 |
-
CodeMirror.defineMode("pegjs", function (config) {
|
15 |
-
var jsMode = CodeMirror.getMode(config, "javascript");
|
16 |
-
|
17 |
-
function identifier(stream) {
|
18 |
-
return stream.match(/^[a-zA-Z_][a-zA-Z0-9_]*/);
|
19 |
-
}
|
20 |
-
|
21 |
-
return {
|
22 |
-
startState: function () {
|
23 |
-
return {
|
24 |
-
inString: false,
|
25 |
-
stringType: null,
|
26 |
-
inComment: false,
|
27 |
-
inChracterClass: false,
|
28 |
-
braced: 0,
|
29 |
-
lhs: true,
|
30 |
-
localState: null
|
31 |
-
};
|
32 |
-
},
|
33 |
-
token: function (stream, state) {
|
34 |
-
if (stream)
|
35 |
-
|
36 |
-
//check for state changes
|
37 |
-
if (!state.inString && !state.inComment && ((stream.peek() == '"') || (stream.peek() == "'"))) {
|
38 |
-
state.stringType = stream.peek();
|
39 |
-
stream.next(); // Skip quote
|
40 |
-
state.inString = true; // Update state
|
41 |
-
}
|
42 |
-
if (!state.inString && !state.inComment && stream.match(/^\/\*/)) {
|
43 |
-
state.inComment = true;
|
44 |
-
}
|
45 |
-
|
46 |
-
//return state
|
47 |
-
if (state.inString) {
|
48 |
-
while (state.inString && !stream.eol()) {
|
49 |
-
if (stream.peek() === state.stringType) {
|
50 |
-
stream.next(); // Skip quote
|
51 |
-
state.inString = false; // Clear flag
|
52 |
-
} else if (stream.peek() === '\\') {
|
53 |
-
stream.next();
|
54 |
-
stream.next();
|
55 |
-
} else {
|
56 |
-
stream.match(/^.[^\\\"\']*/);
|
57 |
-
}
|
58 |
-
}
|
59 |
-
return state.lhs ? "property string" : "string"; // Token style
|
60 |
-
} else if (state.inComment) {
|
61 |
-
while (state.inComment && !stream.eol()) {
|
62 |
-
if (stream.match(/\*\//)) {
|
63 |
-
state.inComment = false; // Clear flag
|
64 |
-
} else {
|
65 |
-
stream.match(/^.[^\*]*/);
|
66 |
-
}
|
67 |
-
}
|
68 |
-
return "comment";
|
69 |
-
} else if (state.inChracterClass) {
|
70 |
-
while (state.inChracterClass && !stream.eol()) {
|
71 |
-
if (!(stream.match(/^[^\]\\]+/) || stream.match(/^\\./))) {
|
72 |
-
state.inChracterClass = false;
|
73 |
-
}
|
74 |
-
}
|
75 |
-
} else if (stream.peek() === '[') {
|
76 |
-
stream.next();
|
77 |
-
state.inChracterClass = true;
|
78 |
-
return 'bracket';
|
79 |
-
} else if (stream.match(/^\/\//)) {
|
80 |
-
stream.skipToEnd();
|
81 |
-
return "comment";
|
82 |
-
} else if (state.braced || stream.peek() === '{') {
|
83 |
-
if (state.localState === null) {
|
84 |
-
state.localState = jsMode.startState();
|
85 |
-
}
|
86 |
-
var token = jsMode.token(stream, state.localState);
|
87 |
-
var text = stream.current();
|
88 |
-
if (!token) {
|
89 |
-
for (var i = 0; i < text.length; i++) {
|
90 |
-
if (text[i] === '{') {
|
91 |
-
state.braced++;
|
92 |
-
} else if (text[i] === '}') {
|
93 |
-
state.braced--;
|
94 |
-
}
|
95 |
-
};
|
96 |
-
}
|
97 |
-
return token;
|
98 |
-
} else if (identifier(stream)) {
|
99 |
-
if (stream.peek() === ':') {
|
100 |
-
return 'variable';
|
101 |
-
}
|
102 |
-
return 'variable-2';
|
103 |
-
} else if (['[', ']', '(', ')'].indexOf(stream.peek()) != -1) {
|
104 |
-
stream.next();
|
105 |
-
return 'bracket';
|
106 |
-
} else if (!stream.eatSpace()) {
|
107 |
-
stream.next();
|
108 |
-
}
|
109 |
-
return null;
|
110 |
-
}
|
111 |
-
};
|
112 |
-
}, "javascript");
|
113 |
-
|
114 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/perl/index.html
DELETED
@@ -1,75 +0,0 @@
|
|
1 |
-
<!doctype html>
|
2 |
-
|
3 |
-
<title>CodeMirror: Perl mode</title>
|
4 |
-
<meta charset="utf-8"/>
|
5 |
-
<link rel=stylesheet href="../../doc/docs.css">
|
6 |
-
|
7 |
-
<link rel="stylesheet" href="../../lib/codemirror.css">
|
8 |
-
<script src="../../lib/codemirror.js"></script>
|
9 |
-
<script src="perl.js"></script>
|
10 |
-
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
11 |
-
<div id=nav>
|
12 |
-
<a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
13 |
-
|
14 |
-
<ul>
|
15 |
-
<li><a href="../../index.html">Home</a>
|
16 |
-
<li><a href="../../doc/manual.html">Manual</a>
|
17 |
-
<li><a href="https://github.com/codemirror/codemirror">Code</a>
|
18 |
-
</ul>
|
19 |
-
<ul>
|
20 |
-
<li><a href="../index.html">Language modes</a>
|
21 |
-
<li><a class=active href="#">Perl</a>
|
22 |
-
</ul>
|
23 |
-
</div>
|
24 |
-
|
25 |
-
<article>
|
26 |
-
<h2>Perl mode</h2>
|
27 |
-
|
28 |
-
|
29 |
-
<div><textarea id="code" name="code">
|
30 |
-
#!/usr/bin/perl
|
31 |
-
|
32 |
-
use Something qw(func1 func2);
|
33 |
-
|
34 |
-
# strings
|
35 |
-
my $s1 = qq'single line';
|
36 |
-
our $s2 = q(multi-
|
37 |
-
line);
|
38 |
-
|
39 |
-
=item Something
|
40 |
-
Example.
|
41 |
-
=cut
|
42 |
-
|
43 |
-
my $html=<<'HTML'
|
44 |
-
<html>
|
45 |
-
<title>hi!</title>
|
46 |
-
</html>
|
47 |
-
HTML
|
48 |
-
|
49 |
-
print "first,".join(',', 'second', qq~third~);
|
50 |
-
|
51 |
-
if($s1 =~ m[(?<!\s)(l.ne)\z]o) {
|
52 |
-
$h->{$1}=$$.' predefined variables';
|
53 |
-
$s2 =~ s/\-line//ox;
|
54 |
-
$s1 =~ s[
|
55 |
-
line ]
|
56 |
-
[
|
57 |
-
block
|
58 |
-
]ox;
|
59 |
-
}
|
60 |
-
|
61 |
-
1; # numbers and comments
|
62 |
-
|
63 |
-
__END__
|
64 |
-
something...
|
65 |
-
|
66 |
-
</textarea></div>
|
67 |
-
|
68 |
-
<script>
|
69 |
-
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
|
70 |
-
lineNumbers: true
|
71 |
-
});
|
72 |
-
</script>
|
73 |
-
|
74 |
-
<p><strong>MIME types defined:</strong> <code>text/x-perl</code>.</p>
|
75 |
-
</article>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/perl/perl.js
DELETED
@@ -1,837 +0,0 @@
|
|
1 |
-
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
2 |
-
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
3 |
-
|
4 |
-
// CodeMirror2 mode/perl/perl.js (text/x-perl) beta 0.10 (2011-11-08)
|
5 |
-
// This is a part of CodeMirror from https://github.com/sabaca/CodeMirror_mode_perl (mail@sabaca.com)
|
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 |
-
|
17 |
-
CodeMirror.defineMode("perl",function(){
|
18 |
-
// http://perldoc.perl.org
|
19 |
-
var PERL={ // null - magic touch
|
20 |
-
// 1 - keyword
|
21 |
-
// 2 - def
|
22 |
-
// 3 - atom
|
23 |
-
// 4 - operator
|
24 |
-
// 5 - variable-2 (predefined)
|
25 |
-
// [x,y] - x=1,2,3; y=must be defined if x{...}
|
26 |
-
// PERL operators
|
27 |
-
'->' : 4,
|
28 |
-
'++' : 4,
|
29 |
-
'--' : 4,
|
30 |
-
'**' : 4,
|
31 |
-
// ! ~ \ and unary + and -
|
32 |
-
'=~' : 4,
|
33 |
-
'!~' : 4,
|
34 |
-
'*' : 4,
|
35 |
-
'/' : 4,
|
36 |
-
'%' : 4,
|
37 |
-
'x' : 4,
|
38 |
-
'+' : 4,
|
39 |
-
'-' : 4,
|
40 |
-
'.' : 4,
|
41 |
-
'<<' : 4,
|
42 |
-
'>>' : 4,
|
43 |
-
// named unary operators
|
44 |
-
'<' : 4,
|
45 |
-
'>' : 4,
|
46 |
-
'<=' : 4,
|
47 |
-
'>=' : 4,
|
48 |
-
'lt' : 4,
|
49 |
-
'gt' : 4,
|
50 |
-
'le' : 4,
|
51 |
-
'ge' : 4,
|
52 |
-
'==' : 4,
|
53 |
-
'!=' : 4,
|
54 |
-
'<=>' : 4,
|
55 |
-
'eq' : 4,
|
56 |
-
'ne' : 4,
|
57 |
-
'cmp' : 4,
|
58 |
-
'~~' : 4,
|
59 |
-
'&' : 4,
|
60 |
-
'|' : 4,
|
61 |
-
'^' : 4,
|
62 |
-
'&&' : 4,
|
63 |
-
'||' : 4,
|
64 |
-
'//' : 4,
|
65 |
-
'..' : 4,
|
66 |
-
'...' : 4,
|
67 |
-
'?' : 4,
|
68 |
-
':' : 4,
|
69 |
-
'=' : 4,
|
70 |
-
'+=' : 4,
|
71 |
-
'-=' : 4,
|
72 |
-
'*=' : 4, // etc. ???
|
73 |
-
',' : 4,
|
74 |
-
'=>' : 4,
|
75 |
-
'::' : 4,
|
76 |
-
// list operators (rightward)
|
77 |
-
'not' : 4,
|
78 |
-
'and' : 4,
|
79 |
-
'or' : 4,
|
80 |
-
'xor' : 4,
|
81 |
-
// PERL predefined variables (I know, what this is a paranoid idea, but may be needed for people, who learn PERL, and for me as well, ...and may be for you?;)
|
82 |
-
'BEGIN' : [5,1],
|
83 |
-
'END' : [5,1],
|
84 |
-
'PRINT' : [5,1],
|
85 |
-
'PRINTF' : [5,1],
|
86 |
-
'GETC' : [5,1],
|
87 |
-
'READ' : [5,1],
|
88 |
-
'READLINE' : [5,1],
|
89 |
-
'DESTROY' : [5,1],
|
90 |
-
'TIE' : [5,1],
|
91 |
-
'TIEHANDLE' : [5,1],
|
92 |
-
'UNTIE' : [5,1],
|
93 |
-
'STDIN' : 5,
|
94 |
-
'STDIN_TOP' : 5,
|
95 |
-
'STDOUT' : 5,
|
96 |
-
'STDOUT_TOP' : 5,
|
97 |
-
'STDERR' : 5,
|
98 |
-
'STDERR_TOP' : 5,
|
99 |
-
'$ARG' : 5,
|
100 |
-
'$_' : 5,
|
101 |
-
'@ARG' : 5,
|
102 |
-
'@_' : 5,
|
103 |
-
'$LIST_SEPARATOR' : 5,
|
104 |
-
'$"' : 5,
|
105 |
-
'$PROCESS_ID' : 5,
|
106 |
-
'$PID' : 5,
|
107 |
-
'$$' : 5,
|
108 |
-
'$REAL_GROUP_ID' : 5,
|
109 |
-
'$GID' : 5,
|
110 |
-
'$(' : 5,
|
111 |
-
'$EFFECTIVE_GROUP_ID' : 5,
|
112 |
-
'$EGID' : 5,
|
113 |
-
'$)' : 5,
|
114 |
-
'$PROGRAM_NAME' : 5,
|
115 |
-
'$0' : 5,
|
116 |
-
'$SUBSCRIPT_SEPARATOR' : 5,
|
117 |
-
'$SUBSEP' : 5,
|
118 |
-
'$;' : 5,
|
119 |
-
'$REAL_USER_ID' : 5,
|
120 |
-
'$UID' : 5,
|
121 |
-
'$<' : 5,
|
122 |
-
'$EFFECTIVE_USER_ID' : 5,
|
123 |
-
'$EUID' : 5,
|
124 |
-
'$>' : 5,
|
125 |
-
'$a' : 5,
|
126 |
-
'$b' : 5,
|
127 |
-
'$COMPILING' : 5,
|
128 |
-
'$^C' : 5,
|
129 |
-
'$DEBUGGING' : 5,
|
130 |
-
'$^D' : 5,
|
131 |
-
'${^ENCODING}' : 5,
|
132 |
-
'$ENV' : 5,
|
133 |
-
'%ENV' : 5,
|
134 |
-
'$SYSTEM_FD_MAX' : 5,
|
135 |
-
'$^F' : 5,
|
136 |
-
'@F' : 5,
|
137 |
-
'${^GLOBAL_PHASE}' : 5,
|
138 |
-
'$^H' : 5,
|
139 |
-
'%^H' : 5,
|
140 |
-
'@INC' : 5,
|
141 |
-
'%INC' : 5,
|
142 |
-
'$INPLACE_EDIT' : 5,
|
143 |
-
'$^I' : 5,
|
144 |
-
'$^M' : 5,
|
145 |
-
'$OSNAME' : 5,
|
146 |
-
'$^O' : 5,
|
147 |
-
'${^OPEN}' : 5,
|
148 |
-
'$PERLDB' : 5,
|
149 |
-
'$^P' : 5,
|
150 |
-
'$SIG' : 5,
|
151 |
-
'%SIG' : 5,
|
152 |
-
'$BASETIME' : 5,
|
153 |
-
'$^T' : 5,
|
154 |
-
'${^TAINT}' : 5,
|
155 |
-
'${^UNICODE}' : 5,
|
156 |
-
'${^UTF8CACHE}' : 5,
|
157 |
-
'${^UTF8LOCALE}' : 5,
|
158 |
-
'$PERL_VERSION' : 5,
|
159 |
-
'$^V' : 5,
|
160 |
-
'${^WIN32_SLOPPY_STAT}' : 5,
|
161 |
-
'$EXECUTABLE_NAME' : 5,
|
162 |
-
'$^X' : 5,
|
163 |
-
'$1' : 5, // - regexp $1, $2...
|
164 |
-
'$MATCH' : 5,
|
165 |
-
'$&' : 5,
|
166 |
-
'${^MATCH}' : 5,
|
167 |
-
'$PREMATCH' : 5,
|
168 |
-
'$`' : 5,
|
169 |
-
'${^PREMATCH}' : 5,
|
170 |
-
'$POSTMATCH' : 5,
|
171 |
-
"$'" : 5,
|
172 |
-
'${^POSTMATCH}' : 5,
|
173 |
-
'$LAST_PAREN_MATCH' : 5,
|
174 |
-
'$+' : 5,
|
175 |
-
'$LAST_SUBMATCH_RESULT' : 5,
|
176 |
-
'$^N' : 5,
|
177 |
-
'@LAST_MATCH_END' : 5,
|
178 |
-
'@+' : 5,
|
179 |
-
'%LAST_PAREN_MATCH' : 5,
|
180 |
-
'%+' : 5,
|
181 |
-
'@LAST_MATCH_START' : 5,
|
182 |
-
'@-' : 5,
|
183 |
-
'%LAST_MATCH_START' : 5,
|
184 |
-
'%-' : 5,
|
185 |
-
'$LAST_REGEXP_CODE_RESULT' : 5,
|
186 |
-
'$^R' : 5,
|
187 |
-
'${^RE_DEBUG_FLAGS}' : 5,
|
188 |
-
'${^RE_TRIE_MAXBUF}' : 5,
|
189 |
-
'$ARGV' : 5,
|
190 |
-
'@ARGV' : 5,
|
191 |
-
'ARGV' : 5,
|
192 |
-
'ARGVOUT' : 5,
|
193 |
-
'$OUTPUT_FIELD_SEPARATOR' : 5,
|
194 |
-
'$OFS' : 5,
|
195 |
-
'$,' : 5,
|
196 |
-
'$INPUT_LINE_NUMBER' : 5,
|
197 |
-
'$NR' : 5,
|
198 |
-
'$.' : 5,
|
199 |
-
'$INPUT_RECORD_SEPARATOR' : 5,
|
200 |
-
'$RS' : 5,
|
201 |
-
'$/' : 5,
|
202 |
-
'$OUTPUT_RECORD_SEPARATOR' : 5,
|
203 |
-
'$ORS' : 5,
|
204 |
-
'$\\' : 5,
|
205 |
-
'$OUTPUT_AUTOFLUSH' : 5,
|
206 |
-
'$|' : 5,
|
207 |
-
'$ACCUMULATOR' : 5,
|
208 |
-
'$^A' : 5,
|
209 |
-
'$FORMAT_FORMFEED' : 5,
|
210 |
-
'$^L' : 5,
|
211 |
-
'$FORMAT_PAGE_NUMBER' : 5,
|
212 |
-
'$%' : 5,
|
213 |
-
'$FORMAT_LINES_LEFT' : 5,
|
214 |
-
'$-' : 5,
|
215 |
-
'$FORMAT_LINE_BREAK_CHARACTERS' : 5,
|
216 |
-
'$:' : 5,
|
217 |
-
'$FORMAT_LINES_PER_PAGE' : 5,
|
218 |
-
'$=' : 5,
|
219 |
-
'$FORMAT_TOP_NAME' : 5,
|
220 |
-
'$^' : 5,
|
221 |
-
'$FORMAT_NAME' : 5,
|
222 |
-
'$~' : 5,
|
223 |
-
'${^CHILD_ERROR_NATIVE}' : 5,
|
224 |
-
'$EXTENDED_OS_ERROR' : 5,
|
225 |
-
'$^E' : 5,
|
226 |
-
'$EXCEPTIONS_BEING_CAUGHT' : 5,
|
227 |
-
'$^S' : 5,
|
228 |
-
'$WARNING' : 5,
|
229 |
-
'$^W' : 5,
|
230 |
-
'${^WARNING_BITS}' : 5,
|
231 |
-
'$OS_ERROR' : 5,
|
232 |
-
'$ERRNO' : 5,
|
233 |
-
'$!' : 5,
|
234 |
-
'%OS_ERROR' : 5,
|
235 |
-
'%ERRNO' : 5,
|
236 |
-
'%!' : 5,
|
237 |
-
'$CHILD_ERROR' : 5,
|
238 |
-
'$?' : 5,
|
239 |
-
'$EVAL_ERROR' : 5,
|
240 |
-
'$@' : 5,
|
241 |
-
'$OFMT' : 5,
|
242 |
-
'$#' : 5,
|
243 |
-
'$*' : 5,
|
244 |
-
'$ARRAY_BASE' : 5,
|
245 |
-
'$[' : 5,
|
246 |
-
'$OLD_PERL_VERSION' : 5,
|
247 |
-
'$]' : 5,
|
248 |
-
// PERL blocks
|
249 |
-
'if' :[1,1],
|
250 |
-
elsif :[1,1],
|
251 |
-
'else' :[1,1],
|
252 |
-
'while' :[1,1],
|
253 |
-
unless :[1,1],
|
254 |
-
'for' :[1,1],
|
255 |
-
foreach :[1,1],
|
256 |
-
// PERL functions
|
257 |
-
'abs' :1, // - absolute value function
|
258 |
-
accept :1, // - accept an incoming socket connect
|
259 |
-
alarm :1, // - schedule a SIGALRM
|
260 |
-
'atan2' :1, // - arctangent of Y/X in the range -PI to PI
|
261 |
-
bind :1, // - binds an address to a socket
|
262 |
-
binmode :1, // - prepare binary files for I/O
|
263 |
-
bless :1, // - create an object
|
264 |
-
bootstrap :1, //
|
265 |
-
'break' :1, // - break out of a "given" block
|
266 |
-
caller :1, // - get context of the current subroutine call
|
267 |
-
chdir :1, // - change your current working directory
|
268 |
-
chmod :1, // - changes the permissions on a list of files
|
269 |
-
chomp :1, // - remove a trailing record separator from a string
|
270 |
-
chop :1, // - remove the last character from a string
|
271 |
-
chown :1, // - change the owership on a list of files
|
272 |
-
chr :1, // - get character this number represents
|
273 |
-
chroot :1, // - make directory new root for path lookups
|
274 |
-
close :1, // - close file (or pipe or socket) handle
|
275 |
-
closedir :1, // - close directory handle
|
276 |
-
connect :1, // - connect to a remote socket
|
277 |
-
'continue' :[1,1], // - optional trailing block in a while or foreach
|
278 |
-
'cos' :1, // - cosine function
|
279 |
-
crypt :1, // - one-way passwd-style encryption
|
280 |
-
dbmclose :1, // - breaks binding on a tied dbm file
|
281 |
-
dbmopen :1, // - create binding on a tied dbm file
|
282 |
-
'default' :1, //
|
283 |
-
defined :1, // - test whether a value, variable, or function is defined
|
284 |
-
'delete' :1, // - deletes a value from a hash
|
285 |
-
die :1, // - raise an exception or bail out
|
286 |
-
'do' :1, // - turn a BLOCK into a TERM
|
287 |
-
dump :1, // - create an immediate core dump
|
288 |
-
each :1, // - retrieve the next key/value pair from a hash
|
289 |
-
endgrent :1, // - be done using group file
|
290 |
-
endhostent :1, // - be done using hosts file
|
291 |
-
endnetent :1, // - be done using networks file
|
292 |
-
endprotoent :1, // - be done using protocols file
|
293 |
-
endpwent :1, // - be done using passwd file
|
294 |
-
endservent :1, // - be done using services file
|
295 |
-
eof :1, // - test a filehandle for its end
|
296 |
-
'eval' :1, // - catch exceptions or compile and run code
|
297 |
-
'exec' :1, // - abandon this program to run another
|
298 |
-
exists :1, // - test whether a hash key is present
|
299 |
-
exit :1, // - terminate this program
|
300 |
-
'exp' :1, // - raise I to a power
|
301 |
-
fcntl :1, // - file control system call
|
302 |
-
fileno :1, // - return file descriptor from filehandle
|
303 |
-
flock :1, // - lock an entire file with an advisory lock
|
304 |
-
fork :1, // - create a new process just like this one
|
305 |
-
format :1, // - declare a picture format with use by the write() function
|
306 |
-
formline :1, // - internal function used for formats
|
307 |
-
getc :1, // - get the next character from the filehandle
|
308 |
-
getgrent :1, // - get next group record
|
309 |
-
getgrgid :1, // - get group record given group user ID
|
310 |
-
getgrnam :1, // - get group record given group name
|
311 |
-
gethostbyaddr :1, // - get host record given its address
|
312 |
-
gethostbyname :1, // - get host record given name
|
313 |
-
gethostent :1, // - get next hosts record
|
314 |
-
getlogin :1, // - return who logged in at this tty
|
315 |
-
getnetbyaddr :1, // - get network record given its address
|
316 |
-
getnetbyname :1, // - get networks record given name
|
317 |
-
getnetent :1, // - get next networks record
|
318 |
-
getpeername :1, // - find the other end of a socket connection
|
319 |
-
getpgrp :1, // - get process group
|
320 |
-
getppid :1, // - get parent process ID
|
321 |
-
getpriority :1, // - get current nice value
|
322 |
-
getprotobyname :1, // - get protocol record given name
|
323 |
-
getprotobynumber :1, // - get protocol record numeric protocol
|
324 |
-
getprotoent :1, // - get next protocols record
|
325 |
-
getpwent :1, // - get next passwd record
|
326 |
-
getpwnam :1, // - get passwd record given user login name
|
327 |
-
getpwuid :1, // - get passwd record given user ID
|
328 |
-
getservbyname :1, // - get services record given its name
|
329 |
-
getservbyport :1, // - get services record given numeric port
|
330 |
-
getservent :1, // - get next services record
|
331 |
-
getsockname :1, // - retrieve the sockaddr for a given socket
|
332 |
-
getsockopt :1, // - get socket options on a given socket
|
333 |
-
given :1, //
|
334 |
-
glob :1, // - expand filenames using wildcards
|
335 |
-
gmtime :1, // - convert UNIX time into record or string using Greenwich time
|
336 |
-
'goto' :1, // - create spaghetti code
|
337 |
-
grep :1, // - locate elements in a list test true against a given criterion
|
338 |
-
hex :1, // - convert a string to a hexadecimal number
|
339 |
-
'import' :1, // - patch a module's namespace into your own
|
340 |
-
index :1, // - find a substring within a string
|
341 |
-
'int' :1, // - get the integer portion of a number
|
342 |
-
ioctl :1, // - system-dependent device control system call
|
343 |
-
'join' :1, // - join a list into a string using a separator
|
344 |
-
keys :1, // - retrieve list of indices from a hash
|
345 |
-
kill :1, // - send a signal to a process or process group
|
346 |
-
last :1, // - exit a block prematurely
|
347 |
-
lc :1, // - return lower-case version of a string
|
348 |
-
lcfirst :1, // - return a string with just the next letter in lower case
|
349 |
-
length :1, // - return the number of bytes in a string
|
350 |
-
'link' :1, // - create a hard link in the filesytem
|
351 |
-
listen :1, // - register your socket as a server
|
352 |
-
local : 2, // - create a temporary value for a global variable (dynamic scoping)
|
353 |
-
localtime :1, // - convert UNIX time into record or string using local time
|
354 |
-
lock :1, // - get a thread lock on a variable, subroutine, or method
|
355 |
-
'log' :1, // - retrieve the natural logarithm for a number
|
356 |
-
lstat :1, // - stat a symbolic link
|
357 |
-
m :null, // - match a string with a regular expression pattern
|
358 |
-
map :1, // - apply a change to a list to get back a new list with the changes
|
359 |
-
mkdir :1, // - create a directory
|
360 |
-
msgctl :1, // - SysV IPC message control operations
|
361 |
-
msgget :1, // - get SysV IPC message queue
|
362 |
-
msgrcv :1, // - receive a SysV IPC message from a message queue
|
363 |
-
msgsnd :1, // - send a SysV IPC message to a message queue
|
364 |
-
my : 2, // - declare and assign a local variable (lexical scoping)
|
365 |
-
'new' :1, //
|
366 |
-
next :1, // - iterate a block prematurely
|
367 |
-
no :1, // - unimport some module symbols or semantics at compile time
|
368 |
-
oct :1, // - convert a string to an octal number
|
369 |
-
open :1, // - open a file, pipe, or descriptor
|
370 |
-
opendir :1, // - open a directory
|
371 |
-
ord :1, // - find a character's numeric representation
|
372 |
-
our : 2, // - declare and assign a package variable (lexical scoping)
|
373 |
-
pack :1, // - convert a list into a binary representation
|
374 |
-
'package' :1, // - declare a separate global namespace
|
375 |
-
pipe :1, // - open a pair of connected filehandles
|
376 |
-
pop :1, // - remove the last element from an array and return it
|
377 |
-
pos :1, // - find or set the offset for the last/next m//g search
|
378 |
-
print :1, // - output a list to a filehandle
|
379 |
-
printf :1, // - output a formatted list to a filehandle
|
380 |
-
prototype :1, // - get the prototype (if any) of a subroutine
|
381 |
-
push :1, // - append one or more elements to an array
|
382 |
-
q :null, // - singly quote a string
|
383 |
-
qq :null, // - doubly quote a string
|
384 |
-
qr :null, // - Compile pattern
|
385 |
-
quotemeta :null, // - quote regular expression magic characters
|
386 |
-
qw :null, // - quote a list of words
|
387 |
-
qx :null, // - backquote quote a string
|
388 |
-
rand :1, // - retrieve the next pseudorandom number
|
389 |
-
read :1, // - fixed-length buffered input from a filehandle
|
390 |
-
readdir :1, // - get a directory from a directory handle
|
391 |
-
readline :1, // - fetch a record from a file
|
392 |
-
readlink :1, // - determine where a symbolic link is pointing
|
393 |
-
readpipe :1, // - execute a system command and collect standard output
|
394 |
-
recv :1, // - receive a message over a Socket
|
395 |
-
redo :1, // - start this loop iteration over again
|
396 |
-
ref :1, // - find out the type of thing being referenced
|
397 |
-
rename :1, // - change a filename
|
398 |
-
require :1, // - load in external functions from a library at runtime
|
399 |
-
reset :1, // - clear all variables of a given name
|
400 |
-
'return' :1, // - get out of a function early
|
401 |
-
reverse :1, // - flip a string or a list
|
402 |
-
rewinddir :1, // - reset directory handle
|
403 |
-
rindex :1, // - right-to-left substring search
|
404 |
-
rmdir :1, // - remove a directory
|
405 |
-
s :null, // - replace a pattern with a string
|
406 |
-
say :1, // - print with newline
|
407 |
-
scalar :1, // - force a scalar context
|
408 |
-
seek :1, // - reposition file pointer for random-access I/O
|
409 |
-
seekdir :1, // - reposition directory pointer
|
410 |
-
select :1, // - reset default output or do I/O multiplexing
|
411 |
-
semctl :1, // - SysV semaphore control operations
|
412 |
-
semget :1, // - get set of SysV semaphores
|
413 |
-
semop :1, // - SysV semaphore operations
|
414 |
-
send :1, // - send a message over a socket
|
415 |
-
setgrent :1, // - prepare group file for use
|
416 |
-
sethostent :1, // - prepare hosts file for use
|
417 |
-
setnetent :1, // - prepare networks file for use
|
418 |
-
setpgrp :1, // - set the process group of a process
|
419 |
-
setpriority :1, // - set a process's nice value
|
420 |
-
setprotoent :1, // - prepare protocols file for use
|
421 |
-
setpwent :1, // - prepare passwd file for use
|
422 |
-
setservent :1, // - prepare services file for use
|
423 |
-
setsockopt :1, // - set some socket options
|
424 |
-
shift :1, // - remove the first element of an array, and return it
|
425 |
-
shmctl :1, // - SysV shared memory operations
|
426 |
-
shmget :1, // - get SysV shared memory segment identifier
|
427 |
-
shmread :1, // - read SysV shared memory
|
428 |
-
shmwrite :1, // - write SysV shared memory
|
429 |
-
shutdown :1, // - close down just half of a socket connection
|
430 |
-
'sin' :1, // - return the sine of a number
|
431 |
-
sleep :1, // - block for some number of seconds
|
432 |
-
socket :1, // - create a socket
|
433 |
-
socketpair :1, // - create a pair of sockets
|
434 |
-
'sort' :1, // - sort a list of values
|
435 |
-
splice :1, // - add or remove elements anywhere in an array
|
436 |
-
'split' :1, // - split up a string using a regexp delimiter
|
437 |
-
sprintf :1, // - formatted print into a string
|
438 |
-
'sqrt' :1, // - square root function
|
439 |
-
srand :1, // - seed the random number generator
|
440 |
-
stat :1, // - get a file's status information
|
441 |
-
state :1, // - declare and assign a state variable (persistent lexical scoping)
|
442 |
-
study :1, // - optimize input data for repeated searches
|
443 |
-
'sub' :1, // - declare a subroutine, possibly anonymously
|
444 |
-
'substr' :1, // - get or alter a portion of a stirng
|
445 |
-
symlink :1, // - create a symbolic link to a file
|
446 |
-
syscall :1, // - execute an arbitrary system call
|
447 |
-
sysopen :1, // - open a file, pipe, or descriptor
|
448 |
-
sysread :1, // - fixed-length unbuffered input from a filehandle
|
449 |
-
sysseek :1, // - position I/O pointer on handle used with sysread and syswrite
|
450 |
-
system :1, // - run a separate program
|
451 |
-
syswrite :1, // - fixed-length unbuffered output to a filehandle
|
452 |
-
tell :1, // - get current seekpointer on a filehandle
|
453 |
-
telldir :1, // - get current seekpointer on a directory handle
|
454 |
-
tie :1, // - bind a variable to an object class
|
455 |
-
tied :1, // - get a reference to the object underlying a tied variable
|
456 |
-
time :1, // - return number of seconds since 1970
|
457 |
-
times :1, // - return elapsed time for self and child processes
|
458 |
-
tr :null, // - transliterate a string
|
459 |
-
truncate :1, // - shorten a file
|
460 |
-
uc :1, // - return upper-case version of a string
|
461 |
-
ucfirst :1, // - return a string with just the next letter in upper case
|
462 |
-
umask :1, // - set file creation mode mask
|
463 |
-
undef :1, // - remove a variable or function definition
|
464 |
-
unlink :1, // - remove one link to a file
|
465 |
-
unpack :1, // - convert binary structure into normal perl variables
|
466 |
-
unshift :1, // - prepend more elements to the beginning of a list
|
467 |
-
untie :1, // - break a tie binding to a variable
|
468 |
-
use :1, // - load in a module at compile time
|
469 |
-
utime :1, // - set a file's last access and modify times
|
470 |
-
values :1, // - return a list of the values in a hash
|
471 |
-
vec :1, // - test or set particular bits in a string
|
472 |
-
wait :1, // - wait for any child process to die
|
473 |
-
waitpid :1, // - wait for a particular child process to die
|
474 |
-
wantarray :1, // - get void vs scalar vs list context of current subroutine call
|
475 |
-
warn :1, // - print debugging info
|
476 |
-
when :1, //
|
477 |
-
write :1, // - print a picture record
|
478 |
-
y :null}; // - transliterate a string
|
479 |
-
|
480 |
-
var RXstyle="string-2";
|
481 |
-
var RXmodifiers=/[goseximacplud]/; // NOTE: "m", "s", "y" and "tr" need to correct real modifiers for each regexp type
|
482 |
-
|
483 |
-
function tokenChain(stream,state,chain,style,tail){ // NOTE: chain.length > 2 is not working now (it's for s[...][...]geos;)
|
484 |
-
state.chain=null; // 12 3tail
|
485 |
-
state.style=null;
|
486 |
-
state.tail=null;
|
487 |
-
state.tokenize=function(stream,state){
|
488 |
-
var e=false,c,i=0;
|
489 |
-
while(c=stream.next()){
|
490 |
-
if(c===chain[i]&&!e){
|
491 |
-
if(chain[++i]!==undefined){
|
492 |
-
state.chain=chain[i];
|
493 |
-
state.style=style;
|
494 |
-
state.tail=tail;}
|
495 |
-
else if(tail)
|
496 |
-
stream.eatWhile(tail);
|
497 |
-
state.tokenize=tokenPerl;
|
498 |
-
return style;}
|
499 |
-
e=!e&&c=="\\";}
|
500 |
-
return style;};
|
501 |
-
return state.tokenize(stream,state);}
|
502 |
-
|
503 |
-
function tokenSOMETHING(stream,state,string){
|
504 |
-
state.tokenize=function(stream,state){
|
505 |
-
if(stream.string==string)
|
506 |
-
state.tokenize=tokenPerl;
|
507 |
-
stream.skipToEnd();
|
508 |
-
return "string";};
|
509 |
-
return state.tokenize(stream,state);}
|
510 |
-
|
511 |
-
function tokenPerl(stream,state){
|
512 |
-
if(stream.eatSpace())
|
513 |
-
return null;
|
514 |
-
if(state.chain)
|
515 |
-
return tokenChain(stream,state,state.chain,state.style,state.tail);
|
516 |
-
if(stream.match(/^\-?[\d\.]/,false))
|
517 |
-
if(stream.match(/^(\-?(\d*\.\d+(e[+-]?\d+)?|\d+\.\d*)|0x[\da-fA-F]+|0b[01]+|\d+(e[+-]?\d+)?)/))
|
518 |
-
return 'number';
|
519 |
-
if(stream.match(/^<<(?=\w)/)){ // NOTE: <<SOMETHING\n...\nSOMETHING\n
|
520 |
-
stream.eatWhile(/\w/);
|
521 |
-
return tokenSOMETHING(stream,state,stream.current().substr(2));}
|
522 |
-
if(stream.sol()&&stream.match(/^\=item(?!\w)/)){// NOTE: \n=item...\n=cut\n
|
523 |
-
return tokenSOMETHING(stream,state,'=cut');}
|
524 |
-
var ch=stream.next();
|
525 |
-
if(ch=='"'||ch=="'"){ // NOTE: ' or " or <<'SOMETHING'\n...\nSOMETHING\n or <<"SOMETHING"\n...\nSOMETHING\n
|
526 |
-
if(prefix(stream, 3)=="<<"+ch){
|
527 |
-
var p=stream.pos;
|
528 |
-
stream.eatWhile(/\w/);
|
529 |
-
var n=stream.current().substr(1);
|
530 |
-
if(n&&stream.eat(ch))
|
531 |
-
return tokenSOMETHING(stream,state,n);
|
532 |
-
stream.pos=p;}
|
533 |
-
return tokenChain(stream,state,[ch],"string");}
|
534 |
-
if(ch=="q"){
|
535 |
-
var c=look(stream, -2);
|
536 |
-
if(!(c&&/\w/.test(c))){
|
537 |
-
c=look(stream, 0);
|
538 |
-
if(c=="x"){
|
539 |
-
c=look(stream, 1);
|
540 |
-
if(c=="("){
|
541 |
-
eatSuffix(stream, 2);
|
542 |
-
return tokenChain(stream,state,[")"],RXstyle,RXmodifiers);}
|
543 |
-
if(c=="["){
|
544 |
-
eatSuffix(stream, 2);
|
545 |
-
return tokenChain(stream,state,["]"],RXstyle,RXmodifiers);}
|
546 |
-
if(c=="{"){
|
547 |
-
eatSuffix(stream, 2);
|
548 |
-
return tokenChain(stream,state,["}"],RXstyle,RXmodifiers);}
|
549 |
-
if(c=="<"){
|
550 |
-
eatSuffix(stream, 2);
|
551 |
-
return tokenChain(stream,state,[">"],RXstyle,RXmodifiers);}
|
552 |
-
if(/[\^'"!~\/]/.test(c)){
|
553 |
-
eatSuffix(stream, 1);
|
554 |
-
return tokenChain(stream,state,[stream.eat(c)],RXstyle,RXmodifiers);}}
|
555 |
-
else if(c=="q"){
|
556 |
-
c=look(stream, 1);
|
557 |
-
if(c=="("){
|
558 |
-
eatSuffix(stream, 2);
|
559 |
-
return tokenChain(stream,state,[")"],"string");}
|
560 |
-
if(c=="["){
|
561 |
-
eatSuffix(stream, 2);
|
562 |
-
return tokenChain(stream,state,["]"],"string");}
|
563 |
-
if(c=="{"){
|
564 |
-
eatSuffix(stream, 2);
|
565 |
-
return tokenChain(stream,state,["}"],"string");}
|
566 |
-
if(c=="<"){
|
567 |
-
eatSuffix(stream, 2);
|
568 |
-
return tokenChain(stream,state,[">"],"string");}
|
569 |
-
if(/[\^'"!~\/]/.test(c)){
|
570 |
-
eatSuffix(stream, 1);
|
571 |
-
return tokenChain(stream,state,[stream.eat(c)],"string");}}
|
572 |
-
else if(c=="w"){
|
573 |
-
c=look(stream, 1);
|
574 |
-
if(c=="("){
|
575 |
-
eatSuffix(stream, 2);
|
576 |
-
return tokenChain(stream,state,[")"],"bracket");}
|
577 |
-
if(c=="["){
|
578 |
-
eatSuffix(stream, 2);
|
579 |
-
return tokenChain(stream,state,["]"],"bracket");}
|
580 |
-
if(c=="{"){
|
581 |
-
eatSuffix(stream, 2);
|
582 |
-
return tokenChain(stream,state,["}"],"bracket");}
|
583 |
-
if(c=="<"){
|
584 |
-
eatSuffix(stream, 2);
|
585 |
-
return tokenChain(stream,state,[">"],"bracket");}
|
586 |
-
if(/[\^'"!~\/]/.test(c)){
|
587 |
-
eatSuffix(stream, 1);
|
588 |
-
return tokenChain(stream,state,[stream.eat(c)],"bracket");}}
|
589 |
-
else if(c=="r"){
|
590 |
-
c=look(stream, 1);
|
591 |
-
if(c=="("){
|
592 |
-
eatSuffix(stream, 2);
|
593 |
-
return tokenChain(stream,state,[")"],RXstyle,RXmodifiers);}
|
594 |
-
if(c=="["){
|
595 |
-
eatSuffix(stream, 2);
|
596 |
-
return tokenChain(stream,state,["]"],RXstyle,RXmodifiers);}
|
597 |
-
if(c=="{"){
|
598 |
-
eatSuffix(stream, 2);
|
599 |
-
return tokenChain(stream,state,["}"],RXstyle,RXmodifiers);}
|
600 |
-
if(c=="<"){
|
601 |
-
eatSuffix(stream, 2);
|
602 |
-
return tokenChain(stream,state,[">"],RXstyle,RXmodifiers);}
|
603 |
-
if(/[\^'"!~\/]/.test(c)){
|
604 |
-
eatSuffix(stream, 1);
|
605 |
-
return tokenChain(stream,state,[stream.eat(c)],RXstyle,RXmodifiers);}}
|
606 |
-
else if(/[\^'"!~\/(\[{<]/.test(c)){
|
607 |
-
if(c=="("){
|
608 |
-
eatSuffix(stream, 1);
|
609 |
-
return tokenChain(stream,state,[")"],"string");}
|
610 |
-
if(c=="["){
|
611 |
-
eatSuffix(stream, 1);
|
612 |
-
return tokenChain(stream,state,["]"],"string");}
|
613 |
-
if(c=="{"){
|
614 |
-
eatSuffix(stream, 1);
|
615 |
-
return tokenChain(stream,state,["}"],"string");}
|
616 |
-
if(c=="<"){
|
617 |
-
eatSuffix(stream, 1);
|
618 |
-
return tokenChain(stream,state,[">"],"string");}
|
619 |
-
if(/[\^'"!~\/]/.test(c)){
|
620 |
-
return tokenChain(stream,state,[stream.eat(c)],"string");}}}}
|
621 |
-
if(ch=="m"){
|
622 |
-
var c=look(stream, -2);
|
623 |
-
if(!(c&&/\w/.test(c))){
|
624 |
-
c=stream.eat(/[(\[{<\^'"!~\/]/);
|
625 |
-
if(c){
|
626 |
-
if(/[\^'"!~\/]/.test(c)){
|
627 |
-
return tokenChain(stream,state,[c],RXstyle,RXmodifiers);}
|
628 |
-
if(c=="("){
|
629 |
-
return tokenChain(stream,state,[")"],RXstyle,RXmodifiers);}
|
630 |
-
if(c=="["){
|
631 |
-
return tokenChain(stream,state,["]"],RXstyle,RXmodifiers);}
|
632 |
-
if(c=="{"){
|
633 |
-
return tokenChain(stream,state,["}"],RXstyle,RXmodifiers);}
|
634 |
-
if(c=="<"){
|
635 |
-
return tokenChain(stream,state,[">"],RXstyle,RXmodifiers);}}}}
|
636 |
-
if(ch=="s"){
|
637 |
-
var c=/[\/>\]})\w]/.test(look(stream, -2));
|
638 |
-
if(!c){
|
639 |
-
c=stream.eat(/[(\[{<\^'"!~\/]/);
|
640 |
-
if(c){
|
641 |
-
if(c=="[")
|
642 |
-
return tokenChain(stream,state,["]","]"],RXstyle,RXmodifiers);
|
643 |
-
if(c=="{")
|
644 |
-
return tokenChain(stream,state,["}","}"],RXstyle,RXmodifiers);
|
645 |
-
if(c=="<")
|
646 |
-
return tokenChain(stream,state,[">",">"],RXstyle,RXmodifiers);
|
647 |
-
if(c=="(")
|
648 |
-
return tokenChain(stream,state,[")",")"],RXstyle,RXmodifiers);
|
649 |
-
return tokenChain(stream,state,[c,c],RXstyle,RXmodifiers);}}}
|
650 |
-
if(ch=="y"){
|
651 |
-
var c=/[\/>\]})\w]/.test(look(stream, -2));
|
652 |
-
if(!c){
|
653 |
-
c=stream.eat(/[(\[{<\^'"!~\/]/);
|
654 |
-
if(c){
|
655 |
-
if(c=="[")
|
656 |
-
return tokenChain(stream,state,["]","]"],RXstyle,RXmodifiers);
|
657 |
-
if(c=="{")
|
658 |
-
return tokenChain(stream,state,["}","}"],RXstyle,RXmodifiers);
|
659 |
-
if(c=="<")
|
660 |
-
return tokenChain(stream,state,[">",">"],RXstyle,RXmodifiers);
|
661 |
-
if(c=="(")
|
662 |
-
return tokenChain(stream,state,[")",")"],RXstyle,RXmodifiers);
|
663 |
-
return tokenChain(stream,state,[c,c],RXstyle,RXmodifiers);}}}
|
664 |
-
if(ch=="t"){
|
665 |
-
var c=/[\/>\]})\w]/.test(look(stream, -2));
|
666 |
-
if(!c){
|
667 |
-
c=stream.eat("r");if(c){
|
668 |
-
c=stream.eat(/[(\[{<\^'"!~\/]/);
|
669 |
-
if(c){
|
670 |
-
if(c=="[")
|
671 |
-
return tokenChain(stream,state,["]","]"],RXstyle,RXmodifiers);
|
672 |
-
if(c=="{")
|
673 |
-
return tokenChain(stream,state,["}","}"],RXstyle,RXmodifiers);
|
674 |
-
if(c=="<")
|
675 |
-
return tokenChain(stream,state,[">",">"],RXstyle,RXmodifiers);
|
676 |
-
if(c=="(")
|
677 |
-
return tokenChain(stream,state,[")",")"],RXstyle,RXmodifiers);
|
678 |
-
return tokenChain(stream,state,[c,c],RXstyle,RXmodifiers);}}}}
|
679 |
-
if(ch=="`"){
|
680 |
-
return tokenChain(stream,state,[ch],"variable-2");}
|
681 |
-
if(ch=="/"){
|
682 |
-
if(!/~\s*$/.test(prefix(stream)))
|
683 |
-
return "operator";
|
684 |
-
else
|
685 |
-
return tokenChain(stream,state,[ch],RXstyle,RXmodifiers);}
|
686 |
-
if(ch=="$"){
|
687 |
-
var p=stream.pos;
|
688 |
-
if(stream.eatWhile(/\d/)||stream.eat("{")&&stream.eatWhile(/\d/)&&stream.eat("}"))
|
689 |
-
return "variable-2";
|
690 |
-
else
|
691 |
-
stream.pos=p;}
|
692 |
-
if(/[$@%]/.test(ch)){
|
693 |
-
var p=stream.pos;
|
694 |
-
if(stream.eat("^")&&stream.eat(/[A-Z]/)||!/[@$%&]/.test(look(stream, -2))&&stream.eat(/[=|\\\-#?@;:&`~\^!\[\]*'"$+.,\/<>()]/)){
|
695 |
-
var c=stream.current();
|
696 |
-
if(PERL[c])
|
697 |
-
return "variable-2";}
|
698 |
-
stream.pos=p;}
|
699 |
-
if(/[$@%&]/.test(ch)){
|
700 |
-
if(stream.eatWhile(/[\w$\[\]]/)||stream.eat("{")&&stream.eatWhile(/[\w$\[\]]/)&&stream.eat("}")){
|
701 |
-
var c=stream.current();
|
702 |
-
if(PERL[c])
|
703 |
-
return "variable-2";
|
704 |
-
else
|
705 |
-
return "variable";}}
|
706 |
-
if(ch=="#"){
|
707 |
-
if(look(stream, -2)!="$"){
|
708 |
-
stream.skipToEnd();
|
709 |
-
return "comment";}}
|
710 |
-
if(/[:+\-\^*$&%@=<>!?|\/~\.]/.test(ch)){
|
711 |
-
var p=stream.pos;
|
712 |
-
stream.eatWhile(/[:+\-\^*$&%@=<>!?|\/~\.]/);
|
713 |
-
if(PERL[stream.current()])
|
714 |
-
return "operator";
|
715 |
-
else
|
716 |
-
stream.pos=p;}
|
717 |
-
if(ch=="_"){
|
718 |
-
if(stream.pos==1){
|
719 |
-
if(suffix(stream, 6)=="_END__"){
|
720 |
-
return tokenChain(stream,state,['\0'],"comment");}
|
721 |
-
else if(suffix(stream, 7)=="_DATA__"){
|
722 |
-
return tokenChain(stream,state,['\0'],"variable-2");}
|
723 |
-
else if(suffix(stream, 7)=="_C__"){
|
724 |
-
return tokenChain(stream,state,['\0'],"string");}}}
|
725 |
-
if(/\w/.test(ch)){
|
726 |
-
var p=stream.pos;
|
727 |
-
if(look(stream, -2)=="{"&&(look(stream, 0)=="}"||stream.eatWhile(/\w/)&&look(stream, 0)=="}"))
|
728 |
-
return "string";
|
729 |
-
else
|
730 |
-
stream.pos=p;}
|
731 |
-
if(/[A-Z]/.test(ch)){
|
732 |
-
var l=look(stream, -2);
|
733 |
-
var p=stream.pos;
|
734 |
-
stream.eatWhile(/[A-Z_]/);
|
735 |
-
if(/[\da-z]/.test(look(stream, 0))){
|
736 |
-
stream.pos=p;}
|
737 |
-
else{
|
738 |
-
var c=PERL[stream.current()];
|
739 |
-
if(!c)
|
740 |
-
return "meta";
|
741 |
-
if(c[1])
|
742 |
-
c=c[0];
|
743 |
-
if(l!=":"){
|
744 |
-
if(c==1)
|
745 |
-
return "keyword";
|
746 |
-
else if(c==2)
|
747 |
-
return "def";
|
748 |
-
else if(c==3)
|
749 |
-
return "atom";
|
750 |
-
else if(c==4)
|
751 |
-
return "operator";
|
752 |
-
else if(c==5)
|
753 |
-
return "variable-2";
|
754 |
-
else
|
755 |
-
return "meta";}
|
756 |
-
else
|
757 |
-
return "meta";}}
|
758 |
-
if(/[a-zA-Z_]/.test(ch)){
|
759 |
-
var l=look(stream, -2);
|
760 |
-
stream.eatWhile(/\w/);
|
761 |
-
var c=PERL[stream.current()];
|
762 |
-
if(!c)
|
763 |
-
return "meta";
|
764 |
-
if(c[1])
|
765 |
-
c=c[0];
|
766 |
-
if(l!=":"){
|
767 |
-
if(c==1)
|
768 |
-
return "keyword";
|
769 |
-
else if(c==2)
|
770 |
-
return "def";
|
771 |
-
else if(c==3)
|
772 |
-
return "atom";
|
773 |
-
else if(c==4)
|
774 |
-
return "operator";
|
775 |
-
else if(c==5)
|
776 |
-
return "variable-2";
|
777 |
-
else
|
778 |
-
return "meta";}
|
779 |
-
else
|
780 |
-
return "meta";}
|
781 |
-
return null;}
|
782 |
-
|
783 |
-
return {
|
784 |
-
startState: function() {
|
785 |
-
return {
|
786 |
-
tokenize: tokenPerl,
|
787 |
-
chain: null,
|
788 |
-
style: null,
|
789 |
-
tail: null
|
790 |
-
};
|
791 |
-
},
|
792 |
-
token: function(stream, state) {
|
793 |
-
return (state.tokenize || tokenPerl)(stream, state);
|
794 |
-
},
|
795 |
-
lineComment: '#'
|
796 |
-
};
|
797 |
-
});
|
798 |
-
|
799 |
-
CodeMirror.registerHelper("wordChars", "perl", /[\w$]/);
|
800 |
-
|
801 |
-
CodeMirror.defineMIME("text/x-perl", "perl");
|
802 |
-
|
803 |
-
// it's like "peek", but need for look-ahead or look-behind if index < 0
|
804 |
-
function look(stream, c){
|
805 |
-
return stream.string.charAt(stream.pos+(c||0));
|
806 |
-
}
|
807 |
-
|
808 |
-
// return a part of prefix of current stream from current position
|
809 |
-
function prefix(stream, c){
|
810 |
-
if(c){
|
811 |
-
var x=stream.pos-c;
|
812 |
-
return stream.string.substr((x>=0?x:0),c);}
|
813 |
-
else{
|
814 |
-
return stream.string.substr(0,stream.pos-1);
|
815 |
-
}
|
816 |
-
}
|
817 |
-
|
818 |
-
// return a part of suffix of current stream from current position
|
819 |
-
function suffix(stream, c){
|
820 |
-
var y=stream.string.length;
|
821 |
-
var x=y-stream.pos+1;
|
822 |
-
return stream.string.substr(stream.pos,(c&&c<y?c:x));
|
823 |
-
}
|
824 |
-
|
825 |
-
// eating and vomiting a part of stream from current position
|
826 |
-
function eatSu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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/pig/index.html
DELETED
@@ -1,55 +0,0 @@
|
|
1 |
-
<!doctype html>
|
2 |
-
|
3 |
-
<title>CodeMirror: Pig Latin mode</title>
|
4 |
-
<meta charset="utf-8"/>
|
5 |
-
<link rel=stylesheet href="../../doc/docs.css">
|
6 |
-
|
7 |
-
<link rel="stylesheet" href="../../lib/codemirror.css">
|
8 |
-
<script src="../../lib/codemirror.js"></script>
|
9 |
-
<script src="pig.js"></script>
|
10 |
-
<style>.CodeMirror {border: 2px inset #dee;}</style>
|
11 |
-
<div id=nav>
|
12 |
-
<a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
13 |
-
|
14 |
-
<ul>
|
15 |
-
<li><a href="../../index.html">Home</a>
|
16 |
-
<li><a href="../../doc/manual.html">Manual</a>
|
17 |
-
<li><a href="https://github.com/codemirror/codemirror">Code</a>
|
18 |
-
</ul>
|
19 |
-
<ul>
|
20 |
-
<li><a href="../index.html">Language modes</a>
|
21 |
-
<li><a class=active href="#">Pig Latin</a>
|
22 |
-
</ul>
|
23 |
-
</div>
|
24 |
-
|
25 |
-
<article>
|
26 |
-
<h2>Pig Latin mode</h2>
|
27 |
-
<form><textarea id="code" name="code">
|
28 |
-
-- Apache Pig (Pig Latin Language) Demo
|
29 |
-
/*
|
30 |
-
This is a multiline comment.
|
31 |
-
*/
|
32 |
-
a = LOAD "\path\to\input" USING PigStorage('\t') AS (x:long, y:chararray, z:bytearray);
|
33 |
-
b = GROUP a BY (x,y,3+4);
|
34 |
-
c = FOREACH b GENERATE flatten(group) as (x,y), SUM(group.$2) as z;
|
35 |
-
STORE c INTO "\path\to\output";
|
36 |
-
|
37 |
-
--
|
38 |
-
</textarea></form>
|
39 |
-
|
40 |
-
<script>
|
41 |
-
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
|
42 |
-
lineNumbers: true,
|
43 |
-
indentUnit: 4,
|
44 |
-
mode: "text/x-pig"
|
45 |
-
});
|
46 |
-
</script>
|
47 |
-
|
48 |
-
<p>
|
49 |
-
Simple mode that handles Pig Latin language.
|
50 |
-
</p>
|
51 |
-
|
52 |
-
<p><strong>MIME type defined:</strong> <code>text/x-pig</code>
|
53 |
-
(PIG code)
|
54 |
-
</html>
|
55 |
-
</article>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/pig/pig.js
DELETED
@@ -1,178 +0,0 @@
|
|
1 |
-
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
2 |
-
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
3 |
-
|
4 |
-
/*
|
5 |
-
* Pig Latin Mode for CodeMirror 2
|
6 |
-
* @author Prasanth Jayachandran
|
7 |
-
* @link https://github.com/prasanthj/pig-codemirror-2
|
8 |
-
* This implementation is adapted from PL/SQL mode in CodeMirror 2.
|
9 |
-
*/
|
10 |
-
(function(mod) {
|
11 |
-
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
12 |
-
mod(require("../../lib/codemirror"));
|
13 |
-
else if (typeof define == "function" && define.amd) // AMD
|
14 |
-
define(["../../lib/codemirror"], mod);
|
15 |
-
else // Plain browser env
|
16 |
-
mod(CodeMirror);
|
17 |
-
})(function(CodeMirror) {
|
18 |
-
"use strict";
|
19 |
-
|
20 |
-
CodeMirror.defineMode("pig", function(_config, parserConfig) {
|
21 |
-
var keywords = parserConfig.keywords,
|
22 |
-
builtins = parserConfig.builtins,
|
23 |
-
types = parserConfig.types,
|
24 |
-
multiLineStrings = parserConfig.multiLineStrings;
|
25 |
-
|
26 |
-
var isOperatorChar = /[*+\-%<>=&?:\/!|]/;
|
27 |
-
|
28 |
-
function chain(stream, state, f) {
|
29 |
-
state.tokenize = f;
|
30 |
-
return f(stream, state);
|
31 |
-
}
|
32 |
-
|
33 |
-
function tokenComment(stream, state) {
|
34 |
-
var isEnd = false;
|
35 |
-
var ch;
|
36 |
-
while(ch = stream.next()) {
|
37 |
-
if(ch == "/" && isEnd) {
|
38 |
-
state.tokenize = tokenBase;
|
39 |
-
break;
|
40 |
-
}
|
41 |
-
isEnd = (ch == "*");
|
42 |
-
}
|
43 |
-
return "comment";
|
44 |
-
}
|
45 |
-
|
46 |
-
function tokenString(quote) {
|
47 |
-
return function(stream, state) {
|
48 |
-
var escaped = false, next, end = false;
|
49 |
-
while((next = stream.next()) != null) {
|
50 |
-
if (next == quote && !escaped) {
|
51 |
-
end = true; break;
|
52 |
-
}
|
53 |
-
escaped = !escaped && next == "\\";
|
54 |
-
}
|
55 |
-
if (end || !(escaped || multiLineStrings))
|
56 |
-
state.tokenize = tokenBase;
|
57 |
-
return "error";
|
58 |
-
};
|
59 |
-
}
|
60 |
-
|
61 |
-
|
62 |
-
function tokenBase(stream, state) {
|
63 |
-
var ch = stream.next();
|
64 |
-
|
65 |
-
// is a start of string?
|
66 |
-
if (ch == '"' || ch == "'")
|
67 |
-
return chain(stream, state, tokenString(ch));
|
68 |
-
// is it one of the special chars
|
69 |
-
else if(/[\[\]{}\(\),;\.]/.test(ch))
|
70 |
-
return null;
|
71 |
-
// is it a number?
|
72 |
-
else if(/\d/.test(ch)) {
|
73 |
-
stream.eatWhile(/[\w\.]/);
|
74 |
-
return "number";
|
75 |
-
}
|
76 |
-
// multi line comment or operator
|
77 |
-
else if (ch == "/") {
|
78 |
-
if (stream.eat("*")) {
|
79 |
-
return chain(stream, state, tokenComment);
|
80 |
-
}
|
81 |
-
else {
|
82 |
-
stream.eatWhile(isOperatorChar);
|
83 |
-
return "operator";
|
84 |
-
}
|
85 |
-
}
|
86 |
-
// single line comment or operator
|
87 |
-
else if (ch=="-") {
|
88 |
-
if(stream.eat("-")){
|
89 |
-
stream.skipToEnd();
|
90 |
-
return "comment";
|
91 |
-
}
|
92 |
-
else {
|
93 |
-
stream.eatWhile(isOperatorChar);
|
94 |
-
return "operator";
|
95 |
-
}
|
96 |
-
}
|
97 |
-
// is it an operator
|
98 |
-
else if (isOperatorChar.test(ch)) {
|
99 |
-
stream.eatWhile(isOperatorChar);
|
100 |
-
return "operator";
|
101 |
-
}
|
102 |
-
else {
|
103 |
-
// get the while word
|
104 |
-
stream.eatWhile(/[\w\$_]/);
|
105 |
-
// is it one of the listed keywords?
|
106 |
-
if (keywords && keywords.propertyIsEnumerable(stream.current().toUpperCase())) {
|
107 |
-
//keywords can be used as variables like flatten(group), group.$0 etc..
|
108 |
-
if (!stream.eat(")") && !stream.eat("."))
|
109 |
-
return "keyword";
|
110 |
-
}
|
111 |
-
// is it one of the builtin functions?
|
112 |
-
if (builtins && builtins.propertyIsEnumerable(stream.current().toUpperCase()))
|
113 |
-
return "variable-2";
|
114 |
-
// is it one of the listed types?
|
115 |
-
if (types && types.propertyIsEnumerable(stream.current().toUpperCase()))
|
116 |
-
return "variable-3";
|
117 |
-
// default is a 'variable'
|
118 |
-
return "variable";
|
119 |
-
}
|
120 |
-
}
|
121 |
-
|
122 |
-
// Interface
|
123 |
-
return {
|
124 |
-
startState: function() {
|
125 |
-
return {
|
126 |
-
tokenize: tokenBase,
|
127 |
-
startOfLine: true
|
128 |
-
};
|
129 |
-
},
|
130 |
-
|
131 |
-
token: function(stream, state) {
|
132 |
-
if(stream.eatSpace()) return null;
|
133 |
-
var style = state.tokenize(stream, state);
|
134 |
-
return style;
|
135 |
-
}
|
136 |
-
};
|
137 |
-
});
|
138 |
-
|
139 |
-
(function() {
|
140 |
-
function keywords(str) {
|
141 |
-
var obj = {}, words = str.split(" ");
|
142 |
-
for (var i = 0; i < words.length; ++i) obj[words[i]] = true;
|
143 |
-
return obj;
|
144 |
-
}
|
145 |
-
|
146 |
-
// builtin funcs taken from trunk revision 1303237
|
147 |
-
var pBuiltins = "ABS ACOS ARITY ASIN ATAN AVG BAGSIZE BINSTORAGE BLOOM BUILDBLOOM CBRT CEIL "
|
148 |
-
+ "CONCAT COR COS COSH COUNT COUNT_STAR COV CONSTANTSIZE CUBEDIMENSIONS DIFF DISTINCT DOUBLEABS "
|
149 |
-
+ "DOUBLEAVG DOUBLEBASE DOUBLEMAX DOUBLEMIN DOUBLEROUND DOUBLESUM EXP FLOOR FLOATABS FLOATAVG "
|
150 |
-
+ "FLOATMAX FLOATMIN FLOATROUND FLOATSUM GENERICINVOKER INDEXOF INTABS INTAVG INTMAX INTMIN "
|
151 |
-
+ "INTSUM INVOKEFORDOUBLE INVOKEFORFLOAT INVOKEFORINT INVOKEFORLONG INVOKEFORSTRING INVOKER "
|
152 |
-
+ "ISEMPTY JSONLOADER JSONMETADATA JSONSTORAGE LAST_INDEX_OF LCFIRST LOG LOG10 LOWER LONGABS "
|
153 |
-
+ "LONGAVG LONGMAX LONGMIN LONGSUM MAX MIN MAPSIZE MONITOREDUDF NONDETERMINISTIC OUTPUTSCHEMA "
|
154 |
-
+ "PIGSTORAGE PIGSTREAMING RANDOM REGEX_EXTRACT REGEX_EXTRACT_ALL REPLACE ROUND SIN SINH SIZE "
|
155 |
-
+ "SQRT STRSPLIT SUBSTRING SUM STRINGCONCAT STRINGMAX STRINGMIN STRINGSIZE TAN TANH TOBAG "
|
156 |
-
+ "TOKENIZE TOMAP TOP TOTUPLE TRIM TEXTLOADER TUPLESIZE UCFIRST UPPER UTF8STORAGECONVERTER ";
|
157 |
-
|
158 |
-
// taken from QueryLexer.g
|
159 |
-
var pKeywords = "VOID IMPORT RETURNS DEFINE LOAD FILTER FOREACH ORDER CUBE DISTINCT COGROUP "
|
160 |
-
+ "JOIN CROSS UNION SPLIT INTO IF OTHERWISE ALL AS BY USING INNER OUTER ONSCHEMA PARALLEL "
|
161 |
-
+ "PARTITION GROUP AND OR NOT GENERATE FLATTEN ASC DESC IS STREAM THROUGH STORE MAPREDUCE "
|
162 |
-
+ "SHIP CACHE INPUT OUTPUT STDERROR STDIN STDOUT LIMIT SAMPLE LEFT RIGHT FULL EQ GT LT GTE LTE "
|
163 |
-
+ "NEQ MATCHES TRUE FALSE DUMP";
|
164 |
-
|
165 |
-
// data types
|
166 |
-
var pTypes = "BOOLEAN INT LONG FLOAT DOUBLE CHARARRAY BYTEARRAY BAG TUPLE MAP ";
|
167 |
-
|
168 |
-
CodeMirror.defineMIME("text/x-pig", {
|
169 |
-
name: "pig",
|
170 |
-
builtins: keywords(pBuiltins),
|
171 |
-
keywords: keywords(pKeywords),
|
172 |
-
types: keywords(pTypes)
|
173 |
-
});
|
174 |
-
|
175 |
-
CodeMirror.registerHelper("hintWords", "pig", (pBuiltins + pTypes + pKeywords).split(" "));
|
176 |
-
}());
|
177 |
-
|
178 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/properties/index.html
DELETED
@@ -1,53 +0,0 @@
|
|
1 |
-
<!doctype html>
|
2 |
-
|
3 |
-
<title>CodeMirror: Properties files mode</title>
|
4 |
-
<meta charset="utf-8"/>
|
5 |
-
<link rel=stylesheet href="../../doc/docs.css">
|
6 |
-
|
7 |
-
<link rel="stylesheet" href="../../lib/codemirror.css">
|
8 |
-
<script src="../../lib/codemirror.js"></script>
|
9 |
-
<script src="properties.js"></script>
|
10 |
-
<style>.CodeMirror {border-top: 1px solid #ddd; border-bottom: 1px solid #ddd;}</style>
|
11 |
-
<div id=nav>
|
12 |
-
<a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
13 |
-
|
14 |
-
<ul>
|
15 |
-
<li><a href="../../index.html">Home</a>
|
16 |
-
<li><a href="../../doc/manual.html">Manual</a>
|
17 |
-
<li><a href="https://github.com/codemirror/codemirror">Code</a>
|
18 |
-
</ul>
|
19 |
-
<ul>
|
20 |
-
<li><a href="../index.html">Language modes</a>
|
21 |
-
<li><a class=active href="#">Properties files</a>
|
22 |
-
</ul>
|
23 |
-
</div>
|
24 |
-
|
25 |
-
<article>
|
26 |
-
<h2>Properties files mode</h2>
|
27 |
-
<form><textarea id="code" name="code">
|
28 |
-
# This is a properties file
|
29 |
-
a.key = A value
|
30 |
-
another.key = http://example.com
|
31 |
-
! Exclamation mark as comment
|
32 |
-
but.not=Within ! A value # indeed
|
33 |
-
# Spaces at the beginning of a line
|
34 |
-
spaces.before.key=value
|
35 |
-
backslash=Used for multi\
|
36 |
-
line entries,\
|
37 |
-
that's convenient.
|
38 |
-
# Unicode sequences
|
39 |
-
unicode.key=This is \u0020 Unicode
|
40 |
-
no.multiline=here
|
41 |
-
# Colons
|
42 |
-
colons : can be used too
|
43 |
-
# Spaces
|
44 |
-
spaces\ in\ keys=Not very common...
|
45 |
-
</textarea></form>
|
46 |
-
<script>
|
47 |
-
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {});
|
48 |
-
</script>
|
49 |
-
|
50 |
-
<p><strong>MIME types defined:</strong> <code>text/x-properties</code>,
|
51 |
-
<code>text/x-ini</code>.</p>
|
52 |
-
|
53 |
-
</article>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/properties/properties.js
DELETED
@@ -1,78 +0,0 @@
|
|
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("properties", function() {
|
15 |
-
return {
|
16 |
-
token: function(stream, state) {
|
17 |
-
var sol = stream.sol() || state.afterSection;
|
18 |
-
var eol = stream.eol();
|
19 |
-
|
20 |
-
state.afterSection = false;
|
21 |
-
|
22 |
-
if (sol) {
|
23 |
-
if (state.nextMultiline) {
|
24 |
-
state.inMultiline = true;
|
25 |
-
state.nextMultiline = false;
|
26 |
-
} else {
|
27 |
-
state.position = "def";
|
28 |
-
}
|
29 |
-
}
|
30 |
-
|
31 |
-
if (eol && ! state.nextMultiline) {
|
32 |
-
state.inMultiline = false;
|
33 |
-
state.position = "def";
|
34 |
-
}
|
35 |
-
|
36 |
-
if (sol) {
|
37 |
-
while(stream.eatSpace());
|
38 |
-
}
|
39 |
-
|
40 |
-
var ch = stream.next();
|
41 |
-
|
42 |
-
if (sol && (ch === "#" || ch === "!" || ch === ";")) {
|
43 |
-
state.position = "comment";
|
44 |
-
stream.skipToEnd();
|
45 |
-
return "comment";
|
46 |
-
} else if (sol && ch === "[") {
|
47 |
-
state.afterSection = true;
|
48 |
-
stream.skipTo("]"); stream.eat("]");
|
49 |
-
return "header";
|
50 |
-
} else if (ch === "=" || ch === ":") {
|
51 |
-
state.position = "quote";
|
52 |
-
return null;
|
53 |
-
} else if (ch === "\\" && state.position === "quote") {
|
54 |
-
if (stream.eol()) { // end of line?
|
55 |
-
// Multiline value
|
56 |
-
state.nextMultiline = true;
|
57 |
-
}
|
58 |
-
}
|
59 |
-
|
60 |
-
return state.position;
|
61 |
-
},
|
62 |
-
|
63 |
-
startState: function() {
|
64 |
-
return {
|
65 |
-
position : "def", // Current position, "def", "quote" or "comment"
|
66 |
-
nextMultiline : false, // Is the next line multiline value
|
67 |
-
inMultiline : false, // Is the current line a multiline value
|
68 |
-
afterSection : false // Did we just open a section
|
69 |
-
};
|
70 |
-
}
|
71 |
-
|
72 |
-
};
|
73 |
-
});
|
74 |
-
|
75 |
-
CodeMirror.defineMIME("text/x-properties", "properties");
|
76 |
-
CodeMirror.defineMIME("text/x-ini", "properties");
|
77 |
-
|
78 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/puppet/index.html
DELETED
@@ -1,121 +0,0 @@
|
|
1 |
-
<!doctype html>
|
2 |
-
|
3 |
-
<title>CodeMirror: Puppet mode</title>
|
4 |
-
<meta charset="utf-8"/>
|
5 |
-
<link rel=stylesheet href="../../doc/docs.css">
|
6 |
-
|
7 |
-
<link rel="stylesheet" href="../../lib/codemirror.css">
|
8 |
-
<script src="../../lib/codemirror.js"></script>
|
9 |
-
<script src="../../addon/edit/matchbrackets.js"></script>
|
10 |
-
<script src="puppet.js"></script>
|
11 |
-
<style>
|
12 |
-
.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}
|
13 |
-
.cm-s-default span.cm-arrow { color: red; }
|
14 |
-
</style>
|
15 |
-
<div id=nav>
|
16 |
-
<a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
17 |
-
|
18 |
-
<ul>
|
19 |
-
<li><a href="../../index.html">Home</a>
|
20 |
-
<li><a href="../../doc/manual.html">Manual</a>
|
21 |
-
<li><a href="https://github.com/codemirror/codemirror">Code</a>
|
22 |
-
</ul>
|
23 |
-
<ul>
|
24 |
-
<li><a href="../index.html">Language modes</a>
|
25 |
-
<li><a class=active href="#">Puppet</a>
|
26 |
-
</ul>
|
27 |
-
</div>
|
28 |
-
|
29 |
-
<article>
|
30 |
-
<h2>Puppet mode</h2>
|
31 |
-
<form><textarea id="code" name="code">
|
32 |
-
# == Class: automysqlbackup
|
33 |
-
#
|
34 |
-
# Puppet module to install AutoMySQLBackup for periodic MySQL backups.
|
35 |
-
#
|
36 |
-
# class { 'automysqlbackup':
|
37 |
-
# backup_dir => '/mnt/backups',
|
38 |
-
# }
|
39 |
-
#
|
40 |
-
|
41 |
-
class automysqlbackup (
|
42 |
-
$bin_dir = $automysqlbackup::params::bin_dir,
|
43 |
-
$etc_dir = $automysqlbackup::params::etc_dir,
|
44 |
-
$backup_dir = $automysqlbackup::params::backup_dir,
|
45 |
-
$install_multicore = undef,
|
46 |
-
$config = {},
|
47 |
-
$config_defaults = {},
|
48 |
-
) inherits automysqlbackup::params {
|
49 |
-
|
50 |
-
# Ensure valid paths are assigned
|
51 |
-
validate_absolute_path($bin_dir)
|
52 |
-
validate_absolute_path($etc_dir)
|
53 |
-
validate_absolute_path($backup_dir)
|
54 |
-
|
55 |
-
# Create a subdirectory in /etc for config files
|
56 |
-
file { $etc_dir:
|
57 |
-
ensure => directory,
|
58 |
-
owner => 'root',
|
59 |
-
group => 'root',
|
60 |
-
mode => '0750',
|
61 |
-
}
|
62 |
-
|
63 |
-
# Create an example backup file, useful for reference
|
64 |
-
file { "${etc_dir}/automysqlbackup.conf.example":
|
65 |
-
ensure => file,
|
66 |
-
owner => 'root',
|
67 |
-
group => 'root',
|
68 |
-
mode => '0660',
|
69 |
-
source => 'puppet:///modules/automysqlbackup/automysqlbackup.conf',
|
70 |
-
}
|
71 |
-
|
72 |
-
# Add files from the developer
|
73 |
-
file { "${etc_dir}/AMB_README":
|
74 |
-
ensure => file,
|
75 |
-
source => 'puppet:///modules/automysqlbackup/AMB_README',
|
76 |
-
}
|
77 |
-
file { "${etc_dir}/AMB_LICENSE":
|
78 |
-
ensure => file,
|
79 |
-
source => 'puppet:///modules/automysqlbackup/AMB_LICENSE',
|
80 |
-
}
|
81 |
-
|
82 |
-
# Install the actual binary file
|
83 |
-
file { "${bin_dir}/automysqlbackup":
|
84 |
-
ensure => file,
|
85 |
-
owner => 'root',
|
86 |
-
group => 'root',
|
87 |
-
mode => '0755',
|
88 |
-
source => 'puppet:///modules/automysqlbackup/automysqlbackup',
|
89 |
-
}
|
90 |
-
|
91 |
-
# Create the base backup directory
|
92 |
-
file { $backup_dir:
|
93 |
-
ensure => directory,
|
94 |
-
owner => 'root',
|
95 |
-
group => 'root',
|
96 |
-
mode => '0755',
|
97 |
-
}
|
98 |
-
|
99 |
-
# If you'd like to keep your config in hiera and pass it to this class
|
100 |
-
if !empty($config) {
|
101 |
-
create_resources('automysqlbackup::backup', $config, $config_defaults)
|
102 |
-
}
|
103 |
-
|
104 |
-
# If using RedHat family, must have the RPMforge repo's enabled
|
105 |
-
if $install_multicore {
|
106 |
-
package { ['pigz', 'pbzip2']: ensure => installed }
|
107 |
-
}
|
108 |
-
|
109 |
-
}
|
110 |
-
</textarea></form>
|
111 |
-
<script>
|
112 |
-
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
|
113 |
-
mode: "text/x-puppet",
|
114 |
-
matchBrackets: true,
|
115 |
-
indentUnit: 4
|
116 |
-
});
|
117 |
-
</script>
|
118 |
-
|
119 |
-
<p><strong>MIME types defined:</strong> <code>text/x-puppet</code>.</p>
|
120 |
-
|
121 |
-
</article>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/puppet/puppet.js
DELETED
@@ -1,220 +0,0 @@
|
|
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("puppet", function () {
|
15 |
-
// Stores the words from the define method
|
16 |
-
var words = {};
|
17 |
-
// Taken, mostly, from the Puppet official variable standards regex
|
18 |
-
var variable_regex = /({)?([a-z][a-z0-9_]*)?((::[a-z][a-z0-9_]*)*::)?[a-zA-Z0-9_]+(})?/;
|
19 |
-
|
20 |
-
// Takes a string of words separated by spaces and adds them as
|
21 |
-
// keys with the value of the first argument 'style'
|
22 |
-
function define(style, string) {
|
23 |
-
var split = string.split(' ');
|
24 |
-
for (var i = 0; i < split.length; i++) {
|
25 |
-
words[split[i]] = style;
|
26 |
-
}
|
27 |
-
}
|
28 |
-
|
29 |
-
// Takes commonly known puppet types/words and classifies them to a style
|
30 |
-
define('keyword', 'class define site node include import inherits');
|
31 |
-
define('keyword', 'case if else in and elsif default or');
|
32 |
-
define('atom', 'false true running present absent file directory undef');
|
33 |
-
define('builtin', 'action augeas burst chain computer cron destination dport exec ' +
|
34 |
-
'file filebucket group host icmp iniface interface jump k5login limit log_level ' +
|
35 |
-
'log_prefix macauthorization mailalias maillist mcx mount nagios_command ' +
|
36 |
-
'nagios_contact nagios_contactgroup nagios_host nagios_hostdependency ' +
|
37 |
-
'nagios_hostescalation nagios_hostextinfo nagios_hostgroup nagios_service ' +
|
38 |
-
'nagios_servicedependency nagios_serviceescalation nagios_serviceextinfo ' +
|
39 |
-
'nagios_servicegroup nagios_timeperiod name notify outiface package proto reject ' +
|
40 |
-
'resources router schedule scheduled_task selboolean selmodule service source ' +
|
41 |
-
'sport ssh_authorized_key sshkey stage state table tidy todest toports tosource ' +
|
42 |
-
'user vlan yumrepo zfs zone zpool');
|
43 |
-
|
44 |
-
// After finding a start of a string ('|") this function attempts to find the end;
|
45 |
-
// If a variable is encountered along the way, we display it differently when it
|
46 |
-
// is encapsulated in a double-quoted string.
|
47 |
-
function tokenString(stream, state) {
|
48 |
-
var current, prev, found_var = false;
|
49 |
-
while (!stream.eol() && (current = stream.next()) != state.pending) {
|
50 |
-
if (current === '$' && prev != '\\' && state.pending == '"') {
|
51 |
-
found_var = true;
|
52 |
-
break;
|
53 |
-
}
|
54 |
-
prev = current;
|
55 |
-
}
|
56 |
-
if (found_var) {
|
57 |
-
stream.backUp(1);
|
58 |
-
}
|
59 |
-
if (current == state.pending) {
|
60 |
-
state.continueString = false;
|
61 |
-
} else {
|
62 |
-
state.continueString = true;
|
63 |
-
}
|
64 |
-
return "string";
|
65 |
-
}
|
66 |
-
|
67 |
-
// Main function
|
68 |
-
function tokenize(stream, state) {
|
69 |
-
// Matches one whole word
|
70 |
-
var word = stream.match(/[\w]+/, false);
|
71 |
-
// Matches attributes (i.e. ensure => present ; 'ensure' would be matched)
|
72 |
-
var attribute = stream.match(/(\s+)?\w+\s+=>.*/, false);
|
73 |
-
// Matches non-builtin resource declarations
|
74 |
-
// (i.e. "apache::vhost {" or "mycustomclasss {" would be matched)
|
75 |
-
var resource = stream.match(/(\s+)?[\w:_]+(\s+)?{/, false);
|
76 |
-
// Matches virtual and exported resources (i.e. @@user { ; and the like)
|
77 |
-
var special_resource = stream.match(/(\s+)?[@]{1,2}[\w:_]+(\s+)?{/, false);
|
78 |
-
|
79 |
-
// Finally advance the stream
|
80 |
-
var ch = stream.next();
|
81 |
-
|
82 |
-
// Have we found a variable?
|
83 |
-
if (ch === '$') {
|
84 |
-
if (stream.match(variable_regex)) {
|
85 |
-
// If so, and its in a string, assign it a different color
|
86 |
-
return state.continueString ? 'variable-2' : 'variable';
|
87 |
-
}
|
88 |
-
// Otherwise return an invalid variable
|
89 |
-
return "error";
|
90 |
-
}
|
91 |
-
// Should we still be looking for the end of a string?
|
92 |
-
if (state.continueString) {
|
93 |
-
// If so, go through the loop again
|
94 |
-
stream.backUp(1);
|
95 |
-
return tokenString(stream, state);
|
96 |
-
}
|
97 |
-
// Are we in a definition (class, node, define)?
|
98 |
-
if (state.inDefinition) {
|
99 |
-
// If so, return def (i.e. for 'class myclass {' ; 'myclass' would be matched)
|
100 |
-
if (stream.match(/(\s+)?[\w:_]+(\s+)?/)) {
|
101 |
-
return 'def';
|
102 |
-
}
|
103 |
-
// Match the rest it the next time around
|
104 |
-
stream.match(/\s+{/);
|
105 |
-
state.inDefinition = false;
|
106 |
-
}
|
107 |
-
// Are we in an 'include' statement?
|
108 |
-
if (state.inInclude) {
|
109 |
-
// Match and return the included class
|
110 |
-
stream.match(/(\s+)?\S+(\s+)?/);
|
111 |
-
state.inInclude = false;
|
112 |
-
return 'def';
|
113 |
-
}
|
114 |
-
// Do we just have a function on our hands?
|
115 |
-
// In 'ensure_resource("myclass")', 'ensure_resource' is matched
|
116 |
-
if (stream.match(/(\s+)?\w+\(/)) {
|
117 |
-
stream.backUp(1);
|
118 |
-
return 'def';
|
119 |
-
}
|
120 |
-
// Have we matched the prior attribute regex?
|
121 |
-
if (attribute) {
|
122 |
-
stream.match(/(\s+)?\w+/);
|
123 |
-
return 'tag';
|
124 |
-
}
|
125 |
-
// Do we have Puppet specific words?
|
126 |
-
if (word && words.hasOwnProperty(word)) {
|
127 |
-
// Negates the initial next()
|
128 |
-
stream.backUp(1);
|
129 |
-
// Acutally move the stream
|
130 |
-
stream.match(/[\w]+/);
|
131 |
-
// We want to process these words differently
|
132 |
-
// do to the importance they have in Puppet
|
133 |
-
if (stream.match(/\s+\S+\s+{/, false)) {
|
134 |
-
state.inDefinition = true;
|
135 |
-
}
|
136 |
-
if (word == 'include') {
|
137 |
-
state.inInclude = true;
|
138 |
-
}
|
139 |
-
// Returns their value as state in the prior define methods
|
140 |
-
return words[word];
|
141 |
-
}
|
142 |
-
// Is there a match on a reference?
|
143 |
-
if (/(^|\s+)[A-Z][\w:_]+/.test(word)) {
|
144 |
-
// Negate the next()
|
145 |
-
stream.backUp(1);
|
146 |
-
// Match the full reference
|
147 |
-
stream.match(/(^|\s+)[A-Z][\w:_]+/);
|
148 |
-
return 'def';
|
149 |
-
}
|
150 |
-
// Have we matched the prior resource regex?
|
151 |
-
if (resource) {
|
152 |
-
stream.match(/(\s+)?[\w:_]+/);
|
153 |
-
return 'def';
|
154 |
-
}
|
155 |
-
// Have we matched the prior special_resource regex?
|
156 |
-
if (special_resource) {
|
157 |
-
stream.match(/(\s+)?[@]{1,2}/);
|
158 |
-
return 'special';
|
159 |
-
}
|
160 |
-
// Match all the comments. All of them.
|
161 |
-
if (ch == "#") {
|
162 |
-
stream.skipToEnd();
|
163 |
-
return "comment";
|
164 |
-
}
|
165 |
-
// Have we found a string?
|
166 |
-
if (ch == "'" || ch == '"') {
|
167 |
-
// Store the type (single or double)
|
168 |
-
state.pending = ch;
|
169 |
-
// Perform the looping function to find the end
|
170 |
-
return tokenString(stream, state);
|
171 |
-
}
|
172 |
-
// Match all the brackets
|
173 |
-
if (ch == '{' || ch == '}') {
|
174 |
-
return 'bracket';
|
175 |
-
}
|
176 |
-
// Match characters that we are going to assume
|
177 |
-
// are trying to be regex
|
178 |
-
if (ch == '/') {
|
179 |
-
stream.match(/.*?\//);
|
180 |
-
return 'variable-3';
|
181 |
-
}
|
182 |
-
// Match all the numbers
|
183 |
-
if (ch.match(/[0-9]/)) {
|
184 |
-
stream.eatWhile(/[0-9]+/);
|
185 |
-
return 'number';
|
186 |
-
}
|
187 |
-
// Match the '=' and '=>' operators
|
188 |
-
if (ch == '=') {
|
189 |
-
if (stream.peek() == '>') {
|
190 |
-
stream.next();
|
191 |
-
}
|
192 |
-
return "operator";
|
193 |
-
}
|
194 |
-
// Keep advancing through all the rest
|
195 |
-
stream.eatWhile(/[\w-]/);
|
196 |
-
// Return a blank line for everything else
|
197 |
-
return null;
|
198 |
-
}
|
199 |
-
// Start it all
|
200 |
-
return {
|
201 |
-
startState: function () {
|
202 |
-
var state = {};
|
203 |
-
state.inDefinition = false;
|
204 |
-
state.inInclude = false;
|
205 |
-
state.continueString = false;
|
206 |
-
state.pending = false;
|
207 |
-
return state;
|
208 |
-
},
|
209 |
-
token: function (stream, state) {
|
210 |
-
// Strip the spaces, but regex will account for them eitherway
|
211 |
-
if (stream.eatSpace()) return null;
|
212 |
-
// Go through the main process
|
213 |
-
return tokenize(stream, state);
|
214 |
-
}
|
215 |
-
};
|
216 |
-
});
|
217 |
-
|
218 |
-
CodeMirror.defineMIME("text/x-puppet", "puppet");
|
219 |
-
|
220 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/python/index.html
DELETED
@@ -1,198 +0,0 @@
|
|
1 |
-
<!doctype html>
|
2 |
-
|
3 |
-
<title>CodeMirror: Python mode</title>
|
4 |
-
<meta charset="utf-8"/>
|
5 |
-
<link rel=stylesheet href="../../doc/docs.css">
|
6 |
-
|
7 |
-
<link rel="stylesheet" href="../../lib/codemirror.css">
|
8 |
-
<script src="../../lib/codemirror.js"></script>
|
9 |
-
<script src="../../addon/edit/matchbrackets.js"></script>
|
10 |
-
<script src="python.js"></script>
|
11 |
-
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
12 |
-
<div id=nav>
|
13 |
-
<a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
14 |
-
|
15 |
-
<ul>
|
16 |
-
<li><a href="../../index.html">Home</a>
|
17 |
-
<li><a href="../../doc/manual.html">Manual</a>
|
18 |
-
<li><a href="https://github.com/codemirror/codemirror">Code</a>
|
19 |
-
</ul>
|
20 |
-
<ul>
|
21 |
-
<li><a href="../index.html">Language modes</a>
|
22 |
-
<li><a class=active href="#">Python</a>
|
23 |
-
</ul>
|
24 |
-
</div>
|
25 |
-
|
26 |
-
<article>
|
27 |
-
<h2>Python mode</h2>
|
28 |
-
|
29 |
-
<div><textarea id="code" name="code">
|
30 |
-
# Literals
|
31 |
-
1234
|
32 |
-
0.0e101
|
33 |
-
.123
|
34 |
-
0b01010011100
|
35 |
-
0o01234567
|
36 |
-
0x0987654321abcdef
|
37 |
-
7
|
38 |
-
2147483647
|
39 |
-
3L
|
40 |
-
79228162514264337593543950336L
|
41 |
-
0x100000000L
|
42 |
-
79228162514264337593543950336
|
43 |
-
0xdeadbeef
|
44 |
-
3.14j
|
45 |
-
10.j
|
46 |
-
10j
|
47 |
-
.001j
|
48 |
-
1e100j
|
49 |
-
3.14e-10j
|
50 |
-
|
51 |
-
|
52 |
-
# String Literals
|
53 |
-
'For\''
|
54 |
-
"God\""
|
55 |
-
"""so loved
|
56 |
-
the world"""
|
57 |
-
'''that he gave
|
58 |
-
his only begotten\' '''
|
59 |
-
'that whosoever believeth \
|
60 |
-
in him'
|
61 |
-
''
|
62 |
-
|
63 |
-
# Identifiers
|
64 |
-
__a__
|
65 |
-
a.b
|
66 |
-
a.b.c
|
67 |
-
|
68 |
-
#Unicode identifiers on Python3
|
69 |
-
# a = x\ddot
|
70 |
-
a⃗ = ẍ
|
71 |
-
# a = v\dot
|
72 |
-
a⃗ = v̇
|
73 |
-
|
74 |
-
#F\vec = m \cdot a\vec
|
75 |
-
F⃗ = m•a⃗
|
76 |
-
|
77 |
-
# Operators
|
78 |
-
+ - * / % & | ^ ~ < >
|
79 |
-
== != <= >= <> << >> // **
|
80 |
-
and or not in is
|
81 |
-
|
82 |
-
#infix matrix multiplication operator (PEP 465)
|
83 |
-
A @ B
|
84 |
-
|
85 |
-
# Delimiters
|
86 |
-
() [] {} , : ` = ; @ . # Note that @ and . require the proper context on Python 2.
|
87 |
-
+= -= *= /= %= &= |= ^=
|
88 |
-
//= >>= <<= **=
|
89 |
-
|
90 |
-
# Keywords
|
91 |
-
as assert break class continue def del elif else except
|
92 |
-
finally for from global if import lambda pass raise
|
93 |
-
return try while with yield
|
94 |
-
|
95 |
-
# Python 2 Keywords (otherwise Identifiers)
|
96 |
-
exec print
|
97 |
-
|
98 |
-
# Python 3 Keywords (otherwise Identifiers)
|
99 |
-
nonlocal
|
100 |
-
|
101 |
-
# Types
|
102 |
-
bool classmethod complex dict enumerate float frozenset int list object
|
103 |
-
property reversed set slice staticmethod str super tuple type
|
104 |
-
|
105 |
-
# Python 2 Types (otherwise Identifiers)
|
106 |
-
basestring buffer file long unicode xrange
|
107 |
-
|
108 |
-
# Python 3 Types (otherwise Identifiers)
|
109 |
-
bytearray bytes filter map memoryview open range zip
|
110 |
-
|
111 |
-
# Some Example code
|
112 |
-
import os
|
113 |
-
from package import ParentClass
|
114 |
-
|
115 |
-
@nonsenseDecorator
|
116 |
-
def doesNothing():
|
117 |
-
pass
|
118 |
-
|
119 |
-
class ExampleClass(ParentClass):
|
120 |
-
@staticmethod
|
121 |
-
def example(inputStr):
|
122 |
-
a = list(inputStr)
|
123 |
-
a.reverse()
|
124 |
-
return ''.join(a)
|
125 |
-
|
126 |
-
def __init__(self, mixin = 'Hello'):
|
127 |
-
self.mixin = mixin
|
128 |
-
|
129 |
-
</textarea></div>
|
130 |
-
|
131 |
-
|
132 |
-
<h2>Cython mode</h2>
|
133 |
-
|
134 |
-
<div><textarea id="code-cython" name="code-cython">
|
135 |
-
|
136 |
-
import numpy as np
|
137 |
-
cimport cython
|
138 |
-
from libc.math cimport sqrt
|
139 |
-
|
140 |
-
@cython.boundscheck(False)
|
141 |
-
@cython.wraparound(False)
|
142 |
-
def pairwise_cython(double[:, ::1] X):
|
143 |
-
cdef int M = X.shape[0]
|
144 |
-
cdef int N = X.shape[1]
|
145 |
-
cdef double tmp, d
|
146 |
-
cdef double[:, ::1] D = np.empty((M, M), dtype=np.float64)
|
147 |
-
for i in range(M):
|
148 |
-
for j in range(M):
|
149 |
-
d = 0.0
|
150 |
-
for k in range(N):
|
151 |
-
tmp = X[i, k] - X[j, k]
|
152 |
-
d += tmp * tmp
|
153 |
-
D[i, j] = sqrt(d)
|
154 |
-
return np.asarray(D)
|
155 |
-
|
156 |
-
</textarea></div>
|
157 |
-
|
158 |
-
<script>
|
159 |
-
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
|
160 |
-
mode: {name: "python",
|
161 |
-
version: 3,
|
162 |
-
singleLineStringErrors: false},
|
163 |
-
lineNumbers: true,
|
164 |
-
indentUnit: 4,
|
165 |
-
matchBrackets: true
|
166 |
-
});
|
167 |
-
|
168 |
-
CodeMirror.fromTextArea(document.getElementById("code-cython"), {
|
169 |
-
mode: {name: "text/x-cython",
|
170 |
-
version: 2,
|
171 |
-
singleLineStringErrors: false},
|
172 |
-
lineNumbers: true,
|
173 |
-
indentUnit: 4,
|
174 |
-
matchBrackets: true
|
175 |
-
});
|
176 |
-
</script>
|
177 |
-
<h2>Configuration Options for Python mode:</h2>
|
178 |
-
<ul>
|
179 |
-
<li>version - 2/3 - The version of Python to recognize. Default is 2.</li>
|
180 |
-
<li>singleLineStringErrors - true/false - If you have a single-line string that is not terminated at the end of the line, this will show subsequent lines as errors if true, otherwise it will consider the newline as the end of the string. Default is false.</li>
|
181 |
-
<li>hangingIndent - int - If you want to write long arguments to a function starting on a new line, how much that line should be indented. Defaults to one normal indentation unit.</li>
|
182 |
-
</ul>
|
183 |
-
<h2>Advanced Configuration Options:</h2>
|
184 |
-
<p>Usefull for superset of python syntax like Enthought enaml, IPython magics and questionmark help</p>
|
185 |
-
<ul>
|
186 |
-
<li>singleOperators - RegEx - Regular Expression for single operator matching, default : <pre>^[\\+\\-\\*/%&|\\^~<>!]</pre> including <pre>@</pre> on Python 3</li>
|
187 |
-
<li>singleDelimiters - RegEx - Regular Expression for single delimiter matching, default : <pre>^[\\(\\)\\[\\]\\{\\}@,:`=;\\.]</pre></li>
|
188 |
-
<li>doubleOperators - RegEx - Regular Expression for double operators matching, default : <pre>^((==)|(!=)|(<=)|(>=)|(<>)|(<<)|(>>)|(//)|(\\*\\*))</pre></li>
|
189 |
-
<li>doubleDelimiters - RegEx - Regular Expressoin for double delimiters matching, default : <pre>^((\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&=)|(\\|=)|(\\^=))</pre></li>
|
190 |
-
<li>tripleDelimiters - RegEx - Regular Expression for triple delimiters matching, default : <pre>^((//=)|(>>=)|(<<=)|(\\*\\*=))</pre></li>
|
191 |
-
<li>identifiers - RegEx - Regular Expression for identifier, default : <pre>^[_A-Za-z][_A-Za-z0-9]*</pre> on Python 2 and <pre>^[_A-Za-z\u00A1-\uFFFF][_A-Za-z0-9\u00A1-\uFFFF]*</pre> on Python 3.</li>
|
192 |
-
<li>extra_keywords - list of string - List of extra words ton consider as keywords</li>
|
193 |
-
<li>extra_builtins - list of string - List of extra words ton consider as builtins</li>
|
194 |
-
</ul>
|
195 |
-
|
196 |
-
|
197 |
-
<p><strong>MIME types defined:</strong> <code>text/x-python</code> and <code>text/x-cython</code>.</p>
|
198 |
-
</article>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/python/python.js
DELETED
@@ -1,347 +0,0 @@
|
|
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 wordRegexp(words) {
|
15 |
-
return new RegExp("^((" + words.join(")|(") + "))\\b");
|
16 |
-
}
|
17 |
-
|
18 |
-
var wordOperators = wordRegexp(["and", "or", "not", "is"]);
|
19 |
-
var commonKeywords = ["as", "assert", "break", "class", "continue",
|
20 |
-
"def", "del", "elif", "else", "except", "finally",
|
21 |
-
"for", "from", "global", "if", "import",
|
22 |
-
"lambda", "pass", "raise", "return",
|
23 |
-
"try", "while", "with", "yield", "in"];
|
24 |
-
var commonBuiltins = ["abs", "all", "any", "bin", "bool", "bytearray", "callable", "chr",
|
25 |
-
"classmethod", "compile", "complex", "delattr", "dict", "dir", "divmod",
|
26 |
-
"enumerate", "eval", "filter", "float", "format", "frozenset",
|
27 |
-
"getattr", "globals", "hasattr", "hash", "help", "hex", "id",
|
28 |
-
"input", "int", "isinstance", "issubclass", "iter", "len",
|
29 |
-
"list", "locals", "map", "max", "memoryview", "min", "next",
|
30 |
-
"object", "oct", "open", "ord", "pow", "property", "range",
|
31 |
-
"repr", "reversed", "round", "set", "setattr", "slice",
|
32 |
-
"sorted", "staticmethod", "str", "sum", "super", "tuple",
|
33 |
-
"type", "vars", "zip", "__import__", "NotImplemented",
|
34 |
-
"Ellipsis", "__debug__"];
|
35 |
-
var py2 = {builtins: ["apply", "basestring", "buffer", "cmp", "coerce", "execfile",
|
36 |
-
"file", "intern", "long", "raw_input", "reduce", "reload",
|
37 |
-
"unichr", "unicode", "xrange", "False", "True", "None"],
|
38 |
-
keywords: ["exec", "print"]};
|
39 |
-
var py3 = {builtins: ["ascii", "bytes", "exec", "print"],
|
40 |
-
keywords: ["nonlocal", "False", "True", "None", "async", "await"]};
|
41 |
-
|
42 |
-
CodeMirror.registerHelper("hintWords", "python", commonKeywords.concat(commonBuiltins));
|
43 |
-
|
44 |
-
function top(state) {
|
45 |
-
return state.scopes[state.scopes.length - 1];
|
46 |
-
}
|
47 |
-
|
48 |
-
CodeMirror.defineMode("python", function(conf, parserConf) {
|
49 |
-
var ERRORCLASS = "error";
|
50 |
-
|
51 |
-
var singleDelimiters = parserConf.singleDelimiters || /^[\(\)\[\]\{\}@,:`=;\.]/;
|
52 |
-
var doubleOperators = parserConf.doubleOperators || /^([!<>]==|<>|<<|>>|\/\/|\*\*)/;
|
53 |
-
var doubleDelimiters = parserConf.doubleDelimiters || /^(\+=|\-=|\*=|%=|\/=|&=|\|=|\^=)/;
|
54 |
-
var tripleDelimiters = parserConf.tripleDelimiters || /^(\/\/=|>>=|<<=|\*\*=)/;
|
55 |
-
|
56 |
-
if (parserConf.version && parseInt(parserConf.version, 10) == 3){
|
57 |
-
// since http://legacy.python.org/dev/peps/pep-0465/ @ is also an operator
|
58 |
-
var singleOperators = parserConf.singleOperators || /^[\+\-\*\/%&|\^~<>!@]/;
|
59 |
-
var identifiers = parserConf.identifiers|| /^[_A-Za-z\u00A1-\uFFFF][_A-Za-z0-9\u00A1-\uFFFF]*/;
|
60 |
-
} else {
|
61 |
-
var singleOperators = parserConf.singleOperators || /^[\+\-\*\/%&|\^~<>!]/;
|
62 |
-
var identifiers = parserConf.identifiers|| /^[_A-Za-z][_A-Za-z0-9]*/;
|
63 |
-
}
|
64 |
-
|
65 |
-
var hangingIndent = parserConf.hangingIndent || conf.indentUnit;
|
66 |
-
|
67 |
-
var myKeywords = commonKeywords, myBuiltins = commonBuiltins;
|
68 |
-
if(parserConf.extra_keywords != undefined){
|
69 |
-
myKeywords = myKeywords.concat(parserConf.extra_keywords);
|
70 |
-
}
|
71 |
-
if(parserConf.extra_builtins != undefined){
|
72 |
-
myBuiltins = myBuiltins.concat(parserConf.extra_builtins);
|
73 |
-
}
|
74 |
-
if (parserConf.version && parseInt(parserConf.version, 10) == 3) {
|
75 |
-
myKeywords = myKeywords.concat(py3.keywords);
|
76 |
-
myBuiltins = myBuiltins.concat(py3.builtins);
|
77 |
-
var stringPrefixes = new RegExp("^(([rb]|(br))?('{3}|\"{3}|['\"]))", "i");
|
78 |
-
} else {
|
79 |
-
myKeywords = myKeywords.concat(py2.keywords);
|
80 |
-
myBuiltins = myBuiltins.concat(py2.builtins);
|
81 |
-
var stringPrefixes = new RegExp("^(([rub]|(ur)|(br))?('{3}|\"{3}|['\"]))", "i");
|
82 |
-
}
|
83 |
-
var keywords = wordRegexp(myKeywords);
|
84 |
-
var builtins = wordRegexp(myBuiltins);
|
85 |
-
|
86 |
-
// tokenizers
|
87 |
-
function tokenBase(stream, state) {
|
88 |
-
// Handle scope changes
|
89 |
-
if (stream.sol() && top(state).type == "py") {
|
90 |
-
var scopeOffset = top(state).offset;
|
91 |
-
if (stream.eatSpace()) {
|
92 |
-
var lineOffset = stream.indentation();
|
93 |
-
if (lineOffset > scopeOffset)
|
94 |
-
pushScope(stream, state, "py");
|
95 |
-
else if (lineOffset < scopeOffset && dedent(stream, state))
|
96 |
-
state.errorToken = true;
|
97 |
-
return null;
|
98 |
-
} else {
|
99 |
-
var style = tokenBaseInner(stream, state);
|
100 |
-
if (scopeOffset > 0 && dedent(stream, state))
|
101 |
-
style += " " + ERRORCLASS;
|
102 |
-
return style;
|
103 |
-
}
|
104 |
-
}
|
105 |
-
return tokenBaseInner(stream, state);
|
106 |
-
}
|
107 |
-
|
108 |
-
function tokenBaseInner(stream, state) {
|
109 |
-
if (stream.eatSpace()) return null;
|
110 |
-
|
111 |
-
var ch = stream.peek();
|
112 |
-
|
113 |
-
// Handle Comments
|
114 |
-
if (ch == "#") {
|
115 |
-
stream.skipToEnd();
|
116 |
-
return "comment";
|
117 |
-
}
|
118 |
-
|
119 |
-
// Handle Number Literals
|
120 |
-
if (stream.match(/^[0-9\.]/, false)) {
|
121 |
-
var floatLiteral = false;
|
122 |
-
// Floats
|
123 |
-
if (stream.match(/^\d*\.\d+(e[\+\-]?\d+)?/i)) { floatLiteral = true; }
|
124 |
-
if (stream.match(/^\d+\.\d*/)) { floatLiteral = true; }
|
125 |
-
if (stream.match(/^\.\d+/)) { floatLiteral = true; }
|
126 |
-
if (floatLiteral) {
|
127 |
-
// Float literals may be "imaginary"
|
128 |
-
stream.eat(/J/i);
|
129 |
-
return "number";
|
130 |
-
}
|
131 |
-
// Integers
|
132 |
-
var intLiteral = false;
|
133 |
-
// Hex
|
134 |
-
if (stream.match(/^0x[0-9a-f]+/i)) intLiteral = true;
|
135 |
-
// Binary
|
136 |
-
if (stream.match(/^0b[01]+/i)) intLiteral = true;
|
137 |
-
// Octal
|
138 |
-
if (stream.match(/^0o[0-7]+/i)) intLiteral = true;
|
139 |
-
// Decimal
|
140 |
-
if (stream.match(/^[1-9]\d*(e[\+\-]?\d+)?/)) {
|
141 |
-
// Decimal literals may be "imaginary"
|
142 |
-
stream.eat(/J/i);
|
143 |
-
// TODO - Can you have imaginary longs?
|
144 |
-
intLiteral = true;
|
145 |
-
}
|
146 |
-
// Zero by itself with no other piece of number.
|
147 |
-
if (stream.match(/^0(?![\dx])/i)) intLiteral = true;
|
148 |
-
if (intLiteral) {
|
149 |
-
// Integer literals may be "long"
|
150 |
-
stream.eat(/L/i);
|
151 |
-
return "number";
|
152 |
-
}
|
153 |
-
}
|
154 |
-
|
155 |
-
// Handle Strings
|
156 |
-
if (stream.match(stringPrefixes)) {
|
157 |
-
state.tokenize = tokenStringFactory(stream.current());
|
158 |
-
return state.tokenize(stream, state);
|
159 |
-
}
|
160 |
-
|
161 |
-
// Handle operators and Delimiters
|
162 |
-
if (stream.match(tripleDelimiters) || stream.match(doubleDelimiters))
|
163 |
-
return "punctuation";
|
164 |
-
|
165 |
-
if (stream.match(doubleOperators) || stream.match(singleOperators))
|
166 |
-
return "operator";
|
167 |
-
|
168 |
-
if (stream.match(singleDelimiters))
|
169 |
-
return "punctuation";
|
170 |
-
|
171 |
-
if (state.lastToken == "." && stream.match(identifiers))
|
172 |
-
return "property";
|
173 |
-
|
174 |
-
if (stream.match(keywords) || stream.match(wordOperators))
|
175 |
-
return "keyword";
|
176 |
-
|
177 |
-
if (stream.match(builtins))
|
178 |
-
return "builtin";
|
179 |
-
|
180 |
-
if (stream.match(/^(self|cls)\b/))
|
181 |
-
return "variable-2";
|
182 |
-
|
183 |
-
if (stream.match(identifiers)) {
|
184 |
-
if (state.lastToken == "def" || state.lastToken == "class")
|
185 |
-
return "def";
|
186 |
-
return "variable";
|
187 |
-
}
|
188 |
-
|
189 |
-
// Handle non-detected items
|
190 |
-
stream.next();
|
191 |
-
return ERRORCLASS;
|
192 |
-
}
|
193 |
-
|
194 |
-
function tokenStringFactory(delimiter) {
|
195 |
-
while ("rub".indexOf(delimiter.charAt(0).toLowerCase()) >= 0)
|
196 |
-
delimiter = delimiter.substr(1);
|
197 |
-
|
198 |
-
var singleline = delimiter.length == 1;
|
199 |
-
var OUTCLASS = "string";
|
200 |
-
|
201 |
-
function tokenString(stream, state) {
|
202 |
-
while (!stream.eol()) {
|
203 |
-
stream.eatWhile(/[^'"\\]/);
|
204 |
-
if (stream.eat("\\")) {
|
205 |
-
stream.next();
|
206 |
-
if (singleline && stream.eol())
|
207 |
-
return OUTCLASS;
|
208 |
-
} else if (stream.match(delimiter)) {
|
209 |
-
state.tokenize = tokenBase;
|
210 |
-
return OUTCLASS;
|
211 |
-
} else {
|
212 |
-
stream.eat(/['"]/);
|
213 |
-
}
|
214 |
-
}
|
215 |
-
if (singleline) {
|
216 |
-
if (parserConf.singleLineStringErrors)
|
217 |
-
return ERRORCLASS;
|
218 |
-
else
|
219 |
-
state.tokenize = tokenBase;
|
220 |
-
}
|
221 |
-
return OUTCLASS;
|
222 |
-
}
|
223 |
-
tokenString.isString = true;
|
224 |
-
return tokenString;
|
225 |
-
}
|
226 |
-
|
227 |
-
function pushScope(stream, state, type) {
|
228 |
-
var offset = 0, align = null;
|
229 |
-
if (type == "py") {
|
230 |
-
while (top(state).type != "py")
|
231 |
-
state.scopes.pop();
|
232 |
-
}
|
233 |
-
offset = top(state).offset + (type == "py" ? conf.indentUnit : hangingIndent);
|
234 |
-
if (type != "py" && !stream.match(/^(\s|#.*)*$/, false))
|
235 |
-
align = stream.column() + 1;
|
236 |
-
state.scopes.push({offset: offset, type: type, align: align});
|
237 |
-
}
|
238 |
-
|
239 |
-
function dedent(stream, state) {
|
240 |
-
var indented = stream.indentation();
|
241 |
-
while (top(state).offset > indented) {
|
242 |
-
if (top(state).type != "py") return true;
|
243 |
-
state.scopes.pop();
|
244 |
-
}
|
245 |
-
return top(state).offset != indented;
|
246 |
-
}
|
247 |
-
|
248 |
-
function tokenLexer(stream, state) {
|
249 |
-
var style = state.tokenize(stream, state);
|
250 |
-
var current = stream.current();
|
251 |
-
|
252 |
-
// Handle decorators
|
253 |
-
if (current == "@"){
|
254 |
-
if(parserConf.version && parseInt(parserConf.version, 10) == 3){
|
255 |
-
return stream.match(identifiers, false) ? "meta" : "operator";
|
256 |
-
} else {
|
257 |
-
return stream.match(identifiers, false) ? "meta" : ERRORCLASS;
|
258 |
-
}
|
259 |
-
}
|
260 |
-
|
261 |
-
if ((style == "variable" || style == "builtin")
|
262 |
-
&& state.lastToken == "meta")
|
263 |
-
style = "meta";
|
264 |
-
|
265 |
-
// Handle scope changes.
|
266 |
-
if (current == "pass" || current == "return")
|
267 |
-
state.dedent += 1;
|
268 |
-
|
269 |
-
if (current == "lambda") state.lambda = true;
|
270 |
-
if (current == ":" && !state.lambda && top(state).type == "py")
|
271 |
-
pushScope(stream, state, "py");
|
272 |
-
|
273 |
-
var delimiter_index = current.length == 1 ? "[({".indexOf(current) : -1;
|
274 |
-
if (delimiter_index != -1)
|
275 |
-
pushScope(stream, state, "])}".slice(delimiter_index, delimiter_index+1));
|
276 |
-
|
277 |
-
delimiter_index = "])}".indexOf(current);
|
278 |
-
if (delimiter_index != -1) {
|
279 |
-
if (top(state).type == current) state.scopes.pop();
|
280 |
-
else return ERRORCLASS;
|
281 |
-
}
|
282 |
-
if (state.dedent > 0 && stream.eol() && top(state).type == "py") {
|
283 |
-
if (state.scopes.length > 1) state.scopes.pop();
|
284 |
-
state.dedent -= 1;
|
285 |
-
}
|
286 |
-
|
287 |
-
return style;
|
288 |
-
}
|
289 |
-
|
290 |
-
var external = {
|
291 |
-
startState: function(basecolumn) {
|
292 |
-
return {
|
293 |
-
tokenize: tokenBase,
|
294 |
-
scopes: [{offset: basecolumn || 0, type: "py", align: null}],
|
295 |
-
lastToken: null,
|
296 |
-
lambda: false,
|
297 |
-
dedent: 0
|
298 |
-
};
|
299 |
-
},
|
300 |
-
|
301 |
-
token: function(stream, state) {
|
302 |
-
var addErr = state.errorToken;
|
303 |
-
if (addErr) state.errorToken = false;
|
304 |
-
var style = tokenLexer(stream, state);
|
305 |
-
|
306 |
-
if (style && style != "comment")
|
307 |
-
state.lastToken = (style == "keyword" || style == "punctuation") ? stream.current() : style;
|
308 |
-
if (style == "punctuation") style = null;
|
309 |
-
|
310 |
-
if (stream.eol() && state.lambda)
|
311 |
-
state.lambda = false;
|
312 |
-
return addErr ? style + " " + ERRORCLASS : style;
|
313 |
-
},
|
314 |
-
|
315 |
-
indent: function(state, textAfter) {
|
316 |
-
if (state.tokenize != tokenBase)
|
317 |
-
return state.tokenize.isString ? CodeMirror.Pass : 0;
|
318 |
-
|
319 |
-
var scope = top(state);
|
320 |
-
var closing = textAfter && textAfter.charAt(0) == scope.type;
|
321 |
-
if (scope.align != null)
|
322 |
-
return scope.align - (closing ? 1 : 0);
|
323 |
-
else if (closing && state.scopes.length > 1)
|
324 |
-
return state.scopes[state.scopes.length - 2].offset;
|
325 |
-
else
|
326 |
-
return scope.offset;
|
327 |
-
},
|
328 |
-
|
329 |
-
closeBrackets: {triples: "'\""},
|
330 |
-
lineComment: "#",
|
331 |
-
fold: "indent"
|
332 |
-
};
|
333 |
-
return external;
|
334 |
-
});
|
335 |
-
|
336 |
-
CodeMirror.defineMIME("text/x-python", "python");
|
337 |
-
|
338 |
-
var words = function(str) { return str.split(" "); };
|
339 |
-
|
340 |
-
CodeMirror.defineMIME("text/x-cython", {
|
341 |
-
name: "python",
|
342 |
-
extra_keywords: words("by cdef cimport cpdef ctypedef enum except"+
|
343 |
-
"extern gil include nogil property public"+
|
344 |
-
"readonly struct union DEF IF ELIF ELSE")
|
345 |
-
});
|
346 |
-
|
347 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/q/index.html
DELETED
@@ -1,144 +0,0 @@
|
|
1 |
-
<!doctype html>
|
2 |
-
|
3 |
-
<title>CodeMirror: Q mode</title>
|
4 |
-
<meta charset="utf-8"/>
|
5 |
-
<link rel=stylesheet href="../../doc/docs.css">
|
6 |
-
|
7 |
-
<link rel="stylesheet" href="../../lib/codemirror.css">
|
8 |
-
<script src="../../lib/codemirror.js"></script>
|
9 |
-
<script src="../../addon/edit/matchbrackets.js"></script>
|
10 |
-
<script src="q.js"></script>
|
11 |
-
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
12 |
-
<div id=nav>
|
13 |
-
<a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
14 |
-
|
15 |
-
<ul>
|
16 |
-
<li><a href="../../index.html">Home</a>
|
17 |
-
<li><a href="../../doc/manual.html">Manual</a>
|
18 |
-
<li><a href="https://github.com/codemirror/codemirror">Code</a>
|
19 |
-
</ul>
|
20 |
-
<ul>
|
21 |
-
<li><a href="../index.html">Language modes</a>
|
22 |
-
<li><a class=active href="#">Q</a>
|
23 |
-
</ul>
|
24 |
-
</div>
|
25 |
-
|
26 |
-
<article>
|
27 |
-
<h2>Q mode</h2>
|
28 |
-
|
29 |
-
|
30 |
-
<div><textarea id="code" name="code">
|
31 |
-
/ utilities to quickly load a csv file - for more exhaustive analysis of the csv contents see csvguess.q
|
32 |
-
/ 2009.09.20 - updated to match latest csvguess.q
|
33 |
-
|
34 |
-
/ .csv.colhdrs[file] - return a list of colhdrs from file
|
35 |
-
/ info:.csv.info[file] - return a table of information about the file
|
36 |
-
/ columns are:
|
37 |
-
/ c - column name; ci - column index; t - load type; mw - max width;
|
38 |
-
/ dchar - distinct characters in values; rule - rule that caught the type
|
39 |
-
/ maybe - needs checking, _could_ be say a date, but perhaps just a float?
|
40 |
-
/ .csv.info0[file;onlycols] - like .csv.info except that it only analyses <onlycols>
|
41 |
-
/ example:
|
42 |
-
/ info:.csv.info0[file;(.csv.colhdrs file)like"*price"]
|
43 |
-
/ info:.csv.infolike[file;"*price"]
|
44 |
-
/ show delete from info where t=" "
|
45 |
-
/ .csv.data[file;info] - use the info from .csv.info to read the data
|
46 |
-
/ .csv.data10[file;info] - like .csv.data but only returns the first 10 rows
|
47 |
-
/ bulkload[file;info] - bulk loads file into table DATA (which must be already defined :: DATA:() )
|
48 |
-
/ .csv.read[file]/read10[file] - for when you don't care about checking/tweaking the <info> before reading
|
49 |
-
|
50 |
-
\d .csv
|
51 |
-
DELIM:","
|
52 |
-
ZAPHDRS:0b / lowercase and remove _ from colhdrs (junk characters are always removed)
|
53 |
-
WIDTHHDR:25000 / number of characters read to get the header
|
54 |
-
READLINES:222 / number of lines read and used to guess the types
|
55 |
-
SYMMAXWIDTH:11 / character columns narrower than this are stored as symbols
|
56 |
-
SYMMAXGR:10 / max symbol granularity% before we give up and keep as a * string
|
57 |
-
FORCECHARWIDTH:30 / every field (of any type) with values this wide or more is forced to character "*"
|
58 |
-
DISCARDEMPTY:0b / completely ignore empty columns if true else set them to "C"
|
59 |
-
CHUNKSIZE:50000000 / used in fs2 (modified .Q.fs)
|
60 |
-
|
61 |
-
k)nameltrim:{$[~@x;.z.s'x;~(*x)in aA:.Q.a,.Q.A;(+/&\~x in aA)_x;x]}
|
62 |
-
k)fs2:{[f;s]((-7!s)>){[f;s;x]i:1+last@&0xa=r:1:(s;x;CHUNKSIZE);f@`\:i#r;x+i}[f;s]/0j}
|
63 |
-
cleanhdrs:{{$[ZAPHDRS;lower x except"_";x]}x where x in DELIM,.Q.an}
|
64 |
-
cancast:{nw:x$"";if[not x in"BXCS";nw:(min 0#;max 0#;::)@\:nw];$[not any nw in x$(11&count y)#y;$[11<count y;not any nw in x$y;1b];0b]}
|
65 |
-
|
66 |
-
read:{[file]data[file;info[file]]}
|
67 |
-
read10:{[file]data10[file;info[file]]}
|
68 |
-
|
69 |
-
colhdrs:{[file]
|
70 |
-
`$nameltrim DELIM vs cleanhdrs first read0(file;0;1+first where 0xa=read1(file;0;WIDTHHDR))}
|
71 |
-
data:{[file;info]
|
72 |
-
(exec c from info where not t=" ")xcol(exec t from info;enlist DELIM)0:file}
|
73 |
-
data10:{[file;info]
|
74 |
-
data[;info](file;0;1+last 11#where 0xa=read1(file;0;15*WIDTHHDR))}
|
75 |
-
info0:{[file;onlycols]
|
76 |
-
colhdrs:`$nameltrim DELIM vs cleanhdrs first head:read0(file;0;1+last where 0xa=read1(file;0;WIDTHHDR));
|
77 |
-
loadfmts:(count colhdrs)#"S";if[count onlycols;loadfmts[where not colhdrs in onlycols]:"C"];
|
78 |
-
breaks:where 0xa=read1(file;0;floor(10+READLINES)*WIDTHHDR%count head);
|
79 |
-
nas:count as:colhdrs xcol(loadfmts;enlist DELIM)0:(file;0;1+last((1+READLINES)&count breaks)#breaks);
|
80 |
-
info:([]c:key flip as;v:value flip as);as:();
|
81 |
-
reserved:key`.q;reserved,:.Q.res;reserved,:`i;
|
82 |
-
info:update res:c in reserved from info;
|
83 |
-
info:update ci:i,t:"?",ipa:0b,mdot:0,mw:0,rule:0,gr:0,ndv:0,maybe:0b,empty:0b,j10:0b,j12:0b from info;
|
84 |
-
info:update ci:`s#ci from info;
|
85 |
-
if[count onlycols;info:update t:" ",rule:10 from info where not c in onlycols];
|
86 |
-
info:update sdv:{string(distinct x)except`}peach v from info;
|
87 |
-
info:update ndv:count each sdv from info;
|
88 |
-
info:update gr:floor 0.5+100*ndv%nas,mw:{max count each x}peach sdv from info where 0<ndv;
|
89 |
-
info:update t:"*",rule:20 from info where mw>.csv.FORCECHARWIDTH; / long values
|
90 |
-
info:update t:"C "[.csv.DISCARDEMPTY],rule:30,empty:1b from info where t="?",mw=0; / empty columns
|
91 |
-
info:update dchar:{asc distinct raze x}peach sdv from info where t="?";
|
92 |
-
info:update mdot:{max sum each"."=x}peach sdv from info where t="?",{"."in x}each dchar;
|
93 |
-
info:update t:"n",rule:40 from info where t="?",{any x in"0123456789"}each dchar; / vaguely numeric..
|
94 |
-
info:update t:"I",rule:50,ipa:1b from info where t="n",mw within 7 15,mdot=3,{all x in".0123456789"}each dchar,.csv.cancast["I"]peach sdv; / ip-address
|
95 |
-
info:update t:"J",rule:60 from info where t="n",mdot=0,{all x in"+-0123456789"}each dchar,.csv.cancast["J"]peach sdv;
|
96 |
-
info:update t:"I",rule:70 from info where t="J",mw<12,.csv.cancast["I"]peach sdv;
|
97 |
-
info:update t:"H",rule:80 from info where t="I",mw<7,.csv.cancast["H"]peach sdv;
|
98 |
-
info:update t:"F",rule:90 from info where t="n",mdot<2,mw>1,.csv.cancast["F"]peach sdv;
|
99 |
-
info:update t:"E",rule:100,maybe:1b from info where t="F",mw<9;
|
100 |
-
info:update t:"M",rule:110,maybe:1b from info where t in"nIHEF",mdot<2,mw within 4 7,.csv.cancast["M"]peach sdv;
|
101 |
-
info:update t:"D",rule:120,maybe:1b from info where t in"nI",mdot in 0 2,mw within 6 11,.csv.cancast["D"]peach sdv;
|
102 |
-
info:update t:"V",rule:130,maybe:1b from info where t="I",mw in 5 6,7<count each dchar,{all x like"*[0-9][0-5][0-9][0-5][0-9]"}peach sdv,.csv.cancast["V"]peach sdv; / 235959 12345
|
103 |
-
info:update t:"U",rule:140,maybe:1b from info where t="H",mw in 3 4,7<count each dchar,{all x like"*[0-9][0-5][0-9]"}peach sdv,.csv.cancast["U"]peach sdv; /2359
|
104 |
-
info:update t:"U",rule:150,maybe:0b from info where t="n",mw in 4 5,mdot=0,{all x like"*[0-9]:[0-5][0-9]"}peach sdv,.csv.cancast["U"]peach sdv;
|
105 |
-
info:update t:"T",rule:160,maybe:0b from info where t="n",mw within 7 12,mdot<2,{all x like"*[0-9]:[0-5][0-9]:[0-5][0-9]*"}peach sdv,.csv.cancast["T"]peach sdv;
|
106 |
-
info:update t:"V",rule:170,maybe:0b from info where t="T",mw in 7 8,mdot=0,.csv.cancast["V"]peach sdv;
|
107 |
-
info:update t:"T",rule:180,maybe:1b from info where t in"EF",mw within 7 10,mdot=1,{all x like"*[0-9][0-5][0-9][0-5][0-9].*"}peach sdv,.csv.cancast["T"]peach sdv;
|
108 |
-
info:update t:"Z",rule:190,maybe:0b from info where t="n",mw within 11 24,mdot<4,.csv.cancast["Z"]peach sdv;
|
109 |
-
info:update t:"P",rule:200,maybe:1b from info where t="n",mw within 12 29,mdot<4,{all x like"[12]*"}peach sdv,.csv.cancast["P"]peach sdv;
|
110 |
-
info:update t:"N",rule:210,maybe:1b from info where t="n",mw within 3 28,mdot=1,.csv.cancast["N"]peach sdv;
|
111 |
-
info:update t:"?",rule:220,maybe:0b from info where t="n"; / reset remaining maybe numeric
|
112 |
-
info:update t:"C",rule:230,maybe:0b from info where t="?",mw=1; / char
|
113 |
-
info:update t:"B",rule:240,maybe:0b from info where t in"HC",mw=1,mdot=0,{$[all x in"01tTfFyYnN";(any"0fFnN"in x)and any"1tTyY"in x;0b]}each dchar; / boolean
|
114 |
-
info:update t:"B",rule:250,maybe:1b from info where t in"HC",mw=1,mdot=0,{all x in"01tTfFyYnN"}each dchar; / boolean
|
115 |
-
info:update t:"X",rule:260,maybe:0b from info where t="?",mw=2,{$[all x in"0123456789abcdefABCDEF";(any .Q.n in x)and any"abcdefABCDEF"in x;0b]}each dchar; /hex
|
116 |
-
info:update t:"S",rule:270,maybe:1b from info where t="?",mw<.csv.SYMMAXWIDTH,mw>1,gr<.csv.SYMMAXGR; / symbols (max width permitting)
|
117 |
-
info:update t:"*",rule:280,maybe:0b from info where t="?"; / the rest as strings
|
118 |
-
/ flag those S/* columns which could be encoded to integers (.Q.j10/x10/j12/x12) to avoid symbols
|
119 |
-
info:update j12:1b from info where t in"S*",mw<13,{all x in .Q.nA}each dchar;
|
120 |
-
info:update j10:1b from info where t in"S*",mw<11,{all x in .Q.b6}each dchar;
|
121 |
-
select c,ci,t,maybe,empty,res,j10,j12,ipa,mw,mdot,rule,gr,ndv,dchar from info}
|
122 |
-
info:info0[;()] / by default don't restrict columns
|
123 |
-
infolike:{[file;pattern] info0[file;{x where x like y}[lower colhdrs[file];pattern]]} / .csv.infolike[file;"*time"]
|
124 |
-
|
125 |
-
\d .
|
126 |
-
/ DATA:()
|
127 |
-
bulkload:{[file;info]
|
128 |
-
if[not`DATA in system"v";'`DATA.not.defined];
|
129 |
-
if[count DATA;'`DATA.not.empty];
|
130 |
-
loadhdrs:exec c from info where not t=" ";loadfmts:exec t from info;
|
131 |
-
.csv.fs2[{[file;loadhdrs;loadfmts] `DATA insert $[count DATA;flip loadhdrs!(loadfmts;.csv.DELIM)0:file;loadhdrs xcol(loadfmts;enlist .csv.DELIM)0:file]}[file;loadhdrs;loadfmts]];
|
132 |
-
count DATA}
|
133 |
-
@[.:;"\\l csvutil.custom.q";::]; / save your custom settings in csvutil.custom.q to override those set at the beginning of the file
|
134 |
-
</textarea></div>
|
135 |
-
|
136 |
-
<script>
|
137 |
-
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
|
138 |
-
lineNumbers: true,
|
139 |
-
matchBrackets: true
|
140 |
-
});
|
141 |
-
</script>
|
142 |
-
|
143 |
-
<p><strong>MIME type defined:</strong> <code>text/x-q</code>.</p>
|
144 |
-
</article>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/q/q.js
DELETED
@@ -1,139 +0,0 @@
|
|
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("q",function(config){
|
15 |
-
var indentUnit=config.indentUnit,
|
16 |
-
curPunc,
|
17 |
-
keywords=buildRE(["abs","acos","aj","aj0","all","and","any","asc","asin","asof","atan","attr","avg","avgs","bin","by","ceiling","cols","cor","cos","count","cov","cross","csv","cut","delete","deltas","desc","dev","differ","distinct","div","do","each","ej","enlist","eval","except","exec","exit","exp","fby","fills","first","fkeys","flip","floor","from","get","getenv","group","gtime","hclose","hcount","hdel","hopen","hsym","iasc","idesc","if","ij","in","insert","inter","inv","key","keys","last","like","list","lj","load","log","lower","lsq","ltime","ltrim","mavg","max","maxs","mcount","md5","mdev","med","meta","min","mins","mmax","mmin","mmu","mod","msum","neg","next","not","null","or","over","parse","peach","pj","plist","prd","prds","prev","prior","rand","rank","ratios","raze","read0","read1","reciprocal","reverse","rload","rotate","rsave","rtrim","save","scan","select","set","setenv","show","signum","sin","sqrt","ss","ssr","string","sublist","sum","sums","sv","system","tables","tan","til","trim","txf","type","uj","ungroup","union","update","upper","upsert","value","var","view","views","vs","wavg","where","where","while","within","wj","wj1","wsum","xasc","xbar","xcol","xcols","xdesc","xexp","xgroup","xkey","xlog","xprev","xrank"]),
|
18 |
-
E=/[|/&^!+:\\\-*%$=~#;@><,?_\'\"\[\(\]\)\s{}]/;
|
19 |
-
function buildRE(w){return new RegExp("^("+w.join("|")+")$");}
|
20 |
-
function tokenBase(stream,state){
|
21 |
-
var sol=stream.sol(),c=stream.next();
|
22 |
-
curPunc=null;
|
23 |
-
if(sol)
|
24 |
-
if(c=="/")
|
25 |
-
return(state.tokenize=tokenLineComment)(stream,state);
|
26 |
-
else if(c=="\\"){
|
27 |
-
if(stream.eol()||/\s/.test(stream.peek()))
|
28 |
-
return stream.skipToEnd(),/^\\\s*$/.test(stream.current())?(state.tokenize=tokenCommentToEOF)(stream, state):state.tokenize=tokenBase,"comment";
|
29 |
-
else
|
30 |
-
return state.tokenize=tokenBase,"builtin";
|
31 |
-
}
|
32 |
-
if(/\s/.test(c))
|
33 |
-
return stream.peek()=="/"?(stream.skipToEnd(),"comment"):"whitespace";
|
34 |
-
if(c=='"')
|
35 |
-
return(state.tokenize=tokenString)(stream,state);
|
36 |
-
if(c=='`')
|
37 |
-
return stream.eatWhile(/[A-Z|a-z|\d|_|:|\/|\.]/),"symbol";
|
38 |
-
if(("."==c&&/\d/.test(stream.peek()))||/\d/.test(c)){
|
39 |
-
var t=null;
|
40 |
-
stream.backUp(1);
|
41 |
-
if(stream.match(/^\d{4}\.\d{2}(m|\.\d{2}([D|T](\d{2}(:\d{2}(:\d{2}(\.\d{1,9})?)?)?)?)?)/)
|
42 |
-
|| stream.match(/^\d+D(\d{2}(:\d{2}(:\d{2}(\.\d{1,9})?)?)?)/)
|
43 |
-
|| stream.match(/^\d{2}:\d{2}(:\d{2}(\.\d{1,9})?)?/)
|
44 |
-
|| stream.match(/^\d+[ptuv]{1}/))
|
45 |
-
t="temporal";
|
46 |
-
else if(stream.match(/^0[NwW]{1}/)
|
47 |
-
|| stream.match(/^0x[\d|a-f|A-F]*/)
|
48 |
-
|| stream.match(/^[0|1]+[b]{1}/)
|
49 |
-
|| stream.match(/^\d+[chijn]{1}/)
|
50 |
-
|| stream.match(/-?\d*(\.\d*)?(e[+\-]?\d+)?(e|f)?/))
|
51 |
-
t="number";
|
52 |
-
return(t&&(!(c=stream.peek())||E.test(c)))?t:(stream.next(),"error");
|
53 |
-
}
|
54 |
-
if(/[A-Z|a-z]|\./.test(c))
|
55 |
-
return stream.eatWhile(/[A-Z|a-z|\.|_|\d]/),keywords.test(stream.current())?"keyword":"variable";
|
56 |
-
if(/[|/&^!+:\\\-*%$=~#;@><\.,?_\']/.test(c))
|
57 |
-
return null;
|
58 |
-
if(/[{}\(\[\]\)]/.test(c))
|
59 |
-
return null;
|
60 |
-
return"error";
|
61 |
-
}
|
62 |
-
function tokenLineComment(stream,state){
|
63 |
-
return stream.skipToEnd(),/\/\s*$/.test(stream.current())?(state.tokenize=tokenBlockComment)(stream,state):(state.tokenize=tokenBase),"comment";
|
64 |
-
}
|
65 |
-
function tokenBlockComment(stream,state){
|
66 |
-
var f=stream.sol()&&stream.peek()=="\\";
|
67 |
-
stream.skipToEnd();
|
68 |
-
if(f&&/^\\\s*$/.test(stream.current()))
|
69 |
-
state.tokenize=tokenBase;
|
70 |
-
return"comment";
|
71 |
-
}
|
72 |
-
function tokenCommentToEOF(stream){return stream.skipToEnd(),"comment";}
|
73 |
-
function tokenString(stream,state){
|
74 |
-
var escaped=false,next,end=false;
|
75 |
-
while((next=stream.next())){
|
76 |
-
if(next=="\""&&!escaped){end=true;break;}
|
77 |
-
escaped=!escaped&&next=="\\";
|
78 |
-
}
|
79 |
-
if(end)state.tokenize=tokenBase;
|
80 |
-
return"string";
|
81 |
-
}
|
82 |
-
function pushContext(state,type,col){state.context={prev:state.context,indent:state.indent,col:col,type:type};}
|
83 |
-
function popContext(state){state.indent=state.context.indent;state.context=state.context.prev;}
|
84 |
-
return{
|
85 |
-
startState:function(){
|
86 |
-
return{tokenize:tokenBase,
|
87 |
-
context:null,
|
88 |
-
indent:0,
|
89 |
-
col:0};
|
90 |
-
},
|
91 |
-
token:function(stream,state){
|
92 |
-
if(stream.sol()){
|
93 |
-
if(state.context&&state.context.align==null)
|
94 |
-
state.context.align=false;
|
95 |
-
state.indent=stream.indentation();
|
96 |
-
}
|
97 |
-
//if (stream.eatSpace()) return null;
|
98 |
-
var style=state.tokenize(stream,state);
|
99 |
-
if(style!="comment"&&state.context&&state.context.align==null&&state.context.type!="pattern"){
|
100 |
-
state.context.align=true;
|
101 |
-
}
|
102 |
-
if(curPunc=="(")pushContext(state,")",stream.column());
|
103 |
-
else if(curPunc=="[")pushContext(state,"]",stream.column());
|
104 |
-
else if(curPunc=="{")pushContext(state,"}",stream.column());
|
105 |
-
else if(/[\]\}\)]/.test(curPunc)){
|
106 |
-
while(state.context&&state.context.type=="pattern")popContext(state);
|
107 |
-
if(state.context&&curPunc==state.context.type)popContext(state);
|
108 |
-
}
|
109 |
-
else if(curPunc=="."&&state.context&&state.context.type=="pattern")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")context=context.prev;
|
125 |
-
var closing=context&&firstChar==context.type;
|
126 |
-
if(!context)
|
127 |
-
return 0;
|
128 |
-
else if(context.type=="pattern")
|
129 |
-
return context.col;
|
130 |
-
else if(context.align)
|
131 |
-
return context.col+(closing?0:1);
|
132 |
-
else
|
133 |
-
return context.indent+(closing?0:indentUnit);
|
134 |
-
}
|
135 |
-
};
|
136 |
-
});
|
137 |
-
CodeMirror.defineMIME("text/x-q","q");
|
138 |
-
|
139 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/r/index.html
DELETED
@@ -1,85 +0,0 @@
|
|
1 |
-
<!doctype html>
|
2 |
-
|
3 |
-
<title>CodeMirror: R mode</title>
|
4 |
-
<meta charset="utf-8"/>
|
5 |
-
<link rel=stylesheet href="../../doc/docs.css">
|
6 |
-
|
7 |
-
<link rel="stylesheet" href="../../lib/codemirror.css">
|
8 |
-
<script src="../../lib/codemirror.js"></script>
|
9 |
-
<script src="r.js"></script>
|
10 |
-
<style>
|
11 |
-
.CodeMirror { border-top: 1px solid silver; border-bottom: 1px solid silver; }
|
12 |
-
.cm-s-default span.cm-semi { color: blue; font-weight: bold; }
|
13 |
-
.cm-s-default span.cm-dollar { color: orange; font-weight: bold; }
|
14 |
-
.cm-s-default span.cm-arrow { color: brown; }
|
15 |
-
.cm-s-default span.cm-arg-is { color: brown; }
|
16 |
-
</style>
|
17 |
-
<div id=nav>
|
18 |
-
<a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
19 |
-
|
20 |
-
<ul>
|
21 |
-
<li><a href="../../index.html">Home</a>
|
22 |
-
<li><a href="../../doc/manual.html">Manual</a>
|
23 |
-
<li><a href="https://github.com/codemirror/codemirror">Code</a>
|
24 |
-
</ul>
|
25 |
-
<ul>
|
26 |
-
<li><a href="../index.html">Language modes</a>
|
27 |
-
<li><a class=active href="#">R</a>
|
28 |
-
</ul>
|
29 |
-
</div>
|
30 |
-
|
31 |
-
<article>
|
32 |
-
<h2>R mode</h2>
|
33 |
-
<form><textarea id="code" name="code">
|
34 |
-
# Code from http://www.mayin.org/ajayshah/KB/R/
|
35 |
-
|
36 |
-
# FIRST LEARN ABOUT LISTS --
|
37 |
-
X = list(height=5.4, weight=54)
|
38 |
-
print("Use default printing --")
|
39 |
-
print(X)
|
40 |
-
print("Accessing individual elements --")
|
41 |
-
cat("Your height is ", X$height, " and your weight is ", X$weight, "\n")
|
42 |
-
|
43 |
-
# FUNCTIONS --
|
44 |
-
square <- function(x) {
|
45 |
-
return(x*x)
|
46 |
-
}
|
47 |
-
cat("The square of 3 is ", square(3), "\n")
|
48 |
-
|
49 |
-
# default value of the arg is set to 5.
|
50 |
-
cube <- function(x=5) {
|
51 |
-
return(x*x*x);
|
52 |
-
}
|
53 |
-
cat("Calling cube with 2 : ", cube(2), "\n") # will give 2^3
|
54 |
-
cat("Calling cube : ", cube(), "\n") # will default to 5^3.
|
55 |
-
|
56 |
-
# LEARN ABOUT FUNCTIONS THAT RETURN MULTIPLE OBJECTS --
|
57 |
-
powers <- function(x) {
|
58 |
-
parcel = list(x2=x*x, x3=x*x*x, x4=x*x*x*x);
|
59 |
-
return(parcel);
|
60 |
-
}
|
61 |
-
|
62 |
-
X = powers(3);
|
63 |
-
print("Showing powers of 3 --"); print(X);
|
64 |
-
|
65 |
-
# WRITING THIS COMPACTLY (4 lines instead of 7)
|
66 |
-
|
67 |
-
powerful <- function(x) {
|
68 |
-
return(list(x2=x*x, x3=x*x*x, x4=x*x*x*x));
|
69 |
-
}
|
70 |
-
print("Showing powers of 3 --"); print(powerful(3));
|
71 |
-
|
72 |
-
# In R, the last expression in a function is, by default, what is
|
73 |
-
# returned. So you could equally just say:
|
74 |
-
powerful <- function(x) {list(x2=x*x, x3=x*x*x, x4=x*x*x*x)}
|
75 |
-
</textarea></form>
|
76 |
-
<script>
|
77 |
-
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {});
|
78 |
-
</script>
|
79 |
-
|
80 |
-
<p><strong>MIME types defined:</strong> <code>text/x-rsrc</code>.</p>
|
81 |
-
|
82 |
-
<p>Development of the CodeMirror R mode was kindly sponsored
|
83 |
-
by <a href="https://twitter.com/ubalo">Ubalo</a>.</p>
|
84 |
-
|
85 |
-
</article>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/r/r.js
DELETED
@@ -1,162 +0,0 @@
|
|
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("r", function(config) {
|
15 |
-
function wordObj(str) {
|
16 |
-
var words = str.split(" "), res = {};
|
17 |
-
for (var i = 0; i < words.length; ++i) res[words[i]] = true;
|
18 |
-
return res;
|
19 |
-
}
|
20 |
-
var atoms = wordObj("NULL NA Inf NaN NA_integer_ NA_real_ NA_complex_ NA_character_");
|
21 |
-
var builtins = wordObj("list quote bquote eval return call parse deparse");
|
22 |
-
var keywords = wordObj("if else repeat while function for in next break");
|
23 |
-
var blockkeywords = wordObj("if else repeat while function for");
|
24 |
-
var opChars = /[+\-*\/^<>=!&|~$:]/;
|
25 |
-
var curPunc;
|
26 |
-
|
27 |
-
function tokenBase(stream, state) {
|
28 |
-
curPunc = null;
|
29 |
-
var ch = stream.next();
|
30 |
-
if (ch == "#") {
|
31 |
-
stream.skipToEnd();
|
32 |
-
return "comment";
|
33 |
-
} else if (ch == "0" && stream.eat("x")) {
|
34 |
-
stream.eatWhile(/[\da-f]/i);
|
35 |
-
return "number";
|
36 |
-
} else if (ch == "." && stream.eat(/\d/)) {
|
37 |
-
stream.match(/\d*(?:e[+\-]?\d+)?/);
|
38 |
-
return "number";
|
39 |
-
} else if (/\d/.test(ch)) {
|
40 |
-
stream.match(/\d*(?:\.\d+)?(?:e[+\-]\d+)?L?/);
|
41 |
-
return "number";
|
42 |
-
} else if (ch == "'" || ch == '"') {
|
43 |
-
state.tokenize = tokenString(ch);
|
44 |
-
return "string";
|
45 |
-
} else if (ch == "." && stream.match(/.[.\d]+/)) {
|
46 |
-
return "keyword";
|
47 |
-
} else if (/[\w\.]/.test(ch) && ch != "_") {
|
48 |
-
stream.eatWhile(/[\w\.]/);
|
49 |
-
var word = stream.current();
|
50 |
-
if (atoms.propertyIsEnumerable(word)) return "atom";
|
51 |
-
if (keywords.propertyIsEnumerable(word)) {
|
52 |
-
// Block keywords start new blocks, except 'else if', which only starts
|
53 |
-
// one new block for the 'if', no block for the 'else'.
|
54 |
-
if (blockkeywords.propertyIsEnumerable(word) &&
|
55 |
-
!stream.match(/\s*if(\s+|$)/, false))
|
56 |
-
curPunc = "block";
|
57 |
-
return "keyword";
|
58 |
-
}
|
59 |
-
if (builtins.propertyIsEnumerable(word)) return "builtin";
|
60 |
-
return "variable";
|
61 |
-
} else if (ch == "%") {
|
62 |
-
if (stream.skipTo("%")) stream.next();
|
63 |
-
return "variable-2";
|
64 |
-
} else if (ch == "<" && stream.eat("-")) {
|
65 |
-
return "arrow";
|
66 |
-
} else if (ch == "=" && state.ctx.argList) {
|
67 |
-
return "arg-is";
|
68 |
-
} else if (opChars.test(ch)) {
|
69 |
-
if (ch == "$") return "dollar";
|
70 |
-
stream.eatWhile(opChars);
|
71 |
-
return "operator";
|
72 |
-
} else if (/[\(\){}\[\];]/.test(ch)) {
|
73 |
-
curPunc = ch;
|
74 |
-
if (ch == ";") return "semi";
|
75 |
-
return null;
|
76 |
-
} else {
|
77 |
-
return null;
|
78 |
-
}
|
79 |
-
}
|
80 |
-
|
81 |
-
function tokenString(quote) {
|
82 |
-
return function(stream, state) {
|
83 |
-
if (stream.eat("\\")) {
|
84 |
-
var ch = stream.next();
|
85 |
-
if (ch == "x") stream.match(/^[a-f0-9]{2}/i);
|
86 |
-
else if ((ch == "u" || ch == "U") && stream.eat("{") && stream.skipTo("}")) stream.next();
|
87 |
-
else if (ch == "u") stream.match(/^[a-f0-9]{4}/i);
|
88 |
-
else if (ch == "U") stream.match(/^[a-f0-9]{8}/i);
|
89 |
-
else if (/[0-7]/.test(ch)) stream.match(/^[0-7]{1,2}/);
|
90 |
-
return "string-2";
|
91 |
-
} else {
|
92 |
-
var next;
|
93 |
-
while ((next = stream.next()) != null) {
|
94 |
-
if (next == quote) { state.tokenize = tokenBase; break; }
|
95 |
-
if (next == "\\") { stream.backUp(1); break; }
|
96 |
-
}
|
97 |
-
return "string";
|
98 |
-
}
|
99 |
-
};
|
100 |
-
}
|
101 |
-
|
102 |
-
function push(state, type, stream) {
|
103 |
-
state.ctx = {type: type,
|
104 |
-
indent: state.indent,
|
105 |
-
align: null,
|
106 |
-
column: stream.column(),
|
107 |
-
prev: state.ctx};
|
108 |
-
}
|
109 |
-
function pop(state) {
|
110 |
-
state.indent = state.ctx.indent;
|
111 |
-
state.ctx = state.ctx.prev;
|
112 |
-
}
|
113 |
-
|
114 |
-
return {
|
115 |
-
startState: function() {
|
116 |
-
return {tokenize: tokenBase,
|
117 |
-
ctx: {type: "top",
|
118 |
-
indent: -config.indentUnit,
|
119 |
-
align: false},
|
120 |
-
indent: 0,
|
121 |
-
afterIdent: false};
|
122 |
-
},
|
123 |
-
|
124 |
-
token: function(stream, state) {
|
125 |
-
if (stream.sol()) {
|
126 |
-
if (state.ctx.align == null) state.ctx.align = false;
|
127 |
-
state.indent = stream.indentation();
|
128 |
-
}
|
129 |
-
if (stream.eatSpace()) return null;
|
130 |
-
var style = state.tokenize(stream, state);
|
131 |
-
if (style != "comment" && state.ctx.align == null) state.ctx.align = true;
|
132 |
-
|
133 |
-
var ctype = state.ctx.type;
|
134 |
-
if ((curPunc == ";" || curPunc == "{" || curPunc == "}") && ctype == "block") pop(state);
|
135 |
-
if (curPunc == "{") push(state, "}", stream);
|
136 |
-
else if (curPunc == "(") {
|
137 |
-
push(state, ")", stream);
|
138 |
-
if (state.afterIdent) state.ctx.argList = true;
|
139 |
-
}
|
140 |
-
else if (curPunc == "[") push(state, "]", stream);
|
141 |
-
else if (curPunc == "block") push(state, "block", stream);
|
142 |
-
else if (curPunc == ctype) pop(state);
|
143 |
-
state.afterIdent = style == "variable" || style == "keyword";
|
144 |
-
return style;
|
145 |
-
},
|
146 |
-
|
147 |
-
indent: function(state, textAfter) {
|
148 |
-
if (state.tokenize != tokenBase) return 0;
|
149 |
-
var firstChar = textAfter && textAfter.charAt(0), ctx = state.ctx,
|
150 |
-
closing = firstChar == ctx.type;
|
151 |
-
if (ctx.type == "block") return ctx.indent + (firstChar == "{" ? 0 : config.indentUnit);
|
152 |
-
else if (ctx.align) return ctx.column + (closing ? 0 : 1);
|
153 |
-
else return ctx.indent + (closing ? 0 : config.indentUnit);
|
154 |
-
},
|
155 |
-
|
156 |
-
lineComment: "#"
|
157 |
-
};
|
158 |
-
});
|
159 |
-
|
160 |
-
CodeMirror.defineMIME("text/x-rsrc", "r");
|
161 |
-
|
162 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/rpm/changes/index.html
DELETED
@@ -1,66 +0,0 @@
|
|
1 |
-
<!doctype html>
|
2 |
-
|
3 |
-
<title>CodeMirror: RPM changes mode</title>
|
4 |
-
<meta charset="utf-8"/>
|
5 |
-
<link rel=stylesheet href="../../doc/docs.css">
|
6 |
-
|
7 |
-
<link rel="stylesheet" href="../../../lib/codemirror.css">
|
8 |
-
<script src="../../../lib/codemirror.js"></script>
|
9 |
-
<script src="changes.js"></script>
|
10 |
-
<link rel="stylesheet" href="../../../doc/docs.css">
|
11 |
-
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
12 |
-
|
13 |
-
<div id=nav>
|
14 |
-
<a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../../doc/logo.png"></a>
|
15 |
-
|
16 |
-
<ul>
|
17 |
-
<li><a href="../../../index.html">Home</a>
|
18 |
-
<li><a href="../../../doc/manual.html">Manual</a>
|
19 |
-
<li><a href="https://github.com/codemirror/codemirror">Code</a>
|
20 |
-
</ul>
|
21 |
-
<ul>
|
22 |
-
<li><a href="../../index.html">Language modes</a>
|
23 |
-
<li><a class=active href="#">RPM changes</a>
|
24 |
-
</ul>
|
25 |
-
</div>
|
26 |
-
|
27 |
-
<article>
|
28 |
-
<h2>RPM changes mode</h2>
|
29 |
-
|
30 |
-
<div><textarea id="code" name="code">
|
31 |
-
-------------------------------------------------------------------
|
32 |
-
Tue Oct 18 13:58:40 UTC 2011 - misterx@example.com
|
33 |
-
|
34 |
-
- Update to r60.3
|
35 |
-
- Fixes bug in the reflect package
|
36 |
-
* disallow Interface method on Value obtained via unexported name
|
37 |
-
|
38 |
-
-------------------------------------------------------------------
|
39 |
-
Thu Oct 6 08:14:24 UTC 2011 - misterx@example.com
|
40 |
-
|
41 |
-
- Update to r60.2
|
42 |
-
- Fixes memory leak in certain map types
|
43 |
-
|
44 |
-
-------------------------------------------------------------------
|
45 |
-
Wed Oct 5 14:34:10 UTC 2011 - misterx@example.com
|
46 |
-
|
47 |
-
- Tweaks for gdb debugging
|
48 |
-
- go.spec changes:
|
49 |
-
- move %go_arch definition to %prep section
|
50 |
-
- pass correct location of go specific gdb pretty printer and
|
51 |
-
functions to cpp as HOST_EXTRA_CFLAGS macro
|
52 |
-
- install go gdb functions & printer
|
53 |
-
- gdb-printer.patch
|
54 |
-
- patch linker (src/cmd/ld/dwarf.c) to emit correct location of go
|
55 |
-
gdb functions and pretty printer
|
56 |
-
</textarea></div>
|
57 |
-
<script>
|
58 |
-
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
|
59 |
-
mode: {name: "changes"},
|
60 |
-
lineNumbers: true,
|
61 |
-
indentUnit: 4
|
62 |
-
});
|
63 |
-
</script>
|
64 |
-
|
65 |
-
<p><strong>MIME types defined:</strong> <code>text/x-rpm-changes</code>.</p>
|
66 |
-
</article>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/rpm/index.html
DELETED
@@ -1,149 +0,0 @@
|
|
1 |
-
<!doctype html>
|
2 |
-
|
3 |
-
<title>CodeMirror: RPM changes mode</title>
|
4 |
-
<meta charset="utf-8"/>
|
5 |
-
<link rel=stylesheet href="../../doc/docs.css">
|
6 |
-
|
7 |
-
<link rel="stylesheet" href="../../lib/codemirror.css">
|
8 |
-
<script src="../../lib/codemirror.js"></script>
|
9 |
-
<script src="rpm.js"></script>
|
10 |
-
<link rel="stylesheet" href="../../doc/docs.css">
|
11 |
-
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
12 |
-
|
13 |
-
<div id=nav>
|
14 |
-
<a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
15 |
-
|
16 |
-
<ul>
|
17 |
-
<li><a href="../../index.html">Home</a>
|
18 |
-
<li><a href="../../doc/manual.html">Manual</a>
|
19 |
-
<li><a href="https://github.com/codemirror/codemirror">Code</a>
|
20 |
-
</ul>
|
21 |
-
<ul>
|
22 |
-
<li><a href="../index.html">Language modes</a>
|
23 |
-
<li><a class=active href="#">RPM</a>
|
24 |
-
</ul>
|
25 |
-
</div>
|
26 |
-
|
27 |
-
<article>
|
28 |
-
<h2>RPM changes mode</h2>
|
29 |
-
|
30 |
-
<div><textarea id="code" name="code">
|
31 |
-
-------------------------------------------------------------------
|
32 |
-
Tue Oct 18 13:58:40 UTC 2011 - misterx@example.com
|
33 |
-
|
34 |
-
- Update to r60.3
|
35 |
-
- Fixes bug in the reflect package
|
36 |
-
* disallow Interface method on Value obtained via unexported name
|
37 |
-
|
38 |
-
-------------------------------------------------------------------
|
39 |
-
Thu Oct 6 08:14:24 UTC 2011 - misterx@example.com
|
40 |
-
|
41 |
-
- Update to r60.2
|
42 |
-
- Fixes memory leak in certain map types
|
43 |
-
|
44 |
-
-------------------------------------------------------------------
|
45 |
-
Wed Oct 5 14:34:10 UTC 2011 - misterx@example.com
|
46 |
-
|
47 |
-
- Tweaks for gdb debugging
|
48 |
-
- go.spec changes:
|
49 |
-
- move %go_arch definition to %prep section
|
50 |
-
- pass correct location of go specific gdb pretty printer and
|
51 |
-
functions to cpp as HOST_EXTRA_CFLAGS macro
|
52 |
-
- install go gdb functions & printer
|
53 |
-
- gdb-printer.patch
|
54 |
-
- patch linker (src/cmd/ld/dwarf.c) to emit correct location of go
|
55 |
-
gdb functions and pretty printer
|
56 |
-
</textarea></div>
|
57 |
-
<script>
|
58 |
-
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
|
59 |
-
mode: {name: "rpm-changes"},
|
60 |
-
lineNumbers: true,
|
61 |
-
indentUnit: 4
|
62 |
-
});
|
63 |
-
</script>
|
64 |
-
|
65 |
-
<h2>RPM spec mode</h2>
|
66 |
-
|
67 |
-
<div><textarea id="code2" name="code2">
|
68 |
-
#
|
69 |
-
# spec file for package minidlna
|
70 |
-
#
|
71 |
-
# Copyright (c) 2011, Sascha Peilicke <saschpe@gmx.de>
|
72 |
-
#
|
73 |
-
# All modifications and additions to the file contributed by third parties
|
74 |
-
# remain the property of their copyright owners, unless otherwise agreed
|
75 |
-
# upon. The license for this file, and modifications and additions to the
|
76 |
-
# file, is the same license as for the pristine package itself (unless the
|
77 |
-
# license for the pristine package is not an Open Source License, in which
|
78 |
-
# case the license is the MIT License). An "Open Source License" is a
|
79 |
-
# license that conforms to the Open Source Definition (Version 1.9)
|
80 |
-
# published by the Open Source Initiative.
|
81 |
-
|
82 |
-
|
83 |
-
Name: libupnp6
|
84 |
-
Version: 1.6.13
|
85 |
-
Release: 0
|
86 |
-
Summary: Portable Universal Plug and Play (UPnP) SDK
|
87 |
-
Group: System/Libraries
|
88 |
-
License: BSD-3-Clause
|
89 |
-
Url: http://sourceforge.net/projects/pupnp/
|
90 |
-
Source0: http://downloads.sourceforge.net/pupnp/libupnp-%{version}.tar.bz2
|
91 |
-
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
92 |
-
|
93 |
-
%description
|
94 |
-
The portable Universal Plug and Play (UPnP) SDK provides support for building
|
95 |
-
UPnP-compliant control points, devices, and bridges on several operating
|
96 |
-
systems.
|
97 |
-
|
98 |
-
%package -n libupnp-devel
|
99 |
-
Summary: Portable Universal Plug and Play (UPnP) SDK
|
100 |
-
Group: Development/Libraries/C and C++
|
101 |
-
Provides: pkgconfig(libupnp)
|
102 |
-
Requires: %{name} = %{version}
|
103 |
-
|
104 |
-
%description -n libupnp-devel
|
105 |
-
The portable Universal Plug and Play (UPnP) SDK provides support for building
|
106 |
-
UPnP-compliant control points, devices, and bridges on several operating
|
107 |
-
systems.
|
108 |
-
|
109 |
-
%prep
|
110 |
-
%setup -n libupnp-%{version}
|
111 |
-
|
112 |
-
%build
|
113 |
-
%configure --disable-static
|
114 |
-
make %{?_smp_mflags}
|
115 |
-
|
116 |
-
%install
|
117 |
-
%makeinstall
|
118 |
-
find %{buildroot} -type f -name '*.la' -exec rm -f {} ';'
|
119 |
-
|
120 |
-
%post -p /sbin/ldconfig
|
121 |
-
|
122 |
-
%postun -p /sbin/ldconfig
|
123 |
-
|
124 |
-
%files
|
125 |
-
%defattr(-,root,root,-)
|
126 |
-
%doc ChangeLog NEWS README TODO
|
127 |
-
%{_libdir}/libixml.so.*
|
128 |
-
%{_libdir}/libthreadutil.so.*
|
129 |
-
%{_libdir}/libupnp.so.*
|
130 |
-
|
131 |
-
%files -n libupnp-devel
|
132 |
-
%defattr(-,root,root,-)
|
133 |
-
%{_libdir}/pkgconfig/libupnp.pc
|
134 |
-
%{_libdir}/libixml.so
|
135 |
-
%{_libdir}/libthreadutil.so
|
136 |
-
%{_libdir}/libupnp.so
|
137 |
-
%{_includedir}/upnp/
|
138 |
-
|
139 |
-
%changelog</textarea></div>
|
140 |
-
<script>
|
141 |
-
var editor = CodeMirror.fromTextArea(document.getElementById("code2"), {
|
142 |
-
mode: {name: "rpm-spec"},
|
143 |
-
lineNumbers: true,
|
144 |
-
indentUnit: 4
|
145 |
-
});
|
146 |
-
</script>
|
147 |
-
|
148 |
-
<p><strong>MIME types defined:</strong> <code>text/x-rpm-spec</code>, <code>text/x-rpm-changes</code>.</p>
|
149 |
-
</article>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/rpm/rpm.js
DELETED
@@ -1,109 +0,0 @@
|
|
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("rpm-changes", function() {
|
15 |
-
var headerSeperator = /^-+$/;
|
16 |
-
var headerLine = /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ?\d{1,2} \d{2}:\d{2}(:\d{2})? [A-Z]{3,4} \d{4} - /;
|
17 |
-
var simpleEmail = /^[\w+.-]+@[\w.-]+/;
|
18 |
-
|
19 |
-
return {
|
20 |
-
token: function(stream) {
|
21 |
-
if (stream.sol()) {
|
22 |
-
if (stream.match(headerSeperator)) { return 'tag'; }
|
23 |
-
if (stream.match(headerLine)) { return 'tag'; }
|
24 |
-
}
|
25 |
-
if (stream.match(simpleEmail)) { return 'string'; }
|
26 |
-
stream.next();
|
27 |
-
return null;
|
28 |
-
}
|
29 |
-
};
|
30 |
-
});
|
31 |
-
|
32 |
-
CodeMirror.defineMIME("text/x-rpm-changes", "rpm-changes");
|
33 |
-
|
34 |
-
// Quick and dirty spec file highlighting
|
35 |
-
|
36 |
-
CodeMirror.defineMode("rpm-spec", function() {
|
37 |
-
var arch = /^(i386|i586|i686|x86_64|ppc64le|ppc64|ppc|ia64|s390x|s390|sparc64|sparcv9|sparc|noarch|alphaev6|alpha|hppa|mipsel)/;
|
38 |
-
|
39 |
-
var preamble = /^[a-zA-Z0-9()]+:/;
|
40 |
-
var section = /^%(debug_package|package|description|prep|build|install|files|clean|changelog|preinstall|preun|postinstall|postun|pretrans|posttrans|pre|post|triggerin|triggerun|verifyscript|check|triggerpostun|triggerprein|trigger)/;
|
41 |
-
var control_flow_complex = /^%(ifnarch|ifarch|if)/; // rpm control flow macros
|
42 |
-
var control_flow_simple = /^%(else|endif)/; // rpm control flow macros
|
43 |
-
var operators = /^(\!|\?|\<\=|\<|\>\=|\>|\=\=|\&\&|\|\|)/; // operators in control flow macros
|
44 |
-
|
45 |
-
return {
|
46 |
-
startState: function () {
|
47 |
-
return {
|
48 |
-
controlFlow: false,
|
49 |
-
macroParameters: false,
|
50 |
-
section: false
|
51 |
-
};
|
52 |
-
},
|
53 |
-
token: function (stream, state) {
|
54 |
-
var ch = stream.peek();
|
55 |
-
if (ch == "#") { stream.skipToEnd(); return "comment"; }
|
56 |
-
|
57 |
-
if (stream.sol()) {
|
58 |
-
if (stream.match(preamble)) { return "header"; }
|
59 |
-
if (stream.match(section)) { return "atom"; }
|
60 |
-
}
|
61 |
-
|
62 |
-
if (stream.match(/^\$\w+/)) { return "def"; } // Variables like '$RPM_BUILD_ROOT'
|
63 |
-
if (stream.match(/^\$\{\w+\}/)) { return "def"; } // Variables like '${RPM_BUILD_ROOT}'
|
64 |
-
|
65 |
-
if (stream.match(control_flow_simple)) { return "keyword"; }
|
66 |
-
if (stream.match(control_flow_complex)) {
|
67 |
-
state.controlFlow = true;
|
68 |
-
return "keyword";
|
69 |
-
}
|
70 |
-
if (state.controlFlow) {
|
71 |
-
if (stream.match(operators)) { return "operator"; }
|
72 |
-
if (stream.match(/^(\d+)/)) { return "number"; }
|
73 |
-
if (stream.eol()) { state.controlFlow = false; }
|
74 |
-
}
|
75 |
-
|
76 |
-
if (stream.match(arch)) {
|
77 |
-
if (stream.eol()) { state.controlFlow = false; }
|
78 |
-
return "number";
|
79 |
-
}
|
80 |
-
|
81 |
-
// Macros like '%make_install' or '%attr(0775,root,root)'
|
82 |
-
if (stream.match(/^%[\w]+/)) {
|
83 |
-
if (stream.match(/^\(/)) { state.macroParameters = true; }
|
84 |
-
return "keyword";
|
85 |
-
}
|
86 |
-
if (state.macroParameters) {
|
87 |
-
if (stream.match(/^\d+/)) { return "number";}
|
88 |
-
if (stream.match(/^\)/)) {
|
89 |
-
state.macroParameters = false;
|
90 |
-
return "keyword";
|
91 |
-
}
|
92 |
-
}
|
93 |
-
|
94 |
-
// Macros like '%{defined fedora}'
|
95 |
-
if (stream.match(/^%\{\??[\w \-\:\!]+\}/)) {
|
96 |
-
if (stream.eol()) { state.controlFlow = false; }
|
97 |
-
return "def";
|
98 |
-
}
|
99 |
-
|
100 |
-
//TODO: Include bash script sub-parser (CodeMirror supports that)
|
101 |
-
stream.next();
|
102 |
-
return null;
|
103 |
-
}
|
104 |
-
};
|
105 |
-
});
|
106 |
-
|
107 |
-
CodeMirror.defineMIME("text/x-rpm-spec", "rpm-spec");
|
108 |
-
|
109 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/vendor/codemirror/mode/rst/index.html
DELETED
@@ -1,535 +0,0 @@
|
|
1 |
-
<!doctype html>
|
2 |
-
|
3 |
-
<title>CodeMirror: reStructuredText mode</title>
|
4 |
-
<meta charset="utf-8"/>
|
5 |
-
<link rel=stylesheet href="../../doc/docs.css">
|
6 |
-
|
7 |
-
<link rel="stylesheet" href="../../lib/codemirror.css">
|
8 |
-
<script src="../../lib/codemirror.js"></script>
|
9 |
-
<script src="../../addon/mode/overlay.js"></script>
|
10 |
-
<script src="rst.js"></script>
|
11 |
-
<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
|
12 |
-
<div id=nav>
|
13 |
-
<a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
|
14 |
-
|
15 |
-
<ul>
|
16 |
-
<li><a href="../../index.html">Home</a>
|
17 |
-
<li><a href="../../doc/manual.html">Manual</a>
|
18 |
-
<li><a href="https://github.com/codemirror/codemirror">Code</a>
|
19 |
-
</ul>
|
20 |
-
<ul>
|
21 |
-
<li><a href="../index.html">Language modes</a>
|
22 |
-
<li><a class=active href="#">reStructuredText</a>
|
23 |
-
</ul>
|
24 |
-
</div>
|
25 |
-
|
26 |
-
<article>
|
27 |
-
<h2>reStructuredText mode</h2>
|
28 |
-
<form><textarea id="code" name="code">
|
29 |
-
.. This is an excerpt from Sphinx documentation: http://sphinx.pocoo.org/_sources/rest.txt
|
30 |
-
|
31 |
-
.. highlightlang:: rest
|
32 |
-
|
33 |
-
.. _rst-primer:
|
34 |
-
|
35 |
-
reStructuredText Primer
|
36 |
-
=======================
|
37 |
-
|
38 |
-
This section is a brief introduction to reStructuredText (reST) concepts and
|
39 |
-
syntax, intended to provide authors with enough information to author documents
|
40 |
-
productively. Since reST was designed to be a simple, unobtrusive markup
|
41 |
-
language, this will not take too long.
|
42 |
-
|
43 |
-
.. seealso::
|
44 |
-
|
45 |
-
The authoritative `reStructuredText User Documentation
|
46 |
-
<http://docutils.sourceforge.net/rst.html>`_. The "ref" links in this
|
47 |
-
document link to the description of the individual constructs in the reST
|
48 |
-
reference.
|
49 |
-
|
50 |
-
|
51 |
-
Paragraphs
|
52 |
-
----------
|
53 |
-
|
54 |
-
The paragraph (:duref:`ref <paragraphs>`) is the most basic block in a reST
|
55 |
-
document. Paragraphs are simply chunks of text separated by one or more blank
|
56 |
-
lines. As in Python, indentation is significant in reST, so all lines of the
|
57 |
-
same paragraph must be left-aligned to the same level of indentation.
|
58 |
-
|
59 |
-
|
60 |
-
.. _inlinemarkup:
|
61 |
-
|
62 |
-
Inline markup
|
63 |
-
-------------
|
64 |
-
|
65 |
-
The standard reST inline markup is quite simple: use
|
66 |
-
|
67 |
-
* one asterisk: ``*text*`` for emphasis (italics),
|
68 |
-
* two asterisks: ``**text**`` for strong emphasis (boldface), and
|
69 |
-
* backquotes: ````text```` for code samples.
|
70 |
-
|
71 |
-
If asterisks or backquotes appear in running text and could be confused with
|
72 |
-
inline markup delimiters, they have to be escaped with a backslash.
|
73 |
-
|
74 |
-
Be aware of some restrictions of this markup:
|
75 |
-
|
76 |
-
* it may not be nested,
|
77 |
-
* content may not start or end with whitespace: ``* text*`` is wrong,
|
78 |
-
* it must be separated from surrounding text by non-word characters. Use a
|
79 |
-
backslash escaped space to work around that: ``thisis\ *one*\ word``.
|
80 |
-
|
81 |
-
These restrictions may be lifted in future versions of the docutils.
|
82 |
-
|
83 |
-
reST also allows for custom "interpreted text roles"', which signify that the
|
84 |
-
enclosed text should be interpreted in a specific way. Sphinx uses this to
|
85 |
-
provide semantic markup and cross-referencing of identifiers, as described in
|
86 |
-
the appropriate section. The general syntax is ``:rolename:`content```.
|
87 |
-
|
88 |
-
Standard reST provides the following roles:
|
89 |
-
|
90 |
-
* :durole:`emphasis` -- alternate spelling for ``*emphasis*``
|
91 |
-
* :durole:`strong` -- alternate spelling for ``**strong**``
|
92 |
-
* :durole:`literal` -- alternate spelling for ````literal````
|
93 |
-
* :durole:`subscript` -- subscript text
|
94 |
-
* :durole:`superscript` -- superscript text
|
95 |
-
* :durole:`title-reference` -- for titles of books, periodicals, and other
|
96 |
-
materials
|
97 |
-
|
98 |
-
See :ref:`inline-markup` for roles added by Sphinx.
|
99 |
-
|
100 |
-
|
101 |
-
Lists and Quote-like blocks
|
102 |
-
---------------------------
|
103 |
-
|
104 |
-
List markup (:duref:`ref <bullet-lists>`) is natural: just place an asterisk at
|
105 |
-
the start of a paragraph and indent properly. The same goes for numbered lists;
|
106 |
-
they can also be autonumbered using a ``#`` sign::
|
107 |
-
|
108 |
-
* This is a bulleted list.
|
109 |
-
* It has two items, the second
|
110 |
-
item uses two lines.
|
111 |
-
|
112 |
-
1. This is a numbered list.
|
113 |
-
2. It has two items too.
|
114 |
-
|
115 |
-
#. This is a numbered list.
|
116 |
-
#. It has two items too.
|
117 |
-
|
118 |
-
|
119 |
-
Nested lists are possible, but be aware that they must be separated from the
|
120 |
-
parent list items by blank lines::
|
121 |
-
|
122 |
-
* this is
|
123 |
-
* a list
|
124 |
-
|
125 |
-
* with a nested list
|
126 |
-
* and some subitems
|
127 |
-
|
128 |
-
* and here the parent list continues
|
129 |
-
|
130 |
-
Definition lists (:duref:`ref <definition-lists>`) are created as follows::
|
131 |
-
|
132 |
-
term (up to a line of text)
|
133 |
-
Definition of the term, which must be indented
|
134 |
-
|
135 |
-
and can even consist of multiple paragraphs
|
136 |
-
|
137 |
-
next term
|
138 |
-
Description.
|
139 |
-
|
140 |
-
Note that the term cannot have more than one line of text.
|
141 |
-
|
142 |
-
Quoted paragraphs (:duref:`ref <block-quotes>`) are created by just indenting
|
143 |
-
them more than the surrounding paragraphs.
|
144 |
-
|
145 |
-
Line blocks (:duref:`ref <line-blocks>`) are a way of preserving line breaks::
|
146 |
-
|
147 |
-
| These lines are
|
148 |
-
| broken exactly like in
|
149 |
-
| the source file.
|
150 |
-
|
151 |
-
There are also several more special blocks available:
|
152 |
-
|
153 |
-
* field lists (:duref:`ref <field-lists>`)
|
154 |
-
* option lists (:duref:`ref <option-lists>`)
|
155 |
-
* quoted literal blocks (:duref:`ref <quoted-literal-blocks>`)
|
156 |
-
* doctest blocks (:duref:`ref <doctest-blocks>`)
|
157 |
-
|
158 |
-
|
159 |
-
Source Code
|
160 |
-
-----------
|
161 |
-
|
162 |
-
Literal code blocks (:duref:`ref <literal-blocks>`) are introduced by ending a
|
163 |
-
paragraph with the special marker ``::``. The literal block must be indented
|
164 |
-
(and, like all paragraphs, separated from the surrounding ones by blank lines)::
|
165 |
-
|
166 |
-
This is a normal text paragraph. The next paragraph is a code sample::
|
167 |
-
|
168 |
-
It is not processed in any way, except
|
169 |
-
that the indentation is removed.
|
170 |
-
|
171 |
-
It can span multiple lines.
|
172 |
-
|
173 |
-
This is a normal text paragraph again.
|
174 |
-
|
175 |
-
The handling of the ``::`` marker is smart:
|
176 |
-
|
177 |
-
* If it occurs as a paragraph of its own, that paragraph is completely left
|
178 |
-
out of the document.
|
179 |
-
* If it is preceded by whitespace, the marker is removed.
|
180 |
-
* If it is preceded by non-whitespace, the marker is replaced by a single
|
181 |
-
colon.
|
182 |
-
|
183 |
-
That way, the second sentence in the above example's first paragraph would be
|
184 |
-
rendered as "The next paragraph is a code sample:".
|
185 |
-
|
186 |
-
|
187 |
-
.. _rst-tables:
|
188 |
-
|
189 |
-
Tables
|
190 |
-
------
|
191 |
-
|
192 |
-
Two forms of tables are supported. For *grid tables* (:duref:`ref
|
193 |
-
<grid-tables>`), you have to "paint" the cell grid yourself. They look like
|
194 |
-
this::
|
195 |
-
|
196 |
-
+------------------------+------------+----------+----------+
|
197 |
-
| Header row, column 1 | Header 2 | Header 3 | Header 4 |
|
198 |
-
| (header rows optional) | | | |
|
199 |
-
+========================+============+==========+==========+
|
200 |
-
| body row 1, column 1 | column 2 | column 3 | column 4 |
|
201 |
-
+------------------------+------------+----------+----------+
|
202 |
-
| body row 2 | ... | ... | |
|
203 |
-
+------------------------+------------+----------+----------+
|
204 |
-
|
205 |
-
*Simple tables* (:duref:`ref <simple-tables>`) are easier to write, but
|
206 |
-
limited: they must contain more than one row, and the first column cannot
|
207 |
-
contain multiple lines. They look like this::
|
208 |
-
|
209 |
-
===== ===== =======
|
210 |
-
A B A and B
|
211 |
-
===== ===== =======
|
212 |
-
False False False
|
213 |
-
True False False
|
214 |
-
False True False
|
215 |
-
True True True
|
216 |
-
===== ===== =======
|
217 |
-
|
218 |
-
|
219 |
-
Hyperlinks
|
220 |
-
----------
|
221 |
-
|
222 |
-
External links
|
223 |
-
^^^^^^^^^^^^^^
|
224 |
-
|
225 |
-
Use ```Link text <http://example.com/>`_`` for inline web links. If the link
|
226 |
-
text should be the web address, you don't need special markup at all, the parser
|
227 |
-
finds links and mail addresses in ordinary text.
|
228 |
-
|
229 |
-
You can also separate the link and the target definition (:duref:`ref
|
230 |
-
<hyperlink-targets>`), like this::
|
231 |
-
|
232 |
-
This is a paragraph that contains `a link`_.
|
233 |
-
|
234 |
-
.. _a link: http://example.com/
|
235 |
-
|
236 |
-
|
237 |
-
Internal links
|
238 |
-
^^^^^^^^^^^^^^
|
239 |
-
|
240 |
-
Internal linking is done via a special reST role provided by Sphinx, see the
|
241 |
-
section on specific markup, :ref:`ref-role`.
|
242 |
-
|
243 |
-
|
244 |
-
Sections
|
245 |
-
--------
|
246 |
-
|
247 |
-
Section headers (:duref:`ref <sections>`) are created by underlining (and
|
248 |
-
optionally overlining) the section title with a punctuation character, at least
|
249 |
-
as long as the text::
|
250 |
-
|
251 |
-
=================
|
252 |
-
This is a heading
|
253 |
-
=================
|
254 |
-
|
255 |
-
Normally, there are no heading levels assigned to certain characters as the
|
256 |
-
structure is determined from the succession of headings. However, for the
|
257 |
-
Python documentation, this convention is used which you may follow:
|
258 |
-
|
259 |
-
* ``#`` with overline, for parts
|
260 |
-
* ``*`` with overline, for chapters
|
261 |
-
* ``=``, for sections
|
262 |
-
* ``-``, for subsections
|
263 |
-
* ``^``, for subsubsections
|
264 |
-
* ``"``, for paragraphs
|
265 |
-
|
266 |
-
Of course, you are free to use your own marker characters (see the reST
|
267 |
-
documentation), and use a deeper nesting level, but keep in mind that most
|
268 |
-
target formats (HTML, LaTeX) have a limited supported nesting depth.
|
269 |
-
|
270 |
-
|
271 |
-
Explicit Markup
|
272 |
-
---------------
|
273 |
-
|
274 |
-
"Explicit markup" (:duref:`ref <explicit-markup-blocks>`) is used in reST for
|
275 |
-
most constructs that need special handling, such as footnotes,
|
276 |
-
specially-highlighted paragraphs, comments, and generic directives.
|
277 |
-
|
278 |
-
An explicit markup block begins with a line starting with ``..`` followed by
|
279 |
-
whitespace and is terminated by the next paragraph at the same level of
|
280 |
-
indentation. (There needs to be a blank line between explicit markup and normal
|
281 |
-
paragraphs. This may all sound a bit complicated, but it is intuitive enough
|
282 |
-
when you write it.)
|
283 |
-
|
284 |
-
|
285 |
-
.. _directives:
|
286 |
-
|
287 |
-
Directives
|
288 |
-
----------
|
289 |
-
|
290 |
-
A directive (:duref:`ref <directives>`) is a generic block of explicit markup.
|
291 |
-
Besides roles, it is one of the extension mechanisms of reST, and Sphinx makes
|
292 |
-
heavy use of it.
|
293 |
-
|
294 |
-
Docutils supports the following directives:
|
295 |
-
|
296 |
-
* Admonitions: :dudir:`attention`, :dudir:`caution`, :dudir:`danger`,
|
297 |
-
:dudir:`error`, :dudir:`hint`, :dudir:`important`, :dudir:`note`,
|
298 |
-
:dudir:`tip`, :dudir:`warning` and the generic :dudir:`admonition`.
|
299 |
-
(Most themes style only "note" and "warning" specially.)
|
300 |
-
|
301 |
-
* Images:
|
302 |
-
|
303 |
-
- :dudir:`image` (see also Images_ below)
|
304 |
-
- :dudir:`figure` (an image with caption and optional legend)
|
305 |
-
|
306 |
-
* Additional body elements:
|
307 |
-
|
308 |
-
- :dudir:`contents` (a local, i.e. for the current file only, table of
|
309 |
-
contents)
|
310 |
-
- :dudir:`container` (a container with a custom class, useful to generate an
|
311 |
-
outer ``<div>`` in HTML)
|
312 |
-
- :dudir:`rubric` (a heading without relation to the document sectioning)
|
313 |
-
- :dudir:`topic`, :dudir:`sidebar` (special highlighted body elements)
|
314 |
-
- :dudir:`parsed-literal` (literal block that supports inline markup)
|
315 |
-
- :dudir:`epigraph` (a block quote with optional attribution line)
|
316 |
-
- :dudir:`highlights`, :dudir:`pull-quote` (block quotes with their own
|
317 |
-
class attribute)
|
318 |
-
- :dudir:`compound` (a compound paragraph)
|
319 |
-
|
320 |
-
* Special tables:
|
321 |
-
|
322 |
-
- :dudir:`table` (a table with title)
|
323 |
-
- :dudir:`csv-table` (a table generated from comma-separated values)
|
324 |
-
- :dudir:`list-table` (a table generated from a list of lists)
|
325 |
-
|
326 |
-
* Special directives:
|
327 |
-
|
328 |
-
- :dudir:`raw` (include raw target-format markup)
|
329 |
-
- :dudir:`include` (include reStructuredText from another file)
|
330 |
-
-- in Sphinx, when given an absolute include file path, this directive takes
|
331 |
-
it as relative to the source directory
|
332 |
-
- :dudir:`class` (assign a class attribute to the next element) [1]_
|
333 |
-
|
334 |
-
* HTML specifics:
|
335 |
-
|
336 |
-
- :dudir:`meta` (generation of HTML ``<meta>`` tags)
|
337 |
-
- :dudir:`title` (override document title)
|
338 |
-
|
339 |
-
* Influencing markup:
|
340 |
-
|
341 |
-
- :dudir:`default-role` (set a new default role)
|
342 |
-
- :dudir:`role` (create a new role)
|
343 |
-
|
344 |
-
Since these are only per-file, better use Sphinx' facilities for setting the
|
345 |
-
:confval:`default_role`.
|
346 |
-
|
347 |
-
Do *not* use the directives :dudir:`sectnum`, :dudir:`header` and
|
348 |
-
:dudir:`footer`.
|
349 |
-
|
350 |
-
Directives added by Sphinx are described in :ref:`sphinxmarkup`.
|
351 |
-
|
352 |
-
Basically, a directive consists of a name, arguments, options and content. (Keep
|
353 |
-
this terminology in mind, it is used in the next chapter describing custom
|
354 |
-
directives.) Looking at this example, ::
|
355 |
-
|
356 |
-
.. function:: foo(x)
|
357 |
-
foo(y, z)
|
358 |
-
:module: some.module.name
|
359 |
-
|
360 |
-
Return a line of text input from the user.
|
361 |
-
|
362 |
-
``function`` is the directive name. It is given two arguments here, the
|
363 |
-
remainder of the first line and the second line, as well as one option
|
364 |
-
``module`` (as you can see, options are given in the lines immediately following
|
365 |
-
the arguments and indicated by the colons). Options must be indented to the
|
366 |
-
same level as the directive content.
|
367 |
-
|
368 |
-
The directive content follows after a blank line and is indented relative to the
|
369 |
-
directive start.
|
370 |
-
|
371 |
-
|
372 |
-
Images
|
373 |
-
------
|
374 |
-
|
375 |
-
reST supports an image directive (:dudir:`ref <image>`), used like so::
|
376 |
-
|
377 |
-
.. image:: gnu.png
|
378 |
-
(options)
|
379 |
-
|
380 |
-
When used within Sphinx, the file name given (here ``gnu.png``) must either be
|
381 |
-
relative to the source file, or absolute which means that they are relative to
|
382 |
-
the top source directory. For example, the file ``sketch/spam.rst`` could refer
|
383 |
-
to the image ``images/spam.png`` as ``../images/spam.png`` or
|
384 |
-
``/images/spam.png``.
|
385 |
-
|
386 |
-
Sphinx will automatically copy image files over to a subdirectory of the output
|
387 |
-
directory on building (e.g. the ``_static`` directory for HTML output.)
|
388 |
-
|
389 |
-
Interpretation of image size options (``width`` and ``height``) is as follows:
|
390 |
-
if the size has no unit or the unit is pixels, the given size will only be
|
391 |
-
respected for output channels that support pixels (i.e. not in LaTeX output).
|
392 |
-
Other units (like ``pt`` for points) will be used for HTML and LaTeX output.
|
393 |
-
|
394 |
-
Sphinx extends the standard docutils behavior by allowing an asterisk for the
|
395 |
-
extension::
|
396 |
-
|
397 |
-
.. image:: gnu.*
|
398 |
-
|
399 |
-
Sphinx then searches for all images matching the provided pattern and determines
|
400 |
-
their type. Each builder then chooses the best image out of these candidates.
|
401 |
-
For instance, if the file name ``gnu.*`` was given and two files :file:`gnu.pdf`
|
402 |
-
and :file:`gnu.png` existed in the source tree, the LaTeX builder would choose
|
403 |
-
the former, while the HTML builder would prefer the latter.
|
404 |
-
|
405 |
-
.. versionchanged:: 0.4
|
406 |
-
Added the support for file names ending in an asterisk.
|
407 |
-
|
408 |
-
.. versionchanged:: 0.6
|
409 |
-
Image paths can now be absolute.
|
410 |
-
|
411 |
-
|
412 |
-
Footnotes
|
413 |
-
---------
|
414 |
-
|
415 |
-
For footnotes (:duref:`ref <footnotes>`), use ``[#name]_`` to mark the footnote
|
416 |
-
location, and add the footnote body at the bottom of the document after a
|
417 |
-
"Footnotes" rubric heading, like so::
|
418 |
-
|
419 |
-
Lorem ipsum [#f1]_ dolor sit amet ... [#f2]_
|
420 |
-
|
421 |
-
.. rubric:: Footnotes
|
422 |
-
|
423 |
-
.. [#f1] Text of the first footnote.
|
424 |
-
.. [#f2] Text of the second footnote.
|
425 |
-
|
426 |
-
You can also explicitly number the footnotes (``[1]_``) or use auto-numbered
|
427 |
-
footnotes without names (``[#]_``).
|
428 |
-
|
429 |
-
|
430 |
-
Citations
|
431 |
-
---------
|
432 |
-
|
433 |
-
Standard reST citations (:duref:`ref <citations>`) are supported, with the
|
434 |
-
additional feature that they are "global", i.e. all citations can be referenced
|
435 |
-
from all files. Use them like so::
|
436 |
-
|
437 |
-
Lorem ipsum [Ref]_ dolor sit amet.
|
438 |
-
|
439 |
-
.. [Ref] Book or article reference, URL or whatever.
|
440 |
-
|
441 |
-
Citation usage is similar to footnote usage, but with a label that is not
|
442 |
-
numeric or begins with ``#``.
|
443 |
-
|
444 |
-
|
445 |
-
Substitutions
|
446 |
-
-------------
|
447 |
-
|
448 |
-
reST supports "substitutions" (:duref:`ref <substitution-definitions>`), which
|
449 |
-
are pieces of text and/or markup referred to in the text by ``|name|``. They
|
450 |
-
are defined like footnotes with explicit markup blocks, like this::
|
451 |
-
|
452 |
-
.. |name| replace:: replacement *text*
|
453 |
-
|
454 |
-
or this::
|
455 |
-
|
456 |
-
.. |caution| image:: warning.png
|
457 |
-
:alt: Warning!
|
458 |
-
|
459 |
-
See the :duref:`reST reference for substitutions <substitution-definitions>`
|
460 |
-
for details.
|
461 |
-
|
462 |
-
If you want to use some substitutions for all documents, put them into
|
463 |
-
:confval:`rst_prolog` or put them into a separate file and include it into all
|
464 |
-
documents you want to use them in, using the :rst:dir:`include` directive. (Be
|
465 |
-
sure to give the include file a file name extension differing from that of other
|
466 |
-
source files, to avoid Sphinx finding it as a standalone document.)
|
467 |
-
|
468 |
-
Sphinx defines some default substitutions, see :ref:`default-substitutions`.
|
469 |
-
|
470 |
-
|
471 |
-
Comments
|
472 |
-
--------
|
473 |
-
|
474 |
-
Every explicit markup block which isn't a valid markup construct (like the
|
475 |
-
footnotes above) is regarded as a comment (:duref:`ref <comments>`). For
|
476 |
-
example::
|
477 |
-
|
478 |
-
.. This is a comment.
|
479 |
-
|
480 |
-
You can indent text after a comment start to form multiline comments::
|
481 |
-
|
482 |
-
..
|
483 |
-
This whole indented block
|
484 |
-
is a comment.
|
485 |
-
|
486 |
-
Still in the comment.
|
487 |
-
|
488 |
-
|
489 |
-
Source encoding
|
490 |
-
---------------
|
491 |
-
|
492 |
-
Since the easiest way to include special characters like em dashes or copyright
|
493 |
-
signs in reST is to directly write them as Unicode characters, one has to
|
494 |
-
specify an encoding. Sphinx assumes source files to be encoded in UTF-8 by
|
495 |
-
default; you can change this with the :confval:`source_encoding` config value.
|
496 |
-
|
497 |
-
|
498 |
-
Gotchas
|
499 |
-
-------
|
500 |
-
|
501 |
-
There are some problems one commonly runs into while authoring reST documents:
|
502 |
-
|
503 |
-
* **Separation of inline markup:** As said above, inline markup spans must be
|
504 |
-
separated from the surrounding text by non-word characters, you have to use a
|
505 |
-
backslash-escaped space to get around that. See `the reference
|
506 |
-
<http://docutils.sf.net/docs/ref/rst/restructuredtext.html#inline-markup>`_
|
507 |
-
for the details.
|
508 |
-
|
509 |
-
* **No nested inline markup:** Something like ``*see :func:`foo`*`` is not
|
510 |
-
possible.
|
511 |
-
|
512 |
-
|
513 |
-
.. rubric:: Footnotes
|
514 |
-
|
515 |
-
.. [1] When the default domain contains a :rst:dir:`class` directive, this directive
|
516 |
-
will be shadowed. Therefore, Sphinx re-exports it as :rst:dir:`rst-class`.
|
517 |
-
</textarea></form>
|
518 |
-
|
519 |
-
<script>
|
520 |
-
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
|
521 |
-
lineNumbers: true,
|
522 |
-
});
|
523 |
-
</script>
|
524 |
-
<p>
|
525 |
-
The <code>python</code> mode will be used for highlighting blocks
|
526 |
-
containing Python/IPython terminal sessions: blocks starting with
|
527 |
-
<code>>>></code> (for Python) or <code>In [num]:</code> (for
|
528 |
-
IPython).
|
529 |
-
|
530 |
-
Further, the <code>stex</code> mode will be used for highlighting
|
531 |
-
blocks containing LaTex code.
|
532 |
-
</p>
|
533 |
-
|
534 |
-
<p><strong>MIME types defined:</strong> <code>text/x-rst</code>.</p>
|
535 |
-
</article>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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-
// 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("../python/python"), require("../stex/stex"), require("../../addon/mode/overlay"));
|
7 |
-
else if (typeof define == "function" && define.amd) // AMD
|
8 |
-
define(["../../lib/codemirror", "../python/python", "../stex/stex", "../../addon/mode/overlay"], mod);
|
9 |
-
else // Plain browser env
|
10 |
-
mod(CodeMirror);
|
11 |
-
})(function(CodeMirror) {
|
12 |
-
"use strict";
|
13 |
-
|
14 |
-
CodeMirror.defineMode('rst', function (config, options) {
|
15 |
-
|
16 |
-
var rx_strong = /^\*\*[^\*\s](?:[^\*]*[^\*\s])?\*\*/;
|
17 |
-
var rx_emphasis = /^\*[^\*\s](?:[^\*]*[^\*\s])?\*/;
|
18 |
-
var rx_literal = /^``[^`\s](?:[^`]*[^`\s])``/;
|
19 |
-
|
20 |
-
var rx_number = /^(?:[\d]+(?:[\.,]\d+)*)/;
|
21 |
-
var rx_positive = /^(?:\s\+[\d]+(?:[\.,]\d+)*)/;
|
22 |
-
var rx_negative = /^(?:\s\-[\d]+(?:[\.,]\d+)*)/;
|
23 |
-
|
24 |
-
var rx_uri_protocol = "[Hh][Tt][Tt][Pp][Ss]?://";
|
25 |
-
var rx_uri_domain = "(?:[\\d\\w.-]+)\\.(?:\\w{2,6})";
|
26 |
-
var rx_uri_path = "(?:/[\\d\\w\\#\\%\\&\\-\\.\\,\\/\\:\\=\\?\\~]+)*";
|
27 |
-
var rx_uri = new RegExp("^" + rx_uri_protocol + rx_uri_domain + rx_uri_path);
|
28 |
-
|
29 |
-
var overlay = {
|
30 |
-
token: function (stream) {
|
31 |
-
|
32 |
-
if (stream.match(rx_strong) && stream.match (/\W+|$/, false))
|
33 |
-
return 'strong';
|
34 |
-
if (stream.match(rx_emphasis) && stream.match (/\W+|$/, false))
|
35 |
-
return 'em';
|
36 |
-
if (stream.match(rx_literal) && stream.match (/\W+|$/, false))
|
37 |
-
return 'string-2';
|
38 |
-
if (stream.match(rx_number))
|
39 |
-
return 'number';
|
40 |
-
if (stream.match(rx_positive))
|
41 |
-
return 'positive';
|
42 |
-
if (stream.match(rx_negative))
|
43 |
-
return 'negative';
|
44 |
-
if (stream.match(rx_uri))
|
45 |
-
return 'link';
|
46 |
-
|
47 |
-
while (stream.next() != null) {
|
48 |
-
if (stream.match(rx_strong, false)) break;
|
49 |
-
if (stream.match(rx_emphasis, false)) break;
|
50 |
-
if (stream.match(rx_literal, false)) break;
|
51 |
-
if (stream.match(rx_number, false)) break;
|
52 |
-
if (stream.match(rx_positive, false)) break;
|
53 |
-
if (stream.match(rx_negative, false)) break;
|
54 |
-
if (stream.match(rx_uri, false)) break;
|
55 |
-
}
|
56 |
-
|
57 |
-
return null;
|
58 |
-
}
|
59 |
-
};
|
60 |
-
|
61 |
-
var mode = CodeMirror.getMode(
|
62 |
-
config, options.backdrop || 'rst-base'
|
63 |
-
);
|
64 |
-
|
65 |
-
return CodeMirror.overlayMode(mode, overlay, true); // combine
|
66 |
-
}, 'python', 'stex');
|
67 |
-
|
68 |
-
///////////////////////////////////////////////////////////////////////////////
|
69 |
-
///////////////////////////////////////////////////////////////////////////////
|
70 |
-
|
71 |
-
CodeMirror.defineMode('rst-base', function (config) {
|
72 |
-
|
73 |
-
///////////////////////////////////////////////////////////////////////////
|
74 |
-
///////////////////////////////////////////////////////////////////////////
|
75 |
-
|
76 |
-
function format(string) {
|
77 |
-
var args = Array.prototype.slice.call(arguments, 1);
|
78 |
-
return string.replace(/{(\d+)}/g, function (match, n) {
|
79 |
-
return typeof args[n] != 'undefined' ? args[n] : match;
|
80 |
-
});
|
81 |
-
}
|
82 |
-
|
83 |
-
///////////////////////////////////////////////////////////////////////////
|
84 |
-
///////////////////////////////////////////////////////////////////////////
|
85 |
-
|
86 |
-
var mode_python = CodeMirror.getMode(config, 'python');
|
87 |
-
var mode_stex = CodeMirror.getMode(config, 'stex');
|
88 |
-
|
89 |
-
///////////////////////////////////////////////////////////////////////////
|
90 |
-
///////////////////////////////////////////////////////////////////////////
|
91 |
-
|
92 |
-
var SEPA = "\\s+";
|
93 |
-
var TAIL = "(?:\\s*|\\W|$)",
|
94 |
-
rx_TAIL = new RegExp(format('^{0}', TAIL));
|
95 |
-
|
96 |
-
var NAME =
|
97 |
-
"(?:[^\\W\\d_](?:[\\w!\"#$%&'()\\*\\+,\\-\\.\/:;<=>\\?]*[^\\W_])?)",
|
98 |
-
rx_NAME = new RegExp(format('^{0}', NAME));
|
99 |
-
var NAME_WWS =
|
100 |
-
"(?:[^\\W\\d_](?:[\\w\\s!\"#$%&'()\\*\\+,\\-\\.\/:;<=>\\?]*[^\\W_])?)";
|
101 |
-
var REF_NAME = format('(?:{0}|`{1}`)', NAME, NAME_WWS);
|
102 |
-
|
103 |
-
var TEXT1 = "(?:[^\\s\\|](?:[^\\|]*[^\\s\\|])?)";
|
104 |
-
var TEXT2 = "(?:[^\\`]+)",
|
105 |
-
rx_TEXT2 = new RegExp(format('^{0}', TEXT2));
|
106 |
-
|
107 |
-
var rx_section = new RegExp(
|
108 |
-
"^([!'#$%&\"()*+,-./:;<=>?@\\[\\\\\\]^_`{|}~])\\1{3,}\\s*$");
|
109 |
-
var rx_explicit = new RegExp(
|
110 |
-
format('^\\.\\.{0}', SEPA));
|
111 |
-
var rx_link = new RegExp(
|
112 |
-
format('^_{0}:{1}|^__:{1}', REF_NAME, TAIL));
|
113 |
-
var rx_directive = new RegExp(
|
114 |
-
format('^{0}::{1}', REF_NAME, TAIL));
|
115 |
-
var rx_substitution = new RegExp(
|
116 |
-
format('^\\|{0}\\|{1}{2}::{3}', TEXT1, SEPA, REF_NAME, TAIL));
|
117 |
-
var rx_footnote = new RegExp(
|
118 |
-
format('^\\[(?:\\d+|#{0}?|\\*)]{1}', REF_NAME, TAIL));
|
119 |
-
var rx_citation = new RegExp(
|
120 |
-
format('^\\[{0}\\]{1}', REF_NAME, TAIL));
|
121 |
-
|
122 |
-
var rx_substitution_ref = new RegExp(
|
123 |
-
format('^\\|{0}\\|', TEXT1));
|
124 |
-
var rx_footnote_ref = new RegExp(
|
125 |
-
format('^\\[(?:\\d+|#{0}?|\\*)]_', REF_NAME));
|
126 |
-
var rx_citation_ref = new RegExp(
|
127 |
-
format('^\\[{0}\\]_', REF_NAME));
|
128 |
-
var rx_link_ref1 = new RegExp(
|
129 |
-
format('^{0}__?', REF_NAME));
|
130 |
-
var rx_link_ref2 = new RegExp(
|
131 |
-
format('^`{0}`_', TEXT2));
|
132 |
-
|
133 |
-
var rx_role_pre = new RegExp(
|
134 |
-
format('^:{0}:`{1}`{2}', NAME, TEXT2, TAIL));
|
135 |
-
var rx_role_suf = new RegExp(
|
136 |
-
format('^`{1}`:{0}:{2}', NAME, TEXT2, TAIL));
|
137 |
-
var rx_role = new RegExp(
|
138 |
-
format('^:{0}:{1}', NAME, TAIL));
|
139 |
-
|
140 |
-
var rx_directive_name = new RegExp(format('^{0}', REF_NAME));
|
141 |
-
var rx_directive_tail = new RegExp(format('^::{0}', TAIL));
|
142 |
-
var rx_substitution_text = new RegExp(format('^\\|{0}\\|', TEXT1));
|
143 |
-
var rx_substitution_sepa = new RegExp(format('^{0}', SEPA));
|
144 |
-
var rx_substitution_name = new RegExp(format('^{0}', REF_NAME));
|
145 |
-
var rx_substitution_tail = new RegExp(format('^::{0}', TAIL));
|
146 |
-
var rx_link_head = new RegExp("^_");
|
147 |
-
var rx_link_name = new RegExp(format('^{0}|_', REF_NAME));
|
148 |
-
var rx_link_tail = new RegExp(format('^:{0}', TAIL));
|
149 |
-
|
150 |
-
var rx_verbatim = new RegExp('^::\\s*$');
|
151 |
-
var rx_examples = new RegExp('^\\s+(?:>>>|In \\[\\d+\\]:)\\s');
|
152 |
-
|
153 |
-
///////////////////////////////////////////////////////////////////////////
|
154 |
-
///////////////////////////////////////////////////////////////////////////
|
155 |
-
|
156 |
-
function to_normal(stream, state) {
|
157 |
-
var token = null;
|
158 |
-
|
159 |
-
if (stream.sol() && stream.match(rx_examples, false)) {
|
160 |
-
change(state, to_mode, {
|
161 |
-
mode: mode_python, local: CodeMirror.startState(mode_python)
|
162 |
-
});
|
163 |
-
} else if (stream.sol() && stream.match(rx_explicit)) {
|
164 |
-
change(state, to_explicit);
|
165 |
-
token = 'meta';
|
166 |
-
} else if (stream.sol() && stream.match(rx_section)) {
|
167 |
-
change(state, to_normal);
|
168 |
-
token = 'header';
|
169 |
-
} else if (phase(state) == rx_role_pre ||
|
170 |
-
stream.match(rx_role_pre, false)) {
|
171 |
-
|
172 |
-
switch (stage(state)) {
|
173 |
-
case 0:
|
174 |
-
change(state, to_normal, context(rx_role_pre, 1));
|
175 |
-
stream.match(/^:/);
|
176 |
-
token = 'meta';
|
177 |
-
break;
|
178 |
-
case 1:
|
179 |
-
change(state, to_normal, context(rx_role_pre, 2));
|
180 |
-
stream.match(rx_NAME);
|
181 |
-
token = 'keyword';
|
182 |
-
|
183 |
-
if (stream.current().match(/^(?:math|latex)/)) {
|
184 |
-
state.tmp_stex = true;
|
185 |
-
}
|
186 |
-
break;
|
187 |
-
case 2:
|
188 |
-
change(state, to_normal, context(rx_role_pre, 3));
|
189 |
-
stream.match(/^:`/);
|
190 |
-
token = 'meta';
|
191 |
-
break;
|
192 |
-
case 3:
|
193 |
-
if (state.tmp_stex) {
|
194 |
-
state.tmp_stex = undefined; state.tmp = {
|
195 |
-
mode: mode_stex, local: CodeMirror.startState(mode_stex)
|
196 |
-
};
|
197 |
-
}
|
198 |
-
|
199 |
-
if (state.tmp) {
|
200 |
-
if (stream.peek() == '`') {
|
201 |
-
change(state, to_normal, context(rx_role_pre, 4));
|
202 |
-
state.tmp = undefined;
|
203 |
-
break;
|
204 |
-
}
|
205 |
-
|
206 |
-
token = state.tmp.mode.token(stream, state.tmp.local);
|
207 |
-
break;
|
208 |
-
}
|
209 |
-
|
210 |
-
change(state, to_normal, context(rx_role_pre, 4));
|
211 |
-
stream.match(rx_TEXT2);
|
212 |
-
token = 'string';
|
213 |
-
break;
|
214 |
-
case 4:
|
215 |
-
change(state, to_normal, context(rx_role_pre, 5));
|
216 |
-
stream.match(/^`/);
|
217 |
-
token = 'meta';
|
218 |
-
break;
|
219 |
-
case 5:
|
220 |
-
change(state, to_normal, context(rx_role_pre, 6));
|
221 |
-
stream.match(rx_TAIL);
|
222 |
-
break;
|
223 |
-
default:
|
224 |
-
change(state, to_normal);
|
225 |
-
}
|
226 |
-
} else if (phase(state) == rx_role_suf ||
|
227 |
-
stream.match(rx_role_suf, false)) {
|
228 |
-
|
229 |
-
switch (stage(state)) {
|
230 |
-
case 0:
|
231 |
-
change(state, to_normal, context(rx_role_suf, 1));
|
232 |
-
stream.match(/^`/);
|
233 |
-
token = 'meta';
|
234 |
-
break;
|
235 |
-
case 1:
|
236 |
-
change(state, to_normal, context(rx_role_suf, 2));
|
237 |
-
stream.match(rx_TEXT2);
|
238 |
-
token = 'string';
|
239 |
-
break;
|
240 |
-
case 2:
|
241 |
-
change(state, to_normal, context(rx_role_suf, 3));
|
242 |
-
stream.match(/^`:/);
|
243 |
-
token = 'meta';
|
244 |
-
break;
|
245 |
-
case 3:
|
246 |
-
change(state, to_normal, context(rx_role_suf, 4));
|
247 |
-
stream.match(rx_NAME);
|
248 |
-
token = 'keyword';
|
249 |
-
break;
|
250 |
-
case 4:
|
251 |
-
change(state, to_normal, context(rx_role_suf, 5));
|
252 |
-
stream.match(/^:/);
|
253 |
-
token = 'meta';
|
254 |
-
break;
|
255 |
-
case 5:
|
256 |
-
change(state, to_normal, context(rx_role_suf, 6));
|
257 |
-
stream.match(rx_TAIL);
|
258 |
-
break;
|
259 |
-
default:
|
260 |
-
change(state, to_normal);
|
261 |
-
}
|
262 |
-
} else if (phase(state) == rx_role || stream.match(rx_role, false)) {
|
263 |
-
|
264 |
-
switch (stage(state)) {
|
265 |
-
case 0:
|
266 |
-
change(state, to_normal, context(rx_role, 1));
|
267 |
-
stream.match(/^:/);
|
268 |
-
token = 'meta';
|
269 |
-
break;
|
270 |
-
case 1:
|
271 |
-
change(state, to_normal, context(rx_role, 2));
|
272 |
-
stream.match(rx_NAME);
|
273 |
-
token = 'keyword';
|
274 |
-
break;
|
275 |
-
case 2:
|
276 |
-
change(state, to_normal, context(rx_role, 3));
|
277 |
-
stream.match(/^:/);
|
278 |
-
token = 'meta';
|
279 |
-
break;
|
280 |
-
case 3:
|
281 |
-
change(state, to_normal, context(rx_role, 4));
|
282 |
-
stream.match(rx_TAIL);
|
283 |
-
break;
|
284 |
-
default:
|
285 |
-
change(state, to_normal);
|
286 |
-
}
|
287 |
-
} else if (phase(state) == rx_substitution_ref ||
|
288 |
-
stream.match(rx_substitution_ref, false)) {
|
289 |
-
|
290 |
-
switch (stage(state)) {
|
291 |
-
case 0:
|
292 |
-
change(state, to_normal, context(rx_substitution_ref, 1));
|
293 |
-
stream.match(rx_substitution_text);
|
294 |
-
token = 'variable-2';
|
295 |
-
break;
|
296 |
-
case 1:
|
297 |
-
change(state, to_normal, context(rx_substitution_ref, 2));
|
298 |
-
if (stream.match(/^_?_?/)) token = 'link';
|
299 |
-
break;
|
300 |
-
default:
|
301 |
-
change(state, to_normal);
|
302 |
-
}
|
303 |
-
} else if (stream.match(rx_footnote_ref)) {
|
304 |
-
change(state, to_normal);
|
305 |
-
token = 'quote';
|
306 |
-
} else if (stream.match(rx_citation_ref)) {
|
307 |
-
change(state, to_normal);
|
308 |
-
token = 'quote';
|
309 |
-
} else if (stream.match(rx_link_ref1)) {
|
310 |
-
change(state, to_normal);
|
311 |
-
if (!stream.peek() || stream.peek().match(/^\W$/)) {
|
312 |
-
token = 'link';
|
313 |
-
}
|
314 |
-
} else if (phase(state) == rx_link_ref2 ||
|
315 |
-
stream.match(rx_link_ref2, false)) {
|
316 |
-
|
317 |
-
switch (stage(state)) {
|
318 |
-
case 0:
|
319 |
-
if (!stream.peek() || stream.peek().match(/^\W$/)) {
|
320 |
-
change(state, to_normal, context(rx_link_ref2, 1));
|
321 |
-
} else {
|
322 |
-
stream.match(rx_link_ref2);
|
323 |
-
}
|
324 |
-
break;
|
325 |
-
case 1:
|
326 |
-
change(state, to_normal, context(rx_link_ref2, 2));
|
327 |
-
stream.match(/^`/);
|
328 |
-
token = 'link';
|
329 |
-
break;
|
330 |
-
case 2:
|
331 |
-
change(state, to_normal, context(rx_link_ref2, 3));
|
332 |
-
stream.match(rx_TEXT2);
|
333 |
-
break;
|
334 |
-
case 3:
|
335 |
-
change(state, to_normal, context(rx_link_ref2, 4));
|
336 |
-
stream.match(/^`_/);
|
337 |
-
token = 'link';
|
338 |
-
break;
|
339 |
-
default:
|
340 |
-
change(state, to_normal);
|
341 |
-
}
|
342 |
-
} else if (stream.match(rx_verbatim)) {
|
343 |
-
change(state, to_verbatim);
|
344 |
-
}
|
345 |
-
|
346 |
-
else {
|
347 |
-
if (stream.next()) change(state, to_normal);
|
348 |
-
}
|
349 |
-
|
350 |
-
return token;
|
351 |
-
}
|
352 |
-
|
353 |
-
///////////////////////////////////////////////////////////////////////////
|
354 |
-
///////////////////////////////////////////////////////////////////////////
|
355 |
-
|
356 |
-
function to_explicit(stream, state) {
|
357 |
-
var token = null;
|
358 |
-
|
359 |
-
if (phase(state) == rx_substitution ||
|
360 |
-
stream.match(rx_substitution, false)) {
|
361 |
-
|
362 |
-
switch (stage(state)) {
|
363 |
-
case 0:
|
364 |
-
change(state, to_explicit, context(rx_substitution, 1));
|
365 |
-
stream.match(rx_substitution_text);
|
366 |
-
token = 'variable-2';
|
367 |
-
break;
|
368 |
-
case 1:
|
369 |
-
change(state, to_explicit, context(rx_substitution, 2));
|
370 |
-
stream.match(rx_substitution_sepa);
|
371 |
-
break;
|
372 |
-
case 2:
|
373 |
-
change(state, to_explicit, context(rx_substitution, 3));
|
374 |
-
stream.match(rx_substitution_name);
|
375 |
-
token = 'keyword';
|
376 |
-
break;
|
377 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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