Commit Graph

7 Commits

Author SHA1 Message Date
John McCall
342a8b35db Parse default-argument expressions in an initializer context.
Swift SVN r11178
2013-12-12 03:36:27 +00:00
Dmitri Hrybenko
581db767bf Use ParserResult and ParserStatus in tuple and function argument parsing
This finally fixes a few code completion test cases.

This also regresses the error message in one parsing testcase because
previously we would just happily skip those tokens, but now error handling path
is a little bit different and these tokens hit different error handling code.
This can be fixed by parsing a tuple for the selector argument and complaining
if the tuple had more than one element.


Swift SVN r7389
2013-08-20 23:55:00 +00:00
Dmitri Hrybenko
b434f7cf3e Added a convenience operator| on ParserStatus
Swift SVN r7383
2013-08-20 23:15:19 +00:00
Dmitri Hrybenko
082bc4a89f ParserStatus: always initialize all members
Swift SVN r7382
2013-08-20 23:11:02 +00:00
Dmitri Hrybenko
f13b5845bb Parser: use ParserStatus in parseList()
This will allow us to do code completion inside lists (e.g., tuples) *and* get
parser recovery instead of stopping at the code completion token immediately.


Swift SVN r7366
2013-08-20 18:26:01 +00:00
Dmitri Hrybenko
b0dd877454 Use ParserResult in type parsing
Swift SVN r7353
2013-08-20 01:19:31 +00:00
Dmitri Hrybenko
19a90b69f7 Parser: add ParserResult<T> -- a wrapper around the AST node plus extra bits
This allows the parser to recover, create an AST node, return it to the caller
*and* signal the caller that there was an error to trigger recovery in the
caller.  Until now the error was signalled with a nullptr result (any non-null
result was considered a success and no recovery was done in that case).

This also allows us to signal the caller if there was a code completion token
inside the production we tried to parse to trigger delayed parsing in the
caller while doing recovery in the callee.  Until now we could not do recovery
in the callee so that the caller could find the code completion token.

Right now we don't take any advantage of these features.  This commit just
replaces some uses of NullablePtr with ParserResult.


Swift SVN r7332
2013-08-19 22:11:23 +00:00