mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-08-24 10:46:50 +02:00
build(dev-deps): add chevrotain
as a devDependencies
This commit is contained in:
@@ -41,5 +41,8 @@
|
|||||||
],
|
],
|
||||||
"publishConfig": {
|
"publishConfig": {
|
||||||
"access": "public"
|
"access": "public"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"chevrotain": "^11.0.3"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,51 +0,0 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
||||||
|
|
||||||
type CustomPatternMatcherReturn = [string] & { payload?: any };
|
|
||||||
|
|
||||||
export type CustomPatternMatcherFunc = (
|
|
||||||
text: string,
|
|
||||||
offset: number,
|
|
||||||
tokens: IToken[],
|
|
||||||
groups: {
|
|
||||||
[groupName: string]: IToken[];
|
|
||||||
}
|
|
||||||
) => CustomPatternMatcherReturn | RegExpExecArray | null;
|
|
||||||
|
|
||||||
interface ICustomPattern {
|
|
||||||
exec: CustomPatternMatcherFunc;
|
|
||||||
}
|
|
||||||
|
|
||||||
type TokenPattern = RegExp | string | CustomPatternMatcherFunc | ICustomPattern;
|
|
||||||
|
|
||||||
export interface IToken {
|
|
||||||
image: string;
|
|
||||||
startOffset: number;
|
|
||||||
startLine?: number;
|
|
||||||
startColumn?: number;
|
|
||||||
endOffset?: number;
|
|
||||||
endLine?: number;
|
|
||||||
endColumn?: number;
|
|
||||||
isInsertedInRecovery?: boolean;
|
|
||||||
tokenTypeIdx: number;
|
|
||||||
tokenType: TokenType;
|
|
||||||
payload?: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface TokenType {
|
|
||||||
name: string;
|
|
||||||
GROUP?: string;
|
|
||||||
PATTERN?: TokenPattern;
|
|
||||||
LABEL?: string;
|
|
||||||
LONGER_ALT?: TokenType | TokenType[];
|
|
||||||
POP_MODE?: boolean;
|
|
||||||
PUSH_MODE?: string;
|
|
||||||
LINE_BREAKS?: boolean;
|
|
||||||
CATEGORIES?: TokenType[];
|
|
||||||
tokenTypeIdx?: number;
|
|
||||||
categoryMatches?: number[];
|
|
||||||
categoryMatchesMap?: {
|
|
||||||
[tokType: number]: boolean;
|
|
||||||
};
|
|
||||||
isParent?: boolean;
|
|
||||||
START_CHARS_HINT?: (string | number)[];
|
|
||||||
}
|
|
@@ -1,5 +1,5 @@
|
|||||||
import type { GrammarAST, Stream, TokenBuilderOptions } from 'langium';
|
import type { GrammarAST, Stream, TokenBuilderOptions } from 'langium';
|
||||||
import type { TokenType } from '../chevrotainWrapper.js';
|
import type { TokenType } from 'chevrotain';
|
||||||
|
|
||||||
import { DefaultTokenBuilder } from 'langium';
|
import { DefaultTokenBuilder } from 'langium';
|
||||||
|
|
||||||
|
4
pnpm-lock.yaml
generated
4
pnpm-lock.yaml
generated
@@ -486,6 +486,10 @@ importers:
|
|||||||
langium:
|
langium:
|
||||||
specifier: 2.1.0
|
specifier: 2.1.0
|
||||||
version: 2.1.0
|
version: 2.1.0
|
||||||
|
devDependencies:
|
||||||
|
chevrotain:
|
||||||
|
specifier: ^11.0.3
|
||||||
|
version: 11.0.3
|
||||||
|
|
||||||
tests/webpack:
|
tests/webpack:
|
||||||
dependencies:
|
dependencies:
|
||||||
|
Reference in New Issue
Block a user