@vc-shell/framework 1.1.2 → 1.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/dist/apl-B2DGVGxc.js +76 -0
- package/dist/asciiarmor-2LVJmxlE.js +34 -0
- package/dist/asn1-jKiBa2Ya.js +95 -0
- package/dist/asterisk-DS281yxp.js +271 -0
- package/dist/brainfuck-C_p9pTT8.js +34 -0
- package/dist/clike-BUuHEmgZ.js +620 -0
- package/dist/clojure-CCKyeQKf.js +800 -0
- package/dist/cmake-CuaCgAKt.js +28 -0
- package/dist/cobol-BlTKFDRj.js +72 -0
- package/dist/coffeescript-BVCvwO8I.js +179 -0
- package/dist/commonlisp-D_kxz07b.js +75 -0
- package/dist/crystal-D309uH6_.js +217 -0
- package/dist/css-bIlmDBTK.js +1560 -0
- package/dist/cypher-BMq4Fwjl.js +68 -0
- package/dist/d-BZcgY6La.js +127 -0
- package/dist/diff-Cg9d_RX2.js +18 -0
- package/dist/{assets/dockerfile-D0MivFIF.js → dockerfile-DIy8NleC.js} +36 -41
- package/dist/dtd-CtLokQ-U.js +84 -0
- package/dist/dylan-QYeExnWK.js +234 -0
- package/dist/ebnf-DUPDuY4r.js +78 -0
- package/dist/ecl-CiXN-g_D.js +121 -0
- package/dist/eiffel-yQhjl4T1.js +110 -0
- package/dist/elm-CNT9vbN0.js +108 -0
- package/dist/erlang-CFOYdy9e.js +487 -0
- package/dist/factor-DDOC7X6P.js +65 -0
- package/dist/fcl-CPC2WYrI.js +103 -0
- package/dist/forth-BmxRyE9S.js +60 -0
- package/dist/fortran-9bvPyrOW.js +442 -0
- package/dist/framework.js +288 -29
- package/dist/gas-BdfkXJT_.js +183 -0
- package/dist/gherkin-CJuwpceU.js +34 -0
- package/dist/groovy-DZeT_VM-.js +146 -0
- package/dist/haskell-Bvt3Qq1t.js +375 -0
- package/dist/haxe-70NVW1pR.js +359 -0
- package/dist/http-D9LttvKF.js +44 -0
- package/dist/idl-B6TRFYjl.js +947 -0
- package/dist/{assets/index-BKF-A58l.js → index-BBYKbiRX.js} +79 -92
- package/dist/index-BDm0tcWn.js +145680 -0
- package/dist/{assets/index-CeeaNa4F.js → index-BDqUaIyQ.js} +136 -167
- package/dist/index-BdflTsg6.js +308 -0
- package/dist/{assets/index-CtmpJVwa.js → index-BpBTtmQ6.js} +270 -312
- package/dist/index-Br0y2YMn.js +58 -0
- package/dist/index-CIcET-ZI.js +71 -0
- package/dist/index-CYAMpxnu.js +341 -0
- package/dist/index-Cf2H7YZ1.js +98 -0
- package/dist/{assets/index-Bv_z_qRq.js → index-Ck055pN8.js} +121 -124
- package/dist/index-D-fPN3yf.js +75 -0
- package/dist/{assets/index-BT8o9-M5.js → index-DJOis7Nc.js} +267 -386
- package/dist/index-DKtQMsy4.js +538 -0
- package/dist/{assets/index-DMTL7O1s.js → index-DWTsz5bC.js} +570 -586
- package/dist/{assets/index-C7zlEJy8.js → index-DuY7BIGm.js} +229 -302
- package/dist/{assets/index-B1srGfDb.js → index-o6aSdNED.js} +119 -165
- package/dist/index-wfv8ehcx.js +249 -0
- package/dist/index.css +9 -18
- package/dist/javascript-WMWNx-Vj.js +690 -0
- package/dist/jinja2-DnB6dQmV.js +154 -0
- package/dist/julia-DpvXAuO6.js +241 -0
- package/dist/livescript-CanGTf8u.js +272 -0
- package/dist/lua-XplVlWi_.js +217 -0
- package/dist/mathematica-jaRHnSxC.js +35 -0
- package/dist/mbox-BctzC1hL.js +76 -0
- package/dist/mirc-CFBPAOaF.js +72 -0
- package/dist/mllike-BSnXJBGA.js +272 -0
- package/dist/modelica-vUgVs--1.js +93 -0
- package/dist/mscgen-Cpl0NYLN.js +104 -0
- package/dist/mumps-CQoS1kWX.js +25 -0
- package/dist/nginx-zDPm3Z74.js +89 -0
- package/dist/nsis-fePjrhq7.js +62 -0
- package/dist/ntriples-CsNjv2QF.js +79 -0
- package/dist/octave-C8PmmSRH.js +143 -0
- package/dist/oz-Ce8aN8oE.js +151 -0
- package/dist/pascal-De0D6mP7.js +77 -0
- package/dist/perl-B4bSCe1C.js +915 -0
- package/dist/pig-D24Z8EXi.js +54 -0
- package/dist/powershell-DkYVfTzP.js +249 -0
- package/dist/properties-Dn9wna3M.js +26 -0
- package/dist/protobuf-BPIjwpzm.js +49 -0
- package/dist/pug-BqUR2bBq.js +248 -0
- package/dist/puppet-nyd4dhjf.js +45 -0
- package/dist/python-B5QdSKoL.js +313 -0
- package/dist/q-DXjKs-tC.js +83 -0
- package/dist/r-LKEuhEGI.js +104 -0
- package/dist/rpm-IznJm2Xc.js +57 -0
- package/dist/ruby-CcYfvIk6.js +228 -0
- package/dist/sas-7E8yHoCW.js +105 -0
- package/dist/scheme-DjibxsNh.js +124 -0
- package/dist/shell-C0C2sNA_.js +182 -0
- package/dist/sieve-Bwz7vjP5.js +72 -0
- package/dist/simple-mode-B0dvCdAA.js +89 -0
- package/dist/smalltalk-Bhddl2pB.js +48 -0
- package/dist/solr-BNlsLglM.js +41 -0
- package/dist/sparql-FarWu_Gb.js +197 -0
- package/dist/spreadsheet-C-cy4P5N.js +49 -0
- package/dist/sql-mMre1Bo3.js +282 -0
- package/dist/stex-92raWT1r.js +129 -0
- package/dist/stylus-CAdqWld3.js +250 -0
- package/dist/swift-DSxqR9R6.js +230 -0
- package/dist/tcl-xfoLljhY.js +81 -0
- package/dist/textile-D1AWE-pc.js +295 -0
- package/dist/tiddlywiki-5wqsXtSk.js +155 -0
- package/dist/tiki-__Kn3CeS.js +181 -0
- package/dist/toml-BHiuTcfn.js +49 -0
- package/dist/troff-D2UO-fKf.js +35 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/ttcn-Bsa4sfRm.js +123 -0
- package/dist/ttcn-cfg-Bac_acMi.js +88 -0
- package/dist/turtle-xwJUxoPV.js +80 -0
- package/dist/ui/components/atoms/vc-widget/vc-widget.vue.d.ts.map +1 -1
- package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/vc-blade-toolbar.vue.d.ts.map +1 -1
- package/dist/vb-c2kQGd6-.js +74 -0
- package/dist/vbscript-Dz1TtKsy.js +324 -0
- package/dist/velocity-DJd0pTTC.js +96 -0
- package/dist/verilog-C4VGD9n1.js +263 -0
- package/dist/vhdl-T9HkrbI2.js +106 -0
- package/dist/webidl-CjfDENEo.js +155 -0
- package/dist/xquery-BUQdORAS.js +422 -0
- package/dist/yacas-C0absKBh.js +73 -0
- package/dist/z80-C8rPtw-0.js +61 -0
- package/package.json +4 -4
- package/ui/components/atoms/vc-widget/vc-widget.vue +2 -0
- package/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/vc-blade-toolbar.vue +65 -32
- package/dist/assets/apl-NdZ6-T1z.js +0 -142
- package/dist/assets/asciiarmor-CmJEbAuq.js +0 -56
- package/dist/assets/asn1-Ctc8K72v.js +0 -192
- package/dist/assets/asterisk-D6r__RMF.js +0 -187
- package/dist/assets/brainfuck-COwWCBpq.js +0 -70
- package/dist/assets/clike-C-PtfL50.js +0 -1019
- package/dist/assets/clojure-C2XPrGCa.js +0 -274
- package/dist/assets/cmake-BGrEgXCL.js +0 -81
- package/dist/assets/cobol-DShPmpZe.js +0 -234
- package/dist/assets/coffeescript-BG8vTfSz.js +0 -329
- package/dist/assets/commonlisp-8oE2EpEe.js +0 -108
- package/dist/assets/core-api-BMLS9FrT.js +0 -8288
- package/dist/assets/core-composables-DYxpIWyY.js +0 -1799
- package/dist/assets/core-constants-DiKDBbnD.js +0 -83
- package/dist/assets/core-directives-QhJx9kWh.js +0 -41
- package/dist/assets/core-interceptors-CSjUvxQ0.js +0 -78
- package/dist/assets/core-plugins-wv2bDZ0l.js +0 -4919
- package/dist/assets/core-services-CAfJRsjs.js +0 -4
- package/dist/assets/core-utilities-BTktq_a-.js +0 -33
- package/dist/assets/crystal--rIRMl16.js +0 -419
- package/dist/assets/css/core-directives-FL4vIIkN.css +0 -73
- package/dist/assets/css/fonts-M1mtyV8L.css +0 -305
- package/dist/assets/css/icons-css-DbCVsovz.css +0 -41
- package/dist/assets/css/shared-components-bnLHdCtf.css +0 -429
- package/dist/assets/css/shared-modules-CNOICmYQ.css +0 -45
- package/dist/assets/css/styles-C62nDZwV.css +0 -4096
- package/dist/assets/css/ui-app-Bh9hmlIB.css +0 -1287
- package/dist/assets/css/ui-content-B29jsmK7.css +0 -1187
- package/dist/assets/css/ui-controls-CRtfFczw.css +0 -387
- package/dist/assets/css/ui-data-CYLxfdUa.css +0 -1555
- package/dist/assets/css/ui-form-C3WrWfVl.css +0 -71
- package/dist/assets/css/ui-form-fields-DOtHhDeM.css +0 -1360
- package/dist/assets/css/ui-helpers-bOoNv5dS.css +0 -37
- package/dist/assets/css/ui-indicators-CybQnCoU.css +0 -628
- package/dist/assets/css/ui-layout-DyGKgizy.css +0 -251
- package/dist/assets/css/ui-media-TWYep8js.css +0 -298
- package/dist/assets/css/ui-media-advanced-BGxy3VSB.css +0 -183
- package/dist/assets/css/ui-navigation-DcPRn8SB.css +0 -1693
- package/dist/assets/css-C_ZeEwz2.js +0 -847
- package/dist/assets/cypher-Bayei42D.js +0 -122
- package/dist/assets/d-B0hhz6be.js +0 -205
- package/dist/assets/diff-DQutOIXs.js +0 -30
- package/dist/assets/dtd-C1CeYVnM.js +0 -121
- package/dist/assets/dylan-Dm9-uD-A.js +0 -337
- package/dist/assets/ebnf-jWG_1Yly.js +0 -151
- package/dist/assets/ecl-CgJPA6z9.js +0 -190
- package/dist/assets/eiffel-lj7uLahq.js +0 -146
- package/dist/assets/elm-Cz7o1ijk.js +0 -230
- package/dist/assets/erlang-CyL5QOyR.js +0 -581
- package/dist/assets/factor-BVWHwYpu.js +0 -65
- package/dist/assets/fcl-DiozYjc8.js +0 -154
- package/dist/assets/forth-B7vn5ze0.js +0 -164
- package/dist/assets/fortran-D2XNEnBT.js +0 -172
- package/dist/assets/gas-B_Tj57Ve.js +0 -343
- package/dist/assets/gherkin-CJ6Qk4EZ.js +0 -147
- package/dist/assets/groovy-ioGz2WSV.js +0 -228
- package/dist/assets/haskell-BHnm1B83.js +0 -239
- package/dist/assets/haxe-Bn6Yo6N3.js +0 -490
- package/dist/assets/http-BOd5SYCT.js +0 -89
- package/dist/assets/idl-FSFk8_xX.js +0 -274
- package/dist/assets/index--5fKpGeN.js +0 -792
- package/dist/assets/index-0lME64YH.js +0 -342
- package/dist/assets/index-B6Ip0FgO.js +0 -437
- package/dist/assets/index-BmV05E5M.js +0 -479
- package/dist/assets/index-C6MavZDA.js +0 -131
- package/dist/assets/index-CwKpgcYl.js +0 -85
- package/dist/assets/index-DRUmDL0J.js +0 -59
- package/dist/assets/index-DgFC-M9G.js +0 -96
- package/dist/assets/javascript-DGrAs70C.js +0 -922
- package/dist/assets/jinja2-D9k5QrXv.js +0 -171
- package/dist/assets/julia-DM42tOPB.js +0 -369
- package/dist/assets/livescript-Dci8HnOi.js +0 -259
- package/dist/assets/lua-CByQu4v6.js +0 -137
- package/dist/assets/lucide-icons-af0BY3bi.js +0 -34555
- package/dist/assets/mathematica-Dkv0uCYF.js +0 -153
- package/dist/assets/mbox-CYTvs5kC.js +0 -114
- package/dist/assets/mirc-DpgP3GCo.js +0 -176
- package/dist/assets/mllike-C6tNn2Yt.js +0 -343
- package/dist/assets/modelica-CR6hTSce.js +0 -192
- package/dist/assets/mscgen-D0GXtzMS.js +0 -149
- package/dist/assets/mumps-Bf1EyDa6.js +0 -129
- package/dist/assets/nginx-By9Phklj.js +0 -163
- package/dist/assets/nsis-B5ggMLQ9.js +0 -80
- package/dist/assets/ntriples-C7VJ7pnm.js +0 -141
- package/dist/assets/octave-6yR_ix15.js +0 -112
- package/dist/assets/oz-CEUnktiQ.js +0 -235
- package/dist/assets/pascal-Dksf1EyF.js +0 -124
- package/dist/assets/perl-B99DUQQt.js +0 -819
- package/dist/assets/pig-DFeDRta6.js +0 -149
- package/dist/assets/powershell-DhwsNWMx.js +0 -381
- package/dist/assets/properties-o21uErwC.js +0 -62
- package/dist/assets/protobuf-YxlANsmD.js +0 -54
- package/dist/assets/pug-bUgjeODZ.js +0 -504
- package/dist/assets/puppet-B8WICGYE.js +0 -205
- package/dist/assets/python-D3FFx1Id.js +0 -389
- package/dist/assets/q-D2Hjhl2C.js +0 -123
- package/dist/assets/r-D73k5lac.js +0 -174
- package/dist/assets/rpm-Duv_WH0z.js +0 -89
- package/dist/assets/ruby-DGCVqZDt.js +0 -287
- package/dist/assets/sas-XjPv1Vy5.js +0 -268
- package/dist/assets/scheme-DeaA28vt.js +0 -263
- package/dist/assets/shared-components-CfAt2hC6.js +0 -1501
- package/dist/assets/shared-composables-v9NkNuAe.js +0 -35
- package/dist/assets/shared-modules-CDP-H5ZB.js +0 -3588
- package/dist/assets/shared-pages-BGRRA5WB.js +0 -20
- package/dist/assets/shell-Bx6QZTgx.js +0 -145
- package/dist/assets/sieve-CWCD62sW.js +0 -178
- package/dist/assets/simple-mode-BAO9cD7H.js +0 -136
- package/dist/assets/smalltalk-DSQbF4MF.js +0 -153
- package/dist/assets/solr-v_XRf31C.js +0 -80
- package/dist/assets/sparql-BrfDqf0-.js +0 -170
- package/dist/assets/spreadsheet-Csn84Pef.js +0 -98
- package/dist/assets/sql-D4utlq1l.js +0 -480
- package/dist/assets/stex-DBkktma-.js +0 -246
- package/dist/assets/stylus-ByG-Fd6f.js +0 -750
- package/dist/assets/swift-CHbTprt3.js +0 -202
- package/dist/assets/tcl-BRlMUELr.js +0 -125
- package/dist/assets/textile-CqfTUjd4.js +0 -441
- package/dist/assets/tiddlywiki-BrsoM8KB.js +0 -278
- package/dist/assets/tiki-D-ivWPkc.js +0 -289
- package/dist/assets/toml-t_IhJu83.js +0 -75
- package/dist/assets/troff-DckGF2AE.js +0 -64
- package/dist/assets/ttcn-B8TAFbRR.js +0 -253
- package/dist/assets/ttcn-cfg-NHh25oCM.js +0 -197
- package/dist/assets/turtle-D9Js0BlL.js +0 -141
- package/dist/assets/ui-app-D31Pr1WY.js +0 -1993
- package/dist/assets/ui-content-B7SxH8y9.js +0 -52887
- package/dist/assets/ui-controls-nmDJYLmC.js +0 -348
- package/dist/assets/ui-data-Ci3b1ye0.js +0 -22901
- package/dist/assets/ui-form-Cs5ooOo7.js +0 -159
- package/dist/assets/ui-form-fields-DFQi31jT.js +0 -40575
- package/dist/assets/ui-helpers-CF-EUlOg.js +0 -1736
- package/dist/assets/ui-indicators-mIQeEqha.js +0 -199
- package/dist/assets/ui-layout-v2XBQky3.js +0 -320
- package/dist/assets/ui-media-WWYrwmZw.js +0 -1259
- package/dist/assets/ui-media-advanced-T8ibi153.js +0 -492
- package/dist/assets/ui-modals-BdZXzI85.js +0 -2
- package/dist/assets/ui-navigation-BtHa6ovW.js +0 -24269
- package/dist/assets/utils-DZK5fu48.js +0 -17216
- package/dist/assets/vb-CbIGLrpY.js +0 -249
- package/dist/assets/vbscript-8ANWle9n.js +0 -320
- package/dist/assets/velocity-D6hz3Hzw.js +0 -186
- package/dist/assets/verilog-DIV442at.js +0 -565
- package/dist/assets/vhdl-BlTiZo_v.js +0 -174
- package/dist/assets/vueuse-CTQm4Zh0.js +0 -9308
- package/dist/assets/webidl-Cp3tcqdk.js +0 -179
- package/dist/assets/xquery-Dd4TBzXv.js +0 -411
- package/dist/assets/yacas-DQ1WucF0.js +0 -182
- package/dist/assets/z80-P1j44jDI.js +0 -102
|
@@ -1,343 +0,0 @@
|
|
|
1
|
-
function mlLike(parserConfig) {
|
|
2
|
-
var words = {
|
|
3
|
-
'as': 'keyword',
|
|
4
|
-
'do': 'keyword',
|
|
5
|
-
'else': 'keyword',
|
|
6
|
-
'end': 'keyword',
|
|
7
|
-
'exception': 'keyword',
|
|
8
|
-
'fun': 'keyword',
|
|
9
|
-
'functor': 'keyword',
|
|
10
|
-
'if': 'keyword',
|
|
11
|
-
'in': 'keyword',
|
|
12
|
-
'include': 'keyword',
|
|
13
|
-
'let': 'keyword',
|
|
14
|
-
'of': 'keyword',
|
|
15
|
-
'open': 'keyword',
|
|
16
|
-
'rec': 'keyword',
|
|
17
|
-
'struct': 'keyword',
|
|
18
|
-
'then': 'keyword',
|
|
19
|
-
'type': 'keyword',
|
|
20
|
-
'val': 'keyword',
|
|
21
|
-
'while': 'keyword',
|
|
22
|
-
'with': 'keyword'
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
var extraWords = parserConfig.extraWords || {};
|
|
26
|
-
for (var prop in extraWords) {
|
|
27
|
-
if (extraWords.hasOwnProperty(prop)) {
|
|
28
|
-
words[prop] = parserConfig.extraWords[prop];
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
var hintWords = [];
|
|
32
|
-
for (var k in words) { hintWords.push(k); }
|
|
33
|
-
|
|
34
|
-
function tokenBase(stream, state) {
|
|
35
|
-
var ch = stream.next();
|
|
36
|
-
|
|
37
|
-
if (ch === '"') {
|
|
38
|
-
state.tokenize = tokenString;
|
|
39
|
-
return state.tokenize(stream, state);
|
|
40
|
-
}
|
|
41
|
-
if (ch === '{') {
|
|
42
|
-
if (stream.eat('|')) {
|
|
43
|
-
state.longString = true;
|
|
44
|
-
state.tokenize = tokenLongString;
|
|
45
|
-
return state.tokenize(stream, state);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
if (ch === '(') {
|
|
49
|
-
if (stream.match(/^\*(?!\))/)) {
|
|
50
|
-
state.commentLevel++;
|
|
51
|
-
state.tokenize = tokenComment;
|
|
52
|
-
return state.tokenize(stream, state);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
if (ch === '~' || ch === '?') {
|
|
56
|
-
stream.eatWhile(/\w/);
|
|
57
|
-
return 'variableName.special';
|
|
58
|
-
}
|
|
59
|
-
if (ch === '`') {
|
|
60
|
-
stream.eatWhile(/\w/);
|
|
61
|
-
return 'quote';
|
|
62
|
-
}
|
|
63
|
-
if (ch === '/' && parserConfig.slashComments && stream.eat('/')) {
|
|
64
|
-
stream.skipToEnd();
|
|
65
|
-
return 'comment';
|
|
66
|
-
}
|
|
67
|
-
if (/\d/.test(ch)) {
|
|
68
|
-
if (ch === '0' && stream.eat(/[bB]/)) {
|
|
69
|
-
stream.eatWhile(/[01]/);
|
|
70
|
-
} if (ch === '0' && stream.eat(/[xX]/)) {
|
|
71
|
-
stream.eatWhile(/[0-9a-fA-F]/);
|
|
72
|
-
} if (ch === '0' && stream.eat(/[oO]/)) {
|
|
73
|
-
stream.eatWhile(/[0-7]/);
|
|
74
|
-
} else {
|
|
75
|
-
stream.eatWhile(/[\d_]/);
|
|
76
|
-
if (stream.eat('.')) {
|
|
77
|
-
stream.eatWhile(/[\d]/);
|
|
78
|
-
}
|
|
79
|
-
if (stream.eat(/[eE]/)) {
|
|
80
|
-
stream.eatWhile(/[\d\-+]/);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
return 'number';
|
|
84
|
-
}
|
|
85
|
-
if ( /[+\-*&%=<>!?|@\.~:]/.test(ch)) {
|
|
86
|
-
return 'operator';
|
|
87
|
-
}
|
|
88
|
-
if (/[\w\xa1-\uffff]/.test(ch)) {
|
|
89
|
-
stream.eatWhile(/[\w\xa1-\uffff]/);
|
|
90
|
-
var cur = stream.current();
|
|
91
|
-
return words.hasOwnProperty(cur) ? words[cur] : 'variable';
|
|
92
|
-
}
|
|
93
|
-
return null
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
function tokenString(stream, state) {
|
|
97
|
-
var next, end = false, escaped = false;
|
|
98
|
-
while ((next = stream.next()) != null) {
|
|
99
|
-
if (next === '"' && !escaped) {
|
|
100
|
-
end = true;
|
|
101
|
-
break;
|
|
102
|
-
}
|
|
103
|
-
escaped = !escaped && next === '\\';
|
|
104
|
-
}
|
|
105
|
-
if (end && !escaped) {
|
|
106
|
-
state.tokenize = tokenBase;
|
|
107
|
-
}
|
|
108
|
-
return 'string';
|
|
109
|
-
}
|
|
110
|
-
function tokenComment(stream, state) {
|
|
111
|
-
var prev, next;
|
|
112
|
-
while(state.commentLevel > 0 && (next = stream.next()) != null) {
|
|
113
|
-
if (prev === '(' && next === '*') state.commentLevel++;
|
|
114
|
-
if (prev === '*' && next === ')') state.commentLevel--;
|
|
115
|
-
prev = next;
|
|
116
|
-
}
|
|
117
|
-
if (state.commentLevel <= 0) {
|
|
118
|
-
state.tokenize = tokenBase;
|
|
119
|
-
}
|
|
120
|
-
return 'comment';
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
function tokenLongString(stream, state) {
|
|
124
|
-
var prev, next;
|
|
125
|
-
while (state.longString && (next = stream.next()) != null) {
|
|
126
|
-
if (prev === '|' && next === '}') state.longString = false;
|
|
127
|
-
prev = next;
|
|
128
|
-
}
|
|
129
|
-
if (!state.longString) {
|
|
130
|
-
state.tokenize = tokenBase;
|
|
131
|
-
}
|
|
132
|
-
return 'string';
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
return {
|
|
136
|
-
startState: function() {return {tokenize: tokenBase, commentLevel: 0, longString: false};},
|
|
137
|
-
token: function(stream, state) {
|
|
138
|
-
if (stream.eatSpace()) return null;
|
|
139
|
-
return state.tokenize(stream, state);
|
|
140
|
-
},
|
|
141
|
-
|
|
142
|
-
languageData: {
|
|
143
|
-
autocomplete: hintWords,
|
|
144
|
-
commentTokens: {
|
|
145
|
-
line: parserConfig.slashComments ? "//" : undefined,
|
|
146
|
-
block: {open: "(*", close: "*)"}
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
};
|
|
150
|
-
}
|
|
151
|
-
const oCaml = mlLike({
|
|
152
|
-
extraWords: {
|
|
153
|
-
'and': 'keyword',
|
|
154
|
-
'assert': 'keyword',
|
|
155
|
-
'begin': 'keyword',
|
|
156
|
-
'class': 'keyword',
|
|
157
|
-
'constraint': 'keyword',
|
|
158
|
-
'done': 'keyword',
|
|
159
|
-
'downto': 'keyword',
|
|
160
|
-
'external': 'keyword',
|
|
161
|
-
'function': 'keyword',
|
|
162
|
-
'initializer': 'keyword',
|
|
163
|
-
'lazy': 'keyword',
|
|
164
|
-
'match': 'keyword',
|
|
165
|
-
'method': 'keyword',
|
|
166
|
-
'module': 'keyword',
|
|
167
|
-
'mutable': 'keyword',
|
|
168
|
-
'new': 'keyword',
|
|
169
|
-
'nonrec': 'keyword',
|
|
170
|
-
'object': 'keyword',
|
|
171
|
-
'private': 'keyword',
|
|
172
|
-
'sig': 'keyword',
|
|
173
|
-
'to': 'keyword',
|
|
174
|
-
'try': 'keyword',
|
|
175
|
-
'value': 'keyword',
|
|
176
|
-
'virtual': 'keyword',
|
|
177
|
-
'when': 'keyword',
|
|
178
|
-
|
|
179
|
-
// builtins
|
|
180
|
-
'raise': 'builtin',
|
|
181
|
-
'failwith': 'builtin',
|
|
182
|
-
'true': 'builtin',
|
|
183
|
-
'false': 'builtin',
|
|
184
|
-
|
|
185
|
-
// Pervasives builtins
|
|
186
|
-
'asr': 'builtin',
|
|
187
|
-
'land': 'builtin',
|
|
188
|
-
'lor': 'builtin',
|
|
189
|
-
'lsl': 'builtin',
|
|
190
|
-
'lsr': 'builtin',
|
|
191
|
-
'lxor': 'builtin',
|
|
192
|
-
'mod': 'builtin',
|
|
193
|
-
'or': 'builtin',
|
|
194
|
-
|
|
195
|
-
// More Pervasives
|
|
196
|
-
'raise_notrace': 'builtin',
|
|
197
|
-
'trace': 'builtin',
|
|
198
|
-
'exit': 'builtin',
|
|
199
|
-
'print_string': 'builtin',
|
|
200
|
-
'print_endline': 'builtin',
|
|
201
|
-
|
|
202
|
-
'int': 'type',
|
|
203
|
-
'float': 'type',
|
|
204
|
-
'bool': 'type',
|
|
205
|
-
'char': 'type',
|
|
206
|
-
'string': 'type',
|
|
207
|
-
'unit': 'type',
|
|
208
|
-
|
|
209
|
-
// Modules
|
|
210
|
-
'List': 'builtin'
|
|
211
|
-
}
|
|
212
|
-
});
|
|
213
|
-
|
|
214
|
-
const fSharp = mlLike({
|
|
215
|
-
extraWords: {
|
|
216
|
-
'abstract': 'keyword',
|
|
217
|
-
'assert': 'keyword',
|
|
218
|
-
'base': 'keyword',
|
|
219
|
-
'begin': 'keyword',
|
|
220
|
-
'class': 'keyword',
|
|
221
|
-
'default': 'keyword',
|
|
222
|
-
'delegate': 'keyword',
|
|
223
|
-
'do!': 'keyword',
|
|
224
|
-
'done': 'keyword',
|
|
225
|
-
'downcast': 'keyword',
|
|
226
|
-
'downto': 'keyword',
|
|
227
|
-
'elif': 'keyword',
|
|
228
|
-
'extern': 'keyword',
|
|
229
|
-
'finally': 'keyword',
|
|
230
|
-
'for': 'keyword',
|
|
231
|
-
'function': 'keyword',
|
|
232
|
-
'global': 'keyword',
|
|
233
|
-
'inherit': 'keyword',
|
|
234
|
-
'inline': 'keyword',
|
|
235
|
-
'interface': 'keyword',
|
|
236
|
-
'internal': 'keyword',
|
|
237
|
-
'lazy': 'keyword',
|
|
238
|
-
'let!': 'keyword',
|
|
239
|
-
'match': 'keyword',
|
|
240
|
-
'member': 'keyword',
|
|
241
|
-
'module': 'keyword',
|
|
242
|
-
'mutable': 'keyword',
|
|
243
|
-
'namespace': 'keyword',
|
|
244
|
-
'new': 'keyword',
|
|
245
|
-
'null': 'keyword',
|
|
246
|
-
'override': 'keyword',
|
|
247
|
-
'private': 'keyword',
|
|
248
|
-
'public': 'keyword',
|
|
249
|
-
'return!': 'keyword',
|
|
250
|
-
'return': 'keyword',
|
|
251
|
-
'select': 'keyword',
|
|
252
|
-
'static': 'keyword',
|
|
253
|
-
'to': 'keyword',
|
|
254
|
-
'try': 'keyword',
|
|
255
|
-
'upcast': 'keyword',
|
|
256
|
-
'use!': 'keyword',
|
|
257
|
-
'use': 'keyword',
|
|
258
|
-
'void': 'keyword',
|
|
259
|
-
'when': 'keyword',
|
|
260
|
-
'yield!': 'keyword',
|
|
261
|
-
'yield': 'keyword',
|
|
262
|
-
|
|
263
|
-
// Reserved words
|
|
264
|
-
'atomic': 'keyword',
|
|
265
|
-
'break': 'keyword',
|
|
266
|
-
'checked': 'keyword',
|
|
267
|
-
'component': 'keyword',
|
|
268
|
-
'const': 'keyword',
|
|
269
|
-
'constraint': 'keyword',
|
|
270
|
-
'constructor': 'keyword',
|
|
271
|
-
'continue': 'keyword',
|
|
272
|
-
'eager': 'keyword',
|
|
273
|
-
'event': 'keyword',
|
|
274
|
-
'external': 'keyword',
|
|
275
|
-
'fixed': 'keyword',
|
|
276
|
-
'method': 'keyword',
|
|
277
|
-
'mixin': 'keyword',
|
|
278
|
-
'object': 'keyword',
|
|
279
|
-
'parallel': 'keyword',
|
|
280
|
-
'process': 'keyword',
|
|
281
|
-
'protected': 'keyword',
|
|
282
|
-
'pure': 'keyword',
|
|
283
|
-
'sealed': 'keyword',
|
|
284
|
-
'tailcall': 'keyword',
|
|
285
|
-
'trait': 'keyword',
|
|
286
|
-
'virtual': 'keyword',
|
|
287
|
-
'volatile': 'keyword',
|
|
288
|
-
|
|
289
|
-
// builtins
|
|
290
|
-
'List': 'builtin',
|
|
291
|
-
'Seq': 'builtin',
|
|
292
|
-
'Map': 'builtin',
|
|
293
|
-
'Set': 'builtin',
|
|
294
|
-
'Option': 'builtin',
|
|
295
|
-
'int': 'builtin',
|
|
296
|
-
'string': 'builtin',
|
|
297
|
-
'not': 'builtin',
|
|
298
|
-
'true': 'builtin',
|
|
299
|
-
'false': 'builtin',
|
|
300
|
-
|
|
301
|
-
'raise': 'builtin',
|
|
302
|
-
'failwith': 'builtin'
|
|
303
|
-
},
|
|
304
|
-
slashComments: true
|
|
305
|
-
});
|
|
306
|
-
|
|
307
|
-
const sml = mlLike({
|
|
308
|
-
extraWords: {
|
|
309
|
-
'abstype': 'keyword',
|
|
310
|
-
'and': 'keyword',
|
|
311
|
-
'andalso': 'keyword',
|
|
312
|
-
'case': 'keyword',
|
|
313
|
-
'datatype': 'keyword',
|
|
314
|
-
'fn': 'keyword',
|
|
315
|
-
'handle': 'keyword',
|
|
316
|
-
'infix': 'keyword',
|
|
317
|
-
'infixr': 'keyword',
|
|
318
|
-
'local': 'keyword',
|
|
319
|
-
'nonfix': 'keyword',
|
|
320
|
-
'op': 'keyword',
|
|
321
|
-
'orelse': 'keyword',
|
|
322
|
-
'raise': 'keyword',
|
|
323
|
-
'withtype': 'keyword',
|
|
324
|
-
'eqtype': 'keyword',
|
|
325
|
-
'sharing': 'keyword',
|
|
326
|
-
'sig': 'keyword',
|
|
327
|
-
'signature': 'keyword',
|
|
328
|
-
'structure': 'keyword',
|
|
329
|
-
'where': 'keyword',
|
|
330
|
-
'true': 'keyword',
|
|
331
|
-
'false': 'keyword',
|
|
332
|
-
|
|
333
|
-
// types
|
|
334
|
-
'int': 'builtin',
|
|
335
|
-
'real': 'builtin',
|
|
336
|
-
'string': 'builtin',
|
|
337
|
-
'char': 'builtin',
|
|
338
|
-
'bool': 'builtin'
|
|
339
|
-
},
|
|
340
|
-
slashComments: true
|
|
341
|
-
});
|
|
342
|
-
|
|
343
|
-
export { fSharp, oCaml, sml };
|
|
@@ -1,192 +0,0 @@
|
|
|
1
|
-
function words(str) {
|
|
2
|
-
var obj = {}, words = str.split(" ");
|
|
3
|
-
for (var i=0; i<words.length; ++i)
|
|
4
|
-
obj[words[i]] = true;
|
|
5
|
-
return obj;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
var keywords = words("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");
|
|
9
|
-
var builtin = words("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");
|
|
10
|
-
var atoms = words("Real Boolean Integer String");
|
|
11
|
-
|
|
12
|
-
var completions = [].concat(Object.keys(keywords), Object.keys(builtin), Object.keys(atoms));
|
|
13
|
-
|
|
14
|
-
var isSingleOperatorChar = /[;=\(:\),{}.*<>+\-\/^\[\]]/;
|
|
15
|
-
var isDoubleOperatorChar = /(:=|<=|>=|==|<>|\.\+|\.\-|\.\*|\.\/|\.\^)/;
|
|
16
|
-
var isDigit = /[0-9]/;
|
|
17
|
-
var isNonDigit = /[_a-zA-Z]/;
|
|
18
|
-
|
|
19
|
-
function tokenLineComment(stream, state) {
|
|
20
|
-
stream.skipToEnd();
|
|
21
|
-
state.tokenize = null;
|
|
22
|
-
return "comment";
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
function tokenBlockComment(stream, state) {
|
|
26
|
-
var maybeEnd = false, ch;
|
|
27
|
-
while (ch = stream.next()) {
|
|
28
|
-
if (maybeEnd && ch == "/") {
|
|
29
|
-
state.tokenize = null;
|
|
30
|
-
break;
|
|
31
|
-
}
|
|
32
|
-
maybeEnd = (ch == "*");
|
|
33
|
-
}
|
|
34
|
-
return "comment";
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
function tokenString(stream, state) {
|
|
38
|
-
var escaped = false, ch;
|
|
39
|
-
while ((ch = stream.next()) != null) {
|
|
40
|
-
if (ch == '"' && !escaped) {
|
|
41
|
-
state.tokenize = null;
|
|
42
|
-
state.sol = false;
|
|
43
|
-
break;
|
|
44
|
-
}
|
|
45
|
-
escaped = !escaped && ch == "\\";
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
return "string";
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
function tokenIdent(stream, state) {
|
|
52
|
-
stream.eatWhile(isDigit);
|
|
53
|
-
while (stream.eat(isDigit) || stream.eat(isNonDigit)) { }
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
var cur = stream.current();
|
|
57
|
-
|
|
58
|
-
if(state.sol && (cur == "package" || cur == "model" || cur == "when" || cur == "connector")) state.level++;
|
|
59
|
-
else if(state.sol && cur == "end" && state.level > 0) state.level--;
|
|
60
|
-
|
|
61
|
-
state.tokenize = null;
|
|
62
|
-
state.sol = false;
|
|
63
|
-
|
|
64
|
-
if (keywords.propertyIsEnumerable(cur)) return "keyword";
|
|
65
|
-
else if (builtin.propertyIsEnumerable(cur)) return "builtin";
|
|
66
|
-
else if (atoms.propertyIsEnumerable(cur)) return "atom";
|
|
67
|
-
else return "variable";
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
function tokenQIdent(stream, state) {
|
|
71
|
-
while (stream.eat(/[^']/)) { }
|
|
72
|
-
|
|
73
|
-
state.tokenize = null;
|
|
74
|
-
state.sol = false;
|
|
75
|
-
|
|
76
|
-
if(stream.eat("'"))
|
|
77
|
-
return "variable";
|
|
78
|
-
else
|
|
79
|
-
return "error";
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
function tokenUnsignedNumber(stream, state) {
|
|
83
|
-
stream.eatWhile(isDigit);
|
|
84
|
-
if (stream.eat('.')) {
|
|
85
|
-
stream.eatWhile(isDigit);
|
|
86
|
-
}
|
|
87
|
-
if (stream.eat('e') || stream.eat('E')) {
|
|
88
|
-
if (!stream.eat('-'))
|
|
89
|
-
stream.eat('+');
|
|
90
|
-
stream.eatWhile(isDigit);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
state.tokenize = null;
|
|
94
|
-
state.sol = false;
|
|
95
|
-
return "number";
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
// Interface
|
|
99
|
-
const modelica = {
|
|
100
|
-
name: "modelica",
|
|
101
|
-
startState: function() {
|
|
102
|
-
return {
|
|
103
|
-
tokenize: null,
|
|
104
|
-
level: 0,
|
|
105
|
-
sol: true
|
|
106
|
-
};
|
|
107
|
-
},
|
|
108
|
-
|
|
109
|
-
token: function(stream, state) {
|
|
110
|
-
if(state.tokenize != null) {
|
|
111
|
-
return state.tokenize(stream, state);
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
if(stream.sol()) {
|
|
115
|
-
state.sol = true;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
// WHITESPACE
|
|
119
|
-
if(stream.eatSpace()) {
|
|
120
|
-
state.tokenize = null;
|
|
121
|
-
return null;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
var ch = stream.next();
|
|
125
|
-
|
|
126
|
-
// LINECOMMENT
|
|
127
|
-
if(ch == '/' && stream.eat('/')) {
|
|
128
|
-
state.tokenize = tokenLineComment;
|
|
129
|
-
}
|
|
130
|
-
// BLOCKCOMMENT
|
|
131
|
-
else if(ch == '/' && stream.eat('*')) {
|
|
132
|
-
state.tokenize = tokenBlockComment;
|
|
133
|
-
}
|
|
134
|
-
// TWO SYMBOL TOKENS
|
|
135
|
-
else if(isDoubleOperatorChar.test(ch+stream.peek())) {
|
|
136
|
-
stream.next();
|
|
137
|
-
state.tokenize = null;
|
|
138
|
-
return "operator";
|
|
139
|
-
}
|
|
140
|
-
// SINGLE SYMBOL TOKENS
|
|
141
|
-
else if(isSingleOperatorChar.test(ch)) {
|
|
142
|
-
state.tokenize = null;
|
|
143
|
-
return "operator";
|
|
144
|
-
}
|
|
145
|
-
// IDENT
|
|
146
|
-
else if(isNonDigit.test(ch)) {
|
|
147
|
-
state.tokenize = tokenIdent;
|
|
148
|
-
}
|
|
149
|
-
// Q-IDENT
|
|
150
|
-
else if(ch == "'" && stream.peek() && stream.peek() != "'") {
|
|
151
|
-
state.tokenize = tokenQIdent;
|
|
152
|
-
}
|
|
153
|
-
// STRING
|
|
154
|
-
else if(ch == '"') {
|
|
155
|
-
state.tokenize = tokenString;
|
|
156
|
-
}
|
|
157
|
-
// UNSIGNED_NUMBER
|
|
158
|
-
else if(isDigit.test(ch)) {
|
|
159
|
-
state.tokenize = tokenUnsignedNumber;
|
|
160
|
-
}
|
|
161
|
-
// ERROR
|
|
162
|
-
else {
|
|
163
|
-
state.tokenize = null;
|
|
164
|
-
return "error";
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
return state.tokenize(stream, state);
|
|
168
|
-
},
|
|
169
|
-
|
|
170
|
-
indent: function(state, textAfter, cx) {
|
|
171
|
-
if (state.tokenize != null) return null;
|
|
172
|
-
|
|
173
|
-
var level = state.level;
|
|
174
|
-
if(/(algorithm)/.test(textAfter)) level--;
|
|
175
|
-
if(/(equation)/.test(textAfter)) level--;
|
|
176
|
-
if(/(initial algorithm)/.test(textAfter)) level--;
|
|
177
|
-
if(/(initial equation)/.test(textAfter)) level--;
|
|
178
|
-
if(/(end)/.test(textAfter)) level--;
|
|
179
|
-
|
|
180
|
-
if(level > 0)
|
|
181
|
-
return cx.unit*level;
|
|
182
|
-
else
|
|
183
|
-
return 0;
|
|
184
|
-
},
|
|
185
|
-
|
|
186
|
-
languageData: {
|
|
187
|
-
commentTokens: {line: "//", block: {open: "/*", close: "*/"}},
|
|
188
|
-
autocomplete: completions
|
|
189
|
-
}
|
|
190
|
-
};
|
|
191
|
-
|
|
192
|
-
export { modelica };
|
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
function mkParser(lang) {
|
|
2
|
-
return {
|
|
3
|
-
name: "mscgen",
|
|
4
|
-
startState: startStateFn,
|
|
5
|
-
copyState: copyStateFn,
|
|
6
|
-
token: produceTokenFunction(lang),
|
|
7
|
-
languageData: {
|
|
8
|
-
commentTokens: {line: "#", block: {open: "/*", close: "*/"}}
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
const mscgen = mkParser({
|
|
14
|
-
"keywords" : ["msc"],
|
|
15
|
-
"options" : ["hscale", "width", "arcgradient", "wordwraparcs"],
|
|
16
|
-
"constants" : ["true", "false", "on", "off"],
|
|
17
|
-
"attributes" : ["label", "idurl", "id", "url", "linecolor", "linecolour", "textcolor", "textcolour", "textbgcolor", "textbgcolour", "arclinecolor", "arclinecolour", "arctextcolor", "arctextcolour", "arctextbgcolor", "arctextbgcolour", "arcskip"],
|
|
18
|
-
"brackets" : ["\\{", "\\}"], // [ and ] are brackets too, but these get handled in with lists
|
|
19
|
-
"arcsWords" : ["note", "abox", "rbox", "box"],
|
|
20
|
-
"arcsOthers" : ["\\|\\|\\|", "\\.\\.\\.", "---", "--", "<->", "==", "<<=>>", "<=>", "\\.\\.", "<<>>", "::", "<:>", "->", "=>>", "=>", ">>", ":>", "<-", "<<=", "<=", "<<", "<:", "x-", "-x"],
|
|
21
|
-
"singlecomment" : ["//", "#"],
|
|
22
|
-
"operators" : ["="]
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
const msgenny = mkParser({
|
|
26
|
-
"keywords" : null,
|
|
27
|
-
"options" : ["hscale", "width", "arcgradient", "wordwraparcs", "wordwrapentities", "watermark"],
|
|
28
|
-
"constants" : ["true", "false", "on", "off", "auto"],
|
|
29
|
-
"attributes" : null,
|
|
30
|
-
"brackets" : ["\\{", "\\}"],
|
|
31
|
-
"arcsWords" : ["note", "abox", "rbox", "box", "alt", "else", "opt", "break", "par", "seq", "strict", "neg", "critical", "ignore", "consider", "assert", "loop", "ref", "exc"],
|
|
32
|
-
"arcsOthers" : ["\\|\\|\\|", "\\.\\.\\.", "---", "--", "<->", "==", "<<=>>", "<=>", "\\.\\.", "<<>>", "::", "<:>", "->", "=>>", "=>", ">>", ":>", "<-", "<<=", "<=", "<<", "<:", "x-", "-x"],
|
|
33
|
-
"singlecomment" : ["//", "#"],
|
|
34
|
-
"operators" : ["="]
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
const xu = mkParser({
|
|
38
|
-
"keywords" : ["msc", "xu"],
|
|
39
|
-
"options" : ["hscale", "width", "arcgradient", "wordwraparcs", "wordwrapentities", "watermark"],
|
|
40
|
-
"constants" : ["true", "false", "on", "off", "auto"],
|
|
41
|
-
"attributes" : ["label", "idurl", "id", "url", "linecolor", "linecolour", "textcolor", "textcolour", "textbgcolor", "textbgcolour", "arclinecolor", "arclinecolour", "arctextcolor", "arctextcolour", "arctextbgcolor", "arctextbgcolour", "arcskip", "title", "deactivate", "activate", "activation"],
|
|
42
|
-
"brackets" : ["\\{", "\\}"], // [ and ] are brackets too, but these get handled in with lists
|
|
43
|
-
"arcsWords" : ["note", "abox", "rbox", "box", "alt", "else", "opt", "break", "par", "seq", "strict", "neg", "critical", "ignore", "consider", "assert", "loop", "ref", "exc"],
|
|
44
|
-
"arcsOthers" : ["\\|\\|\\|", "\\.\\.\\.", "---", "--", "<->", "==", "<<=>>", "<=>", "\\.\\.", "<<>>", "::", "<:>", "->", "=>>", "=>", ">>", ":>", "<-", "<<=", "<=", "<<", "<:", "x-", "-x"],
|
|
45
|
-
"singlecomment" : ["//", "#"],
|
|
46
|
-
"operators" : ["="]
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
function wordRegexpBoundary(pWords) {
|
|
50
|
-
return new RegExp("^\\b(" + pWords.join("|") + ")\\b", "i");
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
function wordRegexp(pWords) {
|
|
54
|
-
return new RegExp("^(?:" + pWords.join("|") + ")", "i");
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
function startStateFn() {
|
|
58
|
-
return {
|
|
59
|
-
inComment : false,
|
|
60
|
-
inString : false,
|
|
61
|
-
inAttributeList : false,
|
|
62
|
-
inScript : false
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
function copyStateFn(pState) {
|
|
67
|
-
return {
|
|
68
|
-
inComment : pState.inComment,
|
|
69
|
-
inString : pState.inString,
|
|
70
|
-
inAttributeList : pState.inAttributeList,
|
|
71
|
-
inScript : pState.inScript
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
function produceTokenFunction(pConfig) {
|
|
76
|
-
return function(pStream, pState) {
|
|
77
|
-
if (pStream.match(wordRegexp(pConfig.brackets), true, true)) {
|
|
78
|
-
return "bracket";
|
|
79
|
-
}
|
|
80
|
-
/* comments */
|
|
81
|
-
if (!pState.inComment) {
|
|
82
|
-
if (pStream.match(/\/\*[^\*\/]*/, true, true)) {
|
|
83
|
-
pState.inComment = true;
|
|
84
|
-
return "comment";
|
|
85
|
-
}
|
|
86
|
-
if (pStream.match(wordRegexp(pConfig.singlecomment), true, true)) {
|
|
87
|
-
pStream.skipToEnd();
|
|
88
|
-
return "comment";
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
if (pState.inComment) {
|
|
92
|
-
if (pStream.match(/[^\*\/]*\*\//, true, true))
|
|
93
|
-
pState.inComment = false;
|
|
94
|
-
else
|
|
95
|
-
pStream.skipToEnd();
|
|
96
|
-
return "comment";
|
|
97
|
-
}
|
|
98
|
-
/* strings */
|
|
99
|
-
if (!pState.inString && pStream.match(/\"(\\\"|[^\"])*/, true, true)) {
|
|
100
|
-
pState.inString = true;
|
|
101
|
-
return "string";
|
|
102
|
-
}
|
|
103
|
-
if (pState.inString) {
|
|
104
|
-
if (pStream.match(/[^\"]*\"/, true, true))
|
|
105
|
-
pState.inString = false;
|
|
106
|
-
else
|
|
107
|
-
pStream.skipToEnd();
|
|
108
|
-
return "string";
|
|
109
|
-
}
|
|
110
|
-
/* keywords & operators */
|
|
111
|
-
if (!!pConfig.keywords && pStream.match(wordRegexpBoundary(pConfig.keywords), true, true))
|
|
112
|
-
return "keyword";
|
|
113
|
-
|
|
114
|
-
if (pStream.match(wordRegexpBoundary(pConfig.options), true, true))
|
|
115
|
-
return "keyword";
|
|
116
|
-
|
|
117
|
-
if (pStream.match(wordRegexpBoundary(pConfig.arcsWords), true, true))
|
|
118
|
-
return "keyword";
|
|
119
|
-
|
|
120
|
-
if (pStream.match(wordRegexp(pConfig.arcsOthers), true, true))
|
|
121
|
-
return "keyword";
|
|
122
|
-
|
|
123
|
-
if (!!pConfig.operators && pStream.match(wordRegexp(pConfig.operators), true, true))
|
|
124
|
-
return "operator";
|
|
125
|
-
|
|
126
|
-
if (!!pConfig.constants && pStream.match(wordRegexp(pConfig.constants), true, true))
|
|
127
|
-
return "variable";
|
|
128
|
-
|
|
129
|
-
/* attribute lists */
|
|
130
|
-
if (!pConfig.inAttributeList && !!pConfig.attributes && pStream.match('[', true, true)) {
|
|
131
|
-
pConfig.inAttributeList = true;
|
|
132
|
-
return "bracket";
|
|
133
|
-
}
|
|
134
|
-
if (pConfig.inAttributeList) {
|
|
135
|
-
if (pConfig.attributes !== null && pStream.match(wordRegexpBoundary(pConfig.attributes), true, true)) {
|
|
136
|
-
return "attribute";
|
|
137
|
-
}
|
|
138
|
-
if (pStream.match(']', true, true)) {
|
|
139
|
-
pConfig.inAttributeList = false;
|
|
140
|
-
return "bracket";
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
pStream.next();
|
|
145
|
-
return null
|
|
146
|
-
};
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
export { mscgen, msgenny, xu };
|