@luxonis/visualizer-protobuf 1.6.1 → 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.
Files changed (136) hide show
  1. package/dist/apl-NdZ6-T1z.js +142 -0
  2. package/dist/apps/depthai-visualizer/lib/src/components/Panel.d.ts +2 -0
  3. package/dist/apps/depthai-visualizer/lib/src/components/Panel.d.ts.map +1 -1
  4. package/dist/apps/depthai-visualizer/lib/src/components/Panel.js +2 -2
  5. package/dist/apps/depthai-visualizer/lib/src/components/Panel.js.map +1 -1
  6. package/dist/apps/depthai-visualizer/lib/src/components/PanelToolbar.d.ts +4 -1
  7. package/dist/apps/depthai-visualizer/lib/src/components/PanelToolbar.d.ts.map +1 -1
  8. package/dist/apps/depthai-visualizer/lib/src/components/PanelToolbar.js +25 -13
  9. package/dist/apps/depthai-visualizer/lib/src/components/PanelToolbar.js.map +1 -1
  10. package/dist/apps/depthai-visualizer/lib/src/panels/ImagePanel.d.ts +2 -8
  11. package/dist/apps/depthai-visualizer/lib/src/panels/ImagePanel.d.ts.map +1 -1
  12. package/dist/apps/depthai-visualizer/lib/src/panels/ImagePanel.js +1 -1
  13. package/dist/apps/depthai-visualizer/lib/src/panels/ImagePanel.js.map +1 -1
  14. package/dist/apps/depthai-visualizer/lib/src/panels/PointCloudPanel.js +2 -2
  15. package/dist/apps/depthai-visualizer/lib/src/panels/PointCloudPanel.js.map +1 -1
  16. package/dist/asciiarmor-CmJEbAuq.js +56 -0
  17. package/dist/asn1-CG_zvzH1.js +192 -0
  18. package/dist/asterisk-D6r__RMF.js +187 -0
  19. package/dist/brainfuck-COwWCBpq.js +70 -0
  20. package/dist/clike-BjlaHgsH.js +1018 -0
  21. package/dist/clojure-C2XPrGCa.js +274 -0
  22. package/dist/cmake-BGrEgXCL.js +81 -0
  23. package/dist/cobol-BfwG5XeO.js +235 -0
  24. package/dist/coffeescript-BG8vTfSz.js +329 -0
  25. package/dist/commonlisp-8oE2EpEe.js +108 -0
  26. package/dist/crystal--rIRMl16.js +419 -0
  27. package/dist/css-C_ZeEwz2.js +847 -0
  28. package/dist/cypher-Bayei42D.js +122 -0
  29. package/dist/d-B0hhz6be.js +205 -0
  30. package/dist/diff-DQutOIXs.js +30 -0
  31. package/dist/dockerfile-FAjn0vs9.js +199 -0
  32. package/dist/dtd-C1CeYVnM.js +121 -0
  33. package/dist/dylan-Dm9-uD-A.js +337 -0
  34. package/dist/ebnf-jWG_1Yly.js +151 -0
  35. package/dist/ecl-CgJPA6z9.js +190 -0
  36. package/dist/eiffel-lj7uLahq.js +146 -0
  37. package/dist/elm-Cz7o1ijk.js +230 -0
  38. package/dist/erlang-CyL5QOyR.js +581 -0
  39. package/dist/factor-B0KnwW_L.js +65 -0
  40. package/dist/fcl-DiozYjc8.js +154 -0
  41. package/dist/forth-B7vn5ze0.js +164 -0
  42. package/dist/fortran-D2XNEnBT.js +172 -0
  43. package/dist/gas-B_Tj57Ve.js +343 -0
  44. package/dist/gherkin-CJ6Qk4EZ.js +147 -0
  45. package/dist/groovy-BD9p_7sW.js +230 -0
  46. package/dist/haskell-BHnm1B83.js +239 -0
  47. package/dist/haxe-DWtZc5G9.js +490 -0
  48. package/dist/http-BOd5SYCT.js +89 -0
  49. package/dist/idl-FSFk8_xX.js +274 -0
  50. package/dist/index-B2YTRRfg.js +77 -0
  51. package/dist/{index-D4ve6uXS.js → index-Beii0-_3.js} +7 -4
  52. package/dist/index-BjWYigIi.js +124 -0
  53. package/dist/index-Bx-Bh4nu.js +114 -0
  54. package/dist/index-Bya68zyH.js +154265 -0
  55. package/dist/index-C3_VkVgd.js +626 -0
  56. package/dist/index-CIOyzzeT.js +199 -0
  57. package/dist/index-CY_MdHWz.js +810 -0
  58. package/dist/index-D8b2daZv.js +155 -0
  59. package/dist/index-DW9KaYNb.js +149 -0
  60. package/dist/index-DZ4eTPnT.js +497 -0
  61. package/dist/index-DZeM9OAW.js +356 -0
  62. package/dist/index-DgQXSEwG.js +348 -0
  63. package/dist/index-DuTu94nj.js +436 -0
  64. package/dist/{index-BZ45K_PO.js → index-KZ3VqQGp.js} +123 -76
  65. package/dist/index-WQmqQNn4.js +205 -0
  66. package/dist/index-o4kozweh.js +458 -0
  67. package/dist/index-rTpSqKsn.js +103 -0
  68. package/dist/index-tmy4XtHv.js +346 -0
  69. package/dist/index.js +7 -3
  70. package/dist/javascript-CWIx5LQU.js +922 -0
  71. package/dist/jinja2-D9k5QrXv.js +171 -0
  72. package/dist/julia-DM42tOPB.js +369 -0
  73. package/dist/livescript-Jd_p-LwX.js +259 -0
  74. package/dist/lua-CByQu4v6.js +137 -0
  75. package/dist/mathematica-Dkv0uCYF.js +153 -0
  76. package/dist/mbox-CYTvs5kC.js +114 -0
  77. package/dist/mirc-DpgP3GCo.js +176 -0
  78. package/dist/mllike-Ti5DOjKW.js +346 -0
  79. package/dist/modelica-CR6hTSce.js +192 -0
  80. package/dist/mscgen-D0GXtzMS.js +149 -0
  81. package/dist/mumps-Bf1EyDa6.js +129 -0
  82. package/dist/nginx-By9Phklj.js +163 -0
  83. package/dist/nsis-27gzqCGG.js +80 -0
  84. package/dist/ntriples-C7VJ7pnm.js +141 -0
  85. package/dist/octave-6yR_ix15.js +112 -0
  86. package/dist/oz-CEUnktiQ.js +235 -0
  87. package/dist/package.json +1 -0
  88. package/dist/packages/studio-base/src/panels/ThreeDeeRender/renderables/ImageMode/MessageHandler.d.ts.map +1 -1
  89. package/dist/packages/studio-base/src/panels/ThreeDeeRender/renderables/ImageMode/MessageHandler.js +83 -57
  90. package/dist/packages/studio-base/src/panels/ThreeDeeRender/renderables/ImageMode/MessageHandler.js.map +1 -1
  91. package/dist/pascal-AdN1jbEG.js +124 -0
  92. package/dist/perl-B99DUQQt.js +819 -0
  93. package/dist/pig-DFeDRta6.js +149 -0
  94. package/dist/powershell-DhwsNWMx.js +381 -0
  95. package/dist/properties-o21uErwC.js +62 -0
  96. package/dist/protobuf-YxlANsmD.js +54 -0
  97. package/dist/pug-OXF_6qhs.js +504 -0
  98. package/dist/puppet-B8WICGYE.js +205 -0
  99. package/dist/python-D3FFx1Id.js +389 -0
  100. package/dist/q-D2Hjhl2C.js +123 -0
  101. package/dist/r-D73k5lac.js +174 -0
  102. package/dist/rpm-Duv_WH0z.js +89 -0
  103. package/dist/ruby-DGCVqZDt.js +287 -0
  104. package/dist/sas-XjPv1Vy5.js +268 -0
  105. package/dist/scheme-DeaA28vt.js +263 -0
  106. package/dist/shell-Bx6QZTgx.js +145 -0
  107. package/dist/sieve-CWCD62sW.js +178 -0
  108. package/dist/simple-mode-DAYwfn8M.js +135 -0
  109. package/dist/smalltalk-DSQbF4MF.js +153 -0
  110. package/dist/solr-v_XRf31C.js +80 -0
  111. package/dist/sparql-BrfDqf0-.js +170 -0
  112. package/dist/spreadsheet-Csn84Pef.js +98 -0
  113. package/dist/sql-Bhuc3u9R.js +481 -0
  114. package/dist/stex-DBkktma-.js +246 -0
  115. package/dist/stylus-dNd_pqKl.js +750 -0
  116. package/dist/swift-CHbTprt3.js +202 -0
  117. package/dist/tcl-BRlMUELr.js +125 -0
  118. package/dist/textile-CqfTUjd4.js +441 -0
  119. package/dist/tiddlywiki-BrsoM8KB.js +278 -0
  120. package/dist/tiki-D-ivWPkc.js +289 -0
  121. package/dist/toml-t_IhJu83.js +75 -0
  122. package/dist/troff-DckGF2AE.js +64 -0
  123. package/dist/ttcn-DlN2TOzU.js +257 -0
  124. package/dist/ttcn-cfg-pHSvg1fS.js +201 -0
  125. package/dist/turtle-D9Js0BlL.js +141 -0
  126. package/dist/vb-CbIGLrpY.js +249 -0
  127. package/dist/vbscript-8ANWle9n.js +320 -0
  128. package/dist/velocity-D6hz3Hzw.js +186 -0
  129. package/dist/verilog-DIV442at.js +565 -0
  130. package/dist/vhdl-BlTiZo_v.js +174 -0
  131. package/dist/webidl-Cp3tcqdk.js +179 -0
  132. package/dist/xquery-BOQU-_D-.js +425 -0
  133. package/dist/yacas-DQ1WucF0.js +182 -0
  134. package/dist/z80-P1j44jDI.js +102 -0
  135. package/package.json +2 -1
  136. package/dist/index-BSCvlHcY.js +0 -23123
@@ -0,0 +1,154 @@
1
+ var keywords = {
2
+ "term": true,
3
+ "method": true, "accu": true,
4
+ "rule": true, "then": true, "is": true, "and": true, "or": true,
5
+ "if": true, "default": true
6
+ };
7
+
8
+ var start_blocks = {
9
+ "var_input": true,
10
+ "var_output": true,
11
+ "fuzzify": true,
12
+ "defuzzify": true,
13
+ "function_block": true,
14
+ "ruleblock": true
15
+ };
16
+
17
+ var end_blocks = {
18
+ "end_ruleblock": true,
19
+ "end_defuzzify": true,
20
+ "end_function_block": true,
21
+ "end_fuzzify": true,
22
+ "end_var": true
23
+ };
24
+
25
+ var atoms = {
26
+ "true": true, "false": true, "nan": true,
27
+ "real": true, "min": true, "max": true, "cog": true, "cogs": true
28
+ };
29
+
30
+ var isOperatorChar = /[+\-*&^%:=<>!|\/]/;
31
+
32
+ function tokenBase(stream, state) {
33
+ var ch = stream.next();
34
+
35
+ if (/[\d\.]/.test(ch)) {
36
+ if (ch == ".") {
37
+ stream.match(/^[0-9]+([eE][\-+]?[0-9]+)?/);
38
+ } else if (ch == "0") {
39
+ stream.match(/^[xX][0-9a-fA-F]+/) || stream.match(/^0[0-7]+/);
40
+ } else {
41
+ stream.match(/^[0-9]*\.?[0-9]*([eE][\-+]?[0-9]+)?/);
42
+ }
43
+ return "number";
44
+ }
45
+
46
+ if (ch == "/" || ch == "(") {
47
+ if (stream.eat("*")) {
48
+ state.tokenize = tokenComment;
49
+ return tokenComment(stream, state);
50
+ }
51
+ if (stream.eat("/")) {
52
+ stream.skipToEnd();
53
+ return "comment";
54
+ }
55
+ }
56
+ if (isOperatorChar.test(ch)) {
57
+ stream.eatWhile(isOperatorChar);
58
+ return "operator";
59
+ }
60
+ stream.eatWhile(/[\w\$_\xa1-\uffff]/);
61
+
62
+ var cur = stream.current().toLowerCase();
63
+ if (keywords.propertyIsEnumerable(cur) ||
64
+ start_blocks.propertyIsEnumerable(cur) ||
65
+ end_blocks.propertyIsEnumerable(cur)) {
66
+ return "keyword";
67
+ }
68
+ if (atoms.propertyIsEnumerable(cur)) return "atom";
69
+ return "variable";
70
+ }
71
+
72
+
73
+ function tokenComment(stream, state) {
74
+ var maybeEnd = false, ch;
75
+ while (ch = stream.next()) {
76
+ if ((ch == "/" || ch == ")") && maybeEnd) {
77
+ state.tokenize = tokenBase;
78
+ break;
79
+ }
80
+ maybeEnd = (ch == "*");
81
+ }
82
+ return "comment";
83
+ }
84
+
85
+ function Context(indented, column, type, align, prev) {
86
+ this.indented = indented;
87
+ this.column = column;
88
+ this.type = type;
89
+ this.align = align;
90
+ this.prev = prev;
91
+ }
92
+
93
+ function pushContext(state, col, type) {
94
+ return state.context = new Context(state.indented, col, type, null, state.context);
95
+ }
96
+
97
+ function popContext(state) {
98
+ if (!state.context.prev) return;
99
+ var t = state.context.type;
100
+ if (t == "end_block")
101
+ state.indented = state.context.indented;
102
+ return state.context = state.context.prev;
103
+ }
104
+
105
+ // Interface
106
+
107
+ const fcl = {
108
+ name: "fcl",
109
+ startState: function(indentUnit) {
110
+ return {
111
+ tokenize: null,
112
+ context: new Context(-indentUnit, 0, "top", false),
113
+ indented: 0,
114
+ startOfLine: true
115
+ };
116
+ },
117
+
118
+ token: function(stream, state) {
119
+ var ctx = state.context;
120
+ if (stream.sol()) {
121
+ if (ctx.align == null) ctx.align = false;
122
+ state.indented = stream.indentation();
123
+ state.startOfLine = true;
124
+ }
125
+ if (stream.eatSpace()) return null;
126
+
127
+ var style = (state.tokenize || tokenBase)(stream, state);
128
+ if (style == "comment") return style;
129
+ if (ctx.align == null) ctx.align = true;
130
+
131
+ var cur = stream.current().toLowerCase();
132
+
133
+ if (start_blocks.propertyIsEnumerable(cur)) pushContext(state, stream.column(), "end_block");
134
+ else if (end_blocks.propertyIsEnumerable(cur)) popContext(state);
135
+
136
+ state.startOfLine = false;
137
+ return style;
138
+ },
139
+
140
+ indent: function(state, textAfter, cx) {
141
+ if (state.tokenize != tokenBase && state.tokenize != null) return 0;
142
+ var ctx = state.context;
143
+
144
+ var closing = end_blocks.propertyIsEnumerable(textAfter);
145
+ if (ctx.align) return ctx.column + (closing ? 0 : 1);
146
+ else return ctx.indented + (closing ? 0 : cx.unit);
147
+ },
148
+
149
+ languageData: {
150
+ commentTokens: {line: "//", block: {open: "(*", close: "*)"}}
151
+ }
152
+ };
153
+
154
+ export { fcl };
@@ -0,0 +1,164 @@
1
+ function toWordList(words) {
2
+ var ret = [];
3
+ words.split(' ').forEach(function(e){
4
+ ret.push({name: e});
5
+ });
6
+ return ret;
7
+ }
8
+
9
+ var coreWordList = toWordList(
10
+ 'INVERT AND OR XOR\
11
+ 2* 2/ LSHIFT RSHIFT\
12
+ 0= = 0< < > U< MIN MAX\
13
+ 2DROP 2DUP 2OVER 2SWAP ?DUP DEPTH DROP DUP OVER ROT SWAP\
14
+ >R R> R@\
15
+ + - 1+ 1- ABS NEGATE\
16
+ S>D * M* UM*\
17
+ FM/MOD SM/REM UM/MOD */ */MOD / /MOD MOD\
18
+ HERE , @ ! CELL+ CELLS C, C@ C! CHARS 2@ 2!\
19
+ ALIGN ALIGNED +! ALLOT\
20
+ CHAR [CHAR] [ ] BL\
21
+ FIND EXECUTE IMMEDIATE COUNT LITERAL STATE\
22
+ ; DOES> >BODY\
23
+ EVALUATE\
24
+ SOURCE >IN\
25
+ <# # #S #> HOLD SIGN BASE >NUMBER HEX DECIMAL\
26
+ FILL MOVE\
27
+ . CR EMIT SPACE SPACES TYPE U. .R U.R\
28
+ ACCEPT\
29
+ TRUE FALSE\
30
+ <> U> 0<> 0>\
31
+ NIP TUCK ROLL PICK\
32
+ 2>R 2R@ 2R>\
33
+ WITHIN UNUSED MARKER\
34
+ I J\
35
+ TO\
36
+ COMPILE, [COMPILE]\
37
+ SAVE-INPUT RESTORE-INPUT\
38
+ PAD ERASE\
39
+ 2LITERAL DNEGATE\
40
+ D- D+ D0< D0= D2* D2/ D< D= DMAX DMIN D>S DABS\
41
+ M+ M*/ D. D.R 2ROT DU<\
42
+ CATCH THROW\
43
+ FREE RESIZE ALLOCATE\
44
+ CS-PICK CS-ROLL\
45
+ GET-CURRENT SET-CURRENT FORTH-WORDLIST GET-ORDER SET-ORDER\
46
+ PREVIOUS SEARCH-WORDLIST WORDLIST FIND ALSO ONLY FORTH DEFINITIONS ORDER\
47
+ -TRAILING /STRING SEARCH COMPARE CMOVE CMOVE> BLANK SLITERAL');
48
+
49
+ 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');
50
+
51
+ function searchWordList (wordList, word) {
52
+ var i;
53
+ for (i = wordList.length - 1; i >= 0; i--) {
54
+ if (wordList[i].name === word.toUpperCase()) {
55
+ return wordList[i];
56
+ }
57
+ }
58
+ return undefined;
59
+ }
60
+ const forth = {
61
+ name: "forth",
62
+ startState: function() {
63
+ return {
64
+ state: '',
65
+ base: 10,
66
+ coreWordList: coreWordList,
67
+ immediateWordList: immediateWordList,
68
+ wordList: []
69
+ };
70
+ },
71
+ token: function (stream, stt) {
72
+ var mat;
73
+ if (stream.eatSpace()) {
74
+ return null;
75
+ }
76
+ if (stt.state === '') { // interpretation
77
+ if (stream.match(/^(\]|:NONAME)(\s|$)/i)) {
78
+ stt.state = ' compilation';
79
+ return 'builtin';
80
+ }
81
+ mat = stream.match(/^(\:)\s+(\S+)(\s|$)+/);
82
+ if (mat) {
83
+ stt.wordList.push({name: mat[2].toUpperCase()});
84
+ stt.state = ' compilation';
85
+ return 'def';
86
+ }
87
+ mat = stream.match(/^(VARIABLE|2VARIABLE|CONSTANT|2CONSTANT|CREATE|POSTPONE|VALUE|WORD)\s+(\S+)(\s|$)+/i);
88
+ if (mat) {
89
+ stt.wordList.push({name: mat[2].toUpperCase()});
90
+ return 'def';
91
+ }
92
+ mat = stream.match(/^(\'|\[\'\])\s+(\S+)(\s|$)+/);
93
+ if (mat) {
94
+ return 'builtin'
95
+ }
96
+ } else { // compilation
97
+ // ; [
98
+ if (stream.match(/^(\;|\[)(\s)/)) {
99
+ stt.state = '';
100
+ stream.backUp(1);
101
+ return 'builtin';
102
+ }
103
+ if (stream.match(/^(\;|\[)($)/)) {
104
+ stt.state = '';
105
+ return 'builtin';
106
+ }
107
+ if (stream.match(/^(POSTPONE)\s+\S+(\s|$)+/)) {
108
+ return 'builtin';
109
+ }
110
+ }
111
+
112
+ // dynamic wordlist
113
+ mat = stream.match(/^(\S+)(\s+|$)/);
114
+ if (mat) {
115
+ if (searchWordList(stt.wordList, mat[1]) !== undefined) {
116
+ return 'variable';
117
+ }
118
+
119
+ // comments
120
+ if (mat[1] === '\\') {
121
+ stream.skipToEnd();
122
+ return 'comment';
123
+ }
124
+
125
+ // core words
126
+ if (searchWordList(stt.coreWordList, mat[1]) !== undefined) {
127
+ return 'builtin';
128
+ }
129
+ if (searchWordList(stt.immediateWordList, mat[1]) !== undefined) {
130
+ return 'keyword';
131
+ }
132
+
133
+ if (mat[1] === '(') {
134
+ stream.eatWhile(function (s) { return s !== ')'; });
135
+ stream.eat(')');
136
+ return 'comment';
137
+ }
138
+
139
+ // // strings
140
+ if (mat[1] === '.(') {
141
+ stream.eatWhile(function (s) { return s !== ')'; });
142
+ stream.eat(')');
143
+ return 'string';
144
+ }
145
+ if (mat[1] === 'S"' || mat[1] === '."' || mat[1] === 'C"') {
146
+ stream.eatWhile(function (s) { return s !== '"'; });
147
+ stream.eat('"');
148
+ return 'string';
149
+ }
150
+
151
+ // numbers
152
+ if (mat[1] - 0xfffffffff) {
153
+ return 'number';
154
+ }
155
+ // if (mat[1].match(/^[-+]?[0-9]+\.[0-9]*/)) {
156
+ // return 'number';
157
+ // }
158
+
159
+ return 'atom';
160
+ }
161
+ }
162
+ };
163
+
164
+ export { forth };
@@ -0,0 +1,172 @@
1
+ function words(array) {
2
+ var keys = {};
3
+ for (var i = 0; i < array.length; ++i) {
4
+ keys[array[i]] = true;
5
+ }
6
+ return keys;
7
+ }
8
+
9
+ var keywords = words([
10
+ "abstract", "accept", "allocatable", "allocate",
11
+ "array", "assign", "asynchronous", "backspace",
12
+ "bind", "block", "byte", "call", "case",
13
+ "class", "close", "common", "contains",
14
+ "continue", "cycle", "data", "deallocate",
15
+ "decode", "deferred", "dimension", "do",
16
+ "elemental", "else", "encode", "end",
17
+ "endif", "entry", "enumerator", "equivalence",
18
+ "exit", "external", "extrinsic", "final",
19
+ "forall", "format", "function", "generic",
20
+ "go", "goto", "if", "implicit", "import", "include",
21
+ "inquire", "intent", "interface", "intrinsic",
22
+ "module", "namelist", "non_intrinsic",
23
+ "non_overridable", "none", "nopass",
24
+ "nullify", "open", "optional", "options",
25
+ "parameter", "pass", "pause", "pointer",
26
+ "print", "private", "program", "protected",
27
+ "public", "pure", "read", "recursive", "result",
28
+ "return", "rewind", "save", "select", "sequence",
29
+ "stop", "subroutine", "target", "then", "to", "type",
30
+ "use", "value", "volatile", "where", "while",
31
+ "write"]);
32
+ var builtins = words(["abort", "abs", "access", "achar", "acos",
33
+ "adjustl", "adjustr", "aimag", "aint", "alarm",
34
+ "all", "allocated", "alog", "amax", "amin",
35
+ "amod", "and", "anint", "any", "asin",
36
+ "associated", "atan", "besj", "besjn", "besy",
37
+ "besyn", "bit_size", "btest", "cabs", "ccos",
38
+ "ceiling", "cexp", "char", "chdir", "chmod",
39
+ "clog", "cmplx", "command_argument_count",
40
+ "complex", "conjg", "cos", "cosh", "count",
41
+ "cpu_time", "cshift", "csin", "csqrt", "ctime",
42
+ "c_funloc", "c_loc", "c_associated", "c_null_ptr",
43
+ "c_null_funptr", "c_f_pointer", "c_null_char",
44
+ "c_alert", "c_backspace", "c_form_feed",
45
+ "c_new_line", "c_carriage_return",
46
+ "c_horizontal_tab", "c_vertical_tab", "dabs",
47
+ "dacos", "dasin", "datan", "date_and_time",
48
+ "dbesj", "dbesj", "dbesjn", "dbesy", "dbesy",
49
+ "dbesyn", "dble", "dcos", "dcosh", "ddim", "derf",
50
+ "derfc", "dexp", "digits", "dim", "dint", "dlog",
51
+ "dlog", "dmax", "dmin", "dmod", "dnint",
52
+ "dot_product", "dprod", "dsign", "dsinh",
53
+ "dsin", "dsqrt", "dtanh", "dtan", "dtime",
54
+ "eoshift", "epsilon", "erf", "erfc", "etime",
55
+ "exit", "exp", "exponent", "extends_type_of",
56
+ "fdate", "fget", "fgetc", "float", "floor",
57
+ "flush", "fnum", "fputc", "fput", "fraction",
58
+ "fseek", "fstat", "ftell", "gerror", "getarg",
59
+ "get_command", "get_command_argument",
60
+ "get_environment_variable", "getcwd",
61
+ "getenv", "getgid", "getlog", "getpid",
62
+ "getuid", "gmtime", "hostnm", "huge", "iabs",
63
+ "iachar", "iand", "iargc", "ibclr", "ibits",
64
+ "ibset", "ichar", "idate", "idim", "idint",
65
+ "idnint", "ieor", "ierrno", "ifix", "imag",
66
+ "imagpart", "index", "int", "ior", "irand",
67
+ "isatty", "ishft", "ishftc", "isign",
68
+ "iso_c_binding", "is_iostat_end", "is_iostat_eor",
69
+ "itime", "kill", "kind", "lbound", "len", "len_trim",
70
+ "lge", "lgt", "link", "lle", "llt", "lnblnk", "loc",
71
+ "log", "logical", "long", "lshift", "lstat", "ltime",
72
+ "matmul", "max", "maxexponent", "maxloc", "maxval",
73
+ "mclock", "merge", "move_alloc", "min", "minexponent",
74
+ "minloc", "minval", "mod", "modulo", "mvbits",
75
+ "nearest", "new_line", "nint", "not", "or", "pack",
76
+ "perror", "precision", "present", "product", "radix",
77
+ "rand", "random_number", "random_seed", "range",
78
+ "real", "realpart", "rename", "repeat", "reshape",
79
+ "rrspacing", "rshift", "same_type_as", "scale",
80
+ "scan", "second", "selected_int_kind",
81
+ "selected_real_kind", "set_exponent", "shape",
82
+ "short", "sign", "signal", "sinh", "sin", "sleep",
83
+ "sngl", "spacing", "spread", "sqrt", "srand", "stat",
84
+ "sum", "symlnk", "system", "system_clock", "tan",
85
+ "tanh", "time", "tiny", "transfer", "transpose",
86
+ "trim", "ttynam", "ubound", "umask", "unlink",
87
+ "unpack", "verify", "xor", "zabs", "zcos", "zexp",
88
+ "zlog", "zsin", "zsqrt"]);
89
+
90
+ var dataTypes = words(["c_bool", "c_char", "c_double", "c_double_complex",
91
+ "c_float", "c_float_complex", "c_funptr", "c_int",
92
+ "c_int16_t", "c_int32_t", "c_int64_t", "c_int8_t",
93
+ "c_int_fast16_t", "c_int_fast32_t", "c_int_fast64_t",
94
+ "c_int_fast8_t", "c_int_least16_t", "c_int_least32_t",
95
+ "c_int_least64_t", "c_int_least8_t", "c_intmax_t",
96
+ "c_intptr_t", "c_long", "c_long_double",
97
+ "c_long_double_complex", "c_long_long", "c_ptr",
98
+ "c_short", "c_signed_char", "c_size_t", "character",
99
+ "complex", "double", "integer", "logical", "real"]);
100
+ var isOperatorChar = /[+\-*&=<>\/\:]/;
101
+ var litOperator = /^\.(and|or|eq|lt|le|gt|ge|ne|not|eqv|neqv)\./i;
102
+
103
+ function tokenBase(stream, state) {
104
+
105
+ if (stream.match(litOperator)){
106
+ return 'operator';
107
+ }
108
+
109
+ var ch = stream.next();
110
+ if (ch == "!") {
111
+ stream.skipToEnd();
112
+ return "comment";
113
+ }
114
+ if (ch == '"' || ch == "'") {
115
+ state.tokenize = tokenString(ch);
116
+ return state.tokenize(stream, state);
117
+ }
118
+ if (/[\[\]\(\),]/.test(ch)) {
119
+ return null;
120
+ }
121
+ if (/\d/.test(ch)) {
122
+ stream.eatWhile(/[\w\.]/);
123
+ return "number";
124
+ }
125
+ if (isOperatorChar.test(ch)) {
126
+ stream.eatWhile(isOperatorChar);
127
+ return "operator";
128
+ }
129
+ stream.eatWhile(/[\w\$_]/);
130
+ var word = stream.current().toLowerCase();
131
+
132
+ if (keywords.hasOwnProperty(word)){
133
+ return 'keyword';
134
+ }
135
+ if (builtins.hasOwnProperty(word) || dataTypes.hasOwnProperty(word)) {
136
+ return 'builtin';
137
+ }
138
+ return "variable";
139
+ }
140
+
141
+ function tokenString(quote) {
142
+ return function(stream, state) {
143
+ var escaped = false, next, end = false;
144
+ while ((next = stream.next()) != null) {
145
+ if (next == quote && !escaped) {
146
+ end = true;
147
+ break;
148
+ }
149
+ escaped = !escaped && next == "\\";
150
+ }
151
+ if (end || !escaped) state.tokenize = null;
152
+ return "string";
153
+ };
154
+ }
155
+
156
+ // Interface
157
+
158
+ const fortran = {
159
+ name: "fortran",
160
+ startState: function() {
161
+ return {tokenize: null};
162
+ },
163
+
164
+ token: function(stream, state) {
165
+ if (stream.eatSpace()) return null;
166
+ var style = (state.tokenize || tokenBase)(stream, state);
167
+ if (style == "comment" || style == "meta") return style;
168
+ return style;
169
+ }
170
+ };
171
+
172
+ export { fortran };