Generator name with hyphen throws an error
Closed this issue · 4 comments
daeteck commented
When a hyphen is added to the name of the generator the linting throws an error.
Example:
generator markdown-something {
provider = "prisma-markdown"
}
Error:
MismatchedTokenException: Expecting --> '{' <-- but found --> 'something' <--
at RecognizerEngine.consumeInternalError (/Users/diegoesteves/Documents/BGS2/node_modules/chevrotain/lib/src/parse/parser/traits/recognizer_engine.js:500:31)
at RecognizerEngine.consumeInternal (/Users/diegoesteves/Documents/BGS2/node_modules/chevrotain/lib/src/parse/parser/traits/recognizer_engine.js:475:22)
at RecognizerApi.CONSUME (/Users/diegoesteves/Documents/BGS2/node_modules/chevrotain/lib/src/parse/parser/traits/recognizer_api.js:47:21)
at PrismaParser.<anonymous> (/Users/diegoesteves/Documents/BGS2/node_modules/@mrleebo/prisma-ast/dist/prisma-ast.cjs.development.js:395:13)
at PrismaParser.invokeRuleWithTry [as block] (/Users/diegoesteves/Documents/BGS2/node_modules/chevrotain/lib/src/parse/parser/traits/recognizer_engine.js:133:26)
at RecognizerEngine.subruleInternal (/Users/diegoesteves/Documents/BGS2/node_modules/chevrotain/lib/src/parse/parser/traits/recognizer_engine.js:447:37)
at RecognizerApi.SUBRULE (/Users/diegoesteves/Documents/BGS2/node_modules/chevrotain/lib/src/parse/parser/traits/recognizer_api.js:77:21)
at PrismaParser.<anonymous> (/Users/diegoesteves/Documents/BGS2/node_modules/@mrleebo/prisma-ast/dist/prisma-ast.cjs.development.js:576:13)
at PrismaParser.invokeRuleWithTry [as component] (/Users/diegoesteves/Documents/BGS2/node_modules/chevrotain/lib/src/parse/parser/traits/recognizer_engine.js:133:26)
at RecognizerEngine.subruleInternal (/Users/diegoesteves/Documents/BGS2/node_modules/chevrotain/lib/src/parse/parser/traits/recognizer_engine.js:447:37) {
token: {
image: 'something',
startOffset: 810,
endOffset: 818,
startLine: 25,
endLine: 25,
startColumn: 19,
endColumn: 27,
tokenTypeIdx: 3,
tokenType: {
name: 'Identifier',
PATTERN: /[a-zA-Z]\w*/,
tokenTypeIdx: 3,
CATEGORIES: [],
categoryMatches: [],
categoryMatchesMap: {},
isParent: false
}
},
resyncedTokens: [],
previousToken: {
image: 'markdown',
startOffset: 801,
endOffset: 808,
startLine: 25,
endLine: 25,
startColumn: 11,
endColumn: 18,
tokenTypeIdx: 3,
tokenType: {
name: 'Identifier',
PATTERN: /[a-zA-Z]\w*/,
tokenTypeIdx: 3,
CATEGORIES: [],
categoryMatches: [],
categoryMatchesMap: {},
isParent: false
}
},
context: {
ruleStack: [ 'schema', 'component', 'block' ],
ruleOccurrenceStack: [ 0, 0, 0 ]
}
}
maxh commented
Interesting. Thanks for reporting. This looks like it might be an issue with https://github.com/MrLeebo/prisma-ast.
maxh commented
Filed MrLeebo/prisma-ast#39
MrLeebo commented
This issue is already fixed in prisma-ast v0.10.1, which prisma-lint is using in the main branch.