This commit is contained in:
nik
2025-10-03 22:27:28 +03:00
parent 829fad0e17
commit 871cf7e792
16520 changed files with 2967597 additions and 3 deletions

27
node_modules/langium/lib/languages/grammar-config.js generated vendored Normal file
View File

@@ -0,0 +1,27 @@
/******************************************************************************
* Copyright 2021 TypeFox GmbH
* This program and the accompanying materials are made available under the
* terms of the MIT License, which is available in the project root.
******************************************************************************/
import { DefaultNameRegexp } from '../utils/cst-utils.js';
import { isCommentTerminal, terminalRegex } from '../utils/grammar-utils.js';
import { isMultilineComment } from '../utils/regexp-utils.js';
import { isTerminalRule } from './generated/ast.js';
/**
* Create the default grammar configuration (used by `createDefaultModule`). This can be overridden in a
* language-specific module.
*/
export function createGrammarConfig(services) {
const rules = [];
const grammar = services.Grammar;
for (const rule of grammar.rules) {
if (isTerminalRule(rule) && isCommentTerminal(rule) && isMultilineComment(terminalRegex(rule))) {
rules.push(rule.name);
}
}
return {
multilineCommentRules: rules,
nameRegexp: DefaultNameRegexp
};
}
//# sourceMappingURL=grammar-config.js.map