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

The string literal's value is not passed properly. #129

Open
HeeMyung opened this issue May 18, 2023 · 1 comment
Open

The string literal's value is not passed properly. #129

HeeMyung opened this issue May 18, 2023 · 1 comment

Comments

@HeeMyung
Copy link

HeeMyung commented May 18, 2023

See example below.

local foo = 'ABCD'

At a very simple level of code like this, "ABCD" is parsed well as a Literal node, but if you look into that node, raw is properly entered, but the value is null.

the result of printing ast is as follows.

{
  type: 'Chunk',
  body: [ { type: 'LocalStatement', variables: [Array], init: [Array] } ],
  comments: []
}
{ type: 'StringLiteral', value: null, raw: "'ABCD'" }
@semiyan
Copy link

semiyan commented Aug 21, 2024

This is an effect of encodingMode 'none', you can either use x-user-defined or pseudo-latin1 and strings should get parsed

parser.parse("a = 1",{
  encodingMode: "x-user-defined"
});

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

2 participants