Skip to content

Using \z string escape with Luau raises a parsing error #1014

@Helloburp

Description

@Helloburp

I'm using Stylua 2.1.0 . I've tried both "Luau" and "All" syntax values.
According to a previous issue (#613), support for the character was fixed for 5.2 and above. Perhaps it's not implemented with Luau?

Here's a snippet from a Luau script I've written:

print(
    "Aborted: Editor lockfile found. \z
    Ensure the lockfile is deleted before creating a new edit instance."
)
Terminal Output
error: could not format file lune\editor\auxiliary.luau: error parsing: 
 - unclosed string (17:13 to 18:1)
 - unexpected token `(` (16:14 to 16:15), expected `)` to close function call
 - unexpected token `the` (18:20 to 18:23), unexpected expression when looking for a statement
 - unexpected token `the` (18:20 to 18:23), expected `end` to conclude `if`
 - unexpected token `lockfile` (18:24 to 18:32), unexpected expression when looking for a statement
 - unexpected token `lockfile` (15:5 to 1:4), expected `end` to close function body block
 - unexpected token `is` (18:33 to 18:35), unexpected expression when looking for a statement
 - unexpected token `deleted` (18:36 to 18:43), unexpected expression when looking for a statement
 - unexpected token `before` (18:44 to 18:50), unexpected expression when looking for a statement
 - unexpected token `creating` (18:51 to 18:59), unexpected expression when looking for a statement
 - unexpected token `a` (18:60 to 18:61), unexpected expression when looking for a statement
 - unexpected token `new` (18:62 to 18:65), unexpected expression when looking for a statement
 - unexpected token `edit` (18:66 to 18:70), unexpected expression when looking for a statement
 - unexpected token `instance` (18:71 to 18:79), unexpected expression when looking for a statement
 - unexpected token `.` (18:79 to 18:80), expected identifier after `.`
 - unexpected token `""` (18:80 to 18:82), unexpected expression when looking for a statement
 - unclosed string (18:80 to 18:82)
 - unexpected token `""` (18:80 to 18:82), unexpected token, this needs to be a statement
 

Other than this, I've had a great experience with this tool so far :) You all are doing great work. Johnny's projects have improved my workflow tenfold-- Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions