Extract CodeMirror language package
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
// This file was generated by lezer-generator. You probably shouldn't edit it.
|
||||
import {LRParser} from "npm:@lezer/lr@^1.4.10"
|
||||
export const parser = LRParser.deserialize({
|
||||
version: 14,
|
||||
states: "7vQYQPOOO#nQPO'#CaOOQO'#Cr'#CrO$wQPO'#CyO&UQPO'#DOO&^QPO'#DSO&eQPO'#DWO&mQPO'#CqO$wQPO'#DcO&wQPO'#DhOOQO'#Cq'#CqOOQO'#Cp'#CpO&|QPO'#CoO$wQPO'#CoOOQO'#Cn'#CnO)fQPO'#CmO.XQPO'#ClO0]QPO'#CkOOQO'#Cj'#CjO2TQPO'#CiO3xQPO'#ChO5jQPO'#CgO7UQPO'#CfOOQO'#Ce'#CeO7`QPO'#C`O7eQPO'#C_OOQO'#Dz'#DzQYQPOOO8xQPO'#D{O8}QPO,58{OOQO,59e,59eO9VQPO'#CaOOQO,59j,59jO9_QPO,59jOOQO,59n,59nO9gQPO,59nO9oQPO'#EOO9tQPO'#DYO9|QPO,59rO:RQPO'#CqO:`QPO'#D^O:hQQO,59vO:mQPO,59vO:rQPO,59]O:wQPO,59}OOQO,5:S,5:SO:|QPO'#DjOOQO,59[,59[O;TQPO,59[OOQO,59Z,59ZO$wQPO,59YO$wQPO,59XO$wQPO,59WOOQO'#Dr'#DrO$wQPO,59VO$wQPO,59UO$wQPO,59TO$wQPO,59SO$wQPO,59RO$wQPO,59QO$wQPO,58zOOQO,58y,58yOOQO-E7x-E7xOOQO,5:g,5:gOOQO-E7y-E7yO;YQPO1G/UO;bQPO1G/UOOQO1G/U1G/UO;jQPO1G/YO;qQPO1G/YOOQO1G/Y1G/YOOQO,5:j,5:jOOQO-E7|-E7|O$wQPO1G/^O$wQPO,59yO;yQPO,59xO<RQPO,59xO$wQPO1G/bO<ZQQO1G/bOOQO1G.w1G.wO<`QPO1G/iO<jQPO'#DkOOQO,5:U,5:UO<rQPO,5:UOOQO1G.v1G.vOOQO1G.t1G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!O!S!T!U!W!X!Y!Z![!]!^!f!k!l!o!r#_#h#m#s#v#w#z$O$R$S$T$U$V$W$X$`$a$b$f$g$h$i$j$k$l#TYORTVW]k!O!S!T!U!W!X!Y!Z![!]!^!f!k!l!o!r#_#h#m#s#v#w#z$O$R$S$T$U$V$W$X$`$a$b$f$g$h$i$j$k$lRvURzVQxVV#d!m#e#tQ#l!rV#|#w$O$RX#j!r#w$O$RR!P[R!u!OQ!WaQ$U$[R$f$dQkOR!`kSmPoR!bmQ!dqR#[!dQ!gsS#`!g#nR#n!sQuUR!juQ!nxR#f!nQ#x#lR$P#x",
|
||||
nodeNames: "⚠ Comment Source Statement FieldDefinition FieldPath Identifier Dot Equal Expression DefaultExpression PatchExpression ComposeExpression LogicalOrExpression LogicalAndExpression ComparisonExpression ConcatExpression AdditiveExpression MultiplicativeExpression UnaryExpression PostfixExpression PrimaryExpression Literal String Integer Float True False Regex ComparisonConstraint Lt Lte Gt Gte Object LBrace Semicolon RBrace Array LBracket Comma RBracket LetExpression Let FieldDefinitionList In FunctionExpression LParen ParameterList Parameter Colon RParen Arrow MatchExpression Match MatchArm Pattern Underscore ImportExpression Import CallSuffix ArgumentList Bang Minus Star Slash Plus PlusPlus CompareOperator EqualEqual BangEqual AmpAmp PipePipe Amp SlashSlash Default",
|
||||
maxTerm: 85,
|
||||
skippedNodes: [0,1],
|
||||
repeatNodeCount: 7,
|
||||
tokenData: "=T~R!PX^$Upq$Uqr$yrs%Wst&zvw'cxy'pyz'uz{'z{|(P|}(^}!O(c!O!P(h!P!Q(m!Q![+T![!]+n!]!^+s!^!_+x!_!`,V!`!a,l!c!},y!}#O-[#P#Q-a#R#S-f#T#W,y#W#X-y#X#Y,y#Y#Z1Z#Z#],y#]#^3k#^#`,y#`#a6}#a#b8b#b#h,y#h#i:r#i#o,y#o#p<n#p#q<s#q#r=O#y#z$U$f$g$U#BY#BZ$U$IS$I_$U$I|$JO$U$JT$JU$U$KV$KW$U&FU&FV$U~$ZY!w~X^$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0,2]},
|
||||
tokenPrec: 2481
|
||||
})
|
||||
@@ -0,0 +1,16 @@
|
||||
// This file was generated by lezer-generator. You probably shouldn't edit it.
|
||||
import {LRParser} from "@lezer/lr"
|
||||
export const parser = LRParser.deserialize({
|
||||
version: 14,
|
||||
states: "7vQYQPOOO#nQPO'#CaOOQO'#Cr'#CrO$wQPO'#CyO&UQPO'#DOO&^QPO'#DSO&eQPO'#DWO&mQPO'#CqO$wQPO'#DcO&wQPO'#DhOOQO'#Cq'#CqOOQO'#Cp'#CpO&|QPO'#CoO$wQPO'#CoOOQO'#Cn'#CnO)fQPO'#CmO.XQPO'#ClO0]QPO'#CkOOQO'#Cj'#CjO2TQPO'#CiO3xQPO'#ChO5jQPO'#CgO7UQPO'#CfOOQO'#Ce'#CeO7`QPO'#C`O7eQPO'#C_OOQO'#Dz'#DzQYQPOOO8xQPO'#D{O8}QPO,58{OOQO,59e,59eO9VQPO'#CaOOQO,59j,59jO9_QPO,59jOOQO,59n,59nO9gQPO,59nO9oQPO'#EOO9tQPO'#DYO9|QPO,59rO:RQPO'#CqO:`QPO'#D^O:hQQO,59vO:mQPO,59vO:rQPO,59]O:wQPO,59}OOQO,5:S,5:SO:|QPO'#DjOOQO,59[,59[O;TQPO,59[OOQO,59Z,59ZO$wQPO,59YO$wQPO,59XO$wQPO,59WOOQO'#Dr'#DrO$wQPO,59VO$wQPO,59UO$wQPO,59TO$wQPO,59SO$wQPO,59RO$wQPO,59QO$wQPO,58zOOQO,58y,58yOOQO-E7x-E7xOOQO,5:g,5:gOOQO-E7y-E7yO;YQPO1G/UO;bQPO1G/UOOQO1G/U1G/UO;jQPO1G/YO;qQPO1G/YOOQO1G/Y1G/YOOQO,5:j,5:jOOQO-E7|-E7|O$wQPO1G/^O$wQPO,59yO;yQPO,59xO<RQPO,59xO$wQPO1G/bO<ZQQO1G/bOOQO1G.w1G.wO<`QPO1G/iO<jQPO'#DkOOQO,5:U,5:UO<rQPO,5:UOOQO1G.v1G.vOOQO1G.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W]k!O!S!T!U!W!X!Y!Z![!]!^!f!k!l!o!r#_#h#m#s#v#w#z$O$R$S$T$U$V$W$X$`$a$b$f$g$h$i$j$k$l#TYORTVW]k!O!S!T!U!W!X!Y!Z![!]!^!f!k!l!o!r#_#h#m#s#v#w#z$O$R$S$T$U$V$W$X$`$a$b$f$g$h$i$j$k$lRvURzVQxVV#d!m#e#tQ#l!rV#|#w$O$RX#j!r#w$O$RR!P[R!u!OQ!WaQ$U$[R$f$dQkOR!`kSmPoR!bmQ!dqR#[!dQ!gsS#`!g#nR#n!sQuUR!juQ!nxR#f!nQ#x#lR$P#x",
|
||||
nodeNames: "⚠ Comment Source Statement FieldDefinition FieldPath Identifier Dot Equal Expression DefaultExpression PatchExpression ComposeExpression LogicalOrExpression LogicalAndExpression ComparisonExpression ConcatExpression AdditiveExpression MultiplicativeExpression UnaryExpression PostfixExpression PrimaryExpression Literal String Integer Float True False Regex ComparisonConstraint Lt Lte Gt Gte Object LBrace Semicolon RBrace Array LBracket Comma RBracket LetExpression Let FieldDefinitionList In FunctionExpression LParen ParameterList Parameter Colon RParen Arrow MatchExpression Match MatchArm Pattern Underscore ImportExpression Import CallSuffix ArgumentList Bang Minus Star Slash Plus PlusPlus CompareOperator EqualEqual BangEqual AmpAmp PipePipe Amp SlashSlash Default",
|
||||
maxTerm: 85,
|
||||
skippedNodes: [0,1],
|
||||
repeatNodeCount: 7,
|
||||
tokenData: "=T~R!PX^$Upq$Uqr$yrs%Wst&zvw'cxy'pyz'uz{'z{|(P|}(^}!O(c!O!P(h!P!Q(m!Q![+T![!]+n!]!^+s!^!_+x!_!`,V!`!a,l!c!},y!}#O-[#P#Q-a#R#S-f#T#W,y#W#X-y#X#Y,y#Y#Z1Z#Z#],y#]#^3k#^#`,y#`#a6}#a#b8b#b#h,y#h#i:r#i#o,y#o#p<n#p#q<s#q#r=O#y#z$U$f$g$U#BY#BZ$U$IS$I_$U$I|$JO$U$JT$JU$U$KV$KW$U&FU&FV$U~$ZY!w~X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source":[0,2]},
|
||||
tokenPrec: 2481
|
||||
})
|
||||
@@ -0,0 +1,77 @@
|
||||
// This file was generated by lezer-generator. You probably shouldn't edit it.
|
||||
export const
|
||||
Comment = 1,
|
||||
Source = 2,
|
||||
Statement = 3,
|
||||
FieldDefinition = 4,
|
||||
FieldPath = 5,
|
||||
Identifier = 6,
|
||||
Dot = 7,
|
||||
Equal = 8,
|
||||
Expression = 9,
|
||||
DefaultExpression = 10,
|
||||
PatchExpression = 11,
|
||||
ComposeExpression = 12,
|
||||
LogicalOrExpression = 13,
|
||||
LogicalAndExpression = 14,
|
||||
ComparisonExpression = 15,
|
||||
ConcatExpression = 16,
|
||||
AdditiveExpression = 17,
|
||||
MultiplicativeExpression = 18,
|
||||
UnaryExpression = 19,
|
||||
PostfixExpression = 20,
|
||||
PrimaryExpression = 21,
|
||||
Literal = 22,
|
||||
String = 23,
|
||||
Integer = 24,
|
||||
Float = 25,
|
||||
True = 26,
|
||||
False = 27,
|
||||
Regex = 28,
|
||||
ComparisonConstraint = 29,
|
||||
Lt = 30,
|
||||
Lte = 31,
|
||||
Gt = 32,
|
||||
Gte = 33,
|
||||
Object = 34,
|
||||
LBrace = 35,
|
||||
Semicolon = 36,
|
||||
RBrace = 37,
|
||||
Array = 38,
|
||||
LBracket = 39,
|
||||
Comma = 40,
|
||||
RBracket = 41,
|
||||
LetExpression = 42,
|
||||
Let = 43,
|
||||
FieldDefinitionList = 44,
|
||||
In = 45,
|
||||
FunctionExpression = 46,
|
||||
LParen = 47,
|
||||
ParameterList = 48,
|
||||
Parameter = 49,
|
||||
Colon = 50,
|
||||
RParen = 51,
|
||||
Arrow = 52,
|
||||
MatchExpression = 53,
|
||||
Match = 54,
|
||||
MatchArm = 55,
|
||||
Pattern = 56,
|
||||
Underscore = 57,
|
||||
ImportExpression = 58,
|
||||
Import = 59,
|
||||
CallSuffix = 60,
|
||||
ArgumentList = 61,
|
||||
Bang = 62,
|
||||
Minus = 63,
|
||||
Star = 64,
|
||||
Slash = 65,
|
||||
Plus = 66,
|
||||
PlusPlus = 67,
|
||||
CompareOperator = 68,
|
||||
EqualEqual = 69,
|
||||
BangEqual = 70,
|
||||
AmpAmp = 71,
|
||||
PipePipe = 72,
|
||||
Amp = 73,
|
||||
SlashSlash = 74,
|
||||
Default = 75
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
import { HighlightStyle } from '@codemirror/language';
|
||||
import { LRLanguage, LanguageSupport } from '@codemirror/language';
|
||||
|
||||
export declare const decodalLanguage: LRLanguage;
|
||||
export declare const decodalHighlightStyle: HighlightStyle;
|
||||
|
||||
export interface DecodalOptions {
|
||||
highlight?: boolean;
|
||||
}
|
||||
|
||||
export declare function decodal(options?: DecodalOptions): LanguageSupport;
|
||||
@@ -0,0 +1,73 @@
|
||||
import { LRLanguage, LanguageSupport, HighlightStyle, syntaxHighlighting, foldNodeProp, indentNodeProp } from '@codemirror/language';
|
||||
import { styleTags, tags as t } from '@lezer/highlight';
|
||||
import { parser } from './decodal-parser.js';
|
||||
|
||||
const parserWithMetadata = parser.configure({
|
||||
props: [
|
||||
styleTags({
|
||||
'Let In Match Import Default': t.keyword,
|
||||
'True False': t.bool,
|
||||
Identifier: t.variableName,
|
||||
String: t.string,
|
||||
Regex: t.regexp,
|
||||
'Integer Float': t.number,
|
||||
Comment: t.lineComment,
|
||||
'Plus Minus Star Slash PlusPlus Equal EqualEqual Bang BangEqual Amp AmpAmp PipePipe SlashSlash Gt Gte Lt Lte Arrow': t.operator,
|
||||
'LBrace RBrace': t.brace,
|
||||
'LBracket RBracket': t.squareBracket,
|
||||
'LParen RParen': t.paren,
|
||||
'Semicolon Comma Dot Colon': t.punctuation,
|
||||
}),
|
||||
indentNodeProp.add({
|
||||
Object: context => context.column(context.node.from) + context.unit,
|
||||
Array: context => context.column(context.node.from) + context.unit,
|
||||
MatchExpression: context => context.column(context.node.from) + context.unit,
|
||||
LetExpression: context => context.column(context.node.from) + context.unit,
|
||||
}),
|
||||
foldNodeProp.add({
|
||||
Object: foldDelimited('{', '}'),
|
||||
Array: foldDelimited('[', ']'),
|
||||
MatchExpression: foldDelimited('{', '}'),
|
||||
}),
|
||||
],
|
||||
});
|
||||
|
||||
function foldDelimited(open, close) {
|
||||
return (node, state) => {
|
||||
const text = state.doc.sliceString(node.from, node.to);
|
||||
const openIndex = text.indexOf(open);
|
||||
const closeIndex = text.lastIndexOf(close);
|
||||
if (openIndex < 0 || closeIndex <= openIndex) return null;
|
||||
const from = node.from + openIndex + open.length;
|
||||
const to = node.from + closeIndex;
|
||||
return from < to ? { from, to } : null;
|
||||
};
|
||||
}
|
||||
|
||||
export const decodalLanguage = LRLanguage.define({
|
||||
parser: parserWithMetadata,
|
||||
languageData: {
|
||||
commentTokens: { line: '#' },
|
||||
closeBrackets: { brackets: ['(', '[', '{', '"'] },
|
||||
},
|
||||
});
|
||||
|
||||
export const decodalHighlightStyle = HighlightStyle.define([
|
||||
{ tag: t.keyword, color: '#93c5fd', fontWeight: '700' },
|
||||
{ tag: t.variableName, color: 'inherit' },
|
||||
{ tag: t.bool, color: '#fbbf24' },
|
||||
{ tag: t.number, color: '#fbbf24' },
|
||||
{ tag: t.string, color: '#86efac' },
|
||||
{ tag: t.regexp, color: '#86efac' },
|
||||
{ tag: t.lineComment, color: '#94a3b8', fontStyle: 'italic' },
|
||||
{ tag: t.operator, color: '#f9a8d4' },
|
||||
{ tag: [t.brace, t.squareBracket, t.paren, t.punctuation], color: '#f9a8d4' },
|
||||
]);
|
||||
|
||||
export function decodal(options = {}) {
|
||||
const { highlight = true } = options;
|
||||
return new LanguageSupport(
|
||||
decodalLanguage,
|
||||
highlight ? [syntaxHighlighting(decodalHighlightStyle)] : [],
|
||||
);
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
import { HighlightStyle, LRLanguage, LanguageSupport } from '@codemirror/language';
|
||||
|
||||
export declare const decodalLanguage: LRLanguage;
|
||||
export declare const decodalHighlightStyle: HighlightStyle;
|
||||
|
||||
export interface DecodalOptions {
|
||||
highlight?: boolean;
|
||||
}
|
||||
|
||||
export declare function decodal(options?: DecodalOptions): LanguageSupport;
|
||||
@@ -0,0 +1,77 @@
|
||||
import { HighlightStyle, LRLanguage, LanguageSupport, foldNodeProp, indentNodeProp, syntaxHighlighting } from 'npm:@codemirror/language@^6.12.4';
|
||||
import { styleTags, tags as t } from 'npm:@lezer/highlight@^1.2.3';
|
||||
import { parser } from './decodal-parser-jsr.js';
|
||||
|
||||
const parserWithMetadata = parser.configure({
|
||||
props: [
|
||||
styleTags({
|
||||
'Let In Match Import Default': t.keyword,
|
||||
'True False': t.bool,
|
||||
Identifier: t.variableName,
|
||||
String: t.string,
|
||||
Regex: t.regexp,
|
||||
'Integer Float': t.number,
|
||||
Comment: t.lineComment,
|
||||
'Plus Minus Star Slash PlusPlus Equal EqualEqual Bang BangEqual Amp AmpAmp PipePipe SlashSlash Gt Gte Lt Lte Arrow': t.operator,
|
||||
'LBrace RBrace': t.brace,
|
||||
'LBracket RBracket': t.squareBracket,
|
||||
'LParen RParen': t.paren,
|
||||
'Semicolon Comma Dot Colon': t.punctuation,
|
||||
}),
|
||||
indentNodeProp.add({
|
||||
Object: context => context.column(context.node.from) + context.unit,
|
||||
Array: context => context.column(context.node.from) + context.unit,
|
||||
MatchExpression: context => context.column(context.node.from) + context.unit,
|
||||
LetExpression: context => context.column(context.node.from) + context.unit,
|
||||
}),
|
||||
foldNodeProp.add({
|
||||
Object: foldDelimited('{', '}'),
|
||||
Array: foldDelimited('[', ']'),
|
||||
MatchExpression: foldDelimited('{', '}'),
|
||||
}),
|
||||
],
|
||||
});
|
||||
|
||||
function foldDelimited(open: string, close: string) {
|
||||
return (node: { from: number; to: number }, state: { doc: { sliceString(from: number, to: number): string } }) => {
|
||||
const text = state.doc.sliceString(node.from, node.to);
|
||||
const openIndex = text.indexOf(open);
|
||||
const closeIndex = text.lastIndexOf(close);
|
||||
if (openIndex < 0 || closeIndex <= openIndex) return null;
|
||||
const from = node.from + openIndex + open.length;
|
||||
const to = node.from + closeIndex;
|
||||
return from < to ? { from, to } : null;
|
||||
};
|
||||
}
|
||||
|
||||
export const decodalLanguage: LRLanguage = LRLanguage.define({
|
||||
parser: parserWithMetadata,
|
||||
languageData: {
|
||||
commentTokens: { line: '#' },
|
||||
closeBrackets: { brackets: ['(', '[', '{', '"'] },
|
||||
},
|
||||
});
|
||||
|
||||
export const decodalHighlightStyle: HighlightStyle = HighlightStyle.define([
|
||||
{ tag: t.keyword, color: '#93c5fd', fontWeight: '700' },
|
||||
{ tag: t.variableName, color: 'inherit' },
|
||||
{ tag: t.bool, color: '#fbbf24' },
|
||||
{ tag: t.number, color: '#fbbf24' },
|
||||
{ tag: t.string, color: '#86efac' },
|
||||
{ tag: t.regexp, color: '#86efac' },
|
||||
{ tag: t.lineComment, color: '#94a3b8', fontStyle: 'italic' },
|
||||
{ tag: t.operator, color: '#f9a8d4' },
|
||||
{ tag: [t.brace, t.squareBracket, t.paren, t.punctuation], color: '#f9a8d4' },
|
||||
]);
|
||||
|
||||
export interface DecodalOptions {
|
||||
highlight?: boolean;
|
||||
}
|
||||
|
||||
export function decodal(options: DecodalOptions = {}): LanguageSupport {
|
||||
const { highlight = true } = options;
|
||||
return new LanguageSupport(
|
||||
decodalLanguage,
|
||||
highlight ? [syntaxHighlighting(decodalHighlightStyle)] : [],
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user