@quirekit/cm-legacy-modes 0.0.0-stage → 0.0.1-alpha.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/LICENSE +21 -0
- package/README.md +27 -2
- package/README.zh-CN.md +28 -0
- package/THIRD_PARTY_NOTICES.md +143 -0
- package/UPSTREAM.json +16 -0
- package/dist/mode/README.md +52 -0
- package/dist/mode/apl.d.ts +2 -0
- package/dist/mode/apl.js +140 -0
- package/dist/mode/asciiarmor.d.ts +2 -0
- package/dist/mode/asciiarmor.js +54 -0
- package/dist/mode/asn1.d.ts +12 -0
- package/dist/mode/asn1.js +190 -0
- package/dist/mode/asterisk.d.ts +2 -0
- package/dist/mode/asterisk.js +186 -0
- package/dist/mode/brainfuck.d.ts +2 -0
- package/dist/mode/brainfuck.js +68 -0
- package/dist/mode/clike.d.ts +35 -0
- package/dist/mode/clike.js +1019 -0
- package/dist/mode/clojure.d.ts +2 -0
- package/dist/mode/clojure.js +272 -0
- package/dist/mode/cmake.d.ts +2 -0
- package/dist/mode/cmake.js +80 -0
- package/dist/mode/cobol.d.ts +2 -0
- package/dist/mode/cobol.js +234 -0
- package/dist/mode/coffeescript.d.ts +2 -0
- package/dist/mode/coffeescript.js +327 -0
- package/dist/mode/commonlisp.d.ts +2 -0
- package/dist/mode/commonlisp.js +107 -0
- package/dist/mode/crystal.d.ts +2 -0
- package/dist/mode/crystal.js +417 -0
- package/dist/mode/css.d.ts +5 -0
- package/dist/mode/css.js +846 -0
- package/dist/mode/cypher.d.ts +2 -0
- package/dist/mode/cypher.js +120 -0
- package/dist/mode/d.d.ts +2 -0
- package/dist/mode/d.js +203 -0
- package/dist/mode/diff.d.ts +2 -0
- package/dist/mode/diff.js +29 -0
- package/dist/mode/dockerfile.d.ts +2 -0
- package/dist/mode/dockerfile.js +198 -0
- package/dist/mode/dtd.d.ts +2 -0
- package/dist/mode/dtd.js +120 -0
- package/dist/mode/dylan.d.ts +2 -0
- package/dist/mode/dylan.js +336 -0
- package/dist/mode/ebnf.d.ts +2 -0
- package/dist/mode/ebnf.js +149 -0
- package/dist/mode/ecl.d.ts +2 -0
- package/dist/mode/ecl.js +188 -0
- package/dist/mode/eiffel.d.ts +2 -0
- package/dist/mode/eiffel.js +145 -0
- package/dist/mode/elm.d.ts +2 -0
- package/dist/mode/elm.js +228 -0
- package/dist/mode/erlang.d.ts +2 -0
- package/dist/mode/erlang.js +580 -0
- package/dist/mode/factor.d.ts +2 -0
- package/dist/mode/factor.js +63 -0
- package/dist/mode/fcl.d.ts +2 -0
- package/dist/mode/fcl.js +153 -0
- package/dist/mode/forth.d.ts +2 -0
- package/dist/mode/forth.js +162 -0
- package/dist/mode/fortran.d.ts +2 -0
- package/dist/mode/fortran.js +171 -0
- package/dist/mode/gas.d.ts +3 -0
- package/dist/mode/gas.js +342 -0
- package/dist/mode/gherkin.d.ts +2 -0
- package/dist/mode/gherkin.js +146 -0
- package/dist/mode/go.d.ts +2 -0
- package/dist/mode/go.js +163 -0
- package/dist/mode/groovy.d.ts +2 -0
- package/dist/mode/groovy.js +226 -0
- package/dist/mode/haskell.d.ts +2 -0
- package/dist/mode/haskell.js +238 -0
- package/dist/mode/haxe.d.ts +3 -0
- package/dist/mode/haxe.js +490 -0
- package/dist/mode/http.d.ts +2 -0
- package/dist/mode/http.js +87 -0
- package/dist/mode/idl.d.ts +2 -0
- package/dist/mode/idl.js +274 -0
- package/dist/mode/javascript.d.ts +5 -0
- package/dist/mode/javascript.js +922 -0
- package/dist/mode/jinja2.d.ts +2 -0
- package/dist/mode/jinja2.js +170 -0
- package/dist/mode/julia.d.ts +2 -0
- package/dist/mode/julia.js +367 -0
- package/dist/mode/livescript.d.ts +2 -0
- package/dist/mode/livescript.js +257 -0
- package/dist/mode/lua.d.ts +2 -0
- package/dist/mode/lua.js +135 -0
- package/dist/mode/mathematica.d.ts +2 -0
- package/dist/mode/mathematica.js +153 -0
- package/dist/mode/mbox.d.ts +2 -0
- package/dist/mode/mbox.js +114 -0
- package/dist/mode/mirc.d.ts +2 -0
- package/dist/mode/mirc.js +174 -0
- package/dist/mode/mllike.d.ts +4 -0
- package/dist/mode/mllike.js +346 -0
- package/dist/mode/modelica.d.ts +2 -0
- package/dist/mode/modelica.js +190 -0
- package/dist/mode/mscgen.d.ts +4 -0
- package/dist/mode/mscgen.js +147 -0
- package/dist/mode/mumps.d.ts +2 -0
- package/dist/mode/mumps.js +127 -0
- package/dist/mode/nginx.d.ts +2 -0
- package/dist/mode/nginx.js +161 -0
- package/dist/mode/nsis.d.ts +2 -0
- package/dist/mode/nsis.js +78 -0
- package/dist/mode/ntriples.d.ts +2 -0
- package/dist/mode/ntriples.js +139 -0
- package/dist/mode/octave.d.ts +2 -0
- package/dist/mode/octave.js +123 -0
- package/dist/mode/oz.d.ts +2 -0
- package/dist/mode/oz.js +233 -0
- package/dist/mode/pascal.d.ts +2 -0
- package/dist/mode/pascal.js +122 -0
- package/dist/mode/pegjs.d.ts +2 -0
- package/dist/mode/pegjs.js +85 -0
- package/dist/mode/perl.d.ts +2 -0
- package/dist/mode/perl.js +818 -0
- package/dist/mode/pig.d.ts +2 -0
- package/dist/mode/pig.js +147 -0
- package/dist/mode/powershell.d.ts +2 -0
- package/dist/mode/powershell.js +379 -0
- package/dist/mode/properties.d.ts +2 -0
- package/dist/mode/properties.js +60 -0
- package/dist/mode/protobuf.d.ts +2 -0
- package/dist/mode/protobuf.js +55 -0
- package/dist/mode/pug.d.ts +2 -0
- package/dist/mode/pug.js +502 -0
- package/dist/mode/puppet.d.ts +2 -0
- package/dist/mode/puppet.js +203 -0
- package/dist/mode/python.d.ts +3 -0
- package/dist/mode/python.js +388 -0
- package/dist/mode/q.d.ts +2 -0
- package/dist/mode/q.js +124 -0
- package/dist/mode/r.d.ts +2 -0
- package/dist/mode/r.js +172 -0
- package/dist/mode/rpm.d.ts +3 -0
- package/dist/mode/rpm.js +88 -0
- package/dist/mode/ruby.d.ts +2 -0
- package/dist/mode/ruby.js +287 -0
- package/dist/mode/rust.d.ts +2 -0
- package/dist/mode/rust.js +54 -0
- package/dist/mode/sas.d.ts +2 -0
- package/dist/mode/sas.js +266 -0
- package/dist/mode/sass.d.ts +2 -0
- package/dist/mode/sass.js +427 -0
- package/dist/mode/scheme.d.ts +2 -0
- package/dist/mode/scheme.js +261 -0
- package/dist/mode/shell.d.ts +2 -0
- package/dist/mode/shell.js +146 -0
- package/dist/mode/sieve.d.ts +2 -0
- package/dist/mode/sieve.js +176 -0
- package/dist/mode/simple-mode.d.ts +14 -0
- package/dist/mode/simple-mode.js +136 -0
- package/dist/mode/smalltalk.d.ts +2 -0
- package/dist/mode/smalltalk.js +151 -0
- package/dist/mode/solr.d.ts +2 -0
- package/dist/mode/solr.js +78 -0
- package/dist/mode/sparql.d.ts +2 -0
- package/dist/mode/sparql.js +169 -0
- package/dist/mode/spreadsheet.d.ts +2 -0
- package/dist/mode/spreadsheet.js +96 -0
- package/dist/mode/sql.d.ts +27 -0
- package/dist/mode/sql.js +481 -0
- package/dist/mode/stex.d.ts +3 -0
- package/dist/mode/stex.js +245 -0
- package/dist/mode/stylus.d.ts +2 -0
- package/dist/mode/stylus.js +747 -0
- package/dist/mode/swift.d.ts +2 -0
- package/dist/mode/swift.js +200 -0
- package/dist/mode/tcl.d.ts +2 -0
- package/dist/mode/tcl.js +123 -0
- package/dist/mode/textile.d.ts +2 -0
- package/dist/mode/textile.js +440 -0
- package/dist/mode/tiddlywiki.d.ts +2 -0
- package/dist/mode/tiddlywiki.js +277 -0
- package/dist/mode/tiki.d.ts +2 -0
- package/dist/mode/tiki.js +291 -0
- package/dist/mode/toml.d.ts +2 -0
- package/dist/mode/toml.js +74 -0
- package/dist/mode/troff.d.ts +2 -0
- package/dist/mode/troff.js +63 -0
- package/dist/mode/ttcn-cfg.d.ts +2 -0
- package/dist/mode/ttcn-cfg.js +199 -0
- package/dist/mode/ttcn.d.ts +2 -0
- package/dist/mode/ttcn.js +255 -0
- package/dist/mode/turtle.d.ts +2 -0
- package/dist/mode/turtle.js +145 -0
- package/dist/mode/vb.d.ts +2 -0
- package/dist/mode/vb.js +254 -0
- package/dist/mode/vbscript.d.ts +3 -0
- package/dist/mode/vbscript.js +320 -0
- package/dist/mode/velocity.d.ts +2 -0
- package/dist/mode/velocity.js +184 -0
- package/dist/mode/verilog.d.ts +3 -0
- package/dist/mode/verilog.js +601 -0
- package/dist/mode/vhdl.d.ts +2 -0
- package/dist/mode/vhdl.js +172 -0
- package/dist/mode/wast.d.ts +2 -0
- package/dist/mode/wast.js +119 -0
- package/dist/mode/webidl.d.ts +2 -0
- package/dist/mode/webidl.js +179 -0
- package/dist/mode/xml.d.ts +3 -0
- package/dist/mode/xml.js +397 -0
- package/dist/mode/xquery.d.ts +2 -0
- package/dist/mode/xquery.js +415 -0
- package/dist/mode/yacas.d.ts +2 -0
- package/dist/mode/yacas.js +181 -0
- package/dist/mode/yaml.d.ts +2 -0
- package/dist/mode/yaml.js +101 -0
- package/dist/mode/z80.d.ts +3 -0
- package/dist/mode/z80.js +101 -0
- package/mode/README.md +52 -0
- package/mode/apl.d.ts +2 -0
- package/mode/apl.js +140 -0
- package/mode/asciiarmor.d.ts +2 -0
- package/mode/asciiarmor.js +54 -0
- package/mode/asn1.d.ts +12 -0
- package/mode/asn1.js +190 -0
- package/mode/asterisk.d.ts +2 -0
- package/mode/asterisk.js +186 -0
- package/mode/brainfuck.d.ts +2 -0
- package/mode/brainfuck.js +68 -0
- package/mode/clike.d.ts +35 -0
- package/mode/clike.js +1019 -0
- package/mode/clojure.d.ts +2 -0
- package/mode/clojure.js +272 -0
- package/mode/cmake.d.ts +2 -0
- package/mode/cmake.js +80 -0
- package/mode/cobol.d.ts +2 -0
- package/mode/cobol.js +234 -0
- package/mode/coffeescript.d.ts +2 -0
- package/mode/coffeescript.js +327 -0
- package/mode/commonlisp.d.ts +2 -0
- package/mode/commonlisp.js +107 -0
- package/mode/crystal.d.ts +2 -0
- package/mode/crystal.js +417 -0
- package/mode/css.d.ts +5 -0
- package/mode/css.js +846 -0
- package/mode/cypher.d.ts +2 -0
- package/mode/cypher.js +120 -0
- package/mode/d.d.ts +2 -0
- package/mode/d.js +203 -0
- package/mode/diff.d.ts +2 -0
- package/mode/diff.js +29 -0
- package/mode/dockerfile.d.ts +2 -0
- package/mode/dockerfile.js +198 -0
- package/mode/dtd.d.ts +2 -0
- package/mode/dtd.js +120 -0
- package/mode/dylan.d.ts +2 -0
- package/mode/dylan.js +336 -0
- package/mode/ebnf.d.ts +2 -0
- package/mode/ebnf.js +149 -0
- package/mode/ecl.d.ts +2 -0
- package/mode/ecl.js +188 -0
- package/mode/eiffel.d.ts +2 -0
- package/mode/eiffel.js +145 -0
- package/mode/elm.d.ts +2 -0
- package/mode/elm.js +228 -0
- package/mode/erlang.d.ts +2 -0
- package/mode/erlang.js +580 -0
- package/mode/factor.d.ts +2 -0
- package/mode/factor.js +63 -0
- package/mode/fcl.d.ts +2 -0
- package/mode/fcl.js +153 -0
- package/mode/forth.d.ts +2 -0
- package/mode/forth.js +162 -0
- package/mode/fortran.d.ts +2 -0
- package/mode/fortran.js +171 -0
- package/mode/gas.d.ts +3 -0
- package/mode/gas.js +342 -0
- package/mode/gherkin.d.ts +2 -0
- package/mode/gherkin.js +146 -0
- package/mode/go.d.ts +2 -0
- package/mode/go.js +163 -0
- package/mode/groovy.d.ts +2 -0
- package/mode/groovy.js +226 -0
- package/mode/haskell.d.ts +2 -0
- package/mode/haskell.js +238 -0
- package/mode/haxe.d.ts +3 -0
- package/mode/haxe.js +490 -0
- package/mode/http.d.ts +2 -0
- package/mode/http.js +87 -0
- package/mode/idl.d.ts +2 -0
- package/mode/idl.js +274 -0
- package/mode/javascript.d.ts +5 -0
- package/mode/javascript.js +922 -0
- package/mode/jinja2.d.ts +2 -0
- package/mode/jinja2.js +170 -0
- package/mode/julia.d.ts +2 -0
- package/mode/julia.js +367 -0
- package/mode/livescript.d.ts +2 -0
- package/mode/livescript.js +257 -0
- package/mode/lua.d.ts +2 -0
- package/mode/lua.js +135 -0
- package/mode/mathematica.d.ts +2 -0
- package/mode/mathematica.js +153 -0
- package/mode/mbox.d.ts +2 -0
- package/mode/mbox.js +114 -0
- package/mode/mirc.d.ts +2 -0
- package/mode/mirc.js +174 -0
- package/mode/mllike.d.ts +4 -0
- package/mode/mllike.js +346 -0
- package/mode/modelica.d.ts +2 -0
- package/mode/modelica.js +190 -0
- package/mode/mscgen.d.ts +4 -0
- package/mode/mscgen.js +147 -0
- package/mode/mumps.d.ts +2 -0
- package/mode/mumps.js +127 -0
- package/mode/nginx.d.ts +2 -0
- package/mode/nginx.js +161 -0
- package/mode/nsis.d.ts +2 -0
- package/mode/nsis.js +78 -0
- package/mode/ntriples.d.ts +2 -0
- package/mode/ntriples.js +139 -0
- package/mode/octave.d.ts +2 -0
- package/mode/octave.js +123 -0
- package/mode/oz.d.ts +2 -0
- package/mode/oz.js +233 -0
- package/mode/pascal.d.ts +2 -0
- package/mode/pascal.js +122 -0
- package/mode/pegjs.d.ts +2 -0
- package/mode/pegjs.js +85 -0
- package/mode/perl.d.ts +2 -0
- package/mode/perl.js +818 -0
- package/mode/pig.d.ts +2 -0
- package/mode/pig.js +147 -0
- package/mode/powershell.d.ts +2 -0
- package/mode/powershell.js +379 -0
- package/mode/properties.d.ts +2 -0
- package/mode/properties.js +60 -0
- package/mode/protobuf.d.ts +2 -0
- package/mode/protobuf.js +55 -0
- package/mode/pug.d.ts +2 -0
- package/mode/pug.js +502 -0
- package/mode/puppet.d.ts +2 -0
- package/mode/puppet.js +203 -0
- package/mode/python.d.ts +3 -0
- package/mode/python.js +388 -0
- package/mode/q.d.ts +2 -0
- package/mode/q.js +124 -0
- package/mode/r.d.ts +2 -0
- package/mode/r.js +172 -0
- package/mode/rpm.d.ts +3 -0
- package/mode/rpm.js +88 -0
- package/mode/ruby.d.ts +2 -0
- package/mode/ruby.js +287 -0
- package/mode/rust.d.ts +2 -0
- package/mode/rust.js +54 -0
- package/mode/sas.d.ts +2 -0
- package/mode/sas.js +266 -0
- package/mode/sass.d.ts +2 -0
- package/mode/sass.js +427 -0
- package/mode/scheme.d.ts +2 -0
- package/mode/scheme.js +261 -0
- package/mode/shell.d.ts +2 -0
- package/mode/shell.js +146 -0
- package/mode/sieve.d.ts +2 -0
- package/mode/sieve.js +176 -0
- package/mode/simple-mode.d.ts +14 -0
- package/mode/simple-mode.js +136 -0
- package/mode/smalltalk.d.ts +2 -0
- package/mode/smalltalk.js +151 -0
- package/mode/solr.d.ts +2 -0
- package/mode/solr.js +78 -0
- package/mode/sparql.d.ts +2 -0
- package/mode/sparql.js +169 -0
- package/mode/spreadsheet.d.ts +2 -0
- package/mode/spreadsheet.js +96 -0
- package/mode/sql.d.ts +27 -0
- package/mode/sql.js +481 -0
- package/mode/stex.d.ts +3 -0
- package/mode/stex.js +245 -0
- package/mode/stylus.d.ts +2 -0
- package/mode/stylus.js +747 -0
- package/mode/swift.d.ts +2 -0
- package/mode/swift.js +200 -0
- package/mode/tcl.d.ts +2 -0
- package/mode/tcl.js +123 -0
- package/mode/textile.d.ts +2 -0
- package/mode/textile.js +440 -0
- package/mode/tiddlywiki.d.ts +2 -0
- package/mode/tiddlywiki.js +277 -0
- package/mode/tiki.d.ts +2 -0
- package/mode/tiki.js +291 -0
- package/mode/toml.d.ts +2 -0
- package/mode/toml.js +74 -0
- package/mode/troff.d.ts +2 -0
- package/mode/troff.js +63 -0
- package/mode/ttcn-cfg.d.ts +2 -0
- package/mode/ttcn-cfg.js +199 -0
- package/mode/ttcn.d.ts +2 -0
- package/mode/ttcn.js +255 -0
- package/mode/turtle.d.ts +2 -0
- package/mode/turtle.js +145 -0
- package/mode/vb.d.ts +2 -0
- package/mode/vb.js +254 -0
- package/mode/vbscript.d.ts +3 -0
- package/mode/vbscript.js +320 -0
- package/mode/velocity.d.ts +2 -0
- package/mode/velocity.js +184 -0
- package/mode/verilog.d.ts +3 -0
- package/mode/verilog.js +601 -0
- package/mode/vhdl.d.ts +2 -0
- package/mode/vhdl.js +172 -0
- package/mode/wast.d.ts +2 -0
- package/mode/wast.js +119 -0
- package/mode/webidl.d.ts +2 -0
- package/mode/webidl.js +179 -0
- package/mode/xml.d.ts +3 -0
- package/mode/xml.js +397 -0
- package/mode/xquery.d.ts +2 -0
- package/mode/xquery.js +415 -0
- package/mode/yacas.d.ts +2 -0
- package/mode/yacas.js +181 -0
- package/mode/yaml.d.ts +2 -0
- package/mode/yaml.js +101 -0
- package/mode/z80.d.ts +3 -0
- package/mode/z80.js +101 -0
- package/package.json +37 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (C) 2018-2021 by Marijn Haverbeke <marijn@haverbeke.berlin> and others
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,28 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @quirekit/cm-legacy-modes
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
English | [简体中文](./README.zh-CN.md)
|
|
4
|
+
|
|
5
|
+
Provides older CodeMirror language modes for syntaxes without a dedicated modern package.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @quirekit/cm-legacy-modes@alpha
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
Import a language from /mode/<name> and wrap it with StreamLanguage.define(...) from cm-language. There is no root import. The package’s mode directory lists available modes.
|
|
16
|
+
|
|
17
|
+
## Things to know
|
|
18
|
+
|
|
19
|
+
- Maintained from `@codemirror/legacy-modes` 6.5.4; UPSTREAM.json records its origin and local changes.
|
|
20
|
+
- Use @quirekit/cm-* consistently within an editor rather than mixing official @codemirror/* instances.
|
|
21
|
+
|
|
22
|
+
## Related documentation
|
|
23
|
+
|
|
24
|
+
- [Markdown editor using these packages](../../msfe/core/README.md)
|
|
25
|
+
|
|
26
|
+
## License
|
|
27
|
+
|
|
28
|
+
[MIT](./LICENSE). Third-party notices: [THIRD_PARTY_NOTICES.md](./THIRD_PARTY_NOTICES.md).
|
package/README.zh-CN.md
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# @quirekit/cm-legacy-modes
|
|
2
|
+
|
|
3
|
+
[English](./README.md) | 简体中文
|
|
4
|
+
|
|
5
|
+
提供旧式 CodeMirror 语言模式,补充没有独立现代语言包的语法。
|
|
6
|
+
|
|
7
|
+
## 安装
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @quirekit/cm-legacy-modes@alpha
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## 使用方式
|
|
14
|
+
|
|
15
|
+
从 /mode/<名称> 子入口选择语言,并用 cm-language 的 StreamLanguage.define(...) 转为扩展。本包没有可直接导入的根入口。可用模式见包内 mode 目录。
|
|
16
|
+
|
|
17
|
+
## 使用时注意
|
|
18
|
+
|
|
19
|
+
- 由 `@codemirror/legacy-modes` 6.5.4 的源码维护而来;来源和本地差异记录在 UPSTREAM.json。
|
|
20
|
+
- 同一实例统一使用 @quirekit/cm-* 包,不与官方 @codemirror/* 的实例混用。
|
|
21
|
+
|
|
22
|
+
## 相关说明
|
|
23
|
+
|
|
24
|
+
- [基于这些包的 Markdown 编辑器](../../msfe/core/README.zh-CN.md)
|
|
25
|
+
|
|
26
|
+
## 许可
|
|
27
|
+
|
|
28
|
+
[MIT](./LICENSE);第三方声明见 [THIRD_PARTY_NOTICES.md](./THIRD_PARTY_NOTICES.md)。
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
# 第三方声明 / Third-party notices
|
|
2
|
+
|
|
3
|
+
QuireKit 的分层授权只适用于相应权利人有权授权的原创部分,不替代或限制以下上游
|
|
4
|
+
材料的授权。独立第三方依赖及资源还可能有其自己的许可,分发包含它们的产物时必须
|
|
5
|
+
继续履行相关义务。本文件不声称是全部运行时依赖或所有构建产物的完整 SBOM。
|
|
6
|
+
|
|
7
|
+
The project license does not replace or restrict the licenses of upstream code.
|
|
8
|
+
Third-party dependencies and resources retain their own terms. This file covers
|
|
9
|
+
recorded upstream foundations and is not a complete dependency or artifact SBOM.
|
|
10
|
+
A license below applies to its identified material, not to all QuireKit code.
|
|
11
|
+
|
|
12
|
+
## QuireKit 原创部分 / Original work
|
|
13
|
+
|
|
14
|
+
Copyright (c) 2026 Wang Yishuai (王一帅) and QuireKit contributors
|
|
15
|
+
|
|
16
|
+
QuireKit 原创部分按包分为三层:MIT 生态层、GNU AGPL 第 3 版(仅此版本,`AGPL-3.0-only`)
|
|
17
|
+
引擎层,以及 QuireKit 商业组件。每个包的许可以其包内 `LICENSE.md` 为准。以下第三方材料
|
|
18
|
+
继续遵循其原有许可,不受上述任何一层影响。
|
|
19
|
+
|
|
20
|
+
QuireKit original work is licensed per package in three tiers: MIT, GNU AGPL
|
|
21
|
+
version 3 only (`AGPL-3.0-only`) and the QuireKit Commercial License. Each
|
|
22
|
+
package's `LICENSE.md` is authoritative. Third-party materials below retain their
|
|
23
|
+
own terms regardless of tier.
|
|
24
|
+
|
|
25
|
+
## ProseMirror
|
|
26
|
+
|
|
27
|
+
The vendored ProseMirror packages retain their original MIT license files.
|
|
28
|
+
The following notices cover the respective upstream portions, including when
|
|
29
|
+
those portions are incorporated into a derived or bundled artifact.
|
|
30
|
+
|
|
31
|
+
### @quirekit/pm-collab, @quirekit/pm-commands, @quirekit/pm-decoration, @quirekit/pm-gapcursor, @quirekit/pm-history, @quirekit/pm-inputrules, @quirekit/pm-keymap, @quirekit/pm-model, @quirekit/pm-schema-list, @quirekit/pm-state, @quirekit/pm-transform, @quirekit/pm-view
|
|
32
|
+
|
|
33
|
+
Copyright (C) 2015-2017 by Marijn Haverbeke <marijn@haverbeke.berlin> and others
|
|
34
|
+
|
|
35
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
36
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
37
|
+
in the Software without restriction, including without limitation the rights
|
|
38
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
39
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
40
|
+
furnished to do so, subject to the following conditions:
|
|
41
|
+
|
|
42
|
+
The above copyright notice and this permission notice shall be included in
|
|
43
|
+
all copies or substantial portions of the Software.
|
|
44
|
+
|
|
45
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
46
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
47
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
48
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
49
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
50
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
51
|
+
THE SOFTWARE.
|
|
52
|
+
|
|
53
|
+
## Tiptap
|
|
54
|
+
|
|
55
|
+
Upstream: https://github.com/ueberdosis/tiptap
|
|
56
|
+
|
|
57
|
+
The following notice applies to Tiptap-derived portions of the compatibility
|
|
58
|
+
layer and extensions, where present. It does not relicense QuireKit additions.
|
|
59
|
+
|
|
60
|
+
MIT License
|
|
61
|
+
|
|
62
|
+
Copyright (c) 2025, Tiptap GmbH
|
|
63
|
+
|
|
64
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
65
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
66
|
+
in the Software without restriction, including without limitation the rights
|
|
67
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
68
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
69
|
+
furnished to do so, subject to the following conditions:
|
|
70
|
+
|
|
71
|
+
The above copyright notice and this permission notice shall be included in all
|
|
72
|
+
copies or substantial portions of the Software.
|
|
73
|
+
|
|
74
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
75
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
76
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
77
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
78
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
79
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
80
|
+
SOFTWARE.
|
|
81
|
+
|
|
82
|
+
## bidi-js
|
|
83
|
+
|
|
84
|
+
Upstream: https://github.com/lojjic/bidi-js
|
|
85
|
+
|
|
86
|
+
The renderer uses bidi-js; its code retains the following license.
|
|
87
|
+
|
|
88
|
+
Copyright (c) 2021 Jason Johnston
|
|
89
|
+
|
|
90
|
+
MIT License
|
|
91
|
+
|
|
92
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
93
|
+
a copy of this software and associated documentation files (the
|
|
94
|
+
"Software"), to deal in the Software without restriction, including
|
|
95
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
96
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
97
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
98
|
+
the following conditions:
|
|
99
|
+
|
|
100
|
+
The above copyright notice and this permission notice shall be
|
|
101
|
+
included in all copies or substantial portions of the Software.
|
|
102
|
+
|
|
103
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
104
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
105
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
106
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
107
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
108
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
109
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
110
|
+
|
|
111
|
+
## Fonts and other resources
|
|
112
|
+
|
|
113
|
+
The font-pack wrapper has its own MIT license. Distributed font assets retain
|
|
114
|
+
their individual OFL or other license files under the font package's licenses
|
|
115
|
+
and dist/licenses directories. The wrapper license does not replace font terms.
|
|
116
|
+
Local system fonts served by development tooling receive no new redistribution
|
|
117
|
+
rights. Other dependencies, bundled resources and license comments retain their
|
|
118
|
+
own notices; those obligations must be checked against the actual artifact.
|
|
119
|
+
|
|
120
|
+
## RevoGrid Community
|
|
121
|
+
|
|
122
|
+
The optional chart data editor loads `@revolist/revogrid` 4.28.2, MIT licensed.
|
|
123
|
+
Upstream: https://github.com/revolist/revogrid
|
|
124
|
+
|
|
125
|
+
Copyright (c) 2024 Revolist OU
|
|
126
|
+
|
|
127
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
128
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
129
|
+
in the Software without restriction, including without limitation the rights
|
|
130
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
131
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
132
|
+
furnished to do so, subject to the following conditions:
|
|
133
|
+
|
|
134
|
+
The above copyright notice and this permission notice shall be included in
|
|
135
|
+
all copies or substantial portions of the Software.
|
|
136
|
+
|
|
137
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
138
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
139
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
140
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
141
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
142
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
143
|
+
THE SOFTWARE.
|
package/UPSTREAM.json
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@codemirror/legacy-modes",
|
|
3
|
+
"version": "6.5.4",
|
|
4
|
+
"commit": "1f2107b74b03223c97fa6812dd4fbf70b3d046df",
|
|
5
|
+
"repository": "https://code.haverbeke.berlin/codemirror/legacy-modes.git",
|
|
6
|
+
"integrity": "sha512-/cZr6qZyl08iYNLGsJ862CXXNI51LryRFRE40ejgoIjXZz0C1rGkD3/Ek5jM/8w1ceRjqtt4qx/KLMh4zBTgew==",
|
|
7
|
+
"tarball": "https://registry.npmjs.org/@codemirror/legacy-modes/-/legacy-modes-6.5.4.tgz",
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"sourceDirectory": "mode",
|
|
10
|
+
"sourceSha256": "db5442e3f2b2432e9742c94d0c1cced52d6cf7062073cf769cc67beb106d309d",
|
|
11
|
+
"licenseSha256": "05c6130cda97e7600ca91427a41e8a065efcf82365fc0293e7de80faec494c07",
|
|
12
|
+
"localChanges": [
|
|
13
|
+
"Package names, imports and build/test configuration use QuireKit workspace identities."
|
|
14
|
+
],
|
|
15
|
+
"sourceEntry": "mode/*.js"
|
|
16
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
<!-- NOTE: README.md is generated from mode/README.md -->
|
|
2
|
+
|
|
3
|
+
# @codemirror/legacy-modes [](https://www.npmjs.org/package/@codemirror/legacy-modes)
|
|
4
|
+
|
|
5
|
+
[ [**WEBSITE**](https://codemirror.net/) | [**ISSUES**](https://code.haverbeke.berlin/codemirror/dev/issues) | [**FORUM**](https://discuss.codemirror.net/c/next/) | [**CHANGELOG**](https://code.haverbeke.berlin/codemirror/legacy-modes/src/branch/main/CHANGELOG.md) ]
|
|
6
|
+
|
|
7
|
+
This package implements a collection of ported [stream
|
|
8
|
+
language](https://codemirror.net/docs/ref#language.StreamParser) modes for
|
|
9
|
+
the [CodeMirror](https://codemirror.net/) code editor. Each mode is
|
|
10
|
+
available as a separate script file, under
|
|
11
|
+
`"@codemirror/legacy-modes/mode/[name]"`, and exports the values
|
|
12
|
+
listed below.
|
|
13
|
+
|
|
14
|
+
The [project page](https://codemirror.net/) has more information, a
|
|
15
|
+
number of [examples](https://codemirror.net/examples/) and the
|
|
16
|
+
[documentation](https://codemirror.net/docs/).
|
|
17
|
+
|
|
18
|
+
This code is released under an
|
|
19
|
+
[MIT license](https://code.haverbeke.berlin/codemirror/legacy-modes/tree/main/LICENSE).
|
|
20
|
+
|
|
21
|
+
We aim to be an inclusive, welcoming community. To make that explicit,
|
|
22
|
+
we have a [code of
|
|
23
|
+
conduct](http://contributor-covenant.org/version/1/1/0/) that applies
|
|
24
|
+
to communication around the project.
|
|
25
|
+
|
|
26
|
+
## Usage
|
|
27
|
+
|
|
28
|
+
Using modes from this package works like this:
|
|
29
|
+
|
|
30
|
+
- Install this package and the
|
|
31
|
+
[`@codemirror/language`](https://codemirror.net/docs/ref/#language)
|
|
32
|
+
package.
|
|
33
|
+
|
|
34
|
+
- Find the `StreamParser` instance you need in the reference below.
|
|
35
|
+
|
|
36
|
+
- Add `StreamLanguage.define(theParser)` to your editor's
|
|
37
|
+
configuration.
|
|
38
|
+
|
|
39
|
+
For example, to load the Lua mode, you'd do something like...
|
|
40
|
+
|
|
41
|
+
```javascript
|
|
42
|
+
import {StreamLanguage} from "@codemirror/language"
|
|
43
|
+
import {lua} from "@codemirror/legacy-modes/mode/lua"
|
|
44
|
+
|
|
45
|
+
import {EditorView, basicSetup} from "codemirror"
|
|
46
|
+
|
|
47
|
+
let view = new EditorView({
|
|
48
|
+
extensions: [basicSetup, StreamLanguage.define(lua)]
|
|
49
|
+
})
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## API Reference
|
package/dist/mode/apl.js
ADDED
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
var builtInFuncs = {
|
|
2
|
+
"+": ["conjugate", "add"],
|
|
3
|
+
"−": ["negate", "subtract"],
|
|
4
|
+
"×": ["signOf", "multiply"],
|
|
5
|
+
"÷": ["reciprocal", "divide"],
|
|
6
|
+
"⌈": ["ceiling", "greaterOf"],
|
|
7
|
+
"⌊": ["floor", "lesserOf"],
|
|
8
|
+
"∣": ["absolute", "residue"],
|
|
9
|
+
"⍳": ["indexGenerate", "indexOf"],
|
|
10
|
+
"?": ["roll", "deal"],
|
|
11
|
+
"⋆": ["exponentiate", "toThePowerOf"],
|
|
12
|
+
"⍟": ["naturalLog", "logToTheBase"],
|
|
13
|
+
"○": ["piTimes", "circularFuncs"],
|
|
14
|
+
"!": ["factorial", "binomial"],
|
|
15
|
+
"⌹": ["matrixInverse", "matrixDivide"],
|
|
16
|
+
"<": [null, "lessThan"],
|
|
17
|
+
"≤": [null, "lessThanOrEqual"],
|
|
18
|
+
"=": [null, "equals"],
|
|
19
|
+
">": [null, "greaterThan"],
|
|
20
|
+
"≥": [null, "greaterThanOrEqual"],
|
|
21
|
+
"≠": [null, "notEqual"],
|
|
22
|
+
"≡": ["depth", "match"],
|
|
23
|
+
"≢": [null, "notMatch"],
|
|
24
|
+
"∈": ["enlist", "membership"],
|
|
25
|
+
"⍷": [null, "find"],
|
|
26
|
+
"∪": ["unique", "union"],
|
|
27
|
+
"∩": [null, "intersection"],
|
|
28
|
+
"∼": ["not", "without"],
|
|
29
|
+
"∨": [null, "or"],
|
|
30
|
+
"∧": [null, "and"],
|
|
31
|
+
"⍱": [null, "nor"],
|
|
32
|
+
"⍲": [null, "nand"],
|
|
33
|
+
"⍴": ["shapeOf", "reshape"],
|
|
34
|
+
",": ["ravel", "catenate"],
|
|
35
|
+
"⍪": [null, "firstAxisCatenate"],
|
|
36
|
+
"⌽": ["reverse", "rotate"],
|
|
37
|
+
"⊖": ["axis1Reverse", "axis1Rotate"],
|
|
38
|
+
"⍉": ["transpose", null],
|
|
39
|
+
"↑": ["first", "take"],
|
|
40
|
+
"↓": [null, "drop"],
|
|
41
|
+
"⊂": ["enclose", "partitionWithAxis"],
|
|
42
|
+
"⊃": ["diclose", "pick"],
|
|
43
|
+
"⌷": [null, "index"],
|
|
44
|
+
"⍋": ["gradeUp", null],
|
|
45
|
+
"⍒": ["gradeDown", null],
|
|
46
|
+
"⊤": ["encode", null],
|
|
47
|
+
"⊥": ["decode", null],
|
|
48
|
+
"⍕": ["format", "formatByExample"],
|
|
49
|
+
"⍎": ["execute", null],
|
|
50
|
+
"⊣": ["stop", "left"],
|
|
51
|
+
"⊢": ["pass", "right"]
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
var isOperator = /[\.\/⌿⍀¨⍣]/;
|
|
55
|
+
var isNiladic = /⍬/;
|
|
56
|
+
var isFunction = /[\+−×÷⌈⌊∣⍳\?⋆⍟○!⌹<≤=>≥≠≡≢∈⍷∪∩∼∨∧⍱⍲⍴,⍪⌽⊖⍉↑↓⊂⊃⌷⍋⍒⊤⊥⍕⍎⊣⊢]/;
|
|
57
|
+
var isArrow = /←/;
|
|
58
|
+
var isComment = /[⍝#].*$/;
|
|
59
|
+
|
|
60
|
+
var stringEater = function(type) {
|
|
61
|
+
var prev;
|
|
62
|
+
prev = false;
|
|
63
|
+
return function(c) {
|
|
64
|
+
prev = c;
|
|
65
|
+
if (c === type) {
|
|
66
|
+
return prev === "\\";
|
|
67
|
+
}
|
|
68
|
+
return true;
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export const apl = {
|
|
73
|
+
name: "apl",
|
|
74
|
+
startState: function() {
|
|
75
|
+
return {
|
|
76
|
+
prev: false,
|
|
77
|
+
func: false,
|
|
78
|
+
op: false,
|
|
79
|
+
string: false,
|
|
80
|
+
escape: false
|
|
81
|
+
};
|
|
82
|
+
},
|
|
83
|
+
token: function(stream, state) {
|
|
84
|
+
var ch;
|
|
85
|
+
if (stream.eatSpace()) {
|
|
86
|
+
return null;
|
|
87
|
+
}
|
|
88
|
+
ch = stream.next();
|
|
89
|
+
if (ch === '"' || ch === "'") {
|
|
90
|
+
stream.eatWhile(stringEater(ch));
|
|
91
|
+
stream.next();
|
|
92
|
+
state.prev = true;
|
|
93
|
+
return "string";
|
|
94
|
+
}
|
|
95
|
+
if (/[\[{\(]/.test(ch)) {
|
|
96
|
+
state.prev = false;
|
|
97
|
+
return null;
|
|
98
|
+
}
|
|
99
|
+
if (/[\]}\)]/.test(ch)) {
|
|
100
|
+
state.prev = true;
|
|
101
|
+
return null;
|
|
102
|
+
}
|
|
103
|
+
if (isNiladic.test(ch)) {
|
|
104
|
+
state.prev = false;
|
|
105
|
+
return "atom";
|
|
106
|
+
}
|
|
107
|
+
if (/[¯\d]/.test(ch)) {
|
|
108
|
+
if (state.func) {
|
|
109
|
+
state.func = false;
|
|
110
|
+
state.prev = false;
|
|
111
|
+
} else {
|
|
112
|
+
state.prev = true;
|
|
113
|
+
}
|
|
114
|
+
stream.eatWhile(/[\w\.]/);
|
|
115
|
+
return "number";
|
|
116
|
+
}
|
|
117
|
+
if (isOperator.test(ch)) {
|
|
118
|
+
return "operator"
|
|
119
|
+
}
|
|
120
|
+
if (isArrow.test(ch)) {
|
|
121
|
+
return "operator";
|
|
122
|
+
}
|
|
123
|
+
if (isFunction.test(ch)) {
|
|
124
|
+
state.func = true;
|
|
125
|
+
state.prev = false;
|
|
126
|
+
return builtInFuncs[ch] ? "variableName.function.standard" : "variableName.function"
|
|
127
|
+
}
|
|
128
|
+
if (isComment.test(ch)) {
|
|
129
|
+
stream.skipToEnd();
|
|
130
|
+
return "comment";
|
|
131
|
+
}
|
|
132
|
+
if (ch === "∘" && stream.peek() === ".") {
|
|
133
|
+
stream.next();
|
|
134
|
+
return "variableName.function";
|
|
135
|
+
}
|
|
136
|
+
stream.eatWhile(/[\w\$_]/);
|
|
137
|
+
state.prev = true;
|
|
138
|
+
return "keyword";
|
|
139
|
+
}
|
|
140
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
function errorIfNotEmpty(stream) {
|
|
2
|
+
var nonWS = stream.match(/^\s*\S/);
|
|
3
|
+
stream.skipToEnd();
|
|
4
|
+
return nonWS ? "error" : null;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export const asciiArmor = {
|
|
8
|
+
name: "asciiarmor",
|
|
9
|
+
token: function(stream, state) {
|
|
10
|
+
var m;
|
|
11
|
+
if (state.state == "top") {
|
|
12
|
+
if (stream.sol() && (m = stream.match(/^-----BEGIN (.*)?-----\s*$/))) {
|
|
13
|
+
state.state = "headers";
|
|
14
|
+
state.type = m[1];
|
|
15
|
+
return "tag";
|
|
16
|
+
}
|
|
17
|
+
return errorIfNotEmpty(stream);
|
|
18
|
+
} else if (state.state == "headers") {
|
|
19
|
+
if (stream.sol() && stream.match(/^\w+:/)) {
|
|
20
|
+
state.state = "header";
|
|
21
|
+
return "atom";
|
|
22
|
+
} else {
|
|
23
|
+
var result = errorIfNotEmpty(stream);
|
|
24
|
+
if (result) state.state = "body";
|
|
25
|
+
return result;
|
|
26
|
+
}
|
|
27
|
+
} else if (state.state == "header") {
|
|
28
|
+
stream.skipToEnd();
|
|
29
|
+
state.state = "headers";
|
|
30
|
+
return "string";
|
|
31
|
+
} else if (state.state == "body") {
|
|
32
|
+
if (stream.sol() && (m = stream.match(/^-----END (.*)?-----\s*$/))) {
|
|
33
|
+
if (m[1] != state.type) return "error";
|
|
34
|
+
state.state = "end";
|
|
35
|
+
return "tag";
|
|
36
|
+
} else {
|
|
37
|
+
if (stream.eatWhile(/[A-Za-z0-9+\/=]/)) {
|
|
38
|
+
return null;
|
|
39
|
+
} else {
|
|
40
|
+
stream.next();
|
|
41
|
+
return "error";
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
} else if (state.state == "end") {
|
|
45
|
+
return errorIfNotEmpty(stream);
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
blankLine: function(state) {
|
|
49
|
+
if (state.state == "headers") state.state = "body";
|
|
50
|
+
},
|
|
51
|
+
startState: function() {
|
|
52
|
+
return {state: "top", type: null};
|
|
53
|
+
}
|
|
54
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import {StreamParser} from "@quirekit/cm-language"
|
|
2
|
+
export declare function asn1(conf: {
|
|
3
|
+
keywords?: {[word: string]: any},
|
|
4
|
+
cmipVerbs?: {[word: string]: any},
|
|
5
|
+
compareTypes?: {[word: string]: any},
|
|
6
|
+
status?: {[word: string]: any},
|
|
7
|
+
tags?: {[word: string]: any},
|
|
8
|
+
storage?: {[word: string]: any},
|
|
9
|
+
modifier?: {[word: string]: any},
|
|
10
|
+
accessTypes?: {[word: string]: any},
|
|
11
|
+
multiLineStrings?: boolean
|
|
12
|
+
}): StreamParser<unknown>
|