@muze-nl/simplystore 0.3.6 → 0.4.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/package.json +2 -2
- package/package.json~ +33 -0
- package/src/server.mjs +68 -61
- package/www/codemirror/addon/comment/comment.js +0 -211
- package/www/codemirror/addon/comment/continuecomment.js +0 -114
- package/www/codemirror/addon/dialog/dialog.css +0 -32
- package/www/codemirror/addon/dialog/dialog.js +0 -163
- package/www/codemirror/addon/display/autorefresh.js +0 -47
- package/www/codemirror/addon/display/fullscreen.css +0 -6
- package/www/codemirror/addon/display/fullscreen.js +0 -41
- package/www/codemirror/addon/display/panel.js +0 -133
- package/www/codemirror/addon/display/placeholder.js +0 -78
- package/www/codemirror/addon/display/rulers.js +0 -51
- package/www/codemirror/addon/edit/closebrackets.js +0 -201
- package/www/codemirror/addon/edit/closetag.js +0 -185
- package/www/codemirror/addon/edit/continuelist.js +0 -101
- package/www/codemirror/addon/edit/matchbrackets.js +0 -160
- package/www/codemirror/addon/edit/matchtags.js +0 -66
- package/www/codemirror/addon/edit/trailingspace.js +0 -27
- package/www/codemirror/addon/fold/brace-fold.js +0 -119
- package/www/codemirror/addon/fold/comment-fold.js +0 -59
- package/www/codemirror/addon/fold/foldcode.js +0 -159
- package/www/codemirror/addon/fold/foldgutter.css +0 -20
- package/www/codemirror/addon/fold/foldgutter.js +0 -169
- package/www/codemirror/addon/fold/indent-fold.js +0 -48
- package/www/codemirror/addon/fold/markdown-fold.js +0 -49
- package/www/codemirror/addon/fold/xml-fold.js +0 -184
- package/www/codemirror/addon/hint/anyword-hint.js +0 -41
- package/www/codemirror/addon/hint/css-hint.js +0 -66
- package/www/codemirror/addon/hint/html-hint.js +0 -351
- package/www/codemirror/addon/hint/javascript-hint.js +0 -162
- package/www/codemirror/addon/hint/show-hint.css +0 -37
- package/www/codemirror/addon/hint/show-hint.js +0 -523
- package/www/codemirror/addon/hint/sql-hint.js +0 -304
- package/www/codemirror/addon/hint/xml-hint.js +0 -132
- package/www/codemirror/addon/lint/coffeescript-lint.js +0 -47
- package/www/codemirror/addon/lint/css-lint.js +0 -40
- package/www/codemirror/addon/lint/html-lint.js +0 -59
- package/www/codemirror/addon/lint/json-lint.js +0 -40
- package/www/codemirror/addon/lint/yaml-lint.js +0 -41
- package/www/codemirror/addon/merge/merge.css +0 -119
- package/www/codemirror/addon/merge/merge.js +0 -1018
- package/www/codemirror/addon/mode/loadmode.js +0 -66
- package/www/codemirror/addon/mode/multiplex.js +0 -136
- package/www/codemirror/addon/mode/multiplex_test.js +0 -49
- package/www/codemirror/addon/mode/overlay.js +0 -90
- package/www/codemirror/addon/mode/simple.js +0 -216
- package/www/codemirror/addon/runmode/colorize.js +0 -40
- package/www/codemirror/addon/runmode/runmode-standalone.js +0 -334
- package/www/codemirror/addon/runmode/runmode.js +0 -76
- package/www/codemirror/addon/runmode/runmode.node.js +0 -329
- package/www/codemirror/addon/scroll/annotatescrollbar.js +0 -128
- package/www/codemirror/addon/scroll/scrollpastend.js +0 -48
- package/www/codemirror/addon/scroll/simplescrollbars.css +0 -66
- package/www/codemirror/addon/scroll/simplescrollbars.js +0 -152
- package/www/codemirror/addon/search/jump-to-line.js +0 -53
- package/www/codemirror/addon/search/match-highlighter.js +0 -167
- package/www/codemirror/addon/search/matchesonscrollbar.css +0 -8
- package/www/codemirror/addon/search/matchesonscrollbar.js +0 -97
- package/www/codemirror/addon/search/search.js +0 -295
- package/www/codemirror/addon/search/searchcursor.js +0 -305
- package/www/codemirror/addon/selection/active-line.js +0 -72
- package/www/codemirror/addon/selection/mark-selection.js +0 -119
- package/www/codemirror/addon/selection/selection-pointer.js +0 -98
- package/www/codemirror/addon/tern/tern.css +0 -87
- package/www/codemirror/addon/tern/tern.js +0 -756
- package/www/codemirror/addon/tern/worker.js +0 -44
- package/www/codemirror/addon/wrap/hardwrap.js +0 -160
- package/www/codemirror/bin/source-highlight +0 -48
- package/www/codemirror/keymap/emacs.js +0 -545
- package/www/codemirror/keymap/sublime.js +0 -720
- package/www/codemirror/keymap/vim.js +0 -5978
- package/www/codemirror/mode/apl/apl.js +0 -174
- package/www/codemirror/mode/asciiarmor/asciiarmor.js +0 -74
- package/www/codemirror/mode/asn.1/asn.1.js +0 -204
- package/www/codemirror/mode/asterisk/asterisk.js +0 -220
- package/www/codemirror/mode/brainfuck/brainfuck.js +0 -85
- package/www/codemirror/mode/clike/clike.js +0 -940
- package/www/codemirror/mode/clojure/clojure.js +0 -292
- package/www/codemirror/mode/cmake/cmake.js +0 -97
- package/www/codemirror/mode/cobol/cobol.js +0 -255
- package/www/codemirror/mode/coffeescript/coffeescript.js +0 -359
- package/www/codemirror/mode/commonlisp/commonlisp.js +0 -125
- package/www/codemirror/mode/crystal/crystal.js +0 -433
- package/www/codemirror/mode/css/css.js +0 -862
- package/www/codemirror/mode/cypher/cypher.js +0 -152
- package/www/codemirror/mode/d/d.js +0 -223
- package/www/codemirror/mode/dart/dart.js +0 -166
- package/www/codemirror/mode/diff/diff.js +0 -47
- package/www/codemirror/mode/django/django.js +0 -356
- package/www/codemirror/mode/dockerfile/dockerfile.js +0 -211
- package/www/codemirror/mode/dtd/dtd.js +0 -142
- package/www/codemirror/mode/dylan/dylan.js +0 -352
- package/www/codemirror/mode/ebnf/ebnf.js +0 -195
- package/www/codemirror/mode/ecl/ecl.js +0 -206
- package/www/codemirror/mode/eiffel/eiffel.js +0 -160
- package/www/codemirror/mode/elm/elm.js +0 -245
- package/www/codemirror/mode/erlang/erlang.js +0 -619
- package/www/codemirror/mode/factor/factor.js +0 -85
- package/www/codemirror/mode/fcl/fcl.js +0 -173
- package/www/codemirror/mode/forth/forth.js +0 -180
- package/www/codemirror/mode/fortran/fortran.js +0 -188
- package/www/codemirror/mode/gas/gas.js +0 -353
- package/www/codemirror/mode/gfm/gfm.js +0 -129
- package/www/codemirror/mode/gherkin/gherkin.js +0 -178
- package/www/codemirror/mode/go/go.js +0 -187
- package/www/codemirror/mode/groovy/groovy.js +0 -247
- package/www/codemirror/mode/haml/haml.js +0 -161
- package/www/codemirror/mode/handlebars/handlebars.js +0 -70
- package/www/codemirror/mode/haskell/haskell.js +0 -268
- package/www/codemirror/mode/haskell-literate/haskell-literate.js +0 -43
- package/www/codemirror/mode/haxe/haxe.js +0 -515
- package/www/codemirror/mode/htmlembedded/htmlembedded.js +0 -37
- package/www/codemirror/mode/htmlmixed/htmlmixed.js +0 -153
- package/www/codemirror/mode/http/http.js +0 -113
- package/www/codemirror/mode/idl/idl.js +0 -290
- package/www/codemirror/mode/jinja2/jinja2.js +0 -193
- package/www/codemirror/mode/jsx/jsx.js +0 -148
- package/www/codemirror/mode/julia/julia.js +0 -390
- package/www/codemirror/mode/livescript/livescript.js +0 -280
- package/www/codemirror/mode/lua/lua.js +0 -160
- package/www/codemirror/mode/markdown/markdown.js +0 -886
- package/www/codemirror/mode/mathematica/mathematica.js +0 -176
- package/www/codemirror/mode/mbox/mbox.js +0 -129
- package/www/codemirror/mode/meta.js +0 -221
- package/www/codemirror/mode/mirc/mirc.js +0 -193
- package/www/codemirror/mode/mllike/mllike.js +0 -359
- package/www/codemirror/mode/modelica/modelica.js +0 -245
- package/www/codemirror/mode/mscgen/mscgen.js +0 -175
- package/www/codemirror/mode/mumps/mumps.js +0 -148
- package/www/codemirror/mode/nginx/nginx.js +0 -178
- package/www/codemirror/mode/nsis/nsis.js +0 -95
- package/www/codemirror/mode/ntriples/ntriples.js +0 -195
- package/www/codemirror/mode/octave/octave.js +0 -139
- package/www/codemirror/mode/oz/oz.js +0 -252
- package/www/codemirror/mode/pascal/pascal.js +0 -136
- package/www/codemirror/mode/pegjs/pegjs.js +0 -111
- package/www/codemirror/mode/perl/perl.js +0 -836
- package/www/codemirror/mode/php/php.js +0 -234
- package/www/codemirror/mode/pig/pig.js +0 -178
- package/www/codemirror/mode/powershell/powershell.js +0 -398
- package/www/codemirror/mode/properties/properties.js +0 -78
- package/www/codemirror/mode/protobuf/protobuf.js +0 -72
- package/www/codemirror/mode/pug/pug.js +0 -591
- package/www/codemirror/mode/puppet/puppet.js +0 -220
- package/www/codemirror/mode/python/python.js +0 -402
- package/www/codemirror/mode/q/q.js +0 -139
- package/www/codemirror/mode/r/r.js +0 -190
- package/www/codemirror/mode/rpm/changes/index.html +0 -66
- package/www/codemirror/mode/rpm/rpm.js +0 -109
- package/www/codemirror/mode/rst/rst.js +0 -557
- package/www/codemirror/mode/ruby/ruby.js +0 -303
- package/www/codemirror/mode/rust/rust.js +0 -72
- package/www/codemirror/mode/sas/sas.js +0 -303
- package/www/codemirror/mode/sass/sass.js +0 -459
- package/www/codemirror/mode/scheme/scheme.js +0 -284
- package/www/codemirror/mode/shell/shell.js +0 -168
- package/www/codemirror/mode/sieve/sieve.js +0 -193
- package/www/codemirror/mode/slim/slim.js +0 -575
- package/www/codemirror/mode/smalltalk/smalltalk.js +0 -168
- package/www/codemirror/mode/smarty/smarty.js +0 -225
- package/www/codemirror/mode/solr/solr.js +0 -104
- package/www/codemirror/mode/soy/soy.js +0 -665
- package/www/codemirror/mode/sparql/sparql.js +0 -184
- package/www/codemirror/mode/spreadsheet/spreadsheet.js +0 -112
- package/www/codemirror/mode/sql/sql.js +0 -525
- package/www/codemirror/mode/stex/stex.js +0 -264
- package/www/codemirror/mode/stylus/stylus.js +0 -775
- package/www/codemirror/mode/swift/swift.js +0 -221
- package/www/codemirror/mode/tcl/tcl.js +0 -140
- package/www/codemirror/mode/textile/textile.js +0 -469
- package/www/codemirror/mode/tiddlywiki/tiddlywiki.css +0 -14
- package/www/codemirror/mode/tiddlywiki/tiddlywiki.js +0 -308
- package/www/codemirror/mode/tiki/tiki.css +0 -26
- package/www/codemirror/mode/tiki/tiki.js +0 -312
- package/www/codemirror/mode/toml/toml.js +0 -88
- package/www/codemirror/mode/tornado/tornado.js +0 -68
- package/www/codemirror/mode/troff/troff.js +0 -84
- package/www/codemirror/mode/ttcn/ttcn.js +0 -283
- package/www/codemirror/mode/ttcn-cfg/ttcn-cfg.js +0 -214
- package/www/codemirror/mode/turtle/turtle.js +0 -162
- package/www/codemirror/mode/twig/twig.js +0 -141
- package/www/codemirror/mode/vb/vb.js +0 -275
- package/www/codemirror/mode/vbscript/vbscript.js +0 -350
- package/www/codemirror/mode/velocity/velocity.js +0 -202
- package/www/codemirror/mode/verilog/verilog.js +0 -781
- package/www/codemirror/mode/vhdl/vhdl.js +0 -189
- package/www/codemirror/mode/vue/vue.js +0 -77
- package/www/codemirror/mode/wast/wast.js +0 -132
- package/www/codemirror/mode/webidl/webidl.js +0 -195
- package/www/codemirror/mode/xml/xml.js +0 -417
- package/www/codemirror/mode/xquery/xquery.js +0 -448
- package/www/codemirror/mode/yacas/yacas.js +0 -204
- package/www/codemirror/mode/yaml/yaml.js +0 -120
- package/www/codemirror/mode/yaml-frontmatter/yaml-frontmatter.js +0 -72
- package/www/codemirror/mode/z80/z80.js +0 -116
- package/www/codemirror/rollup.config.js +0 -52
- package/www/codemirror/src/addon/runmode/codemirror-standalone.js +0 -24
- package/www/codemirror/src/addon/runmode/codemirror.node.js +0 -21
- package/www/codemirror/src/addon/runmode/runmode-standalone.js +0 -2
- package/www/codemirror/src/addon/runmode/runmode.node.js +0 -2
- package/www/codemirror/src/codemirror.js +0 -3
- package/www/codemirror/src/display/Display.js +0 -116
- package/www/codemirror/src/display/focus.js +0 -50
- package/www/codemirror/src/display/gutters.js +0 -44
- package/www/codemirror/src/display/highlight_worker.js +0 -55
- package/www/codemirror/src/display/line_numbers.js +0 -48
- package/www/codemirror/src/display/mode_state.js +0 -22
- package/www/codemirror/src/display/operations.js +0 -206
- package/www/codemirror/src/display/scroll_events.js +0 -132
- package/www/codemirror/src/display/scrollbars.js +0 -194
- package/www/codemirror/src/display/scrolling.js +0 -186
- package/www/codemirror/src/display/selection.js +0 -173
- package/www/codemirror/src/display/update_display.js +0 -267
- package/www/codemirror/src/display/update_line.js +0 -189
- package/www/codemirror/src/display/update_lines.js +0 -82
- package/www/codemirror/src/display/view_tracking.js +0 -153
- package/www/codemirror/src/edit/CodeMirror.js +0 -217
- package/www/codemirror/src/edit/commands.js +0 -178
- package/www/codemirror/src/edit/deleteNearSelection.js +0 -30
- package/www/codemirror/src/edit/drop_events.js +0 -130
- package/www/codemirror/src/edit/fromTextArea.js +0 -61
- package/www/codemirror/src/edit/global_events.js +0 -45
- package/www/codemirror/src/edit/key_events.js +0 -163
- package/www/codemirror/src/edit/legacy.js +0 -62
- package/www/codemirror/src/edit/main.js +0 -69
- package/www/codemirror/src/edit/methods.js +0 -555
- package/www/codemirror/src/edit/mouse_events.js +0 -417
- package/www/codemirror/src/edit/options.js +0 -194
- package/www/codemirror/src/edit/utils.js +0 -7
- package/www/codemirror/src/input/ContentEditableInput.js +0 -546
- package/www/codemirror/src/input/TextareaInput.js +0 -380
- package/www/codemirror/src/input/indent.js +0 -71
- package/www/codemirror/src/input/input.js +0 -134
- package/www/codemirror/src/input/keymap.js +0 -147
- package/www/codemirror/src/input/keynames.js +0 -17
- package/www/codemirror/src/input/movement.js +0 -111
- package/www/codemirror/src/line/highlight.js +0 -284
- package/www/codemirror/src/line/line_data.js +0 -349
- package/www/codemirror/src/line/pos.js +0 -40
- package/www/codemirror/src/line/saw_special_spans.js +0 -10
- package/www/codemirror/src/line/spans.js +0 -390
- package/www/codemirror/src/line/utils_line.js +0 -85
- package/www/codemirror/src/measurement/position_measurement.js +0 -702
- package/www/codemirror/src/measurement/widgets.js +0 -26
- package/www/codemirror/src/model/Doc.js +0 -436
- package/www/codemirror/src/model/change_measurement.js +0 -61
- package/www/codemirror/src/model/changes.js +0 -339
- package/www/codemirror/src/model/chunk.js +0 -167
- package/www/codemirror/src/model/document_data.js +0 -112
- package/www/codemirror/src/model/history.js +0 -228
- package/www/codemirror/src/model/line_widget.js +0 -78
- package/www/codemirror/src/model/mark_text.js +0 -293
- package/www/codemirror/src/model/selection.js +0 -84
- package/www/codemirror/src/model/selection_updates.js +0 -216
- package/www/codemirror/src/modes.js +0 -96
- package/www/codemirror/src/util/StringStream.js +0 -90
- package/www/codemirror/src/util/bidi.js +0 -215
- package/www/codemirror/src/util/browser.js +0 -34
- package/www/codemirror/src/util/dom.js +0 -101
- package/www/codemirror/src/util/event.js +0 -103
- package/www/codemirror/src/util/feature_detection.js +0 -84
- package/www/codemirror/src/util/misc.js +0 -168
- package/www/codemirror/src/util/operation_group.js +0 -72
- package/www/codemirror/theme/3024-day.css +0 -41
- package/www/codemirror/theme/3024-night.css +0 -39
- package/www/codemirror/theme/abbott.css +0 -268
- package/www/codemirror/theme/abcdef.css +0 -32
- package/www/codemirror/theme/ambiance-mobile.css +0 -5
- package/www/codemirror/theme/ambiance.css +0 -74
- package/www/codemirror/theme/ayu-dark.css +0 -44
- package/www/codemirror/theme/ayu-mirage.css +0 -45
- package/www/codemirror/theme/base16-dark.css +0 -40
- package/www/codemirror/theme/base16-light.css +0 -38
- package/www/codemirror/theme/bespin.css +0 -34
- package/www/codemirror/theme/blackboard.css +0 -32
- package/www/codemirror/theme/cobalt.css +0 -25
- package/www/codemirror/theme/colorforth.css +0 -33
- package/www/codemirror/theme/darcula.css +0 -53
- package/www/codemirror/theme/dracula.css +0 -40
- package/www/codemirror/theme/duotone-dark.css +0 -35
- package/www/codemirror/theme/duotone-light.css +0 -36
- package/www/codemirror/theme/eclipse.css +0 -23
- package/www/codemirror/theme/elegant.css +0 -13
- package/www/codemirror/theme/erlang-dark.css +0 -34
- package/www/codemirror/theme/gruvbox-dark.css +0 -39
- package/www/codemirror/theme/hopscotch.css +0 -34
- package/www/codemirror/theme/icecoder.css +0 -43
- package/www/codemirror/theme/idea.css +0 -42
- package/www/codemirror/theme/isotope.css +0 -34
- package/www/codemirror/theme/juejin.css +0 -30
- package/www/codemirror/theme/lesser-dark.css +0 -47
- package/www/codemirror/theme/liquibyte.css +0 -95
- package/www/codemirror/theme/lucario.css +0 -37
- package/www/codemirror/theme/material-darker.css +0 -135
- package/www/codemirror/theme/material-palenight.css +0 -141
- package/www/codemirror/theme/material.css +0 -141
- package/www/codemirror/theme/mbo.css +0 -37
- package/www/codemirror/theme/mdn-like.css +0 -46
- package/www/codemirror/theme/midnight.css +0 -39
- package/www/codemirror/theme/monokai.css +0 -41
- package/www/codemirror/theme/moxer.css +0 -143
- package/www/codemirror/theme/neat.css +0 -12
- package/www/codemirror/theme/neo.css +0 -43
- package/www/codemirror/theme/night.css +0 -27
- package/www/codemirror/theme/nord.css +0 -42
- package/www/codemirror/theme/oceanic-next.css +0 -46
- package/www/codemirror/theme/panda-syntax.css +0 -85
- package/www/codemirror/theme/paraiso-dark.css +0 -38
- package/www/codemirror/theme/paraiso-light.css +0 -38
- package/www/codemirror/theme/pastel-on-dark.css +0 -52
- package/www/codemirror/theme/railscasts.css +0 -34
- package/www/codemirror/theme/rubyblue.css +0 -25
- package/www/codemirror/theme/seti.css +0 -44
- package/www/codemirror/theme/shadowfox.css +0 -52
- package/www/codemirror/theme/solarized.css +0 -165
- package/www/codemirror/theme/ssms.css +0 -16
- package/www/codemirror/theme/the-matrix.css +0 -30
- package/www/codemirror/theme/tomorrow-night-bright.css +0 -35
- package/www/codemirror/theme/tomorrow-night-eighties.css +0 -38
- package/www/codemirror/theme/ttcn.css +0 -64
- package/www/codemirror/theme/twilight.css +0 -32
- package/www/codemirror/theme/vibrant-ink.css +0 -34
- package/www/codemirror/theme/xq-dark.css +0 -53
- package/www/codemirror/theme/xq-light.css +0 -43
- package/www/codemirror/theme/yeti.css +0 -44
- package/www/codemirror/theme/yonce.css +0 -59
- package/www/codemirror/theme/zenburn.css +0 -37
|
@@ -1,284 +0,0 @@
|
|
|
1
|
-
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
|
2
|
-
// Distributed under an MIT license: https://codemirror.net/5/LICENSE
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Author: Koh Zi Han, based on implementation by Koh Zi Chun
|
|
6
|
-
* Improved by: Jakub T. Jankiewicz
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
(function(mod) {
|
|
10
|
-
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
|
11
|
-
mod(require("../../lib/codemirror"));
|
|
12
|
-
else if (typeof define == "function" && define.amd) // AMD
|
|
13
|
-
define(["../../lib/codemirror"], mod);
|
|
14
|
-
else // Plain browser env
|
|
15
|
-
mod(CodeMirror);
|
|
16
|
-
})(function(CodeMirror) {
|
|
17
|
-
"use strict";
|
|
18
|
-
|
|
19
|
-
CodeMirror.defineMode("scheme", function () {
|
|
20
|
-
var BUILTIN = "builtin", COMMENT = "comment", STRING = "string",
|
|
21
|
-
SYMBOL = "symbol", ATOM = "atom", NUMBER = "number", BRACKET = "bracket";
|
|
22
|
-
var INDENT_WORD_SKIP = 2;
|
|
23
|
-
|
|
24
|
-
function makeKeywords(str) {
|
|
25
|
-
var obj = {}, words = str.split(" ");
|
|
26
|
-
for (var i = 0; i < words.length; ++i) obj[words[i]] = true;
|
|
27
|
-
return obj;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
var keywords = makeKeywords("λ case-lambda call/cc class cond-expand define-class define-values exit-handler field import inherit init-field interface let*-values let-values let/ec mixin opt-lambda override protect provide public rename require require-for-syntax syntax syntax-case syntax-error unit/sig unless when with-syntax and begin call-with-current-continuation call-with-input-file call-with-output-file case cond define define-syntax define-macro defmacro delay do dynamic-wind else for-each if lambda let let* let-syntax letrec letrec-syntax map or syntax-rules abs acos angle append apply asin assoc assq assv atan boolean? caar cadr call-with-input-file call-with-output-file call-with-values car cdddar cddddr cdr ceiling char->integer char-alphabetic? char-ci<=? char-ci<? char-ci=? char-ci>=? char-ci>? char-downcase char-lower-case? char-numeric? char-ready? char-upcase char-upper-case? char-whitespace? char<=? char<? char=? char>=? char>? char? close-input-port close-output-port complex? cons cos current-input-port current-output-port denominator display eof-object? eq? equal? eqv? eval even? exact->inexact exact? exp expt #f floor force gcd imag-part inexact->exact inexact? input-port? integer->char integer? interaction-environment lcm length list list->string list->vector list-ref list-tail list? load log magnitude make-polar make-rectangular make-string make-vector max member memq memv min modulo negative? newline not null-environment null? number->string number? numerator odd? open-input-file open-output-file output-port? pair? peek-char port? positive? procedure? quasiquote quote quotient rational? rationalize read read-char real-part real? remainder reverse round scheme-report-environment set! set-car! set-cdr! sin sqrt string string->list string->number string->symbol string-append string-ci<=? string-ci<? string-ci=? string-ci>=? string-ci>? string-copy string-fill! string-length string-ref string-set! string<=? string<? string=? string>=? string>? string? substring symbol->string symbol? #t tan transcript-off transcript-on truncate values vector vector->list vector-fill! vector-length vector-ref vector-set! with-input-from-file with-output-to-file write write-char zero?");
|
|
31
|
-
var indentKeys = makeKeywords("define let letrec let* lambda define-macro defmacro let-syntax letrec-syntax let-values let*-values define-syntax syntax-rules define-values when unless");
|
|
32
|
-
|
|
33
|
-
function stateStack(indent, type, prev) { // represents a state stack object
|
|
34
|
-
this.indent = indent;
|
|
35
|
-
this.type = type;
|
|
36
|
-
this.prev = prev;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
function pushStack(state, indent, type) {
|
|
40
|
-
state.indentStack = new stateStack(indent, type, state.indentStack);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
function popStack(state) {
|
|
44
|
-
state.indentStack = state.indentStack.prev;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
var binaryMatcher = new RegExp(/^(?:[-+]i|[-+][01]+#*(?:\/[01]+#*)?i|[-+]?[01]+#*(?:\/[01]+#*)?@[-+]?[01]+#*(?:\/[01]+#*)?|[-+]?[01]+#*(?:\/[01]+#*)?[-+](?:[01]+#*(?:\/[01]+#*)?)?i|[-+]?[01]+#*(?:\/[01]+#*)?)(?=[()\s;"]|$)/i);
|
|
48
|
-
var octalMatcher = new RegExp(/^(?:[-+]i|[-+][0-7]+#*(?:\/[0-7]+#*)?i|[-+]?[0-7]+#*(?:\/[0-7]+#*)?@[-+]?[0-7]+#*(?:\/[0-7]+#*)?|[-+]?[0-7]+#*(?:\/[0-7]+#*)?[-+](?:[0-7]+#*(?:\/[0-7]+#*)?)?i|[-+]?[0-7]+#*(?:\/[0-7]+#*)?)(?=[()\s;"]|$)/i);
|
|
49
|
-
var hexMatcher = new RegExp(/^(?:[-+]i|[-+][\da-f]+#*(?:\/[\da-f]+#*)?i|[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?@[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?|[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?[-+](?:[\da-f]+#*(?:\/[\da-f]+#*)?)?i|[-+]?[\da-f]+#*(?:\/[\da-f]+#*)?)(?=[()\s;"]|$)/i);
|
|
50
|
-
var decimalMatcher = new RegExp(/^(?:[-+]i|[-+](?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)i|[-+]?(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)@[-+]?(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)|[-+]?(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)[-+](?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*)?i|(?:(?:(?:\d+#+\.?#*|\d+\.\d*#*|\.\d+#*|\d+)(?:[esfdl][-+]?\d+)?)|\d+#*\/\d+#*))(?=[()\s;"]|$)/i);
|
|
51
|
-
|
|
52
|
-
function isBinaryNumber (stream) {
|
|
53
|
-
return stream.match(binaryMatcher);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
function isOctalNumber (stream) {
|
|
57
|
-
return stream.match(octalMatcher);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
function isDecimalNumber (stream, backup) {
|
|
61
|
-
if (backup === true) {
|
|
62
|
-
stream.backUp(1);
|
|
63
|
-
}
|
|
64
|
-
return stream.match(decimalMatcher);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
function isHexNumber (stream) {
|
|
68
|
-
return stream.match(hexMatcher);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
function processEscapedSequence(stream, options) {
|
|
72
|
-
var next, escaped = false;
|
|
73
|
-
while ((next = stream.next()) != null) {
|
|
74
|
-
if (next == options.token && !escaped) {
|
|
75
|
-
|
|
76
|
-
options.state.mode = false;
|
|
77
|
-
break;
|
|
78
|
-
}
|
|
79
|
-
escaped = !escaped && next == "\\";
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
return {
|
|
84
|
-
startState: function () {
|
|
85
|
-
return {
|
|
86
|
-
indentStack: null,
|
|
87
|
-
indentation: 0,
|
|
88
|
-
mode: false,
|
|
89
|
-
sExprComment: false,
|
|
90
|
-
sExprQuote: false
|
|
91
|
-
};
|
|
92
|
-
},
|
|
93
|
-
|
|
94
|
-
token: function (stream, state) {
|
|
95
|
-
if (state.indentStack == null && stream.sol()) {
|
|
96
|
-
// update indentation, but only if indentStack is empty
|
|
97
|
-
state.indentation = stream.indentation();
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
// skip spaces
|
|
101
|
-
if (stream.eatSpace()) {
|
|
102
|
-
return null;
|
|
103
|
-
}
|
|
104
|
-
var returnType = null;
|
|
105
|
-
|
|
106
|
-
switch(state.mode){
|
|
107
|
-
case "string": // multi-line string parsing mode
|
|
108
|
-
processEscapedSequence(stream, {
|
|
109
|
-
token: "\"",
|
|
110
|
-
state: state
|
|
111
|
-
});
|
|
112
|
-
returnType = STRING; // continue on in scheme-string mode
|
|
113
|
-
break;
|
|
114
|
-
case "symbol": // escape symbol
|
|
115
|
-
processEscapedSequence(stream, {
|
|
116
|
-
token: "|",
|
|
117
|
-
state: state
|
|
118
|
-
});
|
|
119
|
-
returnType = SYMBOL; // continue on in scheme-symbol mode
|
|
120
|
-
break;
|
|
121
|
-
case "comment": // comment parsing mode
|
|
122
|
-
var next, maybeEnd = false;
|
|
123
|
-
while ((next = stream.next()) != null) {
|
|
124
|
-
if (next == "#" && maybeEnd) {
|
|
125
|
-
|
|
126
|
-
state.mode = false;
|
|
127
|
-
break;
|
|
128
|
-
}
|
|
129
|
-
maybeEnd = (next == "|");
|
|
130
|
-
}
|
|
131
|
-
returnType = COMMENT;
|
|
132
|
-
break;
|
|
133
|
-
case "s-expr-comment": // s-expr commenting mode
|
|
134
|
-
state.mode = false;
|
|
135
|
-
if(stream.peek() == "(" || stream.peek() == "["){
|
|
136
|
-
// actually start scheme s-expr commenting mode
|
|
137
|
-
state.sExprComment = 0;
|
|
138
|
-
}else{
|
|
139
|
-
// if not we just comment the entire of the next token
|
|
140
|
-
stream.eatWhile(/[^\s\(\)\[\]]/); // eat symbol atom
|
|
141
|
-
returnType = COMMENT;
|
|
142
|
-
break;
|
|
143
|
-
}
|
|
144
|
-
default: // default parsing mode
|
|
145
|
-
var ch = stream.next();
|
|
146
|
-
|
|
147
|
-
if (ch == "\"") {
|
|
148
|
-
state.mode = "string";
|
|
149
|
-
returnType = STRING;
|
|
150
|
-
|
|
151
|
-
} else if (ch == "'") {
|
|
152
|
-
if (stream.peek() == "(" || stream.peek() == "["){
|
|
153
|
-
if (typeof state.sExprQuote != "number") {
|
|
154
|
-
state.sExprQuote = 0;
|
|
155
|
-
} // else already in a quoted expression
|
|
156
|
-
returnType = ATOM;
|
|
157
|
-
} else {
|
|
158
|
-
stream.eatWhile(/[\w_\-!$%&*+\.\/:<=>?@\^~]/);
|
|
159
|
-
returnType = ATOM;
|
|
160
|
-
}
|
|
161
|
-
} else if (ch == '|') {
|
|
162
|
-
state.mode = "symbol";
|
|
163
|
-
returnType = SYMBOL;
|
|
164
|
-
} else if (ch == '#') {
|
|
165
|
-
if (stream.eat("|")) { // Multi-line comment
|
|
166
|
-
state.mode = "comment"; // toggle to comment mode
|
|
167
|
-
returnType = COMMENT;
|
|
168
|
-
} else if (stream.eat(/[tf]/i)) { // #t/#f (atom)
|
|
169
|
-
returnType = ATOM;
|
|
170
|
-
} else if (stream.eat(';')) { // S-Expr comment
|
|
171
|
-
state.mode = "s-expr-comment";
|
|
172
|
-
returnType = COMMENT;
|
|
173
|
-
} else {
|
|
174
|
-
var numTest = null, hasExactness = false, hasRadix = true;
|
|
175
|
-
if (stream.eat(/[ei]/i)) {
|
|
176
|
-
hasExactness = true;
|
|
177
|
-
} else {
|
|
178
|
-
stream.backUp(1); // must be radix specifier
|
|
179
|
-
}
|
|
180
|
-
if (stream.match(/^#b/i)) {
|
|
181
|
-
numTest = isBinaryNumber;
|
|
182
|
-
} else if (stream.match(/^#o/i)) {
|
|
183
|
-
numTest = isOctalNumber;
|
|
184
|
-
} else if (stream.match(/^#x/i)) {
|
|
185
|
-
numTest = isHexNumber;
|
|
186
|
-
} else if (stream.match(/^#d/i)) {
|
|
187
|
-
numTest = isDecimalNumber;
|
|
188
|
-
} else if (stream.match(/^[-+0-9.]/, false)) {
|
|
189
|
-
hasRadix = false;
|
|
190
|
-
numTest = isDecimalNumber;
|
|
191
|
-
// re-consume the initial # if all matches failed
|
|
192
|
-
} else if (!hasExactness) {
|
|
193
|
-
stream.eat('#');
|
|
194
|
-
}
|
|
195
|
-
if (numTest != null) {
|
|
196
|
-
if (hasRadix && !hasExactness) {
|
|
197
|
-
// consume optional exactness after radix
|
|
198
|
-
stream.match(/^#[ei]/i);
|
|
199
|
-
}
|
|
200
|
-
if (numTest(stream))
|
|
201
|
-
returnType = NUMBER;
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
} else if (/^[-+0-9.]/.test(ch) && isDecimalNumber(stream, true)) { // match non-prefixed number, must be decimal
|
|
205
|
-
returnType = NUMBER;
|
|
206
|
-
} else if (ch == ";") { // comment
|
|
207
|
-
stream.skipToEnd(); // rest of the line is a comment
|
|
208
|
-
returnType = COMMENT;
|
|
209
|
-
} else if (ch == "(" || ch == "[") {
|
|
210
|
-
var keyWord = ''; var indentTemp = stream.column(), letter;
|
|
211
|
-
/**
|
|
212
|
-
Either
|
|
213
|
-
(indent-word ..
|
|
214
|
-
(non-indent-word ..
|
|
215
|
-
(;something else, bracket, etc.
|
|
216
|
-
*/
|
|
217
|
-
|
|
218
|
-
while ((letter = stream.eat(/[^\s\(\[\;\)\]]/)) != null) {
|
|
219
|
-
keyWord += letter;
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
if (keyWord.length > 0 && indentKeys.propertyIsEnumerable(keyWord)) { // indent-word
|
|
223
|
-
|
|
224
|
-
pushStack(state, indentTemp + INDENT_WORD_SKIP, ch);
|
|
225
|
-
} else { // non-indent word
|
|
226
|
-
// we continue eating the spaces
|
|
227
|
-
stream.eatSpace();
|
|
228
|
-
if (stream.eol() || stream.peek() == ";") {
|
|
229
|
-
// nothing significant after
|
|
230
|
-
// we restart indentation 1 space after
|
|
231
|
-
pushStack(state, indentTemp + 1, ch);
|
|
232
|
-
} else {
|
|
233
|
-
pushStack(state, indentTemp + stream.current().length, ch); // else we match
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
stream.backUp(stream.current().length - 1); // undo all the eating
|
|
237
|
-
|
|
238
|
-
if(typeof state.sExprComment == "number") state.sExprComment++;
|
|
239
|
-
if(typeof state.sExprQuote == "number") state.sExprQuote++;
|
|
240
|
-
|
|
241
|
-
returnType = BRACKET;
|
|
242
|
-
} else if (ch == ")" || ch == "]") {
|
|
243
|
-
returnType = BRACKET;
|
|
244
|
-
if (state.indentStack != null && state.indentStack.type == (ch == ")" ? "(" : "[")) {
|
|
245
|
-
popStack(state);
|
|
246
|
-
|
|
247
|
-
if(typeof state.sExprComment == "number"){
|
|
248
|
-
if(--state.sExprComment == 0){
|
|
249
|
-
returnType = COMMENT; // final closing bracket
|
|
250
|
-
state.sExprComment = false; // turn off s-expr commenting mode
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
if(typeof state.sExprQuote == "number"){
|
|
254
|
-
if(--state.sExprQuote == 0){
|
|
255
|
-
returnType = ATOM; // final closing bracket
|
|
256
|
-
state.sExprQuote = false; // turn off s-expr quote mode
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
} else {
|
|
261
|
-
stream.eatWhile(/[\w_\-!$%&*+\.\/:<=>?@\^~]/);
|
|
262
|
-
|
|
263
|
-
if (keywords && keywords.propertyIsEnumerable(stream.current())) {
|
|
264
|
-
returnType = BUILTIN;
|
|
265
|
-
} else returnType = "variable";
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
return (typeof state.sExprComment == "number") ? COMMENT : ((typeof state.sExprQuote == "number") ? ATOM : returnType);
|
|
269
|
-
},
|
|
270
|
-
|
|
271
|
-
indent: function (state) {
|
|
272
|
-
if (state.indentStack == null) return state.indentation;
|
|
273
|
-
return state.indentStack.indent;
|
|
274
|
-
},
|
|
275
|
-
|
|
276
|
-
fold: "brace-paren",
|
|
277
|
-
closeBrackets: {pairs: "()[]{}\"\""},
|
|
278
|
-
lineComment: ";;"
|
|
279
|
-
};
|
|
280
|
-
});
|
|
281
|
-
|
|
282
|
-
CodeMirror.defineMIME("text/x-scheme", "scheme");
|
|
283
|
-
|
|
284
|
-
});
|
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
|
2
|
-
// Distributed under an MIT license: https://codemirror.net/5/LICENSE
|
|
3
|
-
|
|
4
|
-
(function(mod) {
|
|
5
|
-
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
|
6
|
-
mod(require("../../lib/codemirror"));
|
|
7
|
-
else if (typeof define == "function" && define.amd) // AMD
|
|
8
|
-
define(["../../lib/codemirror"], mod);
|
|
9
|
-
else // Plain browser env
|
|
10
|
-
mod(CodeMirror);
|
|
11
|
-
})(function(CodeMirror) {
|
|
12
|
-
"use strict";
|
|
13
|
-
|
|
14
|
-
CodeMirror.defineMode('shell', function() {
|
|
15
|
-
|
|
16
|
-
var words = {};
|
|
17
|
-
function define(style, dict) {
|
|
18
|
-
for(var i = 0; i < dict.length; i++) {
|
|
19
|
-
words[dict[i]] = style;
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
var commonAtoms = ["true", "false"];
|
|
24
|
-
var commonKeywords = ["if", "then", "do", "else", "elif", "while", "until", "for", "in", "esac", "fi",
|
|
25
|
-
"fin", "fil", "done", "exit", "set", "unset", "export", "function"];
|
|
26
|
-
var commonCommands = ["ab", "awk", "bash", "beep", "cat", "cc", "cd", "chown", "chmod", "chroot", "clear",
|
|
27
|
-
"cp", "curl", "cut", "diff", "echo", "find", "gawk", "gcc", "get", "git", "grep", "hg", "kill", "killall",
|
|
28
|
-
"ln", "ls", "make", "mkdir", "openssl", "mv", "nc", "nl", "node", "npm", "ping", "ps", "restart", "rm",
|
|
29
|
-
"rmdir", "sed", "service", "sh", "shopt", "shred", "source", "sort", "sleep", "ssh", "start", "stop",
|
|
30
|
-
"su", "sudo", "svn", "tee", "telnet", "top", "touch", "vi", "vim", "wall", "wc", "wget", "who", "write",
|
|
31
|
-
"yes", "zsh"];
|
|
32
|
-
|
|
33
|
-
CodeMirror.registerHelper("hintWords", "shell", commonAtoms.concat(commonKeywords, commonCommands));
|
|
34
|
-
|
|
35
|
-
define('atom', commonAtoms);
|
|
36
|
-
define('keyword', commonKeywords);
|
|
37
|
-
define('builtin', commonCommands);
|
|
38
|
-
|
|
39
|
-
function tokenBase(stream, state) {
|
|
40
|
-
if (stream.eatSpace()) return null;
|
|
41
|
-
|
|
42
|
-
var sol = stream.sol();
|
|
43
|
-
var ch = stream.next();
|
|
44
|
-
|
|
45
|
-
if (ch === '\\') {
|
|
46
|
-
stream.next();
|
|
47
|
-
return null;
|
|
48
|
-
}
|
|
49
|
-
if (ch === '\'' || ch === '"' || ch === '`') {
|
|
50
|
-
state.tokens.unshift(tokenString(ch, ch === "`" ? "quote" : "string"));
|
|
51
|
-
return tokenize(stream, state);
|
|
52
|
-
}
|
|
53
|
-
if (ch === '#') {
|
|
54
|
-
if (sol && stream.eat('!')) {
|
|
55
|
-
stream.skipToEnd();
|
|
56
|
-
return 'meta'; // 'comment'?
|
|
57
|
-
}
|
|
58
|
-
stream.skipToEnd();
|
|
59
|
-
return 'comment';
|
|
60
|
-
}
|
|
61
|
-
if (ch === '$') {
|
|
62
|
-
state.tokens.unshift(tokenDollar);
|
|
63
|
-
return tokenize(stream, state);
|
|
64
|
-
}
|
|
65
|
-
if (ch === '+' || ch === '=') {
|
|
66
|
-
return 'operator';
|
|
67
|
-
}
|
|
68
|
-
if (ch === '-') {
|
|
69
|
-
stream.eat('-');
|
|
70
|
-
stream.eatWhile(/\w/);
|
|
71
|
-
return 'attribute';
|
|
72
|
-
}
|
|
73
|
-
if (ch == "<") {
|
|
74
|
-
if (stream.match("<<")) return "operator"
|
|
75
|
-
var heredoc = stream.match(/^<-?\s*['"]?([^'"]*)['"]?/)
|
|
76
|
-
if (heredoc) {
|
|
77
|
-
state.tokens.unshift(tokenHeredoc(heredoc[1]))
|
|
78
|
-
return 'string-2'
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
if (/\d/.test(ch)) {
|
|
82
|
-
stream.eatWhile(/\d/);
|
|
83
|
-
if(stream.eol() || !/\w/.test(stream.peek())) {
|
|
84
|
-
return 'number';
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
stream.eatWhile(/[\w-]/);
|
|
88
|
-
var cur = stream.current();
|
|
89
|
-
if (stream.peek() === '=' && /\w+/.test(cur)) return 'def';
|
|
90
|
-
return words.hasOwnProperty(cur) ? words[cur] : null;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
function tokenString(quote, style) {
|
|
94
|
-
var close = quote == "(" ? ")" : quote == "{" ? "}" : quote
|
|
95
|
-
return function(stream, state) {
|
|
96
|
-
var next, escaped = false;
|
|
97
|
-
while ((next = stream.next()) != null) {
|
|
98
|
-
if (next === close && !escaped) {
|
|
99
|
-
state.tokens.shift();
|
|
100
|
-
break;
|
|
101
|
-
} else if (next === '$' && !escaped && quote !== "'" && stream.peek() != close) {
|
|
102
|
-
escaped = true;
|
|
103
|
-
stream.backUp(1);
|
|
104
|
-
state.tokens.unshift(tokenDollar);
|
|
105
|
-
break;
|
|
106
|
-
} else if (!escaped && quote !== close && next === quote) {
|
|
107
|
-
state.tokens.unshift(tokenString(quote, style))
|
|
108
|
-
return tokenize(stream, state)
|
|
109
|
-
} else if (!escaped && /['"]/.test(next) && !/['"]/.test(quote)) {
|
|
110
|
-
state.tokens.unshift(tokenStringStart(next, "string"));
|
|
111
|
-
stream.backUp(1);
|
|
112
|
-
break;
|
|
113
|
-
}
|
|
114
|
-
escaped = !escaped && next === '\\';
|
|
115
|
-
}
|
|
116
|
-
return style;
|
|
117
|
-
};
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
function tokenStringStart(quote, style) {
|
|
121
|
-
return function(stream, state) {
|
|
122
|
-
state.tokens[0] = tokenString(quote, style)
|
|
123
|
-
stream.next()
|
|
124
|
-
return tokenize(stream, state)
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
var tokenDollar = function(stream, state) {
|
|
129
|
-
if (state.tokens.length > 1) stream.eat('$');
|
|
130
|
-
var ch = stream.next()
|
|
131
|
-
if (/['"({]/.test(ch)) {
|
|
132
|
-
state.tokens[0] = tokenString(ch, ch == "(" ? "quote" : ch == "{" ? "def" : "string");
|
|
133
|
-
return tokenize(stream, state);
|
|
134
|
-
}
|
|
135
|
-
if (!/\d/.test(ch)) stream.eatWhile(/\w/);
|
|
136
|
-
state.tokens.shift();
|
|
137
|
-
return 'def';
|
|
138
|
-
};
|
|
139
|
-
|
|
140
|
-
function tokenHeredoc(delim) {
|
|
141
|
-
return function(stream, state) {
|
|
142
|
-
if (stream.sol() && stream.string == delim) state.tokens.shift()
|
|
143
|
-
stream.skipToEnd()
|
|
144
|
-
return "string-2"
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
function tokenize(stream, state) {
|
|
149
|
-
return (state.tokens[0] || tokenBase) (stream, state);
|
|
150
|
-
};
|
|
151
|
-
|
|
152
|
-
return {
|
|
153
|
-
startState: function() {return {tokens:[]};},
|
|
154
|
-
token: function(stream, state) {
|
|
155
|
-
return tokenize(stream, state);
|
|
156
|
-
},
|
|
157
|
-
closeBrackets: "()[]{}''\"\"``",
|
|
158
|
-
lineComment: '#',
|
|
159
|
-
fold: "brace"
|
|
160
|
-
};
|
|
161
|
-
});
|
|
162
|
-
|
|
163
|
-
CodeMirror.defineMIME('text/x-sh', 'shell');
|
|
164
|
-
// Apache uses a slightly different Media Type for Shell scripts
|
|
165
|
-
// http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types
|
|
166
|
-
CodeMirror.defineMIME('application/x-sh', 'shell');
|
|
167
|
-
|
|
168
|
-
});
|
|
@@ -1,193 +0,0 @@
|
|
|
1
|
-
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
|
2
|
-
// Distributed under an MIT license: https://codemirror.net/5/LICENSE
|
|
3
|
-
|
|
4
|
-
(function(mod) {
|
|
5
|
-
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
|
6
|
-
mod(require("../../lib/codemirror"));
|
|
7
|
-
else if (typeof define == "function" && define.amd) // AMD
|
|
8
|
-
define(["../../lib/codemirror"], mod);
|
|
9
|
-
else // Plain browser env
|
|
10
|
-
mod(CodeMirror);
|
|
11
|
-
})(function(CodeMirror) {
|
|
12
|
-
"use strict";
|
|
13
|
-
|
|
14
|
-
CodeMirror.defineMode("sieve", function(config) {
|
|
15
|
-
function words(str) {
|
|
16
|
-
var obj = {}, words = str.split(" ");
|
|
17
|
-
for (var i = 0; i < words.length; ++i) obj[words[i]] = true;
|
|
18
|
-
return obj;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
var keywords = words("if elsif else stop require");
|
|
22
|
-
var atoms = words("true false not");
|
|
23
|
-
var indentUnit = config.indentUnit;
|
|
24
|
-
|
|
25
|
-
function tokenBase(stream, state) {
|
|
26
|
-
|
|
27
|
-
var ch = stream.next();
|
|
28
|
-
if (ch == "/" && stream.eat("*")) {
|
|
29
|
-
state.tokenize = tokenCComment;
|
|
30
|
-
return tokenCComment(stream, state);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
if (ch === '#') {
|
|
34
|
-
stream.skipToEnd();
|
|
35
|
-
return "comment";
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
if (ch == "\"") {
|
|
39
|
-
state.tokenize = tokenString(ch);
|
|
40
|
-
return state.tokenize(stream, state);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
if (ch == "(") {
|
|
44
|
-
state._indent.push("(");
|
|
45
|
-
// add virtual angel wings so that editor behaves...
|
|
46
|
-
// ...more sane in case of broken brackets
|
|
47
|
-
state._indent.push("{");
|
|
48
|
-
return null;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
if (ch === "{") {
|
|
52
|
-
state._indent.push("{");
|
|
53
|
-
return null;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
if (ch == ")") {
|
|
57
|
-
state._indent.pop();
|
|
58
|
-
state._indent.pop();
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
if (ch === "}") {
|
|
62
|
-
state._indent.pop();
|
|
63
|
-
return null;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
if (ch == ",")
|
|
67
|
-
return null;
|
|
68
|
-
|
|
69
|
-
if (ch == ";")
|
|
70
|
-
return null;
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
if (/[{}\(\),;]/.test(ch))
|
|
74
|
-
return null;
|
|
75
|
-
|
|
76
|
-
// 1*DIGIT "K" / "M" / "G"
|
|
77
|
-
if (/\d/.test(ch)) {
|
|
78
|
-
stream.eatWhile(/[\d]/);
|
|
79
|
-
stream.eat(/[KkMmGg]/);
|
|
80
|
-
return "number";
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
// ":" (ALPHA / "_") *(ALPHA / DIGIT / "_")
|
|
84
|
-
if (ch == ":") {
|
|
85
|
-
stream.eatWhile(/[a-zA-Z_]/);
|
|
86
|
-
stream.eatWhile(/[a-zA-Z0-9_]/);
|
|
87
|
-
|
|
88
|
-
return "operator";
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
stream.eatWhile(/\w/);
|
|
92
|
-
var cur = stream.current();
|
|
93
|
-
|
|
94
|
-
// "text:" *(SP / HTAB) (hash-comment / CRLF)
|
|
95
|
-
// *(multiline-literal / multiline-dotstart)
|
|
96
|
-
// "." CRLF
|
|
97
|
-
if ((cur == "text") && stream.eat(":"))
|
|
98
|
-
{
|
|
99
|
-
state.tokenize = tokenMultiLineString;
|
|
100
|
-
return "string";
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
if (keywords.propertyIsEnumerable(cur))
|
|
104
|
-
return "keyword";
|
|
105
|
-
|
|
106
|
-
if (atoms.propertyIsEnumerable(cur))
|
|
107
|
-
return "atom";
|
|
108
|
-
|
|
109
|
-
return null;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
function tokenMultiLineString(stream, state)
|
|
113
|
-
{
|
|
114
|
-
state._multiLineString = true;
|
|
115
|
-
// the first line is special it may contain a comment
|
|
116
|
-
if (!stream.sol()) {
|
|
117
|
-
stream.eatSpace();
|
|
118
|
-
|
|
119
|
-
if (stream.peek() == "#") {
|
|
120
|
-
stream.skipToEnd();
|
|
121
|
-
return "comment";
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
stream.skipToEnd();
|
|
125
|
-
return "string";
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
if ((stream.next() == ".") && (stream.eol()))
|
|
129
|
-
{
|
|
130
|
-
state._multiLineString = false;
|
|
131
|
-
state.tokenize = tokenBase;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
return "string";
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
function tokenCComment(stream, state) {
|
|
138
|
-
var maybeEnd = false, ch;
|
|
139
|
-
while ((ch = stream.next()) != null) {
|
|
140
|
-
if (maybeEnd && ch == "/") {
|
|
141
|
-
state.tokenize = tokenBase;
|
|
142
|
-
break;
|
|
143
|
-
}
|
|
144
|
-
maybeEnd = (ch == "*");
|
|
145
|
-
}
|
|
146
|
-
return "comment";
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
function tokenString(quote) {
|
|
150
|
-
return function(stream, state) {
|
|
151
|
-
var escaped = false, ch;
|
|
152
|
-
while ((ch = stream.next()) != null) {
|
|
153
|
-
if (ch == quote && !escaped)
|
|
154
|
-
break;
|
|
155
|
-
escaped = !escaped && ch == "\\";
|
|
156
|
-
}
|
|
157
|
-
if (!escaped) state.tokenize = tokenBase;
|
|
158
|
-
return "string";
|
|
159
|
-
};
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
return {
|
|
163
|
-
startState: function(base) {
|
|
164
|
-
return {tokenize: tokenBase,
|
|
165
|
-
baseIndent: base || 0,
|
|
166
|
-
_indent: []};
|
|
167
|
-
},
|
|
168
|
-
|
|
169
|
-
token: function(stream, state) {
|
|
170
|
-
if (stream.eatSpace())
|
|
171
|
-
return null;
|
|
172
|
-
|
|
173
|
-
return (state.tokenize || tokenBase)(stream, state);
|
|
174
|
-
},
|
|
175
|
-
|
|
176
|
-
indent: function(state, _textAfter) {
|
|
177
|
-
var length = state._indent.length;
|
|
178
|
-
if (_textAfter && (_textAfter[0] == "}"))
|
|
179
|
-
length--;
|
|
180
|
-
|
|
181
|
-
if (length <0)
|
|
182
|
-
length = 0;
|
|
183
|
-
|
|
184
|
-
return length * indentUnit;
|
|
185
|
-
},
|
|
186
|
-
|
|
187
|
-
electricChars: "}"
|
|
188
|
-
};
|
|
189
|
-
});
|
|
190
|
-
|
|
191
|
-
CodeMirror.defineMIME("application/sieve", "sieve");
|
|
192
|
-
|
|
193
|
-
});
|