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

Common: error enum generator should create structures with named fields instead of tuples #269

Open
dmitrii-ubskii opened this issue Mar 1, 2023 · 0 comments

Comments

@dmitrii-ubskii
Copy link
Member

Before:

error_messages! { TypeQLError
    code: "TQL", type: "TypeQL Error",
    SyntaxErrorDetailed(usize, String, String, String) = // unnamed parameters
        3: "There is a syntax error at line {}:\n{}\n{}\n{}", // opaque format string
}

After:

error_messages! { TypeQLError
    code: "TQL", type: "TypeQL Error",
    SyntaxErrorDetailed{ line: usize, text: String, pointer: String, error: String} = // named parameters
        3: "There is a syntax error at line {line}:\n{text}\n{pointer}\n{error}", // string interpolation
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant