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

Literal string gets evaluated as Lua code #51

Open
bendrissou opened this issue Oct 2, 2023 · 1 comment
Open

Literal string gets evaluated as Lua code #51

bendrissou opened this issue Oct 2, 2023 · 1 comment

Comments

@bendrissou
Copy link

Hi,

When a Lua string starts with prefix \u, the string is parsed as Lua code. For example:

a="\u9"

Returns the following output:

line 1:2 token recognition error at: '"\u'
line 1:6 token recognition error at: '"\n'
{
    "Chunk": {
        "body": {
            "Block": {
                "body": [
                    {
                        "Assign": {
                            "targets": [
                                {
                                    "Name": {
                                        "id": "a",
                                        "start_char": 0,
                                        "stop_char": 0,
                                        "line": 1
                                    }
                                }
                            ],
                            "values": [
                                {
                                    "Number": {
                                        "n": 9,
                                        "start_char": 5,
                                        "stop_char": 5,
                                        "line": 1
                                    }
                                }
                            ],
                            "start_char": 0,
                            "stop_char": 5,
                            "line": 1
                        }
                    }
                ],
                "start_char": 0,
                "stop_char": 5,
                "line": 1
            }
        },
        "start_char": 0,
        "stop_char": 5,
        "line": 1
    }
}

Digit 9 is evaluated to Number. I was expecting everything enclosed in quotes to be String.

Is that correct?

@bendrissou
Copy link
Author

Hi @boolangery

Any new updates on this?

Thank you.

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