@manifest-configuration-language/language 0.0.0-stage → 0.1.2
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/README.md +15 -2
- package/package.json +36 -4
- package/src/index.d.ts +5 -0
- package/src/index.js +57 -0
- package/src/layout.js +45 -0
- package/src/mcl.grammar +137 -0
- package/src/mcl.tmLanguage.json +162 -0
- package/src/parser.js +20 -0
- package/src/parser.terms.js +125 -0
package/README.md
CHANGED
|
@@ -1,3 +1,16 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @manifest-configuration-language/language
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
`@manifest-configuration-language/language` contains the MCL TextMate grammar and a Lezer-backed CodeMirror `LanguageSupport` export with standard bracket completion.
|
|
4
|
+
|
|
5
|
+
```js
|
|
6
|
+
import { mclLanguageSupport } from "@manifest-configuration-language/language";
|
|
7
|
+
import mclTextMateGrammar from "@manifest-configuration-language/language/textmate" with { type: "json" };
|
|
8
|
+
|
|
9
|
+
const support = mclLanguageSupport();
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
The Lezer parser provides incremental syntax trees and CodeMirror highlighting for declarations, generic and schema-backed types, expressions, indentation-sensitive map/list blocks, block-level `if`/`else` and `for` expressions, dynamic `key(...)` map keys, node declarations, `with`/`without` overlays, typed functions, and validation rules. Descendant validation supports a type selector, `where = fn(...) => ...`, and `select = bySchema(Type)`; each selector may include the optional integer `minMatches` argument. The grammar recognizes source structure and does not validate evaluation semantics.
|
|
13
|
+
|
|
14
|
+
`npm run check:parity` checks that TextMate and Lezer expose the same keywords, tokenizes representative MCL constructs with the VS Code TextMate tokenizer and checks their scopes, parses package-owned fixtures and every `.mcl` example under `cmd/mcl-wasm/testdata/examples` with both Lezer and the Go formatter, and verifies one malformed declaration is rejected by both parsers. The tokenization check covers comments, strings, keywords, identifiers, function calls, and operators. The fixtures cover descendant selector variants, dynamic map keys, schema-backed types, qualified rule references, nested application manifests, and final `if`/`else` expressions. The parity check uses the Go CLI as the syntax reference. `src/mcl.tmLanguage.json` is the package-owned TextMate grammar source; sibling VS Code and Website copies still need migration to this package.
|
|
15
|
+
|
|
16
|
+
Build generation runs during `prepack` with the pinned `@lezer/generator` dependency. CodeMirror packages, including `@codemirror/autocomplete` for bracket completion, are peers so applications can share their existing editor runtime. The parity check also constructs the support in a Node `EditorState` to catch package integration errors.
|
package/package.json
CHANGED
|
@@ -1,6 +1,38 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@manifest-configuration-language/language",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.2",
|
|
4
|
+
"description": "MCL TextMate grammar and CodeMirror language support.",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/manifest-configuration-language/mcl.git",
|
|
8
|
+
"directory": "packages/language"
|
|
9
|
+
},
|
|
10
|
+
"type": "module",
|
|
11
|
+
"license": "Apache-2.0",
|
|
12
|
+
"files": ["src", "README.md"],
|
|
13
|
+
"exports": {
|
|
14
|
+
".": { "types": "./src/index.d.ts", "import": "./src/index.js" },
|
|
15
|
+
"./textmate": "./src/mcl.tmLanguage.json"
|
|
16
|
+
},
|
|
17
|
+
"scripts": {
|
|
18
|
+
"build": "lezer-generator src/mcl.grammar -o src/parser.js",
|
|
19
|
+
"check:parity": "npm run build && node scripts/check-parity.mjs && node scripts/check-textmate.mjs && node scripts/smoke-language-support.mjs",
|
|
20
|
+
"prepack": "npm run build"
|
|
21
|
+
},
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"@lezer/highlight": "1.2.5",
|
|
24
|
+
"@lezer/lr": "1.4.11"
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@lezer/generator": "1.8.1",
|
|
28
|
+
"vscode-oniguruma": "2.0.1",
|
|
29
|
+
"vscode-textmate": "9.3.2"
|
|
30
|
+
},
|
|
31
|
+
"peerDependencies": {
|
|
32
|
+
"@codemirror/autocomplete": ">=6 <7",
|
|
33
|
+
"@codemirror/language": ">=6 <7",
|
|
34
|
+
"@codemirror/state": ">=6 <7",
|
|
35
|
+
"@codemirror/view": ">=6 <7"
|
|
36
|
+
},
|
|
37
|
+
"publishConfig": { "access": "public" }
|
|
38
|
+
}
|
package/src/index.d.ts
ADDED
package/src/index.js
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { LanguageSupport, LRLanguage, continuedIndent, foldService, indentNodeProp, syntaxTree } from "@codemirror/language";
|
|
2
|
+
import { closeBrackets } from "@codemirror/autocomplete";
|
|
3
|
+
import { styleTags, tags } from "@lezer/highlight";
|
|
4
|
+
import { parser as generatedParser } from "./parser.js";
|
|
5
|
+
|
|
6
|
+
export const parser = generatedParser.configure({
|
|
7
|
+
props: [
|
|
8
|
+
styleTags({
|
|
9
|
+
"import as export type let fn rule emit validate require message using for in if else each descendants where select bySchema minMatches requireEach requireDescendants and or not is with without output schema key": tags.keyword,
|
|
10
|
+
"Any Null Bool Int Decimal String List Map Function Node Schema": tags.typeName,
|
|
11
|
+
"true false null": tags.bool,
|
|
12
|
+
Identifier: tags.variableName,
|
|
13
|
+
QuotedString: tags.string,
|
|
14
|
+
Number: tags.number,
|
|
15
|
+
Comment: tags.comment,
|
|
16
|
+
Operator: tags.operator,
|
|
17
|
+
}),
|
|
18
|
+
indentNodeProp.add({
|
|
19
|
+
LetBlockDeclaration: continuedIndent(),
|
|
20
|
+
Block: continuedIndent({ except: /^\s*else\b/ }),
|
|
21
|
+
IfExpression: continuedIndent({ except: /^\s*else\b/ }),
|
|
22
|
+
ForExpression: continuedIndent(),
|
|
23
|
+
TypeRecordBlock: continuedIndent(),
|
|
24
|
+
RuleBlock: continuedIndent(),
|
|
25
|
+
}),
|
|
26
|
+
],
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
const language = LRLanguage.define({
|
|
30
|
+
name: "mcl",
|
|
31
|
+
parser,
|
|
32
|
+
languageData: { commentTokens: { line: "#" } },
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
export function mclLanguageSupport() {
|
|
36
|
+
return new LanguageSupport(language, [closeBrackets(), foldService.of(foldMclBlock)]);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function foldMclBlock(state, lineStart, lineEnd) {
|
|
40
|
+
const tree = syntaxTree(state);
|
|
41
|
+
const text = state.doc.sliceString(lineStart, lineEnd).trim();
|
|
42
|
+
const isElseHeader = /^else\s*:/.test(text);
|
|
43
|
+
for (let node = tree.resolveInner(lineEnd, -1); node; node = node.parent) {
|
|
44
|
+
if (isElseHeader ? node.name !== "IfExpression" : node.from < lineStart || node.from > lineEnd) continue;
|
|
45
|
+
|
|
46
|
+
let candidate;
|
|
47
|
+
for (let child = node.firstChild; child; child = child.nextSibling) {
|
|
48
|
+
if (child.name === "Block" && child.from >= lineEnd) {
|
|
49
|
+
candidate = child;
|
|
50
|
+
if (!isElseHeader) break;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
if (candidate && candidate.to > lineEnd) return { from: lineEnd, to: candidate.to };
|
|
54
|
+
if (isElseHeader) return null;
|
|
55
|
+
}
|
|
56
|
+
return null;
|
|
57
|
+
}
|
package/src/layout.js
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { ContextTracker, ExternalTokenizer } from "@lezer/lr";
|
|
2
|
+
import { blankLineStart, dedent, indent } from "./parser.terms.js";
|
|
3
|
+
|
|
4
|
+
class IndentLevel {
|
|
5
|
+
constructor(parent, depth) {
|
|
6
|
+
this.parent = parent;
|
|
7
|
+
this.depth = depth;
|
|
8
|
+
this.hash = (parent ? (parent.hash + parent.hash) << 8 : 0) + depth + (depth << 4);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export const trackIndent = new ContextTracker({
|
|
13
|
+
start: new IndentLevel(null, 0),
|
|
14
|
+
shift(context, term, stack, input) {
|
|
15
|
+
if (term === indent) return new IndentLevel(context, stack.pos - input.pos);
|
|
16
|
+
if (term === dedent) return context.parent;
|
|
17
|
+
return context;
|
|
18
|
+
},
|
|
19
|
+
hash: (context) => context.hash,
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
const newline = 10;
|
|
23
|
+
const carriageReturn = 13;
|
|
24
|
+
const space = 32;
|
|
25
|
+
const tab = 9;
|
|
26
|
+
const hash = 35;
|
|
27
|
+
|
|
28
|
+
export const indentation = new ExternalTokenizer((input, stack) => {
|
|
29
|
+
const previous = input.peek(-1);
|
|
30
|
+
if (previous !== -1 && previous !== newline && previous !== carriageReturn) return;
|
|
31
|
+
|
|
32
|
+
let spaces = 0;
|
|
33
|
+
while (input.next === space || input.next === tab) {
|
|
34
|
+
input.advance();
|
|
35
|
+
spaces += 1;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
if ((input.next === newline || input.next === carriageReturn || input.next === hash) && stack.canShift(blankLineStart)) {
|
|
39
|
+
input.acceptToken(blankLineStart, -spaces);
|
|
40
|
+
} else if (spaces > stack.context.depth) {
|
|
41
|
+
input.acceptToken(indent);
|
|
42
|
+
} else if (spaces < stack.context.depth) {
|
|
43
|
+
input.acceptToken(dedent, -spaces);
|
|
44
|
+
}
|
|
45
|
+
}, { contextual: true });
|
package/src/mcl.grammar
ADDED
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
@top MCL { (BlockStatement | FunctionDeclaration | Statement lineEnd)* }
|
|
2
|
+
|
|
3
|
+
Statement {
|
|
4
|
+
ImportDeclaration |
|
|
5
|
+
TypeDeclaration |
|
|
6
|
+
LetDeclaration |
|
|
7
|
+
EmitStatement |
|
|
8
|
+
ValidateStatement |
|
|
9
|
+
ExpressionStatement
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
BlockStatement { TypeRecordDeclaration | LetBlockDeclaration | LetNodeDeclaration | LetOverlayDeclaration | LetRemovalDeclaration | RuleDeclaration }
|
|
13
|
+
|
|
14
|
+
ImportDeclaration { Export? kw<"import"> QuotedString kw<"as"> Identifier }
|
|
15
|
+
Export { kw<"export"> }
|
|
16
|
+
TypeDeclaration { Export? kw<"type"> Identifier TypeParameterList? "=" TypeExpression }
|
|
17
|
+
TypeRecordDeclaration { Export? kw<"type"> Identifier TypeParameterList? "=" lineEnd TypeRecordBlock }
|
|
18
|
+
LetDeclaration { Export? kw<"let"> Identifier TypeAnnotation? "=" Expression }
|
|
19
|
+
LetBlockDeclaration { Export? kw<"let"> Identifier TypeAnnotation? "=" lineEnd Block }
|
|
20
|
+
LetNodeDeclaration { Export? kw<"let"> Identifier TypeAnnotation? "=" NodeExpression }
|
|
21
|
+
LetOverlayDeclaration { Export? kw<"let"> Identifier TypeAnnotation? "=" OverlayExpression }
|
|
22
|
+
LetRemovalDeclaration { Export? kw<"let"> Identifier TypeAnnotation? "=" RemovalExpression }
|
|
23
|
+
TypeAnnotation { ":" TypeExpression }
|
|
24
|
+
FunctionDeclaration { Export? kw<"fn"> Identifier "(" ParameterList? ")" (("->" | ":") TypeExpression)? "=" FunctionBody }
|
|
25
|
+
FunctionBody { Expression lineEnd | lineEnd Block }
|
|
26
|
+
TypeParameterList { "<" Identifier ("," Identifier)* ","? ">" }
|
|
27
|
+
ParameterList { Parameter ("," Parameter)* ","? }
|
|
28
|
+
Parameter { Identifier TypeAnnotation? }
|
|
29
|
+
RuleDeclaration { Export? kw<"rule"> Identifier "(" TypedParameter ")" ":" lineEnd RuleBlock }
|
|
30
|
+
TypedParameter { Identifier ":" TypeExpression }
|
|
31
|
+
RuleBlock { indent RequireStatement+ (dedent | eof) }
|
|
32
|
+
RequireStatement { kw<"require"> Expression (kw<"message"> QuotedString)? lineEnd }
|
|
33
|
+
EmitStatement { kw<"emit"> kw<"each">? Expression }
|
|
34
|
+
ValidateStatement { kw<"validate"> (kw<"each"> DescendantsQuery | Expression) kw<"using"> RuleReference }
|
|
35
|
+
RuleReference { Identifier ("." Identifier)* }
|
|
36
|
+
DescendantsQuery { kw<"descendants"> "(" kw<"output"> "," (TypeExpression | NamedQuerySelector) ("," kw<"minMatches"> "=" Number)? ")" }
|
|
37
|
+
NamedQuerySelector { kw<"where"> "=" LambdaExpression | kw<"select"> "=" BySchemaSelector }
|
|
38
|
+
BySchemaSelector { kw<"bySchema"> "(" TypeExpression ")" }
|
|
39
|
+
ExpressionStatement { Expression }
|
|
40
|
+
|
|
41
|
+
Block { indent BlockLine+ (dedent | eof) }
|
|
42
|
+
BlockLine { MapEntry | SequenceItem | RequireStatement | IfExpression | ForExpression | Expression lineEnd }
|
|
43
|
+
MapEntry { MapEntryKey ":" (Expression lineEnd | lineEnd Block | lineEnd) }
|
|
44
|
+
MapEntryKey { DynamicMapKey | MapKey }
|
|
45
|
+
DynamicMapKey { kw<"key"> "(" Expression ")" }
|
|
46
|
+
MapKey { Identifier | MapKeyword | QuotedString | Number }
|
|
47
|
+
SequenceItem { ListMarker ((MapEntryKey ":" Expression) | Expression)? (lineEnd Block | lineEnd) }
|
|
48
|
+
TypeRecordBlock { indent TypeField+ (dedent | eof) }
|
|
49
|
+
TypeField { MapKey "?"? ":" TypeExpression lineEnd }
|
|
50
|
+
|
|
51
|
+
TypeExpression { TypeAtom ("|" TypeAtom)* }
|
|
52
|
+
TypeAtom {
|
|
53
|
+
PrimitiveType TypeArguments? |
|
|
54
|
+
kw<"schema"> "(" QuotedString ")" |
|
|
55
|
+
QuotedString |
|
|
56
|
+
TypeReference |
|
|
57
|
+
"{" TypeFieldInline ("," TypeFieldInline)* ","? "}" |
|
|
58
|
+
"(" TypeExpression ")"
|
|
59
|
+
}
|
|
60
|
+
TypeReference { Identifier ("." Identifier)* TypeArguments? }
|
|
61
|
+
TypeArguments { "<" TypeExpression ("," TypeExpression)* ","? ">" }
|
|
62
|
+
TypeFieldInline { MapKey "?"? ":" TypeExpression }
|
|
63
|
+
PrimitiveType { kw<"Any"> | kw<"Null"> | kw<"Bool"> | kw<"Int"> | kw<"Decimal"> | kw<"String"> | kw<"List"> | kw<"Map"> | kw<"Function"> | kw<"Node"> | kw<"Schema"> }
|
|
64
|
+
|
|
65
|
+
Expression { UnaryExpression (BinaryOperator UnaryExpression)* }
|
|
66
|
+
UnaryExpression { kw<"not"> PostfixExpression | NegativeNumber | PostfixExpression }
|
|
67
|
+
PostfixExpression { PrimaryExpression Postfix* }
|
|
68
|
+
OverlayExpression { PrimaryExpression Postfix* Overlay }
|
|
69
|
+
Overlay { kw<"with"> ":" lineEnd Block }
|
|
70
|
+
RemovalExpression { PrimaryExpression Postfix* Removal }
|
|
71
|
+
Removal { kw<"without"> ":" lineEnd Block }
|
|
72
|
+
Postfix {
|
|
73
|
+
CallArguments |
|
|
74
|
+
"." MapKey |
|
|
75
|
+
"?." MapKey |
|
|
76
|
+
"[" Expression "]"
|
|
77
|
+
}
|
|
78
|
+
PrimaryExpression {
|
|
79
|
+
Number | QuotedString | MultiString | kw<"true"> | kw<"false"> | kw<"null"> |
|
|
80
|
+
Identifier | PrimitiveType |
|
|
81
|
+
"." Identifier |
|
|
82
|
+
"(" Expression ")" |
|
|
83
|
+
ListExpression |
|
|
84
|
+
InlineMap
|
|
85
|
+
}
|
|
86
|
+
NodeExpression { kw<"node"> ":" lineEnd Block }
|
|
87
|
+
IfExpression { kw<"if"> Expression ":" lineEnd Block (kw<"else"> ":" lineEnd Block)? }
|
|
88
|
+
ForExpression { kw<"for"> Identifier kw<"in"> Expression ":" lineEnd Block }
|
|
89
|
+
LambdaExpression { kw<"fn"> "(" ParameterList? ")" "=>" Expression }
|
|
90
|
+
ListExpression { "[" (Expression ("," Expression)* ","?)? "]" }
|
|
91
|
+
InlineMap { "{" (InlineMapEntry ("," InlineMapEntry)* ","?)? "}" }
|
|
92
|
+
InlineMapEntry { MapEntryKey ":" Expression }
|
|
93
|
+
CallArguments { "(" (CallArgument ("," CallArgument)* ","? | lineEnd indent CallArgument ("," lineEnd? CallArgument)* ","? lineEnd dedent)? ")" }
|
|
94
|
+
CallArgument { ((Identifier | kw<"key">) "=" )? (LambdaExpression | Expression) }
|
|
95
|
+
BinaryOperator { Operator | Minus | kw<"and"> | kw<"or"> | kw<"in"> }
|
|
96
|
+
|
|
97
|
+
@context trackIndent from "./layout.js"
|
|
98
|
+
@external tokens indentation from "./layout.js" {
|
|
99
|
+
indent
|
|
100
|
+
dedent
|
|
101
|
+
blankLineStart
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
@tokens {
|
|
105
|
+
@precedence { NegativeNumber, Minus }
|
|
106
|
+
Identifier { $[A-Za-z_] $[A-Za-z0-9_]* }
|
|
107
|
+
ListMarker { "-" $[ \t]+ }
|
|
108
|
+
NegativeNumber { "-" $[0-9]+ ("." $[0-9]+)? ($[eE] $[+-]? $[0-9]+)? }
|
|
109
|
+
Number { $[0-9]+ ("." $[0-9]+)? ($[eE] $[+-]? $[0-9]+)? }
|
|
110
|
+
QuotedString { "\"" ("\\" _ | !["\\\n\r])* "\"" }
|
|
111
|
+
MultiString { "\"\"\"" (!["] | "\"" !["] | "\"\"" !["])* "\"\"\"" }
|
|
112
|
+
Comment { "#" ![\n\r]* }
|
|
113
|
+
Operator { "==" | "!=" | "<=" | ">=" | "??" | "=>" | "->" | "+" | "*" | "/" | "%" | "|" | "<" | ">" }
|
|
114
|
+
Minus { "-" }
|
|
115
|
+
newline { "\r"? "\n" | "\r" }
|
|
116
|
+
eof { @eof }
|
|
117
|
+
spaces { $[ \t]+ }
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
@skip {
|
|
121
|
+
spaces |
|
|
122
|
+
Comment |
|
|
123
|
+
blankLineStart (spaces | Comment)* lineEnd
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
lineEnd { newline | eof }
|
|
127
|
+
|
|
128
|
+
kw<term> { @specialize[@name={term}]<Identifier, term> }
|
|
129
|
+
|
|
130
|
+
MapKeyword {
|
|
131
|
+
kw<"import"> | kw<"as"> | kw<"export"> | kw<"type"> | kw<"let"> | kw<"fn"> | kw<"rule"> | kw<"emit"> |
|
|
132
|
+
kw<"validate"> | kw<"require"> | kw<"message"> | kw<"using"> | kw<"in"> | kw<"each"> | kw<"descendants"> |
|
|
133
|
+
kw<"where"> | kw<"select"> | kw<"bySchema"> | kw<"minMatches"> | kw<"requireEach"> | kw<"requireDescendants"> |
|
|
134
|
+
kw<"and"> | kw<"or"> | kw<"not"> | kw<"with"> | kw<"without"> | kw<"output"> | kw<"Any"> |
|
|
135
|
+
kw<"Null"> | kw<"Bool"> | kw<"Int"> | kw<"Decimal"> | kw<"String"> | kw<"List"> | kw<"Map"> | kw<"schema"> |
|
|
136
|
+
kw<"Function"> | kw<"Node"> | kw<"Schema"> | kw<"true"> | kw<"false"> | kw<"null">
|
|
137
|
+
}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
|
|
3
|
+
"name": "MCL",
|
|
4
|
+
"scopeName": "source.mcl",
|
|
5
|
+
"patterns": [
|
|
6
|
+
{
|
|
7
|
+
"include": "#comments"
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"include": "#multiline-strings"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"include": "#strings"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"include": "#keywords"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"include": "#constants"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"include": "#types"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"include": "#function-calls"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"include": "#identifiers"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"include": "#numbers"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"include": "#operators"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"include": "#punctuation"
|
|
38
|
+
}
|
|
39
|
+
],
|
|
40
|
+
"repository": {
|
|
41
|
+
"comments": {
|
|
42
|
+
"patterns": [
|
|
43
|
+
{
|
|
44
|
+
"name": "comment.line.number-sign.mcl",
|
|
45
|
+
"match": "(?<= )#.*$|^#.*$"
|
|
46
|
+
}
|
|
47
|
+
]
|
|
48
|
+
},
|
|
49
|
+
"strings": {
|
|
50
|
+
"name": "string.quoted.double.mcl",
|
|
51
|
+
"begin": "\"",
|
|
52
|
+
"beginCaptures": {
|
|
53
|
+
"0": {
|
|
54
|
+
"name": "punctuation.definition.string.begin.mcl"
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
"end": "\"",
|
|
58
|
+
"endCaptures": {
|
|
59
|
+
"0": {
|
|
60
|
+
"name": "punctuation.definition.string.end.mcl"
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
"patterns": [
|
|
64
|
+
{
|
|
65
|
+
"name": "constant.character.escape.mcl",
|
|
66
|
+
"match": "\\\\."
|
|
67
|
+
}
|
|
68
|
+
]
|
|
69
|
+
},
|
|
70
|
+
"multiline-strings": {
|
|
71
|
+
"name": "string.quoted.multi.double.mcl",
|
|
72
|
+
"begin": "\"\"\"",
|
|
73
|
+
"beginCaptures": {
|
|
74
|
+
"0": {
|
|
75
|
+
"name": "punctuation.definition.string.begin.mcl"
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
"end": "\"\"\"",
|
|
79
|
+
"endCaptures": {
|
|
80
|
+
"0": {
|
|
81
|
+
"name": "punctuation.definition.string.end.mcl"
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
"keywords": {
|
|
86
|
+
"patterns": [
|
|
87
|
+
{
|
|
88
|
+
"name": "keyword.control.mcl",
|
|
89
|
+
"match": "\\b(?:import|as|export|let|type|fn|rule|emit|validate|require|message|using|for|in|if|else|each|descendants|where|select|bySchema|minMatches|requireEach|requireDescendants|node|with|without|schema|key)\\b"
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"name": "keyword.operator.mcl",
|
|
93
|
+
"match": "\\b(?:and|or|not)\\b"
|
|
94
|
+
}
|
|
95
|
+
]
|
|
96
|
+
},
|
|
97
|
+
"constants": {
|
|
98
|
+
"patterns": [
|
|
99
|
+
{
|
|
100
|
+
"name": "constant.language.mcl",
|
|
101
|
+
"match": "\\b(?:true|false|null|output)\\b"
|
|
102
|
+
}
|
|
103
|
+
]
|
|
104
|
+
},
|
|
105
|
+
"types": {
|
|
106
|
+
"patterns": [
|
|
107
|
+
{
|
|
108
|
+
"name": "storage.type.mcl",
|
|
109
|
+
"match": "\\b(?:Any|Null|Bool|Int|Decimal|String|List|Map|Function|Node|Schema)\\b"
|
|
110
|
+
}
|
|
111
|
+
]
|
|
112
|
+
},
|
|
113
|
+
"function-calls": {
|
|
114
|
+
"patterns": [
|
|
115
|
+
{
|
|
116
|
+
"name": "entity.name.function.mcl",
|
|
117
|
+
"match": "\\b[A-Za-z_][A-Za-z0-9_]*(?=\\s*\\()"
|
|
118
|
+
}
|
|
119
|
+
]
|
|
120
|
+
},
|
|
121
|
+
"identifiers": {
|
|
122
|
+
"patterns": [
|
|
123
|
+
{
|
|
124
|
+
"name": "variable.other.mcl",
|
|
125
|
+
"match": "\\b[A-Za-z_][A-Za-z0-9_]*\\b"
|
|
126
|
+
}
|
|
127
|
+
]
|
|
128
|
+
},
|
|
129
|
+
"numbers": {
|
|
130
|
+
"patterns": [
|
|
131
|
+
{
|
|
132
|
+
"name": "constant.numeric.mcl",
|
|
133
|
+
"match": "\\b\\d+(?:\\.\\d+)?(?:[eE][+-]?\\d+)?\\b"
|
|
134
|
+
}
|
|
135
|
+
]
|
|
136
|
+
},
|
|
137
|
+
"operators": {
|
|
138
|
+
"patterns": [
|
|
139
|
+
{
|
|
140
|
+
"name": "keyword.operator.mcl",
|
|
141
|
+
"match": "(?:==|!=|<=|>=|\\?\\?|=>|->|\\+|-|\\*|/|%|=|\\||<|>)"
|
|
142
|
+
}
|
|
143
|
+
]
|
|
144
|
+
},
|
|
145
|
+
"punctuation": {
|
|
146
|
+
"patterns": [
|
|
147
|
+
{
|
|
148
|
+
"name": "punctuation.separator.key-value.mcl",
|
|
149
|
+
"match": ":"
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
"name": "punctuation.separator.comma.mcl",
|
|
153
|
+
"match": ","
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
"name": "punctuation.accessor.mcl",
|
|
157
|
+
"match": "\\.|\\?"
|
|
158
|
+
}
|
|
159
|
+
]
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
package/src/parser.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// This file was generated by lezer-generator. You probably shouldn't edit it.
|
|
2
|
+
import {LRParser} from "@lezer/lr"
|
|
3
|
+
import {indentation, trackIndent} from "./layout.js"
|
|
4
|
+
const spec_Identifier = {__proto__:null,export:14, type:16, import:28, as:30, let:32, fn:34, rule:36, emit:38, validate:40, require:42, message:44, using:46, in:48, each:50, descendants:52, where:54, select:56, bySchema:58, minMatches:60, requireEach:62, requireDescendants:64, and:66, or:68, not:70, with:72, without:74, output:76, Any:78, Null:80, Bool:82, Int:84, Decimal:86, String:88, List:90, Map:92, schema:94, Function:96, Node:98, Schema:100, true:102, false:104, null:106, key:138, if:184, else:186, for:190, node:196}
|
|
5
|
+
export const parser = LRParser.deserialize({
|
|
6
|
+
version: 14,
|
|
7
|
+
states: "!)nQ]QROOP#cOPOOO%UQRO'#DyO(_QRO'#DzOOQP'#Dw'#DwO(fQRO'#DwO#hQRO'#DwO)`QRO'#DvOOQP'#Du'#DuO*[QRO'#DtOOQP'#C_'#C_OOQP'#Ex'#ExOOQP'#En'#EnOOQP'#Ez'#EzO*{QRO'#EzQ]QROOOOQP'#Ca'#CaOOQP'#Dh'#DhO+TQRO'#EpO+YQRO'#E`O+kQRO'#DuO-RQRO'#E`O-WQRO'#EiO-]QRO'#ElO-bQRO'#EoO-gQRO'#ErO-nQRO'#EsP-uOQO)CAUOOQP,5:e,5:eO.TQRO,5:eOOQP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vsOw&}Ox&}Oy&}Oz&}O{&}O|&}O}&}O!O&}O!PsO!Q&}O!R&}O!S&}O!T'OO!U'OO!V'OO!W&tO!X&tO!gtO!lSO!vWO$_UO$aTO$bRO$eQO~OesO$V!QO$W!QO~P! lO$Q(UO$W(UO~PHvO$^]X~P#hO$^]X~P+kOh![Xq![Xr![X!x![X!y![X$V![X$W![X$^]X$_![X$a![X$e![X$h![X~O$^]X~P7wOU(XO~OU$`O$`!ti~O$['zO~Ok(^Ol(_O~P;lO$Q(bO~P>aO$Q(bO~O$`(eO~OU&OO~O$Z(hO~P;lO$Y(iO$Z(hO~O$c(lO~P0uO$^(oO~O$[(qO~O$P%jOU!zaV!zaW!za^!za_!za`!zaa!zab!zac!zad!zae!zaf!zag!zah!zai!zaj!zak!zal!zam!zan!zao!zap!zaq!zar!zas!zat!zau!zav!zaw!zax!zay!zaz!za{!za|!za}!za!O!za!P!za!Q!za!R!za!S!za!T!za!U!za!V!za!W!za!X!za!g!za!l!za!v!za!{!za#O!za#R!za$Q!za$W!za$_!za$a!za$b!za$e!za~O$^(yO~Of(|O$V!QO$W!QO~O$^(}O~Oh)OO~O$P)PO~OU$`O~O$[)RO~O$[)SO~O$Y)UO$`)TO~O$`)VO~O$Q)WO~P>aO$Z)YO~P;lO$[)`O~O$P%jOU!diV!diW!di^!di_!di`!dia!dib!dic!did!die!dif!dig!dih!dii!dij!dik!dil!dim!din!dio!dip!diq!dir!dis!dit!diu!div!diw!dix!diy!diz!di{!di|!di}!di!O!di!P!di!Q!di!R!di!S!di!T!di!U!di!V!di!W!di!X!di!g!di!l!di!v!di!{!di#O!di#R!di$Q!di$W!di$_!di$a!di$b!di$e!di~O$P%jOU!ziV!ziW!zi^!zi_!zi`!zia!zib!zic!zid!zie!zif!zig!zih!zii!zij!zik!zil!zim!zin!zio!zip!ziq!zir!zis!zit!ziu!ziv!ziw!zix!ziy!ziz!zi{!zi|!zi}!zi!O!zi!P!zi!Q!zi!R!zi!S!zi!T!zi!U!zi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%`%j%r%x%y%|&m&v&z&{&|'P'_'`'e'z(O(c(d(q(y)O)X)`)iQqRV#g!k#i$lX{V|$V%eXxV|$V%eQ!swU$o#m$q%xQ$s#pU'^%y'`(dV(a'_(c)Xf!qw#m#p$q%x%y'_'`(c(d)XQ$n#lR)j)RQ$c#YQ$u#qR%c$SU$a#Y#q$SV'U%p'V([T!OX!PS&w%j&zT)g)P)hQ$Y#VQ%[$PR&h%`Q$Z#VQ%]$PR&i%`Q%f$VR&p%eQ$[#VQ%^$PR&j%`Q%g$VR&q%eQ$_#XR%a$RQ)Q(ZR)^(pQ'Z%rQ'x&mQ(r'zQ)_(qR)o)`T^O_T[O_R#^!bR(`']R)j)SQ$h#_R%u$fQ!ekR#`!eQ_OR!S_Q$w#sR&R$wQ&b%UR's&bQ'i&SR(j'iQ${#tQ%v$gT&U${%vQ&Z%PR'p&ZQ%S#yR&^%SQ&z%jR(T&zQ!hmR#e!hQ!lqR#j!lQ|VS!y|%eR%e$VQ%q$aR'W%qQ#n!sR$r#nQ%z$sR'a%zQ!PXR!{!PQ)h)PR)t)hQ!R^Q!fkQ!twQ#a!eQ#{!}Q$W#VQ%W#}Q%Z$PQ%{$sQ&d%YQ&g%`Q'R%lY'Y%r&m'z(q)`Q'_%yQ'b%zQ'|&rQ'}&sQ(P&vQ(S&xQ(Z'TQ(]'XQ(c'`Q(p'wQ(w(OQ(z(RQ({(VQ)X(dQ)[(nQ)a(vQ)e(}Q)n)]Q)p)bQ)q)dQ)z)sR*R)}",
|
|
10
|
+
nodeNames: "⚠ Comment MCL BlockStatement TypeRecordDeclaration Export Identifier export type TypeParameterList TypeRecordBlock TypeField MapKey MapKeyword import as let fn rule emit validate require message using in each descendants where select bySchema minMatches requireEach requireDescendants and or not with without output Any Null Bool Int Decimal String List Map schema Function Node Schema true false null QuotedString Number TypeExpression TypeAtom PrimitiveType TypeArguments TypeReference TypeFieldInline LetBlockDeclaration TypeAnnotation Block BlockLine MapEntry MapEntryKey DynamicMapKey key Expression UnaryExpression PostfixExpression PrimaryExpression MultiString ListExpression InlineMap InlineMapEntry Postfix CallArguments CallArgument LambdaExpression ParameterList Parameter NegativeNumber BinaryOperator Operator Minus SequenceItem ListMarker RequireStatement IfExpression if else ForExpression for LetNodeDeclaration NodeExpression node LetOverlayDeclaration OverlayExpression Overlay LetRemovalDeclaration RemovalExpression Removal RuleDeclaration TypedParameter RuleBlock FunctionDeclaration FunctionBody Statement ImportDeclaration TypeDeclaration LetDeclaration EmitStatement ValidateStatement DescendantsQuery NamedQuerySelector BySchemaSelector RuleReference ExpressionStatement",
|
|
11
|
+
maxTerm: 163,
|
|
12
|
+
context: trackIndent,
|
|
13
|
+
skippedNodes: [0,1,121],
|
|
14
|
+
repeatNodeCount: 17,
|
|
15
|
+
tokenData: ".u~RoXY#SYZ#_]^#dpq#Sqr#lrs#wst'|uv#rxy(hyz(mz{#r{|#r|}(r}!O(w!O!P*}!P!Q#r!Q![+S![!],e!^!_,j!_!`,t!`!a-W!a!b-b!c!}-r!}#O.T#P#Q.Y#R#S-r#T#o-r#o#p._#p#q.d#q#r.k~~.p~#XQ$T~XY#Spq#S~#dO$V~~#iP$V~YZ#_P#oP!_!`#rP#wO!xP~#zXOY$gZ]$g^r$grs&as#O$g#O#P%[#P;'S$g;'S;=`&Z<%lO$g~$jXOY$gZ]$g^r$grs%Vs#O$g#O#P%[#P;'S$g;'S;=`&Z<%lO$g~%[O!W~~%_RO;'S$g;'S;=`%h;=`O$g~%kYOY$gZ]$g^r$grs%Vs#O$g#O#P%[#P;'S$g;'S;=`&Z;=`<%l$g<%lO$g~&^P;=`<%l$g~&fP!W~rs&i~&lTOr&irs&{s;'S&i;'S;=`'v<%lO&i~'OTOr&irs'_s;'S&i;'S;=`'v<%lO&i~'bTOr&irs'qs;'S&i;'S;=`'v<%lO&i~'vO!l~~'yP;=`<%l&i~(RTP~OY'|Z]'|^;'S'|;'S;=`(b<%lO'|~(eP;=`<%l'|~(mO$_~~(rO$`~~(wO$Y~~(|S!yPXY)Ypq)Y!Q![)e!`!a*vQ)_Q!{QXY)Ypq)Y~)jS!v~!O!P)v!Q![)e!g!h*[#X#Y*[~)yP!Q![)|~*RR!v~!Q![)|!g!h*[#X#Y*[~*_R{|*h}!O*h!Q![*n~*kP!Q![*n~*sP!v~!Q![*nR*}O$iQ!xP~+SO$a~~+XS!X~!O!P+e!Q![+S!g!h+y#X#Y+y~+hP!Q![+k~+pR!X~!Q![+k!g!h+y#X#Y+y~+|R{|,V}!O,V!Q![,]~,YP!Q![,]~,bP!X~!Q![,]~,jO$^~R,qP$XQ!xP!_!`#rV,yQ$[R!_!`#r!`!a-PT-WO$gS!xPR-_P$ZQ!xP!_!`#rR-gQ$]Q!O!P-m!a!b#rP-rO$hP~-wSU~!Q![-r!c!}-r#R#S-r#T#o-r~.YO$e~~._O$f~~.dO$b~R.kO$dQ!xP~.pO$c~~.uO$W~",
|
|
16
|
+
tokenizers: [indentation, 0, 1, 2],
|
|
17
|
+
topRules: {"MCL":[0,2]},
|
|
18
|
+
specialized: [{term: 6, get: (value) => spec_Identifier[value] || -1}],
|
|
19
|
+
tokenPrec: 3497
|
|
20
|
+
})
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
// This file was generated by lezer-generator. You probably shouldn't edit it.
|
|
2
|
+
export const
|
|
3
|
+
indent = 139,
|
|
4
|
+
dedent = 140,
|
|
5
|
+
blankLineStart = 141,
|
|
6
|
+
Comment = 1,
|
|
7
|
+
MCL = 2,
|
|
8
|
+
BlockStatement = 3,
|
|
9
|
+
TypeRecordDeclaration = 4,
|
|
10
|
+
Export = 5,
|
|
11
|
+
Identifier = 6,
|
|
12
|
+
_export = 7,
|
|
13
|
+
type = 8,
|
|
14
|
+
TypeParameterList = 9,
|
|
15
|
+
TypeRecordBlock = 10,
|
|
16
|
+
TypeField = 11,
|
|
17
|
+
MapKey = 12,
|
|
18
|
+
MapKeyword = 13,
|
|
19
|
+
_import = 14,
|
|
20
|
+
as = 15,
|
|
21
|
+
_let = 16,
|
|
22
|
+
fn = 17,
|
|
23
|
+
rule = 18,
|
|
24
|
+
emit = 19,
|
|
25
|
+
validate = 20,
|
|
26
|
+
_require = 21,
|
|
27
|
+
message = 22,
|
|
28
|
+
using = 23,
|
|
29
|
+
_in = 24,
|
|
30
|
+
each = 25,
|
|
31
|
+
descendants = 26,
|
|
32
|
+
where = 27,
|
|
33
|
+
select = 28,
|
|
34
|
+
bySchema = 29,
|
|
35
|
+
minMatches = 30,
|
|
36
|
+
requireEach = 31,
|
|
37
|
+
requireDescendants = 32,
|
|
38
|
+
and = 33,
|
|
39
|
+
or = 34,
|
|
40
|
+
not = 35,
|
|
41
|
+
_with = 36,
|
|
42
|
+
without = 37,
|
|
43
|
+
output = 38,
|
|
44
|
+
Any = 39,
|
|
45
|
+
Null = 40,
|
|
46
|
+
Bool = 41,
|
|
47
|
+
Int = 42,
|
|
48
|
+
Decimal = 43,
|
|
49
|
+
String = 44,
|
|
50
|
+
List = 45,
|
|
51
|
+
Map = 46,
|
|
52
|
+
schema = 47,
|
|
53
|
+
Function = 48,
|
|
54
|
+
Node = 49,
|
|
55
|
+
Schema = 50,
|
|
56
|
+
_true = 51,
|
|
57
|
+
_false = 52,
|
|
58
|
+
_null = 53,
|
|
59
|
+
QuotedString = 54,
|
|
60
|
+
Number = 55,
|
|
61
|
+
TypeExpression = 56,
|
|
62
|
+
TypeAtom = 57,
|
|
63
|
+
PrimitiveType = 58,
|
|
64
|
+
TypeArguments = 59,
|
|
65
|
+
TypeReference = 60,
|
|
66
|
+
TypeFieldInline = 61,
|
|
67
|
+
LetBlockDeclaration = 62,
|
|
68
|
+
TypeAnnotation = 63,
|
|
69
|
+
Block = 64,
|
|
70
|
+
BlockLine = 65,
|
|
71
|
+
MapEntry = 66,
|
|
72
|
+
MapEntryKey = 67,
|
|
73
|
+
DynamicMapKey = 68,
|
|
74
|
+
key = 69,
|
|
75
|
+
Expression = 70,
|
|
76
|
+
UnaryExpression = 71,
|
|
77
|
+
PostfixExpression = 72,
|
|
78
|
+
PrimaryExpression = 73,
|
|
79
|
+
MultiString = 74,
|
|
80
|
+
ListExpression = 75,
|
|
81
|
+
InlineMap = 76,
|
|
82
|
+
InlineMapEntry = 77,
|
|
83
|
+
Postfix = 78,
|
|
84
|
+
CallArguments = 79,
|
|
85
|
+
CallArgument = 80,
|
|
86
|
+
LambdaExpression = 81,
|
|
87
|
+
ParameterList = 82,
|
|
88
|
+
Parameter = 83,
|
|
89
|
+
NegativeNumber = 84,
|
|
90
|
+
BinaryOperator = 85,
|
|
91
|
+
Operator = 86,
|
|
92
|
+
Minus = 87,
|
|
93
|
+
SequenceItem = 88,
|
|
94
|
+
ListMarker = 89,
|
|
95
|
+
RequireStatement = 90,
|
|
96
|
+
IfExpression = 91,
|
|
97
|
+
_if = 92,
|
|
98
|
+
_else = 93,
|
|
99
|
+
ForExpression = 94,
|
|
100
|
+
_for = 95,
|
|
101
|
+
LetNodeDeclaration = 96,
|
|
102
|
+
NodeExpression = 97,
|
|
103
|
+
node = 98,
|
|
104
|
+
LetOverlayDeclaration = 99,
|
|
105
|
+
OverlayExpression = 100,
|
|
106
|
+
Overlay = 101,
|
|
107
|
+
LetRemovalDeclaration = 102,
|
|
108
|
+
RemovalExpression = 103,
|
|
109
|
+
Removal = 104,
|
|
110
|
+
RuleDeclaration = 105,
|
|
111
|
+
TypedParameter = 106,
|
|
112
|
+
RuleBlock = 107,
|
|
113
|
+
FunctionDeclaration = 108,
|
|
114
|
+
FunctionBody = 109,
|
|
115
|
+
Statement = 110,
|
|
116
|
+
ImportDeclaration = 111,
|
|
117
|
+
TypeDeclaration = 112,
|
|
118
|
+
LetDeclaration = 113,
|
|
119
|
+
EmitStatement = 114,
|
|
120
|
+
ValidateStatement = 115,
|
|
121
|
+
DescendantsQuery = 116,
|
|
122
|
+
NamedQuerySelector = 117,
|
|
123
|
+
BySchemaSelector = 118,
|
|
124
|
+
RuleReference = 119,
|
|
125
|
+
ExpressionStatement = 120
|