Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: handle backticks surrounding IDs #622

Merged
merged 4 commits into from
Oct 9, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
style: apply automated linter fixes
megalinter-bot committed Oct 9, 2023
commit 967fe3e113e8dac4d7f29c673758db3540c24d84
2 changes: 1 addition & 1 deletion src/language/grammar/safe-ds-value-converter.ts
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ export class SafeDsValueConverter extends DefaultValueConverter {
protected override runConverter(rule: GrammarAST.AbstractRule, input: string, cstNode: CstNode): ValueType {
switch (rule.name.toUpperCase()) {
case 'ID':
return input.replaceAll('`', "")
return input.replaceAll('`', '');
case 'TEMPLATE_STRING_START':
return convertString(input.substring(0, input.length - 1));
case 'TEMPLATE_STRING_INNER':
3 changes: 2 additions & 1 deletion tests/language/grammar/safe-ds-value-converter.test.ts
Original file line number Diff line number Diff line change
@@ -4,7 +4,8 @@ import { EmptyFileSystem } from 'langium';
import { getNodeOfType } from '../../helpers/nodeFinder.js';
import {
isSdsClass,
isSdsModule, isSdsTemplateStringEnd,
isSdsModule,
isSdsTemplateStringEnd,
isSdsTemplateStringInner,
isSdsTemplateStringStart,
} from '../../../src/language/generated/ast.js';