Skip to content

TypeScriptToLua modifies strings which contain lua code #1376

@heinzbeinz

Description

@heinzbeinz

Hi,

I am trying out this project and it is really awesome so far. I am trying to convert the testcases which are written in lua to typescript. These test often contain small test scripts which needs to be passed unmodified to the underlying test system.

It seems, that tstl modifies these snippets even when the code is a simple string constant.

Example:

declare function executeSnippet(this: void, snippet: string): void

let snippet = "local x = require('x')"
executeSnippet(snippet)

leads to the following invalid lua code (with modified require)

local snippet = "local x = require("bugreport.x")"
executeSnippet(snippet)

Can I somehow disable the processing of these strings?

Thanks in advance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugscope: transpileAny transpilation not directly related to code transforms

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions