Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better "unexpected kw" handling in ternary parsing #77

Merged
merged 8 commits into from
Sep 14, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/parser.jl
Original file line number Diff line number Diff line change
Expand Up @@ -642,6 +642,9 @@ function parse_cond(ps::ParseState)
# a ? b :c ==> (if a [ ] [?] [ ] b [ ] [:] (error-t) c)
bump_invisible(ps, K"error", TRIVIA_FLAG, error="space required after `:` in `?` expression")
end

# FIXME: This is a very specific case. Error recovery should be handled mor
pfitzseb marked this conversation as resolved.
Show resolved Hide resolved
# generally elsewhere.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aha agreed! This is why I've been wondering what to do about this PR.

if is_block_continuation_keyword(kind(t))
# a "continuaton keyword" is likely to belong to the surrounding code, so
# we abort early
Expand Down