Closed paulcuth closed 7 years ago
Thanks for your research and PR! Unfortunately I dont have access to a dev environment where I can test this at the moment. Unless @fstirlitz gets to it first, I'll be back to my laptop in a week or so
The start position is good, but the end position is now wrong. Your own example from #36:
/* ... */
{
"type": "StringLiteral",
"value": "hello\nworld",
"raw": "[[hello\nworld]]",
"loc": {
"start": {
"line": 1,
"column": 10
},
"end": {
"line": 1,
"column": 25
}
}
}
/* ... */
Also, please add some testcases. Something like
x = [[hello@n@world]]
x = { 1, 2, [[hello@n@@n@world]], @n@ 3 }
into test/scaffolding/literals
and then run make scaffold-tests
. To run tests, make test
.
Cherry-picked in 4b56017a702789db0ea71011758667a511bc0d34.
I don't fully understand the code around locations, but this does fix the issue in my use case.
Fixes oxyc/luaparse#36