[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: How does Lua parse newlines?
- From: "Soni L." <fakedme@...>
- Date: Sat, 14 Oct 2017 12:34:35 -0300
How does Lua parse newlines? For example:
print(#load('return "\\\r\n"')()) --> 1
print(#load('return "\\\n\r"')()) --> 1
print(#load('return "\\\r"')()) --> 1
print(#load('return "\\\n"')()) --> 1
print(load('return "\\z\r\n\\x"', "@[needed so results display
correctly]")) --> nil, error line at 2
print(load('return "\\z\n\r\\x"', "@[needed so results display
correctly]")) --> nil, error line at 2
print(load('return "\\z\n\\x"', "@[needed so results display
correctly]")) --> nil, error line at 2
print(load('return "\\z\r\\x"', "@[needed so results display
correctly]")) --> nil, error line at 2
So it seems that any of "\n", "\r", "\r\n" and "\n\r" are valid
newlines. But where in the code is it?
--
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.