git.iko.soy/rowtype-yoga/psfp
on 557f5b0 help sign in
892 lines 21 kB history raw
1'use strict'
2var monacoEditor = require('@monaco-editor/react');
4exports.editorImpl = monacoEditor.default;
6exports.initMonacoImpl = function() {
7 return monacoEditor.monaco.init();
8}
10exports.getValue = function(editor) {
11 return function() {
12 return editor.getValue();
13 }
16exports.defineThemeImpl = function(monacoInstance) {
17 return function(name) {
18 return function(theme) {
19 return function() {
20 return monacoInstance.editor.defineTheme(name, theme);
21 }
22 }
23 }
26exports.setThemeImpl = function(monacoInstance) {
27 return function(theme) {
28 return function() {
29 return monacoInstance.editor.setTheme(theme);
30 }
31 }
34exports.registerLanguageImpl = function(monacoInstance) {
35 return function(languageId) {
36 return function() {
37 monacoInstance.languages.register({ id: languageId})
38 }
39 }
42exports.setMonarchTokensProviderImpl = function(monacoInstance) {
43 return function(name) {
44 return function(monarchLanguage) {
45 return function() {
46 return monacoInstance.languages.setMonarchTokensProvider(name, monarchLanguage);
47 }
48 }
49 }
52exports.nightOwlTheme = {
53 "base": "vs-dark",
54 "inherit": true,
55 "rules": [
56 {
57 "foreground": "637777",
58 "token": "comment"
59 },
60 {
61 "foreground": "addb67",
62 "token": "string"
63 },
64 {
65 "foreground": "ecc48d",
66 "token": "vstring.quoted"
67 },
68 {
69 "foreground": "ecc48d",
70 "token": "variable.other.readwrite.js"
71 },
72 {
73 "foreground": "5ca7e4",
74 "token": "string.regexp"
75 },
76 {
77 "foreground": "5ca7e4",
78 "token": "string.regexp keyword.other"
79 },
80 {
81 "foreground": "5f7e97",
82 "token": "meta.function punctuation.separator.comma"
83 },
84 {
85 "foreground": "f78c6c",
86 "token": "constant.numeric"
87 },
88 {
89 "foreground": "f78c6c",
90 "token": "constant.character.numeric"
91 },
92 {
93 "foreground": "addb67",
94 "token": "variable"
95 },
96 {
97 "foreground": "c792ea",
98 "token": "keyword"
99 },
100 {
101 "foreground": "c792ea",
102 "token": "punctuation.accessor"
103 },
104 {
105 "foreground": "c792ea",
106 "token": "storage"
107 },
108 {
109 "foreground": "c792ea",
110 "token": "meta.var.expr"
111 },
112 {
113 "foreground": "c792ea",
114 "token": "meta.class meta.method.declaration meta.var.expr storage.type.jsm"
115 },
116 {
117 "foreground": "c792ea",
118 "token": "storage.type.property.js"
119 },
120 {
121 "foreground": "c792ea",
122 "token": "storage.type.property.ts"
123 },
124 {
125 "foreground": "c792ea",
126 "token": "storage.type.property.tsx"
127 },
128 {
129 "foreground": "82aaff",
130 "token": "storage.type"
131 },
132 {
133 "foreground": "ffcb8b",
134 "token": "entity.name.class"
135 },
136 {
137 "foreground": "ffcb8b",
138 "token": "meta.class entity.name.type.class"
139 },
140 {
141 "foreground": "addb67",
142 "token": "entity.other.inherited-class"
143 },
144 {
145 "foreground": "82aaff",
146 "token": "entity.name.function"
147 },
148 {
149 "foreground": "addb67",
150 "token": "punctuation.definition.variable"
151 },
152 {
153 "foreground": "d3423e",
154 "token": "punctuation.section.embedded"
155 },
156 {
157 "foreground": "d6deeb",
158 "token": "punctuation.terminator.expression"
159 },
160 {
161 "foreground": "d6deeb",
162 "token": "punctuation.definition.arguments"
163 },
164 {
165 "foreground": "d6deeb",
166 "token": "punctuation.definition.array"
167 },
168 {
169 "foreground": "d6deeb",
170 "token": "punctuation.section.array"
171 },
172 {
173 "foreground": "d6deeb",
174 "token": "meta.array"
175 },
176 {
177 "foreground": "d9f5dd",
178 "token": "punctuation.definition.list.begin"
179 },
180 {
181 "foreground": "d9f5dd",
182 "token": "punctuation.definition.list.end"
183 },
184 {
185 "foreground": "d9f5dd",
186 "token": "punctuation.separator.arguments"
187 },
188 {
189 "foreground": "d9f5dd",
190 "token": "punctuation.definition.list"
191 },
192 {
193 "foreground": "d3423e",
194 "token": "string.template meta.template.expression"
195 },
196 {
197 "foreground": "d6deeb",
198 "token": "string.template punctuation.definition.string"
199 },
200 {
201 "foreground": "c792ea",
202 "fontStyle": "italic",
203 "token": "italic"
204 },
205 {
206 "foreground": "addb67",
207 "fontStyle": "bold",
208 "token": "bold"
209 },
210 {
211 "foreground": "82aaff",
212 "token": "constant.language"
213 },
214 {
215 "foreground": "82aaff",
216 "token": "punctuation.definition.constant"
217 },
218 {
219 "foreground": "82aaff",
220 "token": "variable.other.constant"
221 },
222 {
223 "foreground": "7fdbca",
224 "token": "support.function.construct"
225 },
226 {
227 "foreground": "7fdbca",
228 "token": "keyword.other.new"
229 },
230 {
231 "foreground": "82aaff",
232 "token": "constant.character"
233 },
234 {
235 "foreground": "82aaff",
236 "token": "constant.other"
237 },
238 {
239 "foreground": "f78c6c",
240 "token": "constant.character.escape"
241 },
242 {
243 "foreground": "addb67",
244 "token": "entity.other.inherited-class"
245 },
246 {
247 "foreground": "d7dbe0",
248 "token": "variable.parameter"
249 },
250 {
251 "foreground": "7fdbca",
252 "token": "entity.name.tag"
253 },
254 {
255 "foreground": "cc2996",
256 "token": "punctuation.definition.tag.html"
257 },
258 {
259 "foreground": "cc2996",
260 "token": "punctuation.definition.tag.begin"
261 },
262 {
263 "foreground": "cc2996",
264 "token": "punctuation.definition.tag.end"
265 },
266 {
267 "foreground": "addb67",
268 "token": "entity.other.attribute-name"
269 },
270 {
271 "foreground": "addb67",
272 "token": "entity.name.tag.custom"
273 },
274 {
275 "foreground": "82aaff",
276 "token": "support.function"
277 },
278 {
279 "foreground": "82aaff",
280 "token": "support.constant"
281 },
282 {
283 "foreground": "7fdbca",
284 "token": "upport.constant.meta.property-value"
285 },
286 {
287 "foreground": "addb67",
288 "token": "support.type"
289 },
290 {
291 "foreground": "addb67",
292 "token": "support.class"
293 },
294 {
295 "foreground": "addb67",
296 "token": "support.variable.dom"
297 },
298 {
299 "foreground": "7fdbca",
300 "token": "support.constant"
301 },
302 {
303 "foreground": "7fdbca",
304 "token": "keyword.other.special-method"
305 },
306 {
307 "foreground": "7fdbca",
308 "token": "keyword.other.new"
309 },
310 {
311 "foreground": "7fdbca",
312 "token": "keyword.other.debugger"
313 },
314 {
315 "foreground": "7fdbca",
316 "token": "keyword.control"
317 },
318 {
319 "foreground": "c792ea",
320 "token": "keyword.operator.comparison"
321 },
322 {
323 "foreground": "c792ea",
324 "token": "keyword.control.flow.js"
325 },
326 {
327 "foreground": "c792ea",
328 "token": "keyword.control.flow.ts"
329 },
330 {
331 "foreground": "c792ea",
332 "token": "keyword.control.flow.tsx"
333 },
334 {
335 "foreground": "c792ea",
336 "token": "keyword.control.ruby"
337 },
338 {
339 "foreground": "c792ea",
340 "token": "keyword.control.module.ruby"
341 },
342 {
343 "foreground": "c792ea",
344 "token": "keyword.control.class.ruby"
345 },
346 {
347 "foreground": "c792ea",
348 "token": "keyword.control.def.ruby"
349 },
350 {
351 "foreground": "c792ea",
352 "token": "keyword.control.loop.js"
353 },
354 {
355 "foreground": "c792ea",
356 "token": "keyword.control.loop.ts"
357 },
358 {
359 "foreground": "c792ea",
360 "token": "keyword.control.import.js"
361 },
362 {
363 "foreground": "c792ea",
364 "token": "keyword.control.import.ts"
365 },
366 {
367 "foreground": "c792ea",
368 "token": "keyword.control.import.tsx"
369 },
370 {
371 "foreground": "c792ea",
372 "token": "keyword.control.from.js"
373 },
374 {
375 "foreground": "c792ea",
376 "token": "keyword.control.from.ts"
377 },
378 {
379 "foreground": "c792ea",
380 "token": "keyword.control.from.tsx"
381 },
382 {
383 "foreground": "ffffff",
384 "background": "ff2c83",
385 "token": "invalid"
386 },
387 {
388 "foreground": "ffffff",
389 "background": "d3423e",
390 "token": "invalid.deprecated"
391 },
392 {
393 "foreground": "7fdbca",
394 "token": "keyword.operator"
395 },
396 {
397 "foreground": "c792ea",
398 "token": "keyword.operator.relational"
399 },
400 {
401 "foreground": "c792ea",
402 "token": "keyword.operator.assignement"
403 },
404 {
405 "foreground": "c792ea",
406 "token": "keyword.operator.arithmetic"
407 },
408 {
409 "foreground": "c792ea",
410 "token": "keyword.operator.bitwise"
411 },
412 {
413 "foreground": "c792ea",
414 "token": "keyword.operator.increment"
415 },
416 {
417 "foreground": "c792ea",
418 "token": "keyword.operator.ternary"
419 },
420 {
421 "foreground": "637777",
422 "token": "comment.line.double-slash"
423 },
424 {
425 "foreground": "cdebf7",
426 "token": "object"
427 },
428 {
429 "foreground": "ff5874",
430 "token": "constant.language.null"
431 },
432 {
433 "foreground": "d6deeb",
434 "token": "meta.brace"
435 },
436 {
437 "foreground": "c792ea",
438 "token": "meta.delimiter.period"
439 },
440 {
441 "foreground": "d9f5dd",
442 "token": "punctuation.definition.string"
443 },
444 {
445 "foreground": "ff5874",
446 "token": "constant.language.boolean"
447 },
448 {
449 "foreground": "ffffff",
450 "token": "object.comma"
451 },
452 {
453 "foreground": "7fdbca",
454 "token": "variable.parameter.function"
455 },
456 {
457 "foreground": "80cbc4",
458 "token": "support.type.vendor.property-name"
459 },
460 {
461 "foreground": "80cbc4",
462 "token": "support.constant.vendor.property-value"
463 },
464 {
465 "foreground": "80cbc4",
466 "token": "support.type.property-name"
467 },
468 {
469 "foreground": "80cbc4",
470 "token": "meta.property-list entity.name.tag"
471 },
472 {
473 "foreground": "57eaf1",
474 "token": "meta.property-list entity.name.tag.reference"
475 },
476 {
477 "foreground": "f78c6c",
478 "token": "constant.other.color.rgb-value punctuation.definition.constant"
479 },
480 {
481 "foreground": "ffeb95",
482 "token": "constant.other.color"
483 },
484 {
485 "foreground": "ffeb95",
486 "token": "keyword.other.unit"
487 },
488 {
489 "foreground": "c792ea",
490 "token": "meta.selector"
491 },
492 {
493 "foreground": "fad430",
494 "token": "entity.other.attribute-name.id"
495 },
496 {
497 "foreground": "80cbc4",
498 "token": "meta.property-name"
499 },
500 {
501 "foreground": "c792ea",
502 "token": "entity.name.tag.doctype"
503 },
504 {
505 "foreground": "c792ea",
506 "token": "meta.tag.sgml.doctype"
507 },
508 {
509 "foreground": "d9f5dd",
510 "token": "punctuation.definition.parameters"
511 },
512 {
513 "foreground": "ecc48d",
514 "token": "string.quoted"
515 },
516 {
517 "foreground": "ecc48d",
518 "token": "string.quoted.double"
519 },
520 {
521 "foreground": "ecc48d",
522 "token": "string.quoted.single"
523 },
524 {
525 "foreground": "addb67",
526 "token": "support.constant.math"
527 },
528 {
529 "foreground": "addb67",
530 "token": "support.type.property-name.json"
531 },
532 {
533 "foreground": "addb67",
534 "token": "support.constant.json"
535 },
536 {
537 "foreground": "c789d6",
538 "token": "meta.structure.dictionary.value.json string.quoted.double"
539 },
540 {
541 "foreground": "80cbc4",
542 "token": "string.quoted.double.json punctuation.definition.string.json"
543 },
544 {
545 "foreground": "ff5874",
546 "token": "meta.structure.dictionary.json meta.structure.dictionary.value constant.language"
547 },
548 {
549 "foreground": "d6deeb",
550 "token": "variable.other.ruby"
551 },
552 {
553 "foreground": "ecc48d",
554 "token": "entity.name.type.class.ruby"
555 },
556 {
557 "foreground": "ecc48d",
558 "token": "keyword.control.class.ruby"
559 },
560 {
561 "foreground": "ecc48d",
562 "token": "meta.class.ruby"
563 },
564 {
565 "foreground": "7fdbca",
566 "token": "constant.language.symbol.hashkey.ruby"
567 },
568 {
569 "foreground": "e0eddd",
570 "background": "a57706",
571 "fontStyle": "italic",
572 "token": "meta.diff"
573 },
574 {
575 "foreground": "e0eddd",
576 "background": "a57706",
577 "fontStyle": "italic",
578 "token": "meta.diff.header"
579 },
580 {
581 "foreground": "ef535090",
582 "fontStyle": "italic",
583 "token": "markup.deleted"
584 },
585 {
586 "foreground": "a2bffc",
587 "fontStyle": "italic",
588 "token": "markup.changed"
589 },
590 {
591 "foreground": "a2bffc",
592 "fontStyle": "italic",
593 "token": "meta.diff.header.git"
594 },
595 {
596 "foreground": "a2bffc",
597 "fontStyle": "italic",
598 "token": "meta.diff.header.from-file"
599 },
600 {
601 "foreground": "a2bffc",
602 "fontStyle": "italic",
603 "token": "meta.diff.header.to-file"
604 },
605 {
606 "foreground": "219186",
607 "background": "eae3ca",
608 "token": "markup.inserted"
609 },
610 {
611 "foreground": "d3201f",
612 "token": "other.package.exclude"
613 },
614 {
615 "foreground": "d3201f",
616 "token": "other.remove"
617 },
618 {
619 "foreground": "269186",
620 "token": "other.add"
621 },
622 {
623 "foreground": "ff5874",
624 "token": "constant.language.python"
625 },
626 {
627 "foreground": "82aaff",
628 "token": "variable.parameter.function.python"
629 },
630 {
631 "foreground": "82aaff",
632 "token": "meta.function-call.arguments.python"
633 },
634 {
635 "foreground": "b2ccd6",
636 "token": "meta.function-call.python"
637 },
638 {
639 "foreground": "b2ccd6",
640 "token": "meta.function-call.generic.python"
641 },
642 {
643 "foreground": "d6deeb",
644 "token": "punctuation.python"
645 },
646 {
647 "foreground": "addb67",
648 "token": "entity.name.function.decorator.python"
649 },
650 {
651 "foreground": "8eace3",
652 "token": "source.python variable.language.special"
653 },
654 {
655 "foreground": "82b1ff",
656 "token": "markup.heading.markdown"
657 },
658 {
659 "foreground": "c792ea",
660 "fontStyle": "italic",
661 "token": "markup.italic.markdown"
662 },
663 {
664 "foreground": "addb67",
665 "fontStyle": "bold",
666 "token": "markup.bold.markdown"
667 },
668 {
669 "foreground": "697098",
670 "token": "markup.quote.markdown"
671 },
672 {
673 "foreground": "80cbc4",
674 "token": "markup.inline.raw.markdown"
675 },
676 {
677 "foreground": "ff869a",
678 "token": "markup.underline.link.markdown"
679 },
680 {
681 "foreground": "ff869a",
682 "token": "markup.underline.link.image.markdown"
683 },
684 {
685 "foreground": "d6deeb",
686 "token": "string.other.link.title.markdown"
687 },
688 {
689 "foreground": "d6deeb",
690 "token": "string.other.link.description.markdown"
691 },
692 {
693 "foreground": "82b1ff",
694 "token": "punctuation.definition.string.markdown"
695 },
696 {
697 "foreground": "82b1ff",
698 "token": "punctuation.definition.string.begin.markdown"
699 },
700 {
701 "foreground": "82b1ff",
702 "token": "punctuation.definition.string.end.markdown"
703 },
704 {
705 "foreground": "82b1ff",
706 "token": "meta.link.inline.markdown punctuation.definition.string"
707 },
708 {
709 "foreground": "7fdbca",
710 "token": "punctuation.definition.metadata.markdown"
711 },
712 {
713 "foreground": "82b1ff",
714 "token": "beginning.punctuation.definition.list.markdown"
715 }
716 ],
717 "colors": {
718 "editor.foreground": "#d6deeb",
719 "editor.background": "#011627",
720 "editor.selectionBackground": "#5f7e9779",
721 "editor.lineHighlightBackground": "#010E17",
722 "editorCursor.foreground": "#80a4c2",
723 "editorWhitespace.foreground": "#2e2040",
724 "editorIndentGuide.background": "#5e81ce52",
725 "editor.selectionHighlightBorder": "#122d42"
726 }
729exports.purescriptSyntax = {
730 "displayName": "Purescript",
731 "name": "purescrript",
732 "mimeTypes": ["text/purescript"],
733 "fileExtensions": ["purs"],
735 "editorOptions": { "tabSize": 2, "insertSpaces": true },
737 "lineComment": "--",
738 "blockCommentStart": "{-",
739 "blockCommentEnd": "-}",
741 "keywords": [
742 "case", "class", "data", "derive", "do", "else",
743 "if", "import", "in", "infix", "infixl", "infixr", "instance",
744 "let", "module", "newtype", "of", "then", "type", "where",
745 "->", "|", "=>", "::", "\\", "=", "|", "foreign", "forall", "∷"
746 ],
748 "extraKeywords": [
749 ],
751 "typeKeywords": [
752 ],
754 "dataStart": [
755 "^data"
756 ],
758 "typeStart": [
759 "class","instance","type", "derive"
760 ],
763 "escapes" : "\\\\(?:[nrt\\\\\"'\\?]|x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|U[0-9a-fA-F]{6})",
764 "symbols0": "[\\$%&\\*\\+@!\\/\\\\\\^~=\\.:\\-\\?]",
765 "symbols" : "(?:@symbols0|[\\|<>])+",
766 "idchars" : "(?:[\\w'])*",
768 "tokenizer": {
769 "root": [
771 ["((?:[A-Z]@idchars\\.)+)([a-z]@idchars)", ["identifier.namespace","identifier"]],
772 ["((?:[A-Z]@idchars\\.)+)([A-Z]@idchars)", ["identifier.namespace","constructor"]],
774 ["[a-z]@idchars(?!\\.)",
775 { "cases":{ "@dataStart": { "token": "keyword", "next" : "@type_data" },
776 "@typeStart": { "token": "keyword", "next" : "@type_type" },
777 "@keywords": "keyword",
778 "@extraKeywords": "keyword",
779 "@default" : "identifier" }
780 }
781 ],
783 ["[A-Z]@idchars", "type.identifier" ],
785 ["_@idchars", "identifier.wildcard"],
788 ["([a-z]@idchars\\.)+", "identifier.namespace" ],
791 { "include": "@whitespace" },
793 ["[{}()\\[\\]]", "@brackets"],
794 ["[,`]", "delimiter"],
797 ["::(?!@symbols0)", "type.operator", "@type_line"],
798 ["@symbols", { "cases": { "@keywords": "keyword.operator",
799 "@extraKeywords": "keyword.operator",
800 "@default": "operator" }}
801 ],
804 ["[0-9]+\\.[0-9]+([eE][\\-+]?[0-9]+)?", "number.float"],
805 ["0[xX][0-9a-fA-F]+", "number.hex"],
806 ["[0-9]+", "number"],
809 ["\"([^\"\\\\]|\\\\.)*$", "string.invalid" ],
810 ["\"", { "token": "string.quote", "bracket": "@open", "next": "@string" } ],
813 ["'[^\\\\']'", "string"],
814 ["(')(@escapes)(')", ["string","string.escape","string"]],
815 ["'", "string.invalid"],
818 ["^[ ]*#.*", "namespace"]
819 ],
821 "whitespace": [
822 ["[ \\r\\n]+", ""],
823 ["{-", "comment", "@comment" ],
824 ["--.*$", "comment"]
825 ],
827 "comment": [
828 ["[^\\{\\-]+", "comment" ],
829 ["{-", "comment", "@push" ],
830 ["-}", "comment", "@pop" ],
831 ["[\\{\\-]", "comment"]
832 ],
834 "string": [
835 ["[^\\\\\"]+", "string"],
836 ["@escapes", "string.escape"],
837 ["\\\\.", "string.escape.invalid"],
838 ["\"", { "token": "string.quote", "bracket": "@close", "next": "@pop" } ]
839 ],
841 "type_type": [
842 [ "\\=", "keyword"],
843 ["^\\s*(?!\\-\\-|\\{\\-)[^\\s]", { "token": "@rematch", "next": "@pop" } ],
844 { "include": "@type" }
845 ],
847 "type_data": [
848 [ "([=|])(\\s*)([A-Z]@idchars)", ["keyword.operator","","constructor"]],
849 ["^\\s*$", { "token": "", "next": "@pop" } ],
850 { "include": "@type" }
851 ],
853 "type_line": [
854 ["^\\s*(?!\\-\\-|\\{\\-)[_a-z]", { "token": "@rematch", "next": "@pop" } ],
855 ["[^=]*=", { "token": "@rematch", "next": "@pop" } ],
856 { "include": "@type" }
857 ],
859 "type": [
860 [ "[(\\[]", { "token": "@brackets.type" }, "@type_nested"],
861 { "include": "@type_content" }
862 ],
864 "type_nested": [
865 ["[)\\]]", { "token": "@brackets.type" }, "@pop" ],
866 ["[(\\[]", { "token": "@brackets.type" }, "@push"],
867 [",", "delimiter.type"],
868 { "include": "@type_content" }
869 ],
871 "type_content": [
872 { "include": "@whitespace" },
875 ["[a-z]\\d*\\b", "type.identifier.typevar"],
876 ["_@idchars", "type.identifier.typevar"],
878 ["((?:[A-Z]@idchars\\.)*)([A-Z]@idchars)",
879 ["type.identifier.namespace","type.identifier"]
880 ],
881 ["((?:[A-Z]@idchars\\.)*)([a-z]@idchars)",
882 { "cases": { "@typeKeywords": ["type.identifier.namespace","type.keyword"],
883 "@keywords": { "token": "@rematch", "next": "@pop" },
884 "@default": ["type.identifier.namespace","type.identifier"]
885 }}
886 ],
888 ["::|->|[\\.:|]", "type.operator"],
889 ["[\\s\\S]","@rematch","@pop"]
890 ]
891 }
892 }