@luxonis/visualizer-protobuf 1.6.2 → 1.7.0
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/dist/apl-NdZ6-T1z.js +142 -0
- package/dist/apps/depthai-visualizer/lib/src/components/Panel.d.ts +2 -0
- package/dist/apps/depthai-visualizer/lib/src/components/Panel.d.ts.map +1 -1
- package/dist/apps/depthai-visualizer/lib/src/components/Panel.js +2 -2
- package/dist/apps/depthai-visualizer/lib/src/components/Panel.js.map +1 -1
- package/dist/apps/depthai-visualizer/lib/src/components/PanelToolbar.d.ts +4 -1
- package/dist/apps/depthai-visualizer/lib/src/components/PanelToolbar.d.ts.map +1 -1
- package/dist/apps/depthai-visualizer/lib/src/components/PanelToolbar.js +25 -13
- package/dist/apps/depthai-visualizer/lib/src/components/PanelToolbar.js.map +1 -1
- package/dist/apps/depthai-visualizer/lib/src/panels/ImagePanel.d.ts +2 -8
- package/dist/apps/depthai-visualizer/lib/src/panels/ImagePanel.d.ts.map +1 -1
- package/dist/apps/depthai-visualizer/lib/src/panels/ImagePanel.js +1 -1
- package/dist/apps/depthai-visualizer/lib/src/panels/ImagePanel.js.map +1 -1
- package/dist/apps/depthai-visualizer/lib/src/panels/PointCloudPanel.js +2 -2
- package/dist/apps/depthai-visualizer/lib/src/panels/PointCloudPanel.js.map +1 -1
- package/dist/asciiarmor-CmJEbAuq.js +56 -0
- package/dist/asn1-CG_zvzH1.js +192 -0
- package/dist/asterisk-D6r__RMF.js +187 -0
- package/dist/brainfuck-COwWCBpq.js +70 -0
- package/dist/clike-BjlaHgsH.js +1018 -0
- package/dist/clojure-C2XPrGCa.js +274 -0
- package/dist/cmake-BGrEgXCL.js +81 -0
- package/dist/cobol-BfwG5XeO.js +235 -0
- package/dist/coffeescript-BG8vTfSz.js +329 -0
- package/dist/commonlisp-8oE2EpEe.js +108 -0
- package/dist/crystal--rIRMl16.js +419 -0
- package/dist/css-C_ZeEwz2.js +847 -0
- package/dist/cypher-Bayei42D.js +122 -0
- package/dist/d-B0hhz6be.js +205 -0
- package/dist/diff-DQutOIXs.js +30 -0
- package/dist/dockerfile-FAjn0vs9.js +199 -0
- package/dist/dtd-C1CeYVnM.js +121 -0
- package/dist/dylan-Dm9-uD-A.js +337 -0
- package/dist/ebnf-jWG_1Yly.js +151 -0
- package/dist/ecl-CgJPA6z9.js +190 -0
- package/dist/eiffel-lj7uLahq.js +146 -0
- package/dist/elm-Cz7o1ijk.js +230 -0
- package/dist/erlang-CyL5QOyR.js +581 -0
- package/dist/factor-B0KnwW_L.js +65 -0
- package/dist/fcl-DiozYjc8.js +154 -0
- package/dist/forth-B7vn5ze0.js +164 -0
- package/dist/fortran-D2XNEnBT.js +172 -0
- package/dist/gas-B_Tj57Ve.js +343 -0
- package/dist/gherkin-CJ6Qk4EZ.js +147 -0
- package/dist/groovy-BD9p_7sW.js +230 -0
- package/dist/haskell-BHnm1B83.js +239 -0
- package/dist/haxe-DWtZc5G9.js +490 -0
- package/dist/http-BOd5SYCT.js +89 -0
- package/dist/idl-FSFk8_xX.js +274 -0
- package/dist/index-B2YTRRfg.js +77 -0
- package/dist/{index-B8tJ5E-v.js → index-Beii0-_3.js} +7 -4
- package/dist/index-BjWYigIi.js +124 -0
- package/dist/index-Bx-Bh4nu.js +114 -0
- package/dist/index-Bya68zyH.js +154265 -0
- package/dist/index-C3_VkVgd.js +626 -0
- package/dist/index-CIOyzzeT.js +199 -0
- package/dist/index-CY_MdHWz.js +810 -0
- package/dist/index-D8b2daZv.js +155 -0
- package/dist/index-DW9KaYNb.js +149 -0
- package/dist/index-DZ4eTPnT.js +497 -0
- package/dist/index-DZeM9OAW.js +356 -0
- package/dist/index-DgQXSEwG.js +348 -0
- package/dist/index-DuTu94nj.js +436 -0
- package/dist/{index-CDLN8AQd.js → index-KZ3VqQGp.js} +88 -35
- package/dist/index-WQmqQNn4.js +205 -0
- package/dist/index-o4kozweh.js +458 -0
- package/dist/index-rTpSqKsn.js +103 -0
- package/dist/index-tmy4XtHv.js +346 -0
- package/dist/index.js +7 -3
- package/dist/javascript-CWIx5LQU.js +922 -0
- package/dist/jinja2-D9k5QrXv.js +171 -0
- package/dist/julia-DM42tOPB.js +369 -0
- package/dist/livescript-Jd_p-LwX.js +259 -0
- package/dist/lua-CByQu4v6.js +137 -0
- package/dist/mathematica-Dkv0uCYF.js +153 -0
- package/dist/mbox-CYTvs5kC.js +114 -0
- package/dist/mirc-DpgP3GCo.js +176 -0
- package/dist/mllike-Ti5DOjKW.js +346 -0
- package/dist/modelica-CR6hTSce.js +192 -0
- package/dist/mscgen-D0GXtzMS.js +149 -0
- package/dist/mumps-Bf1EyDa6.js +129 -0
- package/dist/nginx-By9Phklj.js +163 -0
- package/dist/nsis-27gzqCGG.js +80 -0
- package/dist/ntriples-C7VJ7pnm.js +141 -0
- package/dist/octave-6yR_ix15.js +112 -0
- package/dist/oz-CEUnktiQ.js +235 -0
- package/dist/package.json +1 -0
- package/dist/packages/studio-base/src/panels/ThreeDeeRender/renderables/ImageMode/MessageHandler.d.ts +1 -1
- package/dist/packages/studio-base/src/panels/ThreeDeeRender/renderables/ImageMode/MessageHandler.d.ts.map +1 -1
- package/dist/packages/studio-base/src/panels/ThreeDeeRender/renderables/ImageMode/MessageHandler.js +47 -18
- package/dist/packages/studio-base/src/panels/ThreeDeeRender/renderables/ImageMode/MessageHandler.js.map +1 -1
- package/dist/pascal-AdN1jbEG.js +124 -0
- package/dist/perl-B99DUQQt.js +819 -0
- package/dist/pig-DFeDRta6.js +149 -0
- package/dist/powershell-DhwsNWMx.js +381 -0
- package/dist/properties-o21uErwC.js +62 -0
- package/dist/protobuf-YxlANsmD.js +54 -0
- package/dist/pug-OXF_6qhs.js +504 -0
- package/dist/puppet-B8WICGYE.js +205 -0
- package/dist/python-D3FFx1Id.js +389 -0
- package/dist/q-D2Hjhl2C.js +123 -0
- package/dist/r-D73k5lac.js +174 -0
- package/dist/rpm-Duv_WH0z.js +89 -0
- package/dist/ruby-DGCVqZDt.js +287 -0
- package/dist/sas-XjPv1Vy5.js +268 -0
- package/dist/scheme-DeaA28vt.js +263 -0
- package/dist/shell-Bx6QZTgx.js +145 -0
- package/dist/sieve-CWCD62sW.js +178 -0
- package/dist/simple-mode-DAYwfn8M.js +135 -0
- package/dist/smalltalk-DSQbF4MF.js +153 -0
- package/dist/solr-v_XRf31C.js +80 -0
- package/dist/sparql-BrfDqf0-.js +170 -0
- package/dist/spreadsheet-Csn84Pef.js +98 -0
- package/dist/sql-Bhuc3u9R.js +481 -0
- package/dist/stex-DBkktma-.js +246 -0
- package/dist/stylus-dNd_pqKl.js +750 -0
- package/dist/swift-CHbTprt3.js +202 -0
- package/dist/tcl-BRlMUELr.js +125 -0
- package/dist/textile-CqfTUjd4.js +441 -0
- package/dist/tiddlywiki-BrsoM8KB.js +278 -0
- package/dist/tiki-D-ivWPkc.js +289 -0
- package/dist/toml-t_IhJu83.js +75 -0
- package/dist/troff-DckGF2AE.js +64 -0
- package/dist/ttcn-DlN2TOzU.js +257 -0
- package/dist/ttcn-cfg-pHSvg1fS.js +201 -0
- package/dist/turtle-D9Js0BlL.js +141 -0
- package/dist/vb-CbIGLrpY.js +249 -0
- package/dist/vbscript-8ANWle9n.js +320 -0
- package/dist/velocity-D6hz3Hzw.js +186 -0
- package/dist/verilog-DIV442at.js +565 -0
- package/dist/vhdl-BlTiZo_v.js +174 -0
- package/dist/webidl-Cp3tcqdk.js +179 -0
- package/dist/xquery-BOQU-_D-.js +425 -0
- package/dist/yacas-DQ1WucF0.js +182 -0
- package/dist/z80-P1j44jDI.js +102 -0
- package/package.json +2 -1
- package/dist/index-BoCFgPcb.js +0 -23123
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
function parseWords(str) {
|
|
2
|
+
var obj = {}, words = str.split(" ");
|
|
3
|
+
for (var i = 0; i < words.length; ++i) obj[words[i]] = true;
|
|
4
|
+
return obj;
|
|
5
|
+
}
|
|
6
|
+
var specials = parseWords("$! $$ $& $? $+ $abook $abs $active $activecid " +
|
|
7
|
+
"$activewid $address $addtok $agent $agentname $agentstat $agentver " +
|
|
8
|
+
"$alias $and $anick $ansi2mirc $aop $appactive $appstate $asc $asctime " +
|
|
9
|
+
"$asin $atan $avoice $away $awaymsg $awaytime $banmask $base $bfind " +
|
|
10
|
+
"$binoff $biton $bnick $bvar $bytes $calc $cb $cd $ceil $chan $chanmodes " +
|
|
11
|
+
"$chantypes $chat $chr $cid $clevel $click $cmdbox $cmdline $cnick $color " +
|
|
12
|
+
"$com $comcall $comchan $comerr $compact $compress $comval $cos $count " +
|
|
13
|
+
"$cr $crc $creq $crlf $ctime $ctimer $ctrlenter $date $day $daylight " +
|
|
14
|
+
"$dbuh $dbuw $dccignore $dccport $dde $ddename $debug $decode $decompress " +
|
|
15
|
+
"$deltok $devent $dialog $did $didreg $didtok $didwm $disk $dlevel $dll " +
|
|
16
|
+
"$dllcall $dname $dns $duration $ebeeps $editbox $emailaddr $encode $error " +
|
|
17
|
+
"$eval $event $exist $feof $ferr $fgetc $file $filename $filtered $finddir " +
|
|
18
|
+
"$finddirn $findfile $findfilen $findtok $fline $floor $fopen $fread $fserve " +
|
|
19
|
+
"$fulladdress $fulldate $fullname $fullscreen $get $getdir $getdot $gettok $gmt " +
|
|
20
|
+
"$group $halted $hash $height $hfind $hget $highlight $hnick $hotline " +
|
|
21
|
+
"$hotlinepos $ial $ialchan $ibl $idle $iel $ifmatch $ignore $iif $iil " +
|
|
22
|
+
"$inelipse $ini $inmidi $inpaste $inpoly $input $inrect $inroundrect " +
|
|
23
|
+
"$insong $instok $int $inwave $ip $isalias $isbit $isdde $isdir $isfile " +
|
|
24
|
+
"$isid $islower $istok $isupper $keychar $keyrpt $keyval $knick $lactive " +
|
|
25
|
+
"$lactivecid $lactivewid $left $len $level $lf $line $lines $link $lock " +
|
|
26
|
+
"$lock $locked $log $logstamp $logstampfmt $longfn $longip $lower $ltimer " +
|
|
27
|
+
"$maddress $mask $matchkey $matchtok $md5 $me $menu $menubar $menucontext " +
|
|
28
|
+
"$menutype $mid $middir $mircdir $mircexe $mircini $mklogfn $mnick $mode " +
|
|
29
|
+
"$modefirst $modelast $modespl $mouse $msfile $network $newnick $nick $nofile " +
|
|
30
|
+
"$nopath $noqt $not $notags $notify $null $numeric $numok $oline $onpoly " +
|
|
31
|
+
"$opnick $or $ord $os $passivedcc $pic $play $pnick $port $portable $portfree " +
|
|
32
|
+
"$pos $prefix $prop $protect $puttok $qt $query $rand $r $rawmsg $read $readomo " +
|
|
33
|
+
"$readn $regex $regml $regsub $regsubex $remove $remtok $replace $replacex " +
|
|
34
|
+
"$reptok $result $rgb $right $round $scid $scon $script $scriptdir $scriptline " +
|
|
35
|
+
"$sdir $send $server $serverip $sfile $sha1 $shortfn $show $signal $sin " +
|
|
36
|
+
"$site $sline $snick $snicks $snotify $sock $sockbr $sockerr $sockname " +
|
|
37
|
+
"$sorttok $sound $sqrt $ssl $sreq $sslready $status $strip $str $stripped " +
|
|
38
|
+
"$syle $submenu $switchbar $tan $target $ticks $time $timer $timestamp " +
|
|
39
|
+
"$timestampfmt $timezone $tip $titlebar $toolbar $treebar $trust $ulevel " +
|
|
40
|
+
"$ulist $upper $uptime $url $usermode $v1 $v2 $var $vcmd $vcmdstat $vcmdver " +
|
|
41
|
+
"$version $vnick $vol $wid $width $wildsite $wildtok $window $wrap $xor");
|
|
42
|
+
var keywords = parseWords("abook ajinvite alias aline ame amsg anick aop auser autojoin avoice " +
|
|
43
|
+
"away background ban bcopy beep bread break breplace bset btrunc bunset bwrite " +
|
|
44
|
+
"channel clear clearall cline clipboard close cnick color comclose comopen " +
|
|
45
|
+
"comreg continue copy creq ctcpreply ctcps dcc dccserver dde ddeserver " +
|
|
46
|
+
"debug dec describe dialog did didtok disable disconnect dlevel dline dll " +
|
|
47
|
+
"dns dqwindow drawcopy drawdot drawfill drawline drawpic drawrect drawreplace " +
|
|
48
|
+
"drawrot drawsave drawscroll drawtext ebeeps echo editbox emailaddr enable " +
|
|
49
|
+
"events exit fclose filter findtext finger firewall flash flist flood flush " +
|
|
50
|
+
"flushini font fopen fseek fsend fserve fullname fwrite ghide gload gmove " +
|
|
51
|
+
"gopts goto gplay gpoint gqreq groups gshow gsize gstop gtalk gunload hadd " +
|
|
52
|
+
"halt haltdef hdec hdel help hfree hinc hload hmake hop hsave ial ialclear " +
|
|
53
|
+
"ialmark identd if ignore iline inc invite iuser join kick linesep links list " +
|
|
54
|
+
"load loadbuf localinfo log mdi me menubar mkdir mnick mode msg nick noop notice " +
|
|
55
|
+
"notify omsg onotice part partall pdcc perform play playctrl pop protect pvoice " +
|
|
56
|
+
"qme qmsg query queryn quit raw reload remini remote remove rename renwin " +
|
|
57
|
+
"reseterror resetidle return rlevel rline rmdir run ruser save savebuf saveini " +
|
|
58
|
+
"say scid scon server set showmirc signam sline sockaccept sockclose socklist " +
|
|
59
|
+
"socklisten sockmark sockopen sockpause sockread sockrename sockudp sockwrite " +
|
|
60
|
+
"sound speak splay sreq strip switchbar timer timestamp titlebar tnick tokenize " +
|
|
61
|
+
"toolbar topic tray treebar ulist unload unset unsetall updatenl url uwho " +
|
|
62
|
+
"var vcadd vcmd vcrem vol while whois window winhelp write writeint if isalnum " +
|
|
63
|
+
"isalpha isaop isavoice isban ischan ishop isignore isin isincs isletter islower " +
|
|
64
|
+
"isnotify isnum ison isop isprotect isreg isupper isvoice iswm iswmcs " +
|
|
65
|
+
"elseif else goto menu nicklist status title icon size option text edit " +
|
|
66
|
+
"button check radio box scroll list combo link tab item");
|
|
67
|
+
var functions = parseWords("if elseif else and not or eq ne in ni for foreach while switch");
|
|
68
|
+
var isOperatorChar = /[+\-*&%=<>!?^\/\|]/;
|
|
69
|
+
function chain(stream, state, f) {
|
|
70
|
+
state.tokenize = f;
|
|
71
|
+
return f(stream, state);
|
|
72
|
+
}
|
|
73
|
+
function tokenBase(stream, state) {
|
|
74
|
+
var beforeParams = state.beforeParams;
|
|
75
|
+
state.beforeParams = false;
|
|
76
|
+
var ch = stream.next();
|
|
77
|
+
if (/[\[\]{}\(\),\.]/.test(ch)) {
|
|
78
|
+
if (ch == "(" && beforeParams) state.inParams = true;
|
|
79
|
+
else if (ch == ")") state.inParams = false;
|
|
80
|
+
return null;
|
|
81
|
+
}
|
|
82
|
+
else if (/\d/.test(ch)) {
|
|
83
|
+
stream.eatWhile(/[\w\.]/);
|
|
84
|
+
return "number";
|
|
85
|
+
}
|
|
86
|
+
else if (ch == "\\") {
|
|
87
|
+
stream.eat("\\");
|
|
88
|
+
stream.eat(/./);
|
|
89
|
+
return "number";
|
|
90
|
+
}
|
|
91
|
+
else if (ch == "/" && stream.eat("*")) {
|
|
92
|
+
return chain(stream, state, tokenComment);
|
|
93
|
+
}
|
|
94
|
+
else if (ch == ";" && stream.match(/ *\( *\(/)) {
|
|
95
|
+
return chain(stream, state, tokenUnparsed);
|
|
96
|
+
}
|
|
97
|
+
else if (ch == ";" && !state.inParams) {
|
|
98
|
+
stream.skipToEnd();
|
|
99
|
+
return "comment";
|
|
100
|
+
}
|
|
101
|
+
else if (ch == '"') {
|
|
102
|
+
stream.eat(/"/);
|
|
103
|
+
return "keyword";
|
|
104
|
+
}
|
|
105
|
+
else if (ch == "$") {
|
|
106
|
+
stream.eatWhile(/[$_a-z0-9A-Z\.:]/);
|
|
107
|
+
if (specials && specials.propertyIsEnumerable(stream.current().toLowerCase())) {
|
|
108
|
+
return "keyword";
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
state.beforeParams = true;
|
|
112
|
+
return "builtin";
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
else if (ch == "%") {
|
|
116
|
+
stream.eatWhile(/[^,\s()]/);
|
|
117
|
+
state.beforeParams = true;
|
|
118
|
+
return "string";
|
|
119
|
+
}
|
|
120
|
+
else if (isOperatorChar.test(ch)) {
|
|
121
|
+
stream.eatWhile(isOperatorChar);
|
|
122
|
+
return "operator";
|
|
123
|
+
}
|
|
124
|
+
else {
|
|
125
|
+
stream.eatWhile(/[\w\$_{}]/);
|
|
126
|
+
var word = stream.current().toLowerCase();
|
|
127
|
+
if (keywords && keywords.propertyIsEnumerable(word))
|
|
128
|
+
return "keyword";
|
|
129
|
+
if (functions && functions.propertyIsEnumerable(word)) {
|
|
130
|
+
state.beforeParams = true;
|
|
131
|
+
return "keyword";
|
|
132
|
+
}
|
|
133
|
+
return null;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
function tokenComment(stream, state) {
|
|
137
|
+
var maybeEnd = false, ch;
|
|
138
|
+
while (ch = stream.next()) {
|
|
139
|
+
if (ch == "/" && maybeEnd) {
|
|
140
|
+
state.tokenize = tokenBase;
|
|
141
|
+
break;
|
|
142
|
+
}
|
|
143
|
+
maybeEnd = (ch == "*");
|
|
144
|
+
}
|
|
145
|
+
return "comment";
|
|
146
|
+
}
|
|
147
|
+
function tokenUnparsed(stream, state) {
|
|
148
|
+
var maybeEnd = 0, ch;
|
|
149
|
+
while (ch = stream.next()) {
|
|
150
|
+
if (ch == ";" && maybeEnd == 2) {
|
|
151
|
+
state.tokenize = tokenBase;
|
|
152
|
+
break;
|
|
153
|
+
}
|
|
154
|
+
if (ch == ")")
|
|
155
|
+
maybeEnd++;
|
|
156
|
+
else if (ch != " ")
|
|
157
|
+
maybeEnd = 0;
|
|
158
|
+
}
|
|
159
|
+
return "meta";
|
|
160
|
+
}
|
|
161
|
+
const mirc = {
|
|
162
|
+
name: "mirc",
|
|
163
|
+
startState: function() {
|
|
164
|
+
return {
|
|
165
|
+
tokenize: tokenBase,
|
|
166
|
+
beforeParams: false,
|
|
167
|
+
inParams: false
|
|
168
|
+
};
|
|
169
|
+
},
|
|
170
|
+
token: function(stream, state) {
|
|
171
|
+
if (stream.eatSpace()) return null;
|
|
172
|
+
return state.tokenize(stream, state);
|
|
173
|
+
}
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
export { mirc };
|
|
@@ -0,0 +1,346 @@
|
|
|
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
|
+
name: "ocaml",
|
|
153
|
+
extraWords: {
|
|
154
|
+
'and': 'keyword',
|
|
155
|
+
'assert': 'keyword',
|
|
156
|
+
'begin': 'keyword',
|
|
157
|
+
'class': 'keyword',
|
|
158
|
+
'constraint': 'keyword',
|
|
159
|
+
'done': 'keyword',
|
|
160
|
+
'downto': 'keyword',
|
|
161
|
+
'external': 'keyword',
|
|
162
|
+
'function': 'keyword',
|
|
163
|
+
'initializer': 'keyword',
|
|
164
|
+
'lazy': 'keyword',
|
|
165
|
+
'match': 'keyword',
|
|
166
|
+
'method': 'keyword',
|
|
167
|
+
'module': 'keyword',
|
|
168
|
+
'mutable': 'keyword',
|
|
169
|
+
'new': 'keyword',
|
|
170
|
+
'nonrec': 'keyword',
|
|
171
|
+
'object': 'keyword',
|
|
172
|
+
'private': 'keyword',
|
|
173
|
+
'sig': 'keyword',
|
|
174
|
+
'to': 'keyword',
|
|
175
|
+
'try': 'keyword',
|
|
176
|
+
'value': 'keyword',
|
|
177
|
+
'virtual': 'keyword',
|
|
178
|
+
'when': 'keyword',
|
|
179
|
+
|
|
180
|
+
// builtins
|
|
181
|
+
'raise': 'builtin',
|
|
182
|
+
'failwith': 'builtin',
|
|
183
|
+
'true': 'builtin',
|
|
184
|
+
'false': 'builtin',
|
|
185
|
+
|
|
186
|
+
// Pervasives builtins
|
|
187
|
+
'asr': 'builtin',
|
|
188
|
+
'land': 'builtin',
|
|
189
|
+
'lor': 'builtin',
|
|
190
|
+
'lsl': 'builtin',
|
|
191
|
+
'lsr': 'builtin',
|
|
192
|
+
'lxor': 'builtin',
|
|
193
|
+
'mod': 'builtin',
|
|
194
|
+
'or': 'builtin',
|
|
195
|
+
|
|
196
|
+
// More Pervasives
|
|
197
|
+
'raise_notrace': 'builtin',
|
|
198
|
+
'trace': 'builtin',
|
|
199
|
+
'exit': 'builtin',
|
|
200
|
+
'print_string': 'builtin',
|
|
201
|
+
'print_endline': 'builtin',
|
|
202
|
+
|
|
203
|
+
'int': 'type',
|
|
204
|
+
'float': 'type',
|
|
205
|
+
'bool': 'type',
|
|
206
|
+
'char': 'type',
|
|
207
|
+
'string': 'type',
|
|
208
|
+
'unit': 'type',
|
|
209
|
+
|
|
210
|
+
// Modules
|
|
211
|
+
'List': 'builtin'
|
|
212
|
+
}
|
|
213
|
+
});
|
|
214
|
+
|
|
215
|
+
const fSharp = mlLike({
|
|
216
|
+
name: "fsharp",
|
|
217
|
+
extraWords: {
|
|
218
|
+
'abstract': 'keyword',
|
|
219
|
+
'assert': 'keyword',
|
|
220
|
+
'base': 'keyword',
|
|
221
|
+
'begin': 'keyword',
|
|
222
|
+
'class': 'keyword',
|
|
223
|
+
'default': 'keyword',
|
|
224
|
+
'delegate': 'keyword',
|
|
225
|
+
'do!': 'keyword',
|
|
226
|
+
'done': 'keyword',
|
|
227
|
+
'downcast': 'keyword',
|
|
228
|
+
'downto': 'keyword',
|
|
229
|
+
'elif': 'keyword',
|
|
230
|
+
'extern': 'keyword',
|
|
231
|
+
'finally': 'keyword',
|
|
232
|
+
'for': 'keyword',
|
|
233
|
+
'function': 'keyword',
|
|
234
|
+
'global': 'keyword',
|
|
235
|
+
'inherit': 'keyword',
|
|
236
|
+
'inline': 'keyword',
|
|
237
|
+
'interface': 'keyword',
|
|
238
|
+
'internal': 'keyword',
|
|
239
|
+
'lazy': 'keyword',
|
|
240
|
+
'let!': 'keyword',
|
|
241
|
+
'match': 'keyword',
|
|
242
|
+
'member': 'keyword',
|
|
243
|
+
'module': 'keyword',
|
|
244
|
+
'mutable': 'keyword',
|
|
245
|
+
'namespace': 'keyword',
|
|
246
|
+
'new': 'keyword',
|
|
247
|
+
'null': 'keyword',
|
|
248
|
+
'override': 'keyword',
|
|
249
|
+
'private': 'keyword',
|
|
250
|
+
'public': 'keyword',
|
|
251
|
+
'return!': 'keyword',
|
|
252
|
+
'return': 'keyword',
|
|
253
|
+
'select': 'keyword',
|
|
254
|
+
'static': 'keyword',
|
|
255
|
+
'to': 'keyword',
|
|
256
|
+
'try': 'keyword',
|
|
257
|
+
'upcast': 'keyword',
|
|
258
|
+
'use!': 'keyword',
|
|
259
|
+
'use': 'keyword',
|
|
260
|
+
'void': 'keyword',
|
|
261
|
+
'when': 'keyword',
|
|
262
|
+
'yield!': 'keyword',
|
|
263
|
+
'yield': 'keyword',
|
|
264
|
+
|
|
265
|
+
// Reserved words
|
|
266
|
+
'atomic': 'keyword',
|
|
267
|
+
'break': 'keyword',
|
|
268
|
+
'checked': 'keyword',
|
|
269
|
+
'component': 'keyword',
|
|
270
|
+
'const': 'keyword',
|
|
271
|
+
'constraint': 'keyword',
|
|
272
|
+
'constructor': 'keyword',
|
|
273
|
+
'continue': 'keyword',
|
|
274
|
+
'eager': 'keyword',
|
|
275
|
+
'event': 'keyword',
|
|
276
|
+
'external': 'keyword',
|
|
277
|
+
'fixed': 'keyword',
|
|
278
|
+
'method': 'keyword',
|
|
279
|
+
'mixin': 'keyword',
|
|
280
|
+
'object': 'keyword',
|
|
281
|
+
'parallel': 'keyword',
|
|
282
|
+
'process': 'keyword',
|
|
283
|
+
'protected': 'keyword',
|
|
284
|
+
'pure': 'keyword',
|
|
285
|
+
'sealed': 'keyword',
|
|
286
|
+
'tailcall': 'keyword',
|
|
287
|
+
'trait': 'keyword',
|
|
288
|
+
'virtual': 'keyword',
|
|
289
|
+
'volatile': 'keyword',
|
|
290
|
+
|
|
291
|
+
// builtins
|
|
292
|
+
'List': 'builtin',
|
|
293
|
+
'Seq': 'builtin',
|
|
294
|
+
'Map': 'builtin',
|
|
295
|
+
'Set': 'builtin',
|
|
296
|
+
'Option': 'builtin',
|
|
297
|
+
'int': 'builtin',
|
|
298
|
+
'string': 'builtin',
|
|
299
|
+
'not': 'builtin',
|
|
300
|
+
'true': 'builtin',
|
|
301
|
+
'false': 'builtin',
|
|
302
|
+
|
|
303
|
+
'raise': 'builtin',
|
|
304
|
+
'failwith': 'builtin'
|
|
305
|
+
},
|
|
306
|
+
slashComments: true
|
|
307
|
+
});
|
|
308
|
+
|
|
309
|
+
const sml = mlLike({
|
|
310
|
+
name: "sml",
|
|
311
|
+
extraWords: {
|
|
312
|
+
'abstype': 'keyword',
|
|
313
|
+
'and': 'keyword',
|
|
314
|
+
'andalso': 'keyword',
|
|
315
|
+
'case': 'keyword',
|
|
316
|
+
'datatype': 'keyword',
|
|
317
|
+
'fn': 'keyword',
|
|
318
|
+
'handle': 'keyword',
|
|
319
|
+
'infix': 'keyword',
|
|
320
|
+
'infixr': 'keyword',
|
|
321
|
+
'local': 'keyword',
|
|
322
|
+
'nonfix': 'keyword',
|
|
323
|
+
'op': 'keyword',
|
|
324
|
+
'orelse': 'keyword',
|
|
325
|
+
'raise': 'keyword',
|
|
326
|
+
'withtype': 'keyword',
|
|
327
|
+
'eqtype': 'keyword',
|
|
328
|
+
'sharing': 'keyword',
|
|
329
|
+
'sig': 'keyword',
|
|
330
|
+
'signature': 'keyword',
|
|
331
|
+
'structure': 'keyword',
|
|
332
|
+
'where': 'keyword',
|
|
333
|
+
'true': 'keyword',
|
|
334
|
+
'false': 'keyword',
|
|
335
|
+
|
|
336
|
+
// types
|
|
337
|
+
'int': 'builtin',
|
|
338
|
+
'real': 'builtin',
|
|
339
|
+
'string': 'builtin',
|
|
340
|
+
'char': 'builtin',
|
|
341
|
+
'bool': 'builtin'
|
|
342
|
+
},
|
|
343
|
+
slashComments: true
|
|
344
|
+
});
|
|
345
|
+
|
|
346
|
+
export { fSharp, oCaml, sml };
|