From 64b9e07b165292a30680c3ca3c7eb7b2a40b47ff Mon Sep 17 00:00:00 2001 From: WinPlay02 Date: Thu, 2 Nov 2023 20:00:00 +0100 Subject: [PATCH] feat: Source Maps for Code Generation (#714) Closes #30 ### Summary of Changes - changed code generation to return traced nodes instead of text - add option to generate source maps by providing an optional path --------- Co-authored-by: megalinter-bot <129584137+megalinter-bot@users.noreply.github.com> Co-authored-by: Lars Reimann --- package-lock.json | 27 +- packages/safe-ds-cli/src/cli/generate.ts | 11 +- packages/safe-ds-cli/src/cli/main.ts | 1 + packages/safe-ds-lang/package.json | 1 + .../generation/safe-ds-python-generator.ts | 454 +++++++++++++----- .../tests/helpers/testResources.test.ts | 8 +- .../tests/helpers/testResources.ts | 19 +- .../tests/language/generation/creator.ts | 4 +- .../safe-ds-python-generator.test.ts | 7 +- .../generator/emptyPipeline/gen_input.py.map | 1 + .../generator/emptySegment/gen_input.py.map | 1 + .../parameterWithPythonName/gen_input.py.map | 1 + .../pipelineWithPythonName/gen_input.py.map | 1 + .../segmentWithPythonName/gen_input.py.map | 1 + .../generator/twoPipelines/gen_input.py.map | 1 + .../generator/twoSegments/gen_input.py.map | 1 + .../blockLambdaResult/gen_input.py.map | 1 + .../generator/blockLambda/gen_input.py.map | 1 + .../tests/generator/call/gen_input.py.map | 1 + .../tests/generator/constant/gen_input.py.map | 1 + .../enumVariantCall/gen_input.py.map | 1 + .../expressionLambda/gen_input.py.map | 1 + .../generator/indexedAccess/gen_input.py.map | 1 + .../generator/infixOperation/gen_input.py.map | 1 + .../tests/generator/lists/gen_input.py.map | 1 + .../tests/generator/literals/gen_input.py.map | 1 + .../tests/generator/maps/gen_input.py.map | 1 + .../generator/memberAccess/gen_input.py.map | 1 + .../parenthesizedExpression/gen_input.py.map | 1 + .../prefixOperation/gen_input.py.map | 1 + .../generator/reference/gen_input.py.map | 1 + .../generator/templateString/gen_input.py.map | 1 + .../imports/gen_context_same_package.py.map | 1 + .../tests/generator/imports/gen_input.py.map | 1 + .../tests/generator/wildcard/gen_input.py.map | 1 + .../output/special_module/gen_input.py.map | 1 + .../generator/assignment/gen_input.py.map | 1 + .../expressionStatement/gen_input.py.map | 1 + 38 files changed, 407 insertions(+), 154 deletions(-) create mode 100644 packages/safe-ds-lang/tests/resources/generation/declarations/empty pipeline/output/tests/generator/emptyPipeline/gen_input.py.map create mode 100644 packages/safe-ds-lang/tests/resources/generation/declarations/empty segment/output/tests/generator/emptySegment/gen_input.py.map create mode 100644 packages/safe-ds-lang/tests/resources/generation/declarations/parameter with python name/output/tests/generator/parameterWithPythonName/gen_input.py.map create mode 100644 packages/safe-ds-lang/tests/resources/generation/declarations/pipeline with python name/output/tests/generator/pipelineWithPythonName/gen_input.py.map create mode 100644 packages/safe-ds-lang/tests/resources/generation/declarations/segment with python name/output/tests/generator/segmentWithPythonName/gen_input.py.map create mode 100644 packages/safe-ds-lang/tests/resources/generation/declarations/two pipelines/output/tests/generator/twoPipelines/gen_input.py.map create mode 100644 packages/safe-ds-lang/tests/resources/generation/declarations/two segments/output/tests/generator/twoSegments/gen_input.py.map create mode 100644 packages/safe-ds-lang/tests/resources/generation/expressions/block lambda result/output/tests/generator/blockLambdaResult/gen_input.py.map create mode 100644 packages/safe-ds-lang/tests/resources/generation/expressions/block lambda/output/tests/generator/blockLambda/gen_input.py.map create mode 100644 packages/safe-ds-lang/tests/resources/generation/expressions/call/output/tests/generator/call/gen_input.py.map create mode 100644 packages/safe-ds-lang/tests/resources/generation/expressions/constant/output/tests/generator/constant/gen_input.py.map create mode 100644 packages/safe-ds-lang/tests/resources/generation/expressions/enum variant call/output/tests/generator/enumVariantCall/gen_input.py.map create mode 100644 packages/safe-ds-lang/tests/resources/generation/expressions/expression lambda/output/tests/generator/expressionLambda/gen_input.py.map create mode 100644 packages/safe-ds-lang/tests/resources/generation/expressions/indexed access/output/tests/generator/indexedAccess/gen_input.py.map create mode 100644 packages/safe-ds-lang/tests/resources/generation/expressions/infix operation/output/tests/generator/infixOperation/gen_input.py.map create mode 100644 packages/safe-ds-lang/tests/resources/generation/expressions/lists/output/tests/generator/lists/gen_input.py.map create mode 100644 packages/safe-ds-lang/tests/resources/generation/expressions/literals/output/tests/generator/literals/gen_input.py.map create mode 100644 packages/safe-ds-lang/tests/resources/generation/expressions/maps/output/tests/generator/maps/gen_input.py.map create mode 100644 packages/safe-ds-lang/tests/resources/generation/expressions/member access/output/tests/generator/memberAccess/gen_input.py.map create mode 100644 packages/safe-ds-lang/tests/resources/generation/expressions/parenthesized expression/output/tests/generator/parenthesizedExpression/gen_input.py.map create mode 100644 packages/safe-ds-lang/tests/resources/generation/expressions/prefix operation/output/tests/generator/prefixOperation/gen_input.py.map create mode 100644 packages/safe-ds-lang/tests/resources/generation/expressions/reference/output/tests/generator/reference/gen_input.py.map create mode 100644 packages/safe-ds-lang/tests/resources/generation/expressions/template string/output/tests/generator/templateString/gen_input.py.map create mode 100644 packages/safe-ds-lang/tests/resources/generation/imports/general/output/tests/generator/imports/gen_context_same_package.py.map create mode 100644 packages/safe-ds-lang/tests/resources/generation/imports/general/output/tests/generator/imports/gen_input.py.map create mode 100644 packages/safe-ds-lang/tests/resources/generation/imports/wildcard/output/tests/generator/wildcard/gen_input.py.map create mode 100644 packages/safe-ds-lang/tests/resources/generation/python module/output/special_module/gen_input.py.map create mode 100644 packages/safe-ds-lang/tests/resources/generation/statements/assignment/output/tests/generator/assignment/gen_input.py.map create mode 100644 packages/safe-ds-lang/tests/resources/generation/statements/expression statement/output/tests/generator/expressionStatement/gen_input.py.map diff --git a/package-lock.json b/package-lock.json index 5aff28461..263a274c3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4700,6 +4700,15 @@ "uglify-js": "^3.1.4" } }, + "node_modules/handlebars/node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/has": { "version": "1.0.3", "dev": true, @@ -5331,6 +5340,15 @@ "node": ">=10" } }, + "node_modules/istanbul-lib-source-maps/node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/istanbul-reports": { "version": "3.1.5", "dev": true, @@ -11027,11 +11045,11 @@ } }, "node_modules/source-map": { - "version": "0.6.1", - "dev": true, - "license": "BSD-3-Clause", + "version": "0.7.4", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.4.tgz", + "integrity": "sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA==", "engines": { - "node": ">=0.10.0" + "node": ">= 8" } }, "node_modules/source-map-js": { @@ -12671,6 +12689,7 @@ "chevrotain": "^11.0.3", "glob": "^10.3.10", "langium": "^2.1.0", + "source-map": "^0.7.4", "vscode-languageserver": "^9.0.1", "vscode-languageserver-textdocument": "^1.0.11" }, diff --git a/packages/safe-ds-cli/src/cli/generate.ts b/packages/safe-ds-cli/src/cli/generate.ts index bfb08d209..459ce3530 100644 --- a/packages/safe-ds-cli/src/cli/generate.ts +++ b/packages/safe-ds-cli/src/cli/generate.ts @@ -6,11 +6,14 @@ import fs from 'node:fs'; import path from 'node:path'; import { extractDocument } from './cli-util.js'; -export const generate = async (fileName: string, opts: GenerateOptions): Promise => { +export const generate = async (fileName: string, opts: CliGenerateOptions): Promise => { const services = (await createSafeDsServicesWithBuiltins(NodeFileSystem)).SafeDs; const document = await extractDocument(fileName, services); const destination = opts.destination ?? path.join(path.dirname(fileName), 'generated'); - const generatedFiles = services.generation.PythonGenerator.generate(document, URI.file(path.resolve(destination))); + const generatedFiles = services.generation.PythonGenerator.generate(document, { + destination: URI.file(path.resolve(destination)), + createSourceMaps: opts.sourcemaps, + }); for (const file of generatedFiles) { const fsPath = URI.parse(file.uri).fsPath; @@ -25,6 +28,8 @@ export const generate = async (fileName: string, opts: GenerateOptions): Promise console.log(chalk.green(`Python code generated successfully.`)); }; -export interface GenerateOptions { +export interface CliGenerateOptions { destination?: string; + sourcemaps: boolean; + quiet: boolean; } diff --git a/packages/safe-ds-cli/src/cli/main.ts b/packages/safe-ds-cli/src/cli/main.ts index 613a39d2c..f62a6f37f 100644 --- a/packages/safe-ds-cli/src/cli/main.ts +++ b/packages/safe-ds-cli/src/cli/main.ts @@ -22,6 +22,7 @@ program .option('-d, --destination ', 'destination directory of generation') .option('-r, --root ', 'source root folder') .option('-q, --quiet', 'whether the program should print something', false) + .option('-s, --sourcemaps', 'whether source maps should be generated', false) .description('generate Python code') .action(generate); diff --git a/packages/safe-ds-lang/package.json b/packages/safe-ds-lang/package.json index 98f674806..de0ad76b0 100644 --- a/packages/safe-ds-lang/package.json +++ b/packages/safe-ds-lang/package.json @@ -47,6 +47,7 @@ "chevrotain": "^11.0.3", "glob": "^10.3.10", "langium": "^2.1.0", + "source-map": "^0.7.4", "vscode-languageserver": "^9.0.1", "vscode-languageserver-textdocument": "^1.0.11" }, diff --git a/packages/safe-ds-lang/src/language/generation/safe-ds-python-generator.ts b/packages/safe-ds-lang/src/language/generation/safe-ds-python-generator.ts index fe630fd0d..6ae94e801 100644 --- a/packages/safe-ds-lang/src/language/generation/safe-ds-python-generator.ts +++ b/packages/safe-ds-lang/src/language/generation/safe-ds-python-generator.ts @@ -48,13 +48,21 @@ import { import { isInStubFile, isStubFile } from '../helpers/fileExtensions.js'; import path from 'path'; import { - expandToString, - expandToStringWithNL, + CompositeGeneratorNode, + expandToNode, + expandTracedToNode, findRootNode, getContainerOfType, getDocument, + joinToNode, + joinTracedToNode, LangiumDocument, + NL, streamAllContents, + toStringAndTrace, + TraceRegion, + traceToNode, + TreeStreamImpl, URI, } from 'langium'; import { @@ -80,6 +88,7 @@ import { TextDocument } from 'vscode-languageserver-textdocument'; import { SafeDsAnnotations } from '../builtins/safe-ds-annotations.js'; import { SafeDsNodeMapper } from '../helpers/safe-ds-node-mapper.js'; import { SafeDsPartialEvaluator } from '../partialEvaluation/safe-ds-partial-evaluator.js'; +import { SourceMapGenerator, StartOfSourceMap } from 'source-map'; export const CODEGEN_PREFIX = '__gen_'; const BLOCK_LAMBDA_PREFIX = `${CODEGEN_PREFIX}block_lambda_`; @@ -89,6 +98,8 @@ const YIELD_PREFIX = `${CODEGEN_PREFIX}yield_`; const RUNNER_CODEGEN_PACKAGE = 'safeds_runner.codegen'; const PYTHON_INDENT = ' '; +const NLNL = new CompositeGeneratorNode(NL, NL); + export class SafeDsPythonGenerator { private readonly builtinAnnotations: SafeDsAnnotations; private readonly nodeMapper: SafeDsNodeMapper; @@ -100,7 +111,7 @@ export class SafeDsPythonGenerator { this.partialEvaluator = services.evaluation.PartialEvaluator; } - generate(document: LangiumDocument, destination: URI): TextDocument[] { + generate(document: LangiumDocument, generateOptions: GenerateOptions): TextDocument[] { const node = document.parseResult.value; // Do not generate stub files @@ -111,24 +122,33 @@ export class SafeDsPythonGenerator { const name = path.parse(document.uri.fsPath).name; const pythonModuleName = this.builtinAnnotations.getPythonModule(node); const packagePath = pythonModuleName === undefined ? node.name.split('.') : [pythonModuleName]; - const parentDirectoryPath = path.join(destination.fsPath, ...packagePath); + const parentDirectoryPath = path.join(generateOptions.destination!.fsPath, ...packagePath); const generatedFiles = new Map(); - generatedFiles.set( - `${path.join(parentDirectoryPath, this.formatGeneratedFileName(name))}.py`, - this.generateModule(node), - ); + const generatedModule = this.generateModule(node); + const { text, trace } = toStringAndTrace(generatedModule); + const pythonOutputPath = `${path.join(parentDirectoryPath, this.formatGeneratedFileName(name))}.py`; + if (generateOptions.createSourceMaps) { + generatedFiles.set( + `${pythonOutputPath}.map`, + this.generateSourceMap(document, text, trace, this.formatGeneratedFileName(name)), + ); + } + generatedFiles.set(pythonOutputPath, text); for (const pipeline of streamAllContents(node).filter(isSdsPipeline)) { const entryPointFilename = `${path.join( parentDirectoryPath, `${this.formatGeneratedFileName(name)}_${this.getPythonNameOrDefault(pipeline)}`, )}.py`; - const entryPointContent = expandToStringWithNL`from ${this.formatGeneratedFileName( + const entryPointContent = expandTracedToNode(pipeline)`from ${this.formatGeneratedFileName( name, )} import ${this.getPythonNameOrDefault( pipeline, - )}\n\nif __name__ == '__main__':\n${PYTHON_INDENT}${this.getPythonNameOrDefault(pipeline)}()`; - generatedFiles.set(entryPointFilename, entryPointContent); + )}\n\nif __name__ == '__main__':\n${PYTHON_INDENT}${this.getPythonNameOrDefault( + pipeline, + )}()`.appendNewLine(); + const generatedPipelineEntry = toStringAndTrace(entryPointContent); + generatedFiles.set(entryPointFilename, generatedPipelineEntry.text); } return Array.from(generatedFiles.entries()).map(([fsPath, content]) => @@ -136,6 +156,65 @@ export class SafeDsPythonGenerator { ); } + private generateSourceMap( + document: LangiumDocument, + generatedText: String, + trace: TraceRegion, + generatedFileName: string, + ): string { + const sourceTextFull = document.textDocument.getText(); + const mapper: SourceMapGenerator = new SourceMapGenerator({ + file: `${generatedFileName}.py`, + }); + // Use only the filename (and extension) in the source map + const inputPath = path.parse(document.uri.fsPath); + const inputFile = `${inputPath.name}${inputPath.ext}`; + + new TreeStreamImpl(trace, (r) => r.children ?? [], { includeRoot: true }).forEach((r) => { + if (!r.sourceRegion || !r.targetRegion || r.children?.[0].targetRegion.offset === r.targetRegion.offset) { + return; + } + const sourceStart = r.sourceRegion.range?.start; + const targetStart = r.targetRegion.range?.start; + const sourceEnd = r.sourceRegion?.range?.end; + const sourceText = + sourceEnd && sourceTextFull.length >= r.sourceRegion.end + ? sourceTextFull.substring(r.sourceRegion.offset, r.sourceRegion.end) + : /* c8 ignore next */ + ''; + if (sourceStart && targetStart) { + mapper.addMapping({ + original: { line: sourceStart.line + 1, column: sourceStart.character }, + generated: { line: targetStart.line + 1, column: targetStart.character }, + source: inputFile, + name: /^[_a-zA-Z][_a-zA-Z0-9]*$/u.test(sourceText) ? sourceText.toLowerCase() : undefined, + }); + } + const targetEnd = r.targetRegion?.range?.end; + const targetText = + targetEnd && generatedText.length >= r.targetRegion.end + ? generatedText.substring(r.targetRegion.offset, r.targetRegion.end) + : /* c8 ignore next */ + ''; + if ( + sourceEnd && + targetEnd && + !r.children && + sourceText && + targetText && + !/\s/u.test(sourceText) && + !/\s/u.test(targetText) + ) { + mapper.addMapping({ + original: { line: sourceEnd.line + 1, column: sourceEnd.character }, + generated: { line: targetEnd.line + 1, column: targetEnd.character }, + source: inputFile, + }); + } + }); + return mapper.toString(); + } + private getPythonNameOrDefault(object: SdsDeclaration) { return this.builtinAnnotations.getPythonName(object) || object.name; } @@ -144,7 +223,7 @@ export class SafeDsPythonGenerator { return `gen_${baseName.replaceAll('%2520', '_').replaceAll(/[ .-]/gu, '_').replaceAll(/\\W/gu, '')}`; } - private generateModule(module: SdsModule): string { + private generateModule(module: SdsModule): CompositeGeneratorNode { const importSet = new Map(); const segments = getModuleMembers(module) .filter(isSdsSegment) @@ -153,67 +232,91 @@ export class SafeDsPythonGenerator { .filter(isSdsPipeline) .map((pipeline) => this.generatePipeline(pipeline, importSet)); const imports = this.generateImports(Array.from(importSet.values())); - const output: string[] = []; + const output = new CompositeGeneratorNode(); + output.trace(module); if (imports.length > 0) { - output.push( - expandToStringWithNL`# Imports ----------------------------------------------------------------------\n\n${imports.join( - '\n', - )}`, - ); + output.append('# Imports ----------------------------------------------------------------------'); + output.appendNewLine(); + output.appendNewLine(); + output.append(joinToNode(imports, (importDecl) => importDecl, { separator: NL })); + output.appendNewLine(); } if (segments.length > 0) { - output.push( - expandToStringWithNL`# Segments ---------------------------------------------------------------------\n\n${segments.join( - '\n\n', - )}`, - ); + output.appendNewLineIf(imports.length > 0); + output.append('# Segments ---------------------------------------------------------------------'); + output.appendNewLine(); + output.appendNewLine(); + output.append(joinToNode(segments, (segment) => segment, { separator: NLNL })); + output.appendNewLine(); } if (pipelines.length > 0) { - output.push( - expandToStringWithNL`# Pipelines --------------------------------------------------------------------\n\n${pipelines.join( - '\n\n', - )}`, - ); + output.appendNewLineIf(imports.length > 0 || segments.length > 0); + output.append('# Pipelines --------------------------------------------------------------------'); + output.appendNewLine(); + output.appendNewLine(); + output.append(joinToNode(pipelines, (pipeline) => pipeline, { separator: NLNL })); + output.appendNewLine(); } - return expandToStringWithNL`${output.join('\n')}`; + return output; } - private generateSegment(segment: SdsSegment, importSet: Map): string { + private generateSegment(segment: SdsSegment, importSet: Map): CompositeGeneratorNode { const infoFrame = new GenerationInfoFrame(importSet); const segmentResult = segment.resultList?.results || []; let segmentBlock = this.generateBlock(segment.body, infoFrame); if (segmentResult.length !== 0) { - segmentBlock += `\nreturn ${segmentResult.map((result) => `${YIELD_PREFIX}${result.name}`).join(', ')}`; + segmentBlock.appendNewLine(); + segmentBlock.append( + expandTracedToNode(segment.resultList!)`return ${joinTracedToNode(segment.resultList!, 'results')( + segmentResult, + (result) => expandTracedToNode(result)`${YIELD_PREFIX}${result.name}`, + { separator: ', ' }, + )}`, + ); } - return expandToString`def ${this.getPythonNameOrDefault(segment)}(${this.generateParameters( - segment.parameterList, - infoFrame, - )}):\n${PYTHON_INDENT}${segmentBlock}`; + return expandTracedToNode(segment)`def ${traceToNode( + segment, + 'name', + )(this.getPythonNameOrDefault(segment))}(${this.generateParameters(segment.parameterList, infoFrame)}):` + .appendNewLine() + .indent({ indentedChildren: [segmentBlock], indentation: PYTHON_INDENT }); } - private generateParameters(parameters: SdsParameterList | undefined, frame: GenerationInfoFrame): string { - const result = (parameters?.parameters || []).map((param) => this.generateParameter(param, frame)); - return result.join(', '); + private generateParameters( + parameters: SdsParameterList | undefined, + frame: GenerationInfoFrame, + ): CompositeGeneratorNode | undefined { + if (!parameters) { + /* c8 ignore next 2 */ + return undefined; + } + return joinTracedToNode(parameters, 'parameters')( + parameters?.parameters || [], + (param) => this.generateParameter(param, frame), + { separator: ', ' }, + ); } private generateParameter( parameter: SdsParameter, frame: GenerationInfoFrame, defaultValue: boolean = true, - ): string { - return expandToString`${this.getPythonNameOrDefault(parameter)}${ + ): CompositeGeneratorNode { + return expandTracedToNode(parameter)`${traceToNode(parameter, 'name')(this.getPythonNameOrDefault(parameter))}${ defaultValue && parameter.defaultValue !== undefined - ? '=' + this.generateExpression(parameter.defaultValue, frame) + ? expandToNode`=${this.generateExpression(parameter.defaultValue, frame)}` : '' }`; } - private generatePipeline(pipeline: SdsPipeline, importSet: Map): string { + private generatePipeline(pipeline: SdsPipeline, importSet: Map): CompositeGeneratorNode { const infoFrame = new GenerationInfoFrame(importSet); - return expandToString`def ${this.getPythonNameOrDefault(pipeline)}():\n${PYTHON_INDENT}${this.generateBlock( - pipeline.body, - infoFrame, - )}`; + return expandTracedToNode(pipeline)`def ${traceToNode( + pipeline, + 'name', + )(this.getPythonNameOrDefault(pipeline))}():` + .appendNewLine() + .indent({ indentedChildren: [this.generateBlock(pipeline.body, infoFrame)], indentation: PYTHON_INDENT }); } private generateImports(importSet: ImportData[]): string[] { @@ -252,32 +355,36 @@ export class SafeDsPythonGenerator { } } - private generateBlock(block: SdsBlock, frame: GenerationInfoFrame): string { + private generateBlock(block: SdsBlock, frame: GenerationInfoFrame): CompositeGeneratorNode { // TODO filter withEffect let statements = getStatements(block); if (statements.length === 0) { - return 'pass'; + return traceToNode(block)('pass'); } - return expandToString`${statements.map((stmt) => this.generateStatement(stmt, frame)).join('\n')}`; + return joinTracedToNode(block, 'statements')(statements, (stmt) => this.generateStatement(stmt, frame), { + separator: NL, + })!; } - private generateStatement(statement: SdsStatement, frame: GenerationInfoFrame): string { + private generateStatement(statement: SdsStatement, frame: GenerationInfoFrame): CompositeGeneratorNode { if (isSdsAssignment(statement)) { - return this.generateAssignment(statement, frame); + return traceToNode(statement)(this.generateAssignment(statement, frame)); } else if (isSdsExpressionStatement(statement)) { - const expressionStatement = statement; - const blockLambdaCode: string[] = []; - for (const lambda of streamAllContents(expressionStatement.expression).filter(isSdsBlockLambda)) { + const blockLambdaCode: CompositeGeneratorNode[] = []; + for (const lambda of streamAllContents(statement.expression).filter(isSdsBlockLambda)) { blockLambdaCode.push(this.generateBlockLambda(lambda, frame)); } - blockLambdaCode.push(this.generateExpression(expressionStatement.expression, frame)); - return expandToString`${blockLambdaCode.join('\n')}`; + blockLambdaCode.push(this.generateExpression(statement.expression, frame)); + + return joinTracedToNode(statement)(blockLambdaCode, (stmt) => stmt, { + separator: NL, + })!; } /* c8 ignore next 2 */ throw new Error(`Unknown SdsStatement: ${statement}`); } - private generateAssignment(assignment: SdsAssignment, frame: GenerationInfoFrame): string { + private generateAssignment(assignment: SdsAssignment, frame: GenerationInfoFrame): CompositeGeneratorNode { const requiredAssignees = isSdsCall(assignment.expression) ? getAbstractResults(this.nodeMapper.callToCallable(assignment.expression)).length : /* c8 ignore next */ @@ -286,165 +393,232 @@ export class SafeDsPythonGenerator { if (assignees.some((value) => !isSdsWildcard(value))) { const actualAssignees = assignees.map(this.generateAssignee); if (requiredAssignees === actualAssignees.length) { - return `${actualAssignees.join(', ')} = ${this.generateExpression(assignment.expression!, frame)}`; + return expandTracedToNode(assignment)`${joinToNode( + actualAssignees, + (actualAssignee) => actualAssignee, + { separator: ', ' }, + )} = ${this.generateExpression(assignment.expression!, frame)}`; } else { // Add wildcards to match given results - return `${actualAssignees - .concat(Array(requiredAssignees - actualAssignees.length).fill('_')) - .join(', ')} = ${this.generateExpression(assignment.expression!, frame)}`; + return expandTracedToNode(assignment)`${joinToNode( + actualAssignees.concat(Array(requiredAssignees - actualAssignees.length).fill('_')), + (actualAssignee) => actualAssignee, + { separator: ', ' }, + )} = ${this.generateExpression(assignment.expression!, frame)}`; } } else { - return this.generateExpression(assignment.expression!, frame); + return traceToNode(assignment)(this.generateExpression(assignment.expression!, frame)); } } - private generateAssignee(assignee: SdsAssignee): string { + private generateAssignee(assignee: SdsAssignee): CompositeGeneratorNode { if (isSdsBlockLambdaResult(assignee)) { - return `${BLOCK_LAMBDA_RESULT_PREFIX}${assignee.name}`; + return expandTracedToNode(assignee)`${BLOCK_LAMBDA_RESULT_PREFIX}${traceToNode( + assignee, + 'name', + )(assignee.name)}`; } else if (isSdsPlaceholder(assignee)) { - return assignee.name; + return traceToNode(assignee)(assignee.name); } else if (isSdsWildcard(assignee)) { - return '_'; + return traceToNode(assignee)('_'); } else if (isSdsYield(assignee)) { - return `${YIELD_PREFIX}${assignee.result?.ref?.name!}`; + return expandTracedToNode(assignee)`${YIELD_PREFIX}${traceToNode( + assignee, + 'result', + )(assignee.result?.ref?.name!)}`; } /* c8 ignore next 2 */ throw new Error(`Unknown SdsAssignment: ${assignee.$type}`); } - private generateBlockLambda(blockLambda: SdsBlockLambda, frame: GenerationInfoFrame): string { - const results = streamBlockLambdaResults(blockLambda); + private generateBlockLambda(blockLambda: SdsBlockLambda, frame: GenerationInfoFrame): CompositeGeneratorNode { + const results = streamBlockLambdaResults(blockLambda).toArray(); let lambdaBlock = this.generateBlock(blockLambda.body, frame); - if (!results.isEmpty()) { - lambdaBlock += `\nreturn ${results - .map((result) => `${BLOCK_LAMBDA_RESULT_PREFIX}${result.name}`) - .join(', ')}`; + if (results.length !== 0) { + lambdaBlock.appendNewLine(); + lambdaBlock.append( + expandTracedToNode(blockLambda)`return ${joinToNode( + results, + (result) => + expandTracedToNode(result)`${BLOCK_LAMBDA_RESULT_PREFIX}${traceToNode( + result, + 'name', + )(result.name)}`, + { separator: ', ' }, + )}`, + ); } - return expandToString`def ${frame.getUniqueLambdaBlockName(blockLambda)}(${this.generateParameters( - blockLambda.parameterList, - frame, - )}):\n${PYTHON_INDENT}${lambdaBlock}`; + return expandTracedToNode(blockLambda)`def ${frame.getUniqueLambdaBlockName( + blockLambda, + )}(${this.generateParameters(blockLambda.parameterList, frame)}):` + .appendNewLine() + .indent({ + indentedChildren: [lambdaBlock], + indentation: PYTHON_INDENT, + }); } - private generateExpression(expression: SdsExpression, frame: GenerationInfoFrame): string { + private generateExpression(expression: SdsExpression, frame: GenerationInfoFrame): CompositeGeneratorNode { if (isSdsTemplateStringPart(expression)) { if (isSdsTemplateStringStart(expression)) { - return `${this.formatStringSingleLine(expression.value)}{ `; + return expandTracedToNode(expression)`${this.formatStringSingleLine(expression.value)}{ `; } else if (isSdsTemplateStringInner(expression)) { - return ` }${this.formatStringSingleLine(expression.value)}{ `; + return expandTracedToNode(expression)` }${this.formatStringSingleLine(expression.value)}{ `; } else if (isSdsTemplateStringEnd(expression)) { - return ` }${this.formatStringSingleLine(expression.value)}`; + return expandTracedToNode(expression)` }${this.formatStringSingleLine(expression.value)}`; } } const partiallyEvaluatedNode = this.partialEvaluator.evaluate(expression); if (partiallyEvaluatedNode instanceof BooleanConstant) { - return partiallyEvaluatedNode.value ? 'True' : 'False'; + return traceToNode(expression)(partiallyEvaluatedNode.value ? 'True' : 'False'); } else if (partiallyEvaluatedNode instanceof IntConstant) { - return String(partiallyEvaluatedNode.value); + return traceToNode(expression)(String(partiallyEvaluatedNode.value)); } else if (partiallyEvaluatedNode instanceof FloatConstant) { const floatValue = partiallyEvaluatedNode.value; - return Number.isInteger(floatValue) ? `${floatValue}.0` : String(floatValue); + return traceToNode(expression)(Number.isInteger(floatValue) ? `${floatValue}.0` : String(floatValue)); } else if (partiallyEvaluatedNode === NullConstant) { - return 'None'; + return traceToNode(expression)('None'); } else if (partiallyEvaluatedNode instanceof StringConstant) { - return `'${this.formatStringSingleLine(partiallyEvaluatedNode.value)}'`; + return expandTracedToNode(expression)`'${this.formatStringSingleLine(partiallyEvaluatedNode.value)}'`; } // Handled after constant expressions: EnumVariant, List, Map else if (isSdsTemplateString(expression)) { - return `f'${expression.expressions.map((expr) => this.generateExpression(expr, frame)).join('')}'`; + return expandTracedToNode(expression)`f'${joinTracedToNode(expression, 'expressions')( + expression.expressions, + (expr) => this.generateExpression(expr, frame), + { separator: '' }, + )}'`; } else if (isSdsMap(expression)) { - const mapContent = expression.entries.map( + return expandTracedToNode(expression)`{${joinTracedToNode(expression, 'entries')( + expression.entries, (entry) => - `${this.generateExpression(entry.key, frame)}: ${this.generateExpression(entry.value, frame)}`, - ); - return `{${mapContent.join(', ')}}`; + expandTracedToNode(entry)`${traceToNode( + entry, + 'key', + )(this.generateExpression(entry.key, frame))}: ${traceToNode( + entry, + 'value', + )(this.generateExpression(entry.value, frame))}`, + { separator: ', ' }, + )}}`; } else if (isSdsList(expression)) { - const listContent = expression.elements.map((value) => this.generateExpression(value, frame)); - return `[${listContent.join(', ')}]`; + return expandTracedToNode(expression)`[${joinTracedToNode(expression, 'elements')( + expression.elements, + (value) => this.generateExpression(value, frame), + { separator: ', ' }, + )}]`; } else if (isSdsBlockLambda(expression)) { - return frame.getUniqueLambdaBlockName(expression); + return traceToNode(expression)(frame.getUniqueLambdaBlockName(expression)); } else if (isSdsCall(expression)) { const callable = this.nodeMapper.callToCallable(expression); if (isSdsFunction(callable)) { const pythonCall = this.builtinAnnotations.getPythonCall(callable); if (pythonCall) { - let thisParam: string | undefined = undefined; + let thisParam: CompositeGeneratorNode | undefined = undefined; if (isSdsMemberAccess(expression.receiver)) { thisParam = this.generateExpression(expression.receiver.receiver, frame); } const argumentsMap = this.getArgumentsMap(expression.argumentList.arguments, frame); - return this.generatePythonCall(pythonCall, argumentsMap, thisParam); + return this.generatePythonCall(expression, pythonCall, argumentsMap, thisParam); } } const sortedArgs = this.sortArguments(expression.argumentList.arguments); - return expandToString`${this.generateExpression(expression.receiver, frame)}(${sortedArgs - .map((arg) => this.generateArgument(arg, frame)) - .join(', ')})`; + return expandTracedToNode(expression)`${this.generateExpression( + expression.receiver, + frame, + )}(${joinTracedToNode(expression.argumentList, 'arguments')( + sortedArgs, + (arg) => this.generateArgument(arg, frame), + { separator: ', ' }, + )})`; } else if (isSdsExpressionLambda(expression)) { - return `lambda ${this.generateParameters(expression.parameterList, frame)}: ${this.generateExpression( - expression.result, + return expandTracedToNode(expression)`lambda ${this.generateParameters( + expression.parameterList, frame, - )}`; + )}: ${this.generateExpression(expression.result, frame)}`; } else if (isSdsInfixOperation(expression)) { const leftOperand = this.generateExpression(expression.leftOperand, frame); const rightOperand = this.generateExpression(expression.rightOperand, frame); switch (expression.operator) { case 'or': frame.addImport({ importPath: RUNNER_CODEGEN_PACKAGE }); - return `${RUNNER_CODEGEN_PACKAGE}.eager_or(${leftOperand}, ${rightOperand})`; + return expandTracedToNode(expression)`${traceToNode( + expression, + 'operator', + )(`${RUNNER_CODEGEN_PACKAGE}.eager_or`)}(${leftOperand}, ${rightOperand})`; case 'and': frame.addImport({ importPath: RUNNER_CODEGEN_PACKAGE }); - return `${RUNNER_CODEGEN_PACKAGE}.eager_and(${leftOperand}, ${rightOperand})`; + return expandTracedToNode(expression)`${traceToNode( + expression, + 'operator', + )(`${RUNNER_CODEGEN_PACKAGE}.eager_and`)}(${leftOperand}, ${rightOperand})`; case '?:': frame.addImport({ importPath: RUNNER_CODEGEN_PACKAGE }); - return `${RUNNER_CODEGEN_PACKAGE}.eager_elvis(${leftOperand}, ${rightOperand})`; + return expandTracedToNode(expression)`${traceToNode( + expression, + 'operator', + )(`${RUNNER_CODEGEN_PACKAGE}.eager_elvis`)}(${leftOperand}, ${rightOperand})`; case '===': - return `(${leftOperand}) is (${rightOperand})`; + return expandTracedToNode(expression)`(${leftOperand}) ${traceToNode( + expression, + 'operator', + )('is')} (${rightOperand})`; case '!==': - return `(${leftOperand}) is not (${rightOperand})`; + return expandTracedToNode(expression)`(${leftOperand}) ${traceToNode( + expression, + 'operator', + )('is not')} (${rightOperand})`; default: - return `(${leftOperand}) ${expression.operator} (${rightOperand})`; + return expandTracedToNode(expression)`(${leftOperand}) ${traceToNode( + expression, + 'operator', + )(expression.operator)} (${rightOperand})`; } } else if (isSdsIndexedAccess(expression)) { - return expandToString`${this.generateExpression(expression.receiver, frame)}[${this.generateExpression( - expression.index, + return expandTracedToNode(expression)`${this.generateExpression( + expression.receiver, frame, - )}]`; + )}[${this.generateExpression(expression.index, frame)}]`; } else if (isSdsMemberAccess(expression)) { const member = expression.member?.target.ref!; const receiver = this.generateExpression(expression.receiver, frame); if (isSdsEnumVariant(member)) { const enumMember = this.generateExpression(expression.member!, frame); const suffix = isSdsCall(expression.$container) ? '' : '()'; - return `${receiver}.${enumMember}${suffix}`; + return expandTracedToNode(expression)`${receiver}.${enumMember}${suffix}`; } else if (isSdsAbstractResult(member)) { const resultList = getAbstractResults(getContainerOfType(member, isSdsCallable)); if (resultList.length === 1) { - return receiver; + return traceToNode(expression)(receiver); } const currentIndex = resultList.indexOf(member); - return `${receiver}[${currentIndex}]`; + return expandTracedToNode(expression)`${receiver}[${traceToNode(expression.member!)( + String(currentIndex), + )}]`; } else { const memberExpression = this.generateExpression(expression.member!, frame); if (expression.isNullSafe) { frame.addImport({ importPath: RUNNER_CODEGEN_PACKAGE }); - return `${RUNNER_CODEGEN_PACKAGE}.safe_access(${receiver}, '${memberExpression}')`; + return expandTracedToNode(expression)`${traceToNode( + expression, + 'isNullSafe', + )(`${RUNNER_CODEGEN_PACKAGE}.safe_access`)}(${receiver}, '${memberExpression}')`; } else { - return `${receiver}.${memberExpression}`; + return expandTracedToNode(expression)`${receiver}.${memberExpression}`; } } } else if (isSdsParenthesizedExpression(expression)) { - return expandToString`${this.generateExpression(expression.expression, frame)}`; + return expandTracedToNode(expression)`${this.generateExpression(expression.expression, frame)}`; } else if (isSdsPrefixOperation(expression)) { const operand = this.generateExpression(expression.operand, frame); switch (expression.operator) { case 'not': - return expandToString`not (${operand})`; + return expandTracedToNode(expression)`${traceToNode(expression, 'operator')('not')} (${operand})`; case '-': - return expandToString`-(${operand})`; + return expandTracedToNode(expression)`${traceToNode(expression, 'operator')('-')}(${operand})`; } } else if (isSdsReference(expression)) { const declaration = expression.target.ref!; @@ -452,26 +626,41 @@ export class SafeDsPythonGenerator { this.getExternalReferenceNeededImport(expression, declaration) || this.getInternalReferenceNeededImport(expression, declaration); frame.addImport(referenceImport); - return referenceImport?.alias || this.getPythonNameOrDefault(declaration); + return traceToNode(expression)(referenceImport?.alias || this.getPythonNameOrDefault(declaration)); } /* c8 ignore next 2 */ throw new Error(`Unknown expression type: ${expression.$type}`); } private generatePythonCall( + expression: SdsExpression, pythonCall: string, - argumentsMap: Map, - thisParam: string | undefined = undefined, - ): string { + argumentsMap: Map, + thisParam: CompositeGeneratorNode | undefined = undefined, + ): CompositeGeneratorNode { if (thisParam) { argumentsMap.set('this', thisParam); } - - return pythonCall.replace(/\$[_a-zA-Z][_a-zA-Z0-9]*/gu, (value) => argumentsMap.get(value.substring(1))!); + const splitRegex = /(\$[_a-zA-Z][_a-zA-Z0-9]*)/gu; + const splitPythonCallDefinition = pythonCall.split(splitRegex); + return joinTracedToNode(expression)( + splitPythonCallDefinition, + (part) => { + if (splitRegex.test(part)) { + return argumentsMap.get(part.substring(1))!; + } else { + return part; + } + }, + { separator: '' }, + )!; } - private getArgumentsMap(argumentList: SdsArgument[], frame: GenerationInfoFrame): Map { - const argumentsMap = new Map(); + private getArgumentsMap( + argumentList: SdsArgument[], + frame: GenerationInfoFrame, + ): Map { + const argumentsMap = new Map(); argumentList.reduce((map, value) => { map.set(this.nodeMapper.argumentToParameter(value)?.name!, this.generateArgument(value, frame)); return map; @@ -493,11 +682,11 @@ export class SafeDsPythonGenerator { .map((value) => value.arg); } - private generateArgument(argument: SdsArgument, frame: GenerationInfoFrame) { + private generateArgument(argument: SdsArgument, frame: GenerationInfoFrame): CompositeGeneratorNode { const parameter = this.nodeMapper.argumentToParameter(argument); - return expandToString`${ + return expandTracedToNode(argument)`${ parameter !== undefined && !isRequiredParameter(parameter) - ? this.generateParameter(parameter, frame, false) + '=' + ? expandToNode`${this.generateParameter(parameter, frame, false)}=` : '' }${this.generateExpression(argument.value, frame)}`; } @@ -599,3 +788,8 @@ class GenerationInfoFrame { return `${BLOCK_LAMBDA_PREFIX}${this.blockLambdaManager.assignId(lambda)}`; } } + +export interface GenerateOptions { + destination: URI; + createSourceMaps: boolean; +} diff --git a/packages/safe-ds-lang/tests/helpers/testResources.test.ts b/packages/safe-ds-lang/tests/helpers/testResources.test.ts index 2b40cab72..111c3c590 100644 --- a/packages/safe-ds-lang/tests/helpers/testResources.test.ts +++ b/packages/safe-ds-lang/tests/helpers/testResources.test.ts @@ -1,11 +1,11 @@ import { describe, expect, it } from 'vitest'; import { - listTestPythonFiles, + listTestFilesWithExtensions, listTestSafeDsFiles, listTestSafeDsFilesGroupedByParentDirectory, + ShortenedTestResourceName, TestResourceName, testResourceNameToUri, - ShortenedTestResourceName, uriToShortenedTestResourceName, } from './testResources.js'; import { URI } from 'langium'; @@ -41,10 +41,10 @@ describe('listTestSafeDsFiles', () => { }); }); -describe('listTestPythonFiles', () => { +describe('listTestFilesWithExtensions', () => { it('should return all Python files in a resource directory', () => { const rootResourceName = 'helpers/listPythonFiles'; - const actual = listTestPythonFiles(rootResourceName); + const actual = listTestFilesWithExtensions(rootResourceName, ['py']); const expected = ['python file.py', 'nested/python file.py']; expectFileListsToMatch(rootResourceName, actual, expected); diff --git a/packages/safe-ds-lang/tests/helpers/testResources.ts b/packages/safe-ds-lang/tests/helpers/testResources.ts index 64bddd0ce..0abe56b99 100644 --- a/packages/safe-ds-lang/tests/helpers/testResources.ts +++ b/packages/safe-ds-lang/tests/helpers/testResources.ts @@ -50,22 +50,21 @@ export const uriToShortenedTestResourceName = ( * @return URIs of the discovered Safe-DS files. */ export const listTestSafeDsFiles = (rootTestResourceName: TestResourceName): URI[] => { - const pattern = `**/*.{${SAFE_DS_FILE_EXTENSIONS.join(',')}}`; - const cwd = testResourceNameToUri(rootTestResourceName).fsPath; - - return globSync(pattern, { cwd, nodir: true }) - .filter(isNotSkipped) - .map((it) => URI.file(path.join(cwd, it))); + const rootPath = testResourceNameToUri(rootTestResourceName).fsPath; + return listTestFilesWithExtensions(rootTestResourceName, SAFE_DS_FILE_EXTENSIONS).filter((uri) => + isNotSkipped(path.relative(rootPath, uri.fsPath)), + ); }; /** - * Lists all Python files in the given root directory. + * Lists all files that end in any of the provided extensions in the given root directory. * * @param rootTestResourceName The resource name of the root directory. - * @return URIs of the discovered Python files. + * @param extensions The array containing file extensions to match + * @return URIs of the discovered files. */ -export const listTestPythonFiles = (rootTestResourceName: TestResourceName): URI[] => { - const pattern = `**/*.py`; +export const listTestFilesWithExtensions = (rootTestResourceName: TestResourceName, extensions: string[]): URI[] => { + const pattern = extensions.length === 1 ? `**/*.${extensions[0]}` : `**/*.{${extensions.join(',')}}`; const cwd = testResourceNameToUri(rootTestResourceName).fsPath; return globSync(pattern, { cwd, nodir: true }).map((it) => URI.file(path.join(cwd, it))); diff --git a/packages/safe-ds-lang/tests/language/generation/creator.ts b/packages/safe-ds-lang/tests/language/generation/creator.ts index 87364e6b5..583d17afc 100644 --- a/packages/safe-ds-lang/tests/language/generation/creator.ts +++ b/packages/safe-ds-lang/tests/language/generation/creator.ts @@ -1,5 +1,5 @@ import { - listTestPythonFiles, + listTestFilesWithExtensions, listTestSafeDsFilesGroupedByParentDirectory, loadDocuments, uriToShortenedTestResourceName, @@ -92,7 +92,7 @@ const createGenerationTest = async (parentDirectory: URI, inputUris: URI[]): Pro * @param actualOutputRoot Where the actual output files supposed to be located. */ const readExpectedOutputFiles = (expectedOutputRoot: URI, actualOutputRoot: URI): ExpectedOutputFile[] => { - return listTestPythonFiles(uriToShortenedTestResourceName(expectedOutputRoot)).map((uri) => { + return listTestFilesWithExtensions(uriToShortenedTestResourceName(expectedOutputRoot), ['py', 'map']).map((uri) => { return { uri: URI.file(path.join(actualOutputRoot.fsPath, path.relative(expectedOutputRoot.fsPath, uri.fsPath))), code: fs.readFileSync(uri.fsPath).toString(), diff --git a/packages/safe-ds-lang/tests/language/generation/safe-ds-python-generator.test.ts b/packages/safe-ds-lang/tests/language/generation/safe-ds-python-generator.test.ts index 4a1114c96..84e95e8d1 100644 --- a/packages/safe-ds-lang/tests/language/generation/safe-ds-python-generator.test.ts +++ b/packages/safe-ds-lang/tests/language/generation/safe-ds-python-generator.test.ts @@ -31,7 +31,12 @@ describe('generation', async () => { // Generate code for all documents const actualOutputs = stream(documents) - .flatMap((document) => pythonGenerator.generate(document, test.actualOutputRoot)) + .flatMap((document) => + pythonGenerator.generate(document, { + destination: test.actualOutputRoot, + createSourceMaps: true, + }), + ) .map((textDocument) => [textDocument.uri, textDocument.getText()]) .toMap( (entry) => entry[0], diff --git a/packages/safe-ds-lang/tests/resources/generation/declarations/empty pipeline/output/tests/generator/emptyPipeline/gen_input.py.map b/packages/safe-ds-lang/tests/resources/generation/declarations/empty pipeline/output/tests/generator/emptyPipeline/gen_input.py.map new file mode 100644 index 000000000..0d59bc041 --- /dev/null +++ b/packages/safe-ds-lang/tests/resources/generation/declarations/empty pipeline/output/tests/generator/emptyPipeline/gen_input.py.map @@ -0,0 +1 @@ +{"version":3,"sources":["input.sdstest"],"names":["test"],"mappings":"AAAA;;AAEA,IAASA,IAAI;IAAC,IAAE","file":"gen_input.py"} \ No newline at end of file diff --git a/packages/safe-ds-lang/tests/resources/generation/declarations/empty segment/output/tests/generator/emptySegment/gen_input.py.map b/packages/safe-ds-lang/tests/resources/generation/declarations/empty segment/output/tests/generator/emptySegment/gen_input.py.map new file mode 100644 index 000000000..9f57b9aaa --- /dev/null +++ b/packages/safe-ds-lang/tests/resources/generation/declarations/empty segment/output/tests/generator/emptySegment/gen_input.py.map @@ -0,0 +1 @@ +{"version":3,"sources":["input.sdstest"],"names":["test"],"mappings":"AAAA;;AAEA,IAAQA,IAAI;IAAG,IAAE","file":"gen_input.py"} \ No newline at end of file diff --git a/packages/safe-ds-lang/tests/resources/generation/declarations/parameter with python name/output/tests/generator/parameterWithPythonName/gen_input.py.map b/packages/safe-ds-lang/tests/resources/generation/declarations/parameter with python name/output/tests/generator/parameterWithPythonName/gen_input.py.map new file mode 100644 index 000000000..4b451a86c --- /dev/null +++ b/packages/safe-ds-lang/tests/resources/generation/declarations/parameter with python name/output/tests/generator/parameterWithPythonName/gen_input.py.map @@ -0,0 +1 @@ +{"version":3,"sources":["input.sdstest"],"names":["test","param1","param2","param3","f1","f2"],"mappings":"AAAA;;AAKA,IAAQA,IAAI,CAACC,MAAM,EAA8BC,OAAM,EAA8BC,OAAM,CAAQ,CAAC;IAChGC,EAAE,CAAC,OAACH,MAAM,EAAOC,MAAM,EAAOC,MAAM,CAAQ,CAAC,EAAK,CAAC;IAChD,yBAACF,MAAM,EAAOC,MAAM,EAAOC,MAAM,CAAQ,CAAC;QAAE,IAAE;IAAjDE,EAAE,CAAC","file":"gen_input.py"} \ No newline at end of file diff --git a/packages/safe-ds-lang/tests/resources/generation/declarations/pipeline with python name/output/tests/generator/pipelineWithPythonName/gen_input.py.map b/packages/safe-ds-lang/tests/resources/generation/declarations/pipeline with python name/output/tests/generator/pipelineWithPythonName/gen_input.py.map new file mode 100644 index 000000000..236d7c4c5 --- /dev/null +++ b/packages/safe-ds-lang/tests/resources/generation/declarations/pipeline with python name/output/tests/generator/pipelineWithPythonName/gen_input.py.map @@ -0,0 +1 @@ +{"version":3,"sources":["input.sdstest"],"names":["testpipeline","f"],"mappings":"AAAA;;AAKA,IAASA,aAAY;IACjBC,CAAC","file":"gen_input.py"} \ No newline at end of file diff --git a/packages/safe-ds-lang/tests/resources/generation/declarations/segment with python name/output/tests/generator/segmentWithPythonName/gen_input.py.map b/packages/safe-ds-lang/tests/resources/generation/declarations/segment with python name/output/tests/generator/segmentWithPythonName/gen_input.py.map new file mode 100644 index 000000000..2ab4bca4c --- /dev/null +++ b/packages/safe-ds-lang/tests/resources/generation/declarations/segment with python name/output/tests/generator/segmentWithPythonName/gen_input.py.map @@ -0,0 +1 @@ +{"version":3,"sources":["input.sdstest"],"names":["testsegment","f"],"mappings":"AAAA;;AAKA,IAAQA,YAAW;IACfC,CAAC","file":"gen_input.py"} \ No newline at end of file diff --git a/packages/safe-ds-lang/tests/resources/generation/declarations/two pipelines/output/tests/generator/twoPipelines/gen_input.py.map b/packages/safe-ds-lang/tests/resources/generation/declarations/two pipelines/output/tests/generator/twoPipelines/gen_input.py.map new file mode 100644 index 000000000..8578f8a7a --- /dev/null +++ b/packages/safe-ds-lang/tests/resources/generation/declarations/two pipelines/output/tests/generator/twoPipelines/gen_input.py.map @@ -0,0 +1 @@ +{"version":3,"sources":["input.sdstest"],"names":["test1","f","test2"],"mappings":"AAAA;;AAIA,IAASA,KAAK;IACVC,CAAC;;AAGL,IAASC,KAAK;IACVD,CAAC","file":"gen_input.py"} \ No newline at end of file diff --git a/packages/safe-ds-lang/tests/resources/generation/declarations/two segments/output/tests/generator/twoSegments/gen_input.py.map b/packages/safe-ds-lang/tests/resources/generation/declarations/two segments/output/tests/generator/twoSegments/gen_input.py.map new file mode 100644 index 000000000..a7053ee92 --- /dev/null +++ b/packages/safe-ds-lang/tests/resources/generation/declarations/two segments/output/tests/generator/twoSegments/gen_input.py.map @@ -0,0 +1 @@ +{"version":3,"sources":["input.sdstest"],"names":["test1","a","b","f","test2","c"],"mappings":"AAAA;;AAIA,IAAQA,KAAK,CAACC,CAAC,EAAOC,CAAC,CAAQ,CAAC;IAC5BC,CAAC;;AAGL,IAAQC,KAAK,CAACH,CAAC,EAAOI,CAAC;IACnBF,CAAC","file":"gen_input.py"} \ No newline at end of file diff --git a/packages/safe-ds-lang/tests/resources/generation/expressions/block lambda result/output/tests/generator/blockLambdaResult/gen_input.py.map b/packages/safe-ds-lang/tests/resources/generation/expressions/block lambda result/output/tests/generator/blockLambdaResult/gen_input.py.map new file mode 100644 index 000000000..12c2af08e --- /dev/null +++ b/packages/safe-ds-lang/tests/resources/generation/expressions/block lambda result/output/tests/generator/blockLambdaResult/gen_input.py.map @@ -0,0 +1 @@ +{"version":3,"sources":["input.sdstest"],"names":["f1","l","h","f2","e1","d1","test","a","b","d","g","e"],"mappings":"AAAA;;AAMA,IAAQA,EAAE,CAACC,CAAC;IACRC,CAAC,CAACD,CAAC,CAAC,CAAC,EAAE,CAAC;;AAGZ,IAAQE,EAAE,CAACF,CAAC;IACRC,CAAC,CAACD,CAAC,CAAC,CAAC,EAAE,CAAC,EAAEG,CAAE;IACZF,CAAC,CAACD,CAAC,CAAC,CAAC,EAAE,CAAC,EAAEI,CAAE;;;;AAGhB,IAASC,IAAI;IAEN,yBAACC,CAAC,EAAOC,CAAC;QACT,0BAAMC,CAAC,GAAGC,CAAC;QADZ,OACC,0BAAMD,CAAC;IADXT,EAAE,CAAC;IAGA,yBAACO,CAAC,EAAOC,CAAC;QACT,0BAAMC,CAAC,GAAGC,CAAC;QACX,0BAAMC,CAAC,GAAGD,CAAC;QAFZ,OACC,0BAAMD,CAAC,EACP,0BAAME,CAAC;IAFXR,EAAE,CAAC","file":"gen_input.py"} \ No newline at end of file diff --git a/packages/safe-ds-lang/tests/resources/generation/expressions/block lambda/output/tests/generator/blockLambda/gen_input.py.map b/packages/safe-ds-lang/tests/resources/generation/expressions/block lambda/output/tests/generator/blockLambda/gen_input.py.map new file mode 100644 index 000000000..353842a02 --- /dev/null +++ b/packages/safe-ds-lang/tests/resources/generation/expressions/block lambda/output/tests/generator/blockLambda/gen_input.py.map @@ -0,0 +1 @@ +{"version":3,"sources":["input.sdstest"],"names":["test","a","b","d","g","f1","c","f2"],"mappings":"AAAA;;AAOA,IAASA,IAAI;IACN,yBAACC,CAAC,EAAOC,CAAC,CAAQ,CAAC;QAClB,0BAAMC,CAAC,GAAGC,CAAC;QADZ,OACC,0BAAMD,CAAC;IADXE,EAAE,CAAC;IAGA,yBAACJ,CAAC,EAAOK,CAAC;QACT,0BAAMH,CAAC,GAAGC,CAAC;QADZ,OACC,0BAAMD,CAAC;IADXE,EAAE,CAAC;IAGA;QAAG,IAAE;IAARE,EAAE,CAAC","file":"gen_input.py"} \ No newline at end of file diff --git a/packages/safe-ds-lang/tests/resources/generation/expressions/call/output/tests/generator/call/gen_input.py.map b/packages/safe-ds-lang/tests/resources/generation/expressions/call/output/tests/generator/call/gen_input.py.map new file mode 100644 index 000000000..a03fae446 --- /dev/null +++ b/packages/safe-ds-lang/tests/resources/generation/expressions/call/output/tests/generator/call/gen_input.py.map @@ -0,0 +1 @@ +{"version":3,"sources":["input.sdstest"],"names":["test","f","g","param2","h"],"mappings":"AAAA;;AAuBA,IAASA,IAAI;IACTC,CAAC,CAAEC,CAAC,CAAC,CAAC,EAlBNC,MAAM,CAkBE,CAAC;IACTF,CAAC,CAAEC,CAAC,CAAsB,CAAC,EAnB3BC,MAAM,CAmBQ,CAAC;IACfF,CAAC,CAAEG,CAAC,CAAC,CAAC,EAfiBD,OAAM,CAerB,CAAC;IACTF,CAAC,CAAEG,CAAC,CAAsB,CAAC,EAhBJD,OAAM,CAgBf,CAAC;IACb,KAAK;IACL,KAAK,GAAE,GAAG;IACZ,EAAQ,GAAG,EAAT,IAAI","file":"gen_input.py"} \ No newline at end of file diff --git a/packages/safe-ds-lang/tests/resources/generation/expressions/constant/output/tests/generator/constant/gen_input.py.map b/packages/safe-ds-lang/tests/resources/generation/expressions/constant/output/tests/generator/constant/gen_input.py.map new file mode 100644 index 000000000..5d4ee0926 --- /dev/null +++ b/packages/safe-ds-lang/tests/resources/generation/expressions/constant/output/tests/generator/constant/gen_input.py.map @@ -0,0 +1 @@ +{"version":3,"sources":["input.sdstest"],"names":["test","f","null"],"mappings":"AAAA;;AAIA,IAASA,IAAI;IACTC,CAAC,CAAC;IACFA,CAAC,CAAC;IACFA,CAAC,CAAC;IACFA,CAAC,CAACC,IAAI;IACND,CAAC,CAAC","file":"gen_input.py"} \ No newline at end of file diff --git a/packages/safe-ds-lang/tests/resources/generation/expressions/enum variant call/output/tests/generator/enumVariantCall/gen_input.py.map b/packages/safe-ds-lang/tests/resources/generation/expressions/enum variant call/output/tests/generator/enumVariantCall/gen_input.py.map new file mode 100644 index 000000000..f814e4aa3 --- /dev/null +++ b/packages/safe-ds-lang/tests/resources/generation/expressions/enum variant call/output/tests/generator/enumVariantCall/gen_input.py.map @@ -0,0 +1 @@ +{"version":3,"sources":["input.sdstest"],"names":["test","f","myenum","variant1","variant2"],"mappings":"AAAA;;AASA,IAASA,IAAI;IACVC,CAAC,CAACC,MAAM,CAACC,QAAQ;IACjBF,CAAC,CAACC,MAAM,CAAEC,QAAQ;IAClBF,CAAC,CAACC,MAAM,CAACC,QAAQ;IACjBF,CAAC,CAACC,MAAM,CAAEC,QAAQ;IAClBF,CAAC,CAACC,MAAM,CAACE,QAAQ,CAAC,CAAC;IACnBH,CAAC,CAACC,MAAM,CAAEE,QAAQ,CAAC,CAAC","file":"gen_input.py"} \ No newline at end of file diff --git a/packages/safe-ds-lang/tests/resources/generation/expressions/expression lambda/output/tests/generator/expressionLambda/gen_input.py.map b/packages/safe-ds-lang/tests/resources/generation/expressions/expression lambda/output/tests/generator/expressionLambda/gen_input.py.map new file mode 100644 index 000000000..db976a153 --- /dev/null +++ b/packages/safe-ds-lang/tests/resources/generation/expressions/expression lambda/output/tests/generator/expressionLambda/gen_input.py.map @@ -0,0 +1 @@ +{"version":3,"sources":["input.sdstest"],"names":["test","f","a","b","c"],"mappings":"AAAA;;AAIA,IAASA,IAAI;IACTC,CAAC,CAAC,OAACC,CAAC,EAAEC,CAAC,CAAG,CAAC,EAAK,CAAC;IACjBF,CAAC,CAAC,OAACC,CAAC,EAAEE,CAAC,EAAK,CAAC","file":"gen_input.py"} \ No newline at end of file diff --git a/packages/safe-ds-lang/tests/resources/generation/expressions/indexed access/output/tests/generator/indexedAccess/gen_input.py.map b/packages/safe-ds-lang/tests/resources/generation/expressions/indexed access/output/tests/generator/indexedAccess/gen_input.py.map new file mode 100644 index 000000000..d5a74f99b --- /dev/null +++ b/packages/safe-ds-lang/tests/resources/generation/expressions/indexed access/output/tests/generator/indexedAccess/gen_input.py.map @@ -0,0 +1 @@ +{"version":3,"sources":["input.sdstest"],"names":["test","params","f"],"mappings":"AAAA;;AAIA,IAAQA,IAAI,CAACC,MAAM;IACfC,CAAC,CAACD,MAAM,CAAC,CAAC","file":"gen_input.py"} \ No newline at end of file diff --git a/packages/safe-ds-lang/tests/resources/generation/expressions/infix operation/output/tests/generator/infixOperation/gen_input.py.map b/packages/safe-ds-lang/tests/resources/generation/expressions/infix operation/output/tests/generator/infixOperation/gen_input.py.map new file mode 100644 index 000000000..210a6bf99 --- /dev/null +++ b/packages/safe-ds-lang/tests/resources/generation/expressions/infix operation/output/tests/generator/infixOperation/gen_input.py.map @@ -0,0 +1 @@ +{"version":3,"sources":["input.sdstest"],"names":["test","f","or","g","and","h","i"],"mappings":"AAAA;;;;;;AAUA,IAASA,IAAI;IACTC,CAAC,CAAKC,8BAAE,CAANC,CAAC,IAAMA,CAAC;IACVF,CAAC,CAAKG,+BAAG,CAAPD,CAAC,IAAOA,CAAC;IAEXF,CAAC,CAAC,CAAAI,CAAC,IAAG,EAAE,EAACA,CAAC;IACVJ,CAAC,CAAC,CAAAI,CAAC,IAAG,EAAE,EAACA,CAAC;IACVJ,CAAC,CAAC,CAAAI,CAAC,IAAG,EAAG,EAACA,CAAC;IACXJ,CAAC,CAAC,CAAAI,CAAC,IAAG,QAAIA,CAAC;IAEXJ,CAAC,CAAC,CAAAI,CAAC,IAAG,CAAC,EAACA,CAAC;IACTJ,CAAC,CAAC,CAAAI,CAAC,IAAG,EAAE,EAACA,CAAC;IACVJ,CAAC,CAAC,CAAAI,CAAC,IAAG,EAAE,EAACA,CAAC;IACVJ,CAAC,CAAC,CAAAI,CAAC,IAAG,CAAC,EAACA,CAAC;IAETJ,CAAC,CAAC,CAAAI,CAAC,IAAG,CAAC,EAACA,CAAC;IACTJ,CAAC,CAAC,CAAAI,CAAC,IAAG,CAAC,EAACA,CAAC;IACTJ,CAAC,CAAC,CAAAI,CAAC,IAAG,CAAC,EAACA,CAAC;IACTJ,CAAC,CAAC,CAAAI,CAAC,IAAG,CAAC,EAACA,CAAC;IAETJ,CAAC,CAAK,iCAAE,CAANK,CAAC,IAAMA,CAAC","file":"gen_input.py"} \ No newline at end of file diff --git a/packages/safe-ds-lang/tests/resources/generation/expressions/lists/output/tests/generator/lists/gen_input.py.map b/packages/safe-ds-lang/tests/resources/generation/expressions/lists/output/tests/generator/lists/gen_input.py.map new file mode 100644 index 000000000..e143f4293 --- /dev/null +++ b/packages/safe-ds-lang/tests/resources/generation/expressions/lists/output/tests/generator/lists/gen_input.py.map @@ -0,0 +1 @@ +{"version":3,"sources":["input.sdstest"],"names":["test","f","h"],"mappings":"AAAA;;AAMA,IAASA,IAAI;IACTC,CAAC,CAAC,EAAE;IACJA,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;IACVA,CAAC,CAAC,CAAC,CAAC,EAAEC,CAAC,IAAI,CAAAA,CAAC,IAAG,CAAC,EAAC,CAAC","file":"gen_input.py"} \ No newline at end of file diff --git a/packages/safe-ds-lang/tests/resources/generation/expressions/literals/output/tests/generator/literals/gen_input.py.map b/packages/safe-ds-lang/tests/resources/generation/expressions/literals/output/tests/generator/literals/gen_input.py.map new file mode 100644 index 000000000..2be08079a --- /dev/null +++ b/packages/safe-ds-lang/tests/resources/generation/expressions/literals/output/tests/generator/literals/gen_input.py.map @@ -0,0 +1 @@ +{"version":3,"sources":["input.sdstest"],"names":["test","f","true","false","null"],"mappings":"AAAA;;AAIA,IAASA,IAAI;IACTC,CAAC,CAACC,IAAI;IACND,CAAC,CAACE,KAAK;IACPF,CAAC,CAAC,GAAG;IACLA,CAAC,CAAC,CAAC;IACHA,CAAC,CAACG,IAAI;IACNH,CAAC,CAAC,EAAE;IACJA,CAAC,CAAC","file":"gen_input.py"} \ No newline at end of file diff --git a/packages/safe-ds-lang/tests/resources/generation/expressions/maps/output/tests/generator/maps/gen_input.py.map b/packages/safe-ds-lang/tests/resources/generation/expressions/maps/output/tests/generator/maps/gen_input.py.map new file mode 100644 index 000000000..54ca34598 --- /dev/null +++ b/packages/safe-ds-lang/tests/resources/generation/expressions/maps/output/tests/generator/maps/gen_input.py.map @@ -0,0 +1 @@ +{"version":3,"sources":["input.sdstest"],"names":["test","g1","h2","h1","g2"],"mappings":"AAAA;;AAUA,IAASA,IAAI;IACTC,EAAE,CAAC,EAAE;IACLA,EAAE,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG;IACtBA,EAAE,CAAC,CAACC,EAAE,IAAI,IAAI,EAAE,GAAG,EAAEC,EAAE;IACvBC,EAAE,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG;IACtBA,EAAE,CAAC,CAAC,GAAG,EAAE,GAAG,EAAED,EAAE,IAAID,EAAE","file":"gen_input.py"} \ No newline at end of file diff --git a/packages/safe-ds-lang/tests/resources/generation/expressions/member access/output/tests/generator/memberAccess/gen_input.py.map b/packages/safe-ds-lang/tests/resources/generation/expressions/member access/output/tests/generator/memberAccess/gen_input.py.map new file mode 100644 index 000000000..9b5cf0fb0 --- /dev/null +++ b/packages/safe-ds-lang/tests/resources/generation/expressions/member access/output/tests/generator/memberAccess/gen_input.py.map @@ -0,0 +1 @@ +{"version":3,"sources":["input.sdstest"],"names":["test","f","g","h","result1","result2","c","a","b","factory"],"mappings":"AAAA;;;;;;AAiBA,IAASA,IAAI;IACTC,CAAC,CAACC,CAAC;IACHD,CAAC,CAACE,CAAC,GAAGC,CAAO;IACbH,CAAC,CAACE,CAAC,GAAGE,CAAO;IACbJ,CAAC,CAACK,CAAC,GAAGC,CAAC;IACPN,CAAC,CAACK,CAAC,GAAGE,CAAC;IACPP,CAAC,CAAU,iCAAC,CAAVQ,OAAO,KAAIF,CAAC;IACdN,CAAC,CAAU,iCAAC,CAAVQ,OAAO,KAAID,CAAC;IACdP,CAAC,CAAO,CAAC,GAAPK,CAAC","file":"gen_input.py"} \ No newline at end of file diff --git a/packages/safe-ds-lang/tests/resources/generation/expressions/parenthesized expression/output/tests/generator/parenthesizedExpression/gen_input.py.map b/packages/safe-ds-lang/tests/resources/generation/expressions/parenthesized expression/output/tests/generator/parenthesizedExpression/gen_input.py.map new file mode 100644 index 000000000..508b1d926 --- /dev/null +++ b/packages/safe-ds-lang/tests/resources/generation/expressions/parenthesized expression/output/tests/generator/parenthesizedExpression/gen_input.py.map @@ -0,0 +1 @@ +{"version":3,"sources":["input.sdstest"],"names":["test","f","g"],"mappings":"AAAA;;AAMA,IAASA,IAAI;IACTC,CAAC,CAAEC,CAAC","file":"gen_input.py"} \ No newline at end of file diff --git a/packages/safe-ds-lang/tests/resources/generation/expressions/prefix operation/output/tests/generator/prefixOperation/gen_input.py.map b/packages/safe-ds-lang/tests/resources/generation/expressions/prefix operation/output/tests/generator/prefixOperation/gen_input.py.map new file mode 100644 index 000000000..9a6640681 --- /dev/null +++ b/packages/safe-ds-lang/tests/resources/generation/expressions/prefix operation/output/tests/generator/prefixOperation/gen_input.py.map @@ -0,0 +1 @@ +{"version":3,"sources":["input.sdstest"],"names":["test","f","not","g","h"],"mappings":"AAAA;;AAQA,IAASA,IAAI;IACTC,CAAC,CAACC,GAAG,EAACC,CAAC;IACPF,CAAC,CAAC,CAAC,CAAAG,CAAC","file":"gen_input.py"} \ No newline at end of file diff --git a/packages/safe-ds-lang/tests/resources/generation/expressions/reference/output/tests/generator/reference/gen_input.py.map b/packages/safe-ds-lang/tests/resources/generation/expressions/reference/output/tests/generator/reference/gen_input.py.map new file mode 100644 index 000000000..116003f67 --- /dev/null +++ b/packages/safe-ds-lang/tests/resources/generation/expressions/reference/output/tests/generator/reference/gen_input.py.map @@ -0,0 +1 @@ +{"version":3,"sources":["input.sdstest"],"names":["test","f","explainmodel"],"mappings":"AAAA;;AAOA,IAASA,IAAI;IACTC,CAAC,CAACC,aAAY","file":"gen_input.py"} \ No newline at end of file diff --git a/packages/safe-ds-lang/tests/resources/generation/expressions/template string/output/tests/generator/templateString/gen_input.py.map b/packages/safe-ds-lang/tests/resources/generation/expressions/template string/output/tests/generator/templateString/gen_input.py.map new file mode 100644 index 000000000..9333bd67d --- /dev/null +++ b/packages/safe-ds-lang/tests/resources/generation/expressions/template string/output/tests/generator/templateString/gen_input.py.map @@ -0,0 +1 @@ +{"version":3,"sources":["input.sdstest"],"names":["test","f","g"],"mappings":"AAAA;;AAMA,IAASA,IAAI;IACTC,CAAC,CAAC,EAAA,SACHC,CAAC,EAAG,YACEA,CAAC,EAAG","file":"gen_input.py"} \ No newline at end of file diff --git a/packages/safe-ds-lang/tests/resources/generation/imports/general/output/tests/generator/imports/gen_context_same_package.py.map b/packages/safe-ds-lang/tests/resources/generation/imports/general/output/tests/generator/imports/gen_context_same_package.py.map new file mode 100644 index 000000000..d79ad80dc --- /dev/null +++ b/packages/safe-ds-lang/tests/resources/generation/imports/general/output/tests/generator/imports/gen_context_same_package.py.map @@ -0,0 +1 @@ +{"version":3,"sources":["context same package.sdstest"],"names":["segment1insamepackage","result","impurefunction","segment2insamepackage"],"mappings":"AAAA;;AAIA,IAAQA,qBAAqB;IACzB,YAAMC,MAAM,GAAGC,cAAc;IADD,OAAG;;AAInC,IAAQC,qBAAqB;IACzB,YAAMF,MAAM,GAAGC,cAAc;IADD,OAAG","file":"gen_context_same_package.py"} \ No newline at end of file diff --git a/packages/safe-ds-lang/tests/resources/generation/imports/general/output/tests/generator/imports/gen_input.py.map b/packages/safe-ds-lang/tests/resources/generation/imports/general/output/tests/generator/imports/gen_input.py.map new file mode 100644 index 000000000..b5c506e32 --- /dev/null +++ b/packages/safe-ds-lang/tests/resources/generation/imports/general/output/tests/generator/imports/gen_input.py.map @@ -0,0 +1 @@ +{"version":3,"sources":["input.sdstest"],"names":["test","f","segment1insamepackage","segment2insamepackage","function1indifferentpackage","g","function1incompilationunitwithpythonmodule","h"],"mappings":"AAAA;;;;;;;;AASA,IAASA,IAAI;IACTC,CAAC,CAACC,qBAAqB;IACvBD,CAAC,CAACC,qBAAqB;IACvBD,CAAC,CAACE,qBAAqB;IACvBF,CAAC,CAACE,qBAAqB;IAEvBF,CAAC,CAACG,2BAA2B;IAC7BH,CAAC,CAACG,2BAA2B;IAC7BH,CAAC,CAACI,CAAC;IACHJ,CAAC,CAACI,CAAC;IAEHJ,CAAC,CAACK,0CAA0C;IAC5CL,CAAC,CAACK,0CAA0C;IAC5CL,CAAC,CAACM,CAAC;IACHN,CAAC,CAACM,CAAC","file":"gen_input.py"} \ No newline at end of file diff --git a/packages/safe-ds-lang/tests/resources/generation/imports/wildcard/output/tests/generator/wildcard/gen_input.py.map b/packages/safe-ds-lang/tests/resources/generation/imports/wildcard/output/tests/generator/wildcard/gen_input.py.map new file mode 100644 index 000000000..ff643626d --- /dev/null +++ b/packages/safe-ds-lang/tests/resources/generation/imports/wildcard/output/tests/generator/wildcard/gen_input.py.map @@ -0,0 +1 @@ +{"version":3,"sources":["input.sdstest"],"names":["test","f","function1indifferentpackage","function2indifferentpackage","function1incompilationunitwithpythonmodule","function2incompilationunitwithpythonmodule"],"mappings":"AAAA;;;;;;;AAOA,IAASA,IAAI;IACTC,CAAC,CAACC,2BAA2B;IAC7BD,CAAC,CAACC,2BAA2B;IAC7BD,CAAC,CAACE,2BAA2B;IAC7BF,CAAC,CAACE,2BAA2B;IAE7BF,CAAC,CAACG,0CAA0C;IAC5CH,CAAC,CAACG,0CAA0C;IAC5CH,CAAC,CAACI,0CAA0C;IAC5CJ,CAAC,CAACI,0CAA0C","file":"gen_input.py"} \ No newline at end of file diff --git a/packages/safe-ds-lang/tests/resources/generation/python module/output/special_module/gen_input.py.map b/packages/safe-ds-lang/tests/resources/generation/python module/output/special_module/gen_input.py.map new file mode 100644 index 000000000..d40585458 --- /dev/null +++ b/packages/safe-ds-lang/tests/resources/generation/python module/output/special_module/gen_input.py.map @@ -0,0 +1 @@ +{"version":3,"sources":["input.sdstest"],"names":["test","f"],"mappings":"AAAA;;AAMA,IAAQA,IAAI;IACRC,CAAC","file":"gen_input.py"} \ No newline at end of file diff --git a/packages/safe-ds-lang/tests/resources/generation/statements/assignment/output/tests/generator/assignment/gen_input.py.map b/packages/safe-ds-lang/tests/resources/generation/statements/assignment/output/tests/generator/assignment/gen_input.py.map new file mode 100644 index 000000000..3d17d21e3 --- /dev/null +++ b/packages/safe-ds-lang/tests/resources/generation/statements/assignment/output/tests/generator/assignment/gen_input.py.map @@ -0,0 +1 @@ +{"version":3,"sources":["input.sdstest"],"names":["testsegment","g","_","c","f1","a","x","testpipeline","f2"],"mappings":"AAAA;;AAuBA,IAAQA,WAAW;IACLC,CAAC;IACX,GAAOC,CAAC,EAAE,YAAMC,CAAC,GAAGF,CAAC;IACrB,UAAQA,CAAC;IACTG,EAAE,CAACC,CAAC;IACJD,EAAE,CAACE,CAAC;IALc,OAAG;;;;AAhBzB,IAASC,YAAY;IACPN,CAAC;IACX,GAAOC,CAAC,EAAEA,CAAC,GAAGD,CAAC;IACf,UAAQA,CAAC;IACTG,EAAE,CAACC,CAAC;IACJD,EAAE,CAACE,CAAC;IAED;QACWL,CAAC;QACX,GAAOC,CAAC,EAAE,0BAAMC,CAAC,GAAGF,CAAC;QACrB,UAAQA,CAAC;QACTG,EAAE,CAACC,CAAC;QACJD,EAAE,CAACE,CAAC;QALL,OAEW,0BAAMH,CAAC;IAFrBK,EAAE,CAAC","file":"gen_input.py"} \ No newline at end of file diff --git a/packages/safe-ds-lang/tests/resources/generation/statements/expression statement/output/tests/generator/expressionStatement/gen_input.py.map b/packages/safe-ds-lang/tests/resources/generation/statements/expression statement/output/tests/generator/expressionStatement/gen_input.py.map new file mode 100644 index 000000000..125a90e05 --- /dev/null +++ b/packages/safe-ds-lang/tests/resources/generation/statements/expression statement/output/tests/generator/expressionStatement/gen_input.py.map @@ -0,0 +1 @@ +{"version":3,"sources":["input.sdstest"],"names":["testsegment","g","testpipeline","f"],"mappings":"AAAA;;AAcA,IAAQA,WAAW;IACfC,CAAC;;;;AATL,IAASC,YAAY;IACjBD,CAAC;IAEC;QACEA,CAAC;IADLE,CAAC,CAAC","file":"gen_input.py"} \ No newline at end of file