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
This commit is contained in:
Dmitri Hrybenko
2013-08-20 18:26:01 +00:00
parent 26bde07f76
commit f13b5845bb
3 changed files with 124 additions and 18 deletions

View File

@@ -388,7 +388,14 @@ public:
bool parseMatchingToken(tok K, SourceLoc &TokLoc, Diag<> ErrorDiag,
SourceLoc OtherLoc);
/// parseList - Parse the list of statements, expressions, or declarations.
/// \brief Parse the list of statements, expressions, or declarations.
ParserStatus parseList(tok RightK, SourceLoc LeftLoc, SourceLoc &RightLoc,
tok SeparatorK, bool OptionalSep, Diag<> ErrorDiag,
std::function<ParserStatus()> callback);
/// \brief Parse the list of statements, expressions, or declarations.
///
/// \returns false on success, true on error.
bool parseList(tok RightK, SourceLoc LeftLoc, SourceLoc &RightLoc,
tok SeparatorK, bool OptionalSep, Diag<> ErrorDiag,
std::function<bool()> callback);