Skip to content

Commit

Permalink
Merge pull request #305 from julia-vscode/sp/fix-304
Browse files Browse the repository at this point in the history
fix blockquote in array exprs
  • Loading branch information
pfitzseb authored Aug 6, 2021
2 parents 8ece2fc + 6c1f4df commit 5c0cac8
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/keywords.jl
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function parse_kw(ps::ParseState)
end
end
elseif k === Tokens.QUOTE
return @default ps @closer ps :block parse_blockexpr(ps, :quote)
return @default ps @nocloser ps :inref @closer ps :block parse_blockexpr(ps, :quote)
elseif k === Tokens.FOR
return @default ps @closer ps :block parse_blockexpr(ps, :for)
elseif k === Tokens.WHILE
Expand Down
32 changes: 32 additions & 0 deletions test/parser.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1289,4 +1289,36 @@ end
x, ps = CSTParser.parse(CSTParser.ParseState(str), true)
@test ps.errored == false
end

@testset "#304" begin
str = """
const _examples = PlotExample[
PlotExample( # 40
"Lens",
"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.",
[
quote
begin
plot(
[(0, 0), (0, 0.9), (1, 0.9), (2, 1), (3, 0.9), (80, 0)],
legend = :outertopright,
)
plot!([(0, 0), (0, 0.9), (2, 0.9), (3, 1), (4, 0.9), (80, 0)])
plot!([(0, 0), (0, 0.9), (3, 0.9), (4, 1), (5, 0.9), (80, 0)])
plot!([(0, 0), (0, 0.9), (4, 0.9), (5, 1), (6, 0.9), (80, 0)])
lens!(
[1, 6],
[0.9, 1.1],
inset = (1, bbox(0.5, 0.0, 0.4, 0.4)),
)
end
end,
],
),
]
"""
@test test_expr(str)
x, ps = CSTParser.parse(CSTParser.ParseState(str), true)
@test ps.errored == false
end
end

0 comments on commit 5c0cac8

Please sign in to comment.