diff --git a/Ast/src/Lexer.cpp b/Ast/src/Lexer.cpp index a7b75815..90c3577f 100644 --- a/Ast/src/Lexer.cpp +++ b/Ast/src/Lexer.cpp @@ -6,6 +6,8 @@ #include +LUAU_FASTFLAG(LuauInterpolatedStringBaseSupport) + namespace Luau { @@ -808,7 +810,13 @@ Lexeme Lexer::readNext() return readQuotedString(); case '`': - return readInterpolatedStringBegin(); + if (FFlag::LuauInterpolatedStringBaseSupport) + return readInterpolatedStringBegin(); + else + { + consume(); + return Lexeme(Location(start, 1), '`'); + } case '.': consume(); diff --git a/Ast/src/Parser.cpp b/Ast/src/Parser.cpp index 3b548442..bb5982f8 100644 --- a/Ast/src/Parser.cpp +++ b/Ast/src/Parser.cpp @@ -26,6 +26,8 @@ LUAU_DYNAMIC_FASTFLAGVARIABLE(LuaReportParseIntegerIssues, false) LUAU_FASTFLAGVARIABLE(LuauAlwaysCaptureHotComments, false) +LUAU_FASTFLAGVARIABLE(LuauInterpolatedStringBaseSupport, true) + bool lua_telemetry_parsed_out_of_range_bin_integer = false; bool lua_telemetry_parsed_out_of_range_hex_integer = false; bool lua_telemetry_parsed_double_prefix_hex_integer = false; @@ -2199,7 +2201,7 @@ AstExpr* Parser::parseSimpleExpr() { return parseString(); } - else if (lexer.current().type == Lexeme::InterpStringBegin) + else if (FFlag::LuauInterpolatedStringBaseSupport && lexer.current().type == Lexeme::InterpStringBegin) { return parseInterpString(); } diff --git a/Compiler/src/Compiler.cpp b/Compiler/src/Compiler.cpp index cacd3266..5d22f3e9 100644 --- a/Compiler/src/Compiler.cpp +++ b/Compiler/src/Compiler.cpp @@ -30,6 +30,8 @@ LUAU_FASTFLAGVARIABLE(LuauCompileFoldBuiltins, false) LUAU_FASTFLAGVARIABLE(LuauCompileBetterMultret, false) LUAU_FASTFLAGVARIABLE(LuauCompileFreeReassign, false) +LUAU_FASTFLAG(LuauInterpolatedStringBaseSupport) + namespace Luau { @@ -2018,7 +2020,7 @@ struct Compiler { compileExprIfElse(expr, target, targetTemp); } - else if (AstExprInterpString* interpString = node->as()) + else if (AstExprInterpString* interpString = node->as(); FFlag::LuauInterpolatedStringBaseSupport && interpString) { compileExprInterpString(interpString, target, targetTemp); }