mirror of
https://github.com/leafo/moonscript.git
synced 2024-10-05 05:34:19 +00:00
fixed "\\" from not parsing
This commit is contained in:
parent
87159dc95d
commit
6c391cb572
@ -212,7 +212,9 @@ local build_grammar = wrap(function()
|
|||||||
local Name = sym"@" * Name / mark"self" + Name + Space * "..." / trim
|
local Name = sym"@" * Name / mark"self" + Name + Space * "..." / trim
|
||||||
|
|
||||||
local function simple_string(delim, x)
|
local function simple_string(delim, x)
|
||||||
return C(symx(delim)) * C((P('\\'..delim) + (1 - S('\r\n'..delim)))^0) * sym(delim) / mark"string"
|
return C(symx(delim)) * C((P('\\'..delim) +
|
||||||
|
"\\\\" +
|
||||||
|
(1 - S('\r\n'..delim)))^0) * sym(delim) / mark"string"
|
||||||
end
|
end
|
||||||
|
|
||||||
-- wrap if statement if there is a conditional decorator
|
-- wrap if statement if there is a conditional decorator
|
||||||
|
@ -27,3 +27,7 @@ hola = [===[
|
|||||||
mm = [[well trhere]]
|
mm = [[well trhere]]
|
||||||
|
|
||||||
|
|
||||||
|
x = "\\"
|
||||||
|
x = "a\\b"
|
||||||
|
x = "\\\n"
|
||||||
|
x = "\""
|
||||||
|
@ -12,3 +12,7 @@ local hi_there = [[ hi there
|
|||||||
local well = [==[ "helo" ]==]
|
local well = [==[ "helo" ]==]
|
||||||
local hola = [===[ eat noots]===]
|
local hola = [===[ eat noots]===]
|
||||||
local mm = [[well trhere]]
|
local mm = [[well trhere]]
|
||||||
|
local x = "\\"
|
||||||
|
x = "a\\b"
|
||||||
|
x = "\\\n"
|
||||||
|
x = "\""
|
Loading…
Reference in New Issue
Block a user