Skip to content

Commit 5c0cac8

Browse files
authored
Merge pull request #305 from julia-vscode/sp/fix-304
fix blockquote in array exprs
2 parents 8ece2fc + 6c1f4df commit 5c0cac8

File tree

2 files changed

+33
-1
lines changed

2 files changed

+33
-1
lines changed

src/components/keywords.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ function parse_kw(ps::ParseState)
2929
end
3030
end
3131
elseif k === Tokens.QUOTE
32-
return @default ps @closer ps :block parse_blockexpr(ps, :quote)
32+
return @default ps @nocloser ps :inref @closer ps :block parse_blockexpr(ps, :quote)
3333
elseif k === Tokens.FOR
3434
return @default ps @closer ps :block parse_blockexpr(ps, :for)
3535
elseif k === Tokens.WHILE

test/parser.jl

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1289,4 +1289,36 @@ end
12891289
x, ps = CSTParser.parse(CSTParser.ParseState(str), true)
12901290
@test ps.errored == false
12911291
end
1292+
1293+
@testset "#304" begin
1294+
str = """
1295+
const _examples = PlotExample[
1296+
PlotExample( # 40
1297+
"Lens",
1298+
"A lens lets you easily magnify a region of a plot. x and y coordinates refer to the to be magnified region and the via the `inset` keyword the subplot index and the bounding box (in relative coordinates) of the inset plot with the magnified plot can be specified. Additional attributes count for the inset plot.",
1299+
[
1300+
quote
1301+
begin
1302+
plot(
1303+
[(0, 0), (0, 0.9), (1, 0.9), (2, 1), (3, 0.9), (80, 0)],
1304+
legend = :outertopright,
1305+
)
1306+
plot!([(0, 0), (0, 0.9), (2, 0.9), (3, 1), (4, 0.9), (80, 0)])
1307+
plot!([(0, 0), (0, 0.9), (3, 0.9), (4, 1), (5, 0.9), (80, 0)])
1308+
plot!([(0, 0), (0, 0.9), (4, 0.9), (5, 1), (6, 0.9), (80, 0)])
1309+
lens!(
1310+
[1, 6],
1311+
[0.9, 1.1],
1312+
inset = (1, bbox(0.5, 0.0, 0.4, 0.4)),
1313+
)
1314+
end
1315+
end,
1316+
],
1317+
),
1318+
]
1319+
"""
1320+
@test test_expr(str)
1321+
x, ps = CSTParser.parse(CSTParser.ParseState(str), true)
1322+
@test ps.errored == false
1323+
end
12921324
end

0 commit comments

Comments
 (0)