Skip to content

Commit 4a35236

Browse files
authored
Merge pull request #329 from julia-vscode/sp/fix-at-doc-endmarker
Fix at-doc parsing at EOF
2 parents c145497 + 323b2af commit 4a35236

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/CSTParser.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,7 @@ function parse(ps::ParseState, cont=false)
291291
end
292292

293293
function _continue_doc_parse(ps::ParseState, x::EXPR)
294+
kindof(ps.nt) !== Tokens.ENDMARKER &&
294295
headof(x) === :macrocall &&
295296
valof(x.args[1]) == "@doc" &&
296297
length(x.args) < 4 &&

test/parser.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -965,6 +965,9 @@ end
965965
@test "if true\n@doc \"doc\"\nT\nend" |> test_expr
966966
@test "if true\n@doc \"doc\" T\nend" |> test_expr
967967
@test "@doc \"I am a module\" ModuleMacroDoc" |> test_expr
968+
@test """
969+
@doc(foo)
970+
""" |> test_expr
968971
end
969972

970973
@testset "braces" begin

0 commit comments

Comments
 (0)