Commit Graph

2 Commits

Author SHA1 Message Date
practicalswift
6d1ae2a39c [gardening] 2016 → 2017 2017-01-06 16:41:22 +01:00
Robert Widmann
443bc682f6 Actually improve recovery when parsing bogus expressions
The crashes fixed appeared at first to be related to IfConfigStmt
parsing, but are in reality symptoms of being too lax in what we accept
when parsing of sub-expressions fail.

Optional type annotation parsing used to propagate failures before it
was patched to ‘recover’ with an AnyPattern.  Instead, we’ll just hit
the error path for parsing in the main expressions because what is here
now isn’t a reasonable thing to return.

#selector parsing assumed that the current token it was at after
consuming up to a right-brace wasn’t bogus.  Instead, if we’ve got
here, we may as well just return a loc we know is valid: PreviousLoc.
2016-12-15 19:08:26 -05:00