lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]




On 2017-10-14 02:00 PM, Francisco Olarte wrote:
On Sat, Oct 14, 2017 at 5:43 PM, Soni L. <fakedme@gmail.com> wrote:
...
print(load('return "\\z \n\r \n\r \r\n \n \n\\x"', "@test"))
nil    test:6: hexadecimal digit expected near '"\x"

WHY LINE 6. I NEED TO KNOW.
Because you forgot to escape the newlines and it is in the sixth line?
i.e., preceeding your line with:

Oh. Yeah, that's right. 5 newlines make 6 lines.

Why can't I figure out how to parse it myself tho...[1]

function load(...) return ... end
gives me: (start of line dots added for easier counting )

.> print(load('return "\\z \n\r \n\r \r\n \n \n\\x"', "@test"))
.return "\z
.
.
.
.
.\x"    @test
.>

Francisco Olarte.


[1]: https://stackoverflow.com/questions/46746752/parsing-lua-strings-more-specifically-newlines

--
Disclaimer: these emails may be made public at any given time, with or without reason. If you don't agree with this, DO NOT REPLY.