Skip to content

Not escaping multiline strings correctly #1

@myplacedk

Description

@myplacedk

When I have a multiline string, "Save to ESP" fails. Example:

print([[Hello
World]])

I can execute it, but when I save it I get this:

> SENT: file.remove("delme.lua")
SENT: file.open("delme.lua","w")
SENT: file.writeline([[print([[Hello]])
SENT: file.writeline([[World]])]])
SENT: file.close()
file.remove("delme.lua")
> file.open("delme.lua","w")
> file.writeline([[print([[Hello]])
stdin:1: nesting of [[...]] is deprecated near '['
> file.writeline([[World]])]])
stdin:1: unexpected symbol near ']'
> file.close()

I think the problem is in https://github.com/hwiguna/g33k/blob/master/ArduinoProjects/Windows/ESP8266_Related/LuaUploader/SerialPort/Form1.cs line 211:

stringBuilder.AppendLine("file.writeline([[" + line + "]])");

You may want to check if there's anything else that should be escaped.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions