@haste-health/lang-fp 0.2.3

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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (C) 2021 by Marijn Haverbeke <marijnh@gmail.com> 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 ADDED
@@ -0,0 +1 @@
1
+ # FHIRPath Codemirror Language
package/lib/index.cjs ADDED
@@ -0,0 +1,59 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var language = require('@codemirror/language');
6
+ var highlight = require('@lezer/highlight');
7
+ var lr = require('@lezer/lr');
8
+
9
+ // This file was generated by lezer-generator. You probably shouldn't edit it.
10
+ const spec_Identifier = { __proto__: null, true: 12, false: 12 };
11
+ const parser = lr.LRParser.deserialize({
12
+ version: 14,
13
+ states: "!^QYQPOOOtQPO'#CnOOQO'#Cn'#CnOOQO'#Cj'#CjQYQPOOO!iQPO,59POOQO-E6h-E6hOOQO1G.k1G.kO!pQPO1G.kOOQO7+$V7+$V",
14
+ stateData: "!w~OaOSPOS~ORQOSPOTQOUQOVQOZQO[QO]QO~OYTORbXSbXTbXUbXVbXZbX[bX]bX_bXWbX~OWVO~PYOWXO~PYO",
15
+ goto: "zcPPPPPPPPPdPPPPjPPPtXQOSTWQSOSUSWRWTXROSTW",
16
+ nodeNames: "⚠ LineComment Program Variable Identifier String Boolean This ) FunctionCall ( Number Dot Operators",
17
+ maxTerm: 18,
18
+ skippedNodes: [0, 1],
19
+ repeatNodeCount: 1,
20
+ tokenData: "(l~RaXY!WYZ!W]^!Wpq!Wtu!iuv#Wwx#uxy%cyz%h}!O%m!O!P&i!P!Q&n!Q!R%v!R![&^!_!`']!c!}(W#T#o(W~!]Sa~XY!WYZ!W]^!Wpq!W~!lP#h#i!o~!rP#[#]!u~!xP#]#^!{~#OP#g#h#R~#WOV~~#ZQ!c!}#a#T#o#a~#fTR~}!O#a!Q![#a!c!}#a#R#S#a#T#o#a~#xVOw#uwx$_x#O#u#O#P$d#P;'S#u;'S;=`%]<%lO#u~$dOT~~$gRO;'S#u;'S;=`$p;=`O#u~$sWOw#uwx$_x#O#u#O#P$d#P;'S#u;'S;=`%];=`<%l#u<%lO#u~%`P;=`<%l#u~%hOY~~%mOW~~%pQ!Q!R%v!R![&^~%{PZ~!O!P&O~&RP!Q![&U~&ZPZ~!Q![&U~&cQZ~!O!P&O!Q![&^~&nO[~~&qP!P!Q&t~&ySP~OY&tZ;'S&t;'S;=`'V<%lO&t~'YP;=`<%l&t~'`Pz{'c~'fP!P!Q'i~'lP{|'o~'rP}!O'u~'xPqr'{~(OP!_!`(R~(WO]~~(]TS~}!O(W!Q![(W!c!}(W#R#S(W#T#o(W",
21
+ tokenizers: [0],
22
+ topRules: { "Program": [0, 2] },
23
+ specialized: [{ term: 4, get: (value) => spec_Identifier[value] || -1 }],
24
+ tokenPrec: 0
25
+ });
26
+
27
+ const FPLanguage = language.LRLanguage.define({
28
+ parser: parser.configure({
29
+ props: [
30
+ language.indentNodeProp.add({
31
+ Application: language.delimitedIndent({ closing: ")", align: false }),
32
+ }),
33
+ language.foldNodeProp.add({
34
+ Application: language.foldInside,
35
+ }),
36
+ highlight.styleTags({
37
+ Operators: highlight.tags.arithmeticOperator,
38
+ FunctionCall: highlight.tags.function(highlight.tags.propertyName),
39
+ This: highlight.tags.self,
40
+ Variable: highlight.tags.definition(highlight.tags.variableName),
41
+ Number: highlight.tags.number,
42
+ Identifier: highlight.tags.name,
43
+ Boolean: highlight.tags.bool,
44
+ String: highlight.tags.string,
45
+ LineComment: highlight.tags.lineComment,
46
+ "( )": highlight.tags.paren,
47
+ }),
48
+ ],
49
+ }),
50
+ languageData: {
51
+ commentTokens: { line: "//" },
52
+ },
53
+ });
54
+ function index () {
55
+ return new language.LanguageSupport(FPLanguage);
56
+ }
57
+
58
+ exports.FPLanguage = FPLanguage;
59
+ exports["default"] = index;
@@ -0,0 +1,4 @@
1
+ import { LRLanguage, LanguageSupport } from "@codemirror/language";
2
+ declare const FPLanguage: LRLanguage;
3
+ declare function indexFunc(): LanguageSupport;
4
+ export { FPLanguage, indexFunc as default };
package/lib/index.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ import { LRLanguage, LanguageSupport } from "@codemirror/language";
2
+ declare const FPLanguage: LRLanguage;
3
+ declare function indexFunc(): LanguageSupport;
4
+ export { FPLanguage, indexFunc as default };
package/lib/index.js ADDED
@@ -0,0 +1,54 @@
1
+ import { LRLanguage, indentNodeProp, delimitedIndent, foldNodeProp, foldInside, LanguageSupport } from '@codemirror/language';
2
+ import { styleTags, tags } from '@lezer/highlight';
3
+ import { LRParser } from '@lezer/lr';
4
+
5
+ // This file was generated by lezer-generator. You probably shouldn't edit it.
6
+ const spec_Identifier = { __proto__: null, true: 12, false: 12 };
7
+ const parser = LRParser.deserialize({
8
+ version: 14,
9
+ states: "!^QYQPOOOtQPO'#CnOOQO'#Cn'#CnOOQO'#Cj'#CjQYQPOOO!iQPO,59POOQO-E6h-E6hOOQO1G.k1G.kO!pQPO1G.kOOQO7+$V7+$V",
10
+ stateData: "!w~OaOSPOS~ORQOSPOTQOUQOVQOZQO[QO]QO~OYTORbXSbXTbXUbXVbXZbX[bX]bX_bXWbX~OWVO~PYOWXO~PYO",
11
+ goto: "zcPPPPPPPPPdPPPPjPPPtXQOSTWQSOSUSWRWTXROSTW",
12
+ nodeNames: "⚠ LineComment Program Variable Identifier String Boolean This ) FunctionCall ( Number Dot Operators",
13
+ maxTerm: 18,
14
+ skippedNodes: [0, 1],
15
+ repeatNodeCount: 1,
16
+ tokenData: "(l~RaXY!WYZ!W]^!Wpq!Wtu!iuv#Wwx#uxy%cyz%h}!O%m!O!P&i!P!Q&n!Q!R%v!R![&^!_!`']!c!}(W#T#o(W~!]Sa~XY!WYZ!W]^!Wpq!W~!lP#h#i!o~!rP#[#]!u~!xP#]#^!{~#OP#g#h#R~#WOV~~#ZQ!c!}#a#T#o#a~#fTR~}!O#a!Q![#a!c!}#a#R#S#a#T#o#a~#xVOw#uwx$_x#O#u#O#P$d#P;'S#u;'S;=`%]<%lO#u~$dOT~~$gRO;'S#u;'S;=`$p;=`O#u~$sWOw#uwx$_x#O#u#O#P$d#P;'S#u;'S;=`%];=`<%l#u<%lO#u~%`P;=`<%l#u~%hOY~~%mOW~~%pQ!Q!R%v!R![&^~%{PZ~!O!P&O~&RP!Q![&U~&ZPZ~!Q![&U~&cQZ~!O!P&O!Q![&^~&nO[~~&qP!P!Q&t~&ySP~OY&tZ;'S&t;'S;=`'V<%lO&t~'YP;=`<%l&t~'`Pz{'c~'fP!P!Q'i~'lP{|'o~'rP}!O'u~'xPqr'{~(OP!_!`(R~(WO]~~(]TS~}!O(W!Q![(W!c!}(W#R#S(W#T#o(W",
17
+ tokenizers: [0],
18
+ topRules: { "Program": [0, 2] },
19
+ specialized: [{ term: 4, get: (value) => spec_Identifier[value] || -1 }],
20
+ tokenPrec: 0
21
+ });
22
+
23
+ const FPLanguage = LRLanguage.define({
24
+ parser: parser.configure({
25
+ props: [
26
+ indentNodeProp.add({
27
+ Application: delimitedIndent({ closing: ")", align: false }),
28
+ }),
29
+ foldNodeProp.add({
30
+ Application: foldInside,
31
+ }),
32
+ styleTags({
33
+ Operators: tags.arithmeticOperator,
34
+ FunctionCall: tags.function(tags.propertyName),
35
+ This: tags.self,
36
+ Variable: tags.definition(tags.variableName),
37
+ Number: tags.number,
38
+ Identifier: tags.name,
39
+ Boolean: tags.bool,
40
+ String: tags.string,
41
+ LineComment: tags.lineComment,
42
+ "( )": tags.paren,
43
+ }),
44
+ ],
45
+ }),
46
+ languageData: {
47
+ commentTokens: { line: "//" },
48
+ },
49
+ });
50
+ function index () {
51
+ return new LanguageSupport(FPLanguage);
52
+ }
53
+
54
+ export { FPLanguage, index as default };
package/package.json ADDED
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "@haste-health/lang-fp",
3
+ "version": "0.2.3",
4
+ "description": "FHIRPath language support for CodeMirror",
5
+ "scripts": {
6
+ "lezer": "lezer-generator src/syntax.grammar -o src/syntax.grammar.js",
7
+ "prepare": "pnpm lezer && rollup -c",
8
+ "build": "pnpm prepare",
9
+ "publish": "pnpm build && pnpm npm publish --access public --tolerate-republish"
10
+ },
11
+ "type": "module",
12
+ "main": "lib/index.cjs",
13
+ "module": "lib/index.js",
14
+ "exports": {
15
+ "import": "./lib/index.js",
16
+ "require": "./lib/index.cjs"
17
+ },
18
+ "types": "lib/index.d.ts",
19
+ "sideEffects": false,
20
+ "dependencies": {
21
+ "@codemirror/language": "^6.10.8",
22
+ "@lezer/common": "^1.3.0",
23
+ "@lezer/highlight": "^1.0.0",
24
+ "@lezer/lr": "^1.0.0"
25
+ },
26
+ "devDependencies": {
27
+ "@lezer/generator": "^1.0.0",
28
+ "mocha": "^9.2.2",
29
+ "rollup": "^2.79.2",
30
+ "rollup-plugin-dts": "^4.2.3",
31
+ "rollup-plugin-ts": "^3.4.5",
32
+ "typescript": "^4.9.5"
33
+ },
34
+ "license": "MIT"
35
+ }