-
Notifications
You must be signed in to change notification settings - Fork 157
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
Not escaping multiline strings correctly #1
Comments
myplacedk, thanks for reporting that. I'm a lua n00b, is that a realistic scenario? I've always used double quotes for strings: print("Hello World") or if you want the line break, then print("Hello\r\nWorld") |
It's a very realistic scenario. I've also had the problem with a line like this:
Which becomes...
...and the interpreter thinks there's an extra ] in the end. I'm a Lua newbie myself, but I think a better solution may be to use single-quotes, and make sure that all single quotes and backslashes gets escaped with a backslash.
=>
|
Good point! On Fri, Feb 6, 2015 at 7:32 AM, Niels Ulrik Andersen <
|
Sorry, I'm not a C# developer. If I didn't have to set up a development environment to test my fix, I'd probably have fixed it myself. :) |
Hi myplacedk! |
I don't have an esp8266 with me, but this looks okay to me. Input: a = [[ This is
a test]]
b = a[0]
c = 'More test'
d = 'Here\'s even more'` 1.0.2.2: file.writeline([[a = [[ This is]])
file.writeline([[a test]]]]) -- Syntax error
file.writeline([[b = a[0]]]) -- Syntax error
file.writeline([[c = 'More test']])
file.writeline([[d = 'Here\'s even more']]) 1.0.2.3: file.writeline('a = [[ This is')
file.writeline('a test]]')
file.writeline('b = a[0]')
file.writeline('c = \'More test\'')
file.writeline('d = \'Here\\\'s even more\'')
-- No syntax errors, yay! |
Niels, On Mon, Feb 9, 2015 at 2:58 AM, Niels Ulrik Andersen <
|
i still have problem with '\n' in buf="textBox.value.split('\n');" |
When I have a multiline string, "Save to ESP" fails. Example:
I can execute it, but when I save it I get this:
I think the problem is in https://github.com/hwiguna/g33k/blob/master/ArduinoProjects/Windows/ESP8266_Related/LuaUploader/SerialPort/Form1.cs line 211:
You may want to check if there's anything else that should be escaped.
The text was updated successfully, but these errors were encountered: