Our recovery is better now, and we don't skip that much. Actually, even if we
would stop at code completion token during recovery, completion results would
be something very generic anyway (because there is no interesting parser state
to observe), and these results can be produced as a fallback separately (not
implemented).
Swift SVN r7754
value expression and the type checker will complain anyway.
Instead, recover by unwrapping the BraceStmt that is contained inside, and
produce a specialized diagnostic.
Swift SVN r7680
This increases the amount of noise in diagnostics. But we did not get these
diagnostics before because we were just skipping these brace statements. We
shoud improve recovery in parsing of whatever declaration that precedes the
brace statement so that it is picked up as a body of that declaration.
Swift SVN r7679
Now we make the desicion to delay parsing if the parsed production contained a
code completion token, not if we just stopped at the code completion token.
Swift SVN r7442
But the implementation of expression parsing still does not propagate the code
completion bits because it uses NullablePtr for results.
Swift SVN r7425
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
This allows us to show generic parameters in:
struct S<T> {
func f(a: #^A^#
}
And show the type Z in:
struct S {
func f(a: #^A^#
typealias Z = Int
}
Swift SVN r7216
Constructor delegation in parser was useless, because the code was split
between the constructors arbitrarily.
There was no need to pass down IsMainModule because the parser could figure
that out on its own. Also rename it to allowTopLevelCode() to better describe
what it actually affects.
Swift SVN r7098
a closing brace.
Fixes two bugs:
* delayed parsing was not correctly skipping over the function body because it
stopped at the 'var' decl;
* parser was not creating a BraceStmt for the function body if it could not
find the closing brace.
Swift SVN r7062
prevent the parser from constructing the AST for it. Forward references are
not allowed at the top level.
Resolves all FIXMEs in test/CodeCompletion/complete_at_top_level.swift.
Swift SVN r6829
Modules can be in either 'Raw' or 'Canonical' form, with different invariants on each. We don't actually distinguish those invariants yet, but this patch adds the field to SILModule and adds a "sil_stage" declaration to SIL printer/parser syntax.
Swift SVN r6793
We haven't fully updated references to union cases, and enums still are not
their own thing yet, but "oneof" is gone. Long live "union"!
Swift SVN r6783
This allows us to do code completion inside top-lever var initializers.
As a part of implementation, we make sure that error recovery does not
implicitly skip over the code completion token. This also fixes a bug that
prevented us from doing code completion inside function argument list, added
tests for that.
Swift SVN r6708
Give oneof bodies syntax consistent with other NominalTypes. Give oneof elements first-class declaration syntax using the 'case' introducer, as suggested by Jordan. Oneofs can contain 'case' decls, functions, properties, and constructors, but not physical ivars. Non-oneof scopes cannot contain 'case' decls. Add some QoI to the oneof 'case' parser to also parse and complain about things that resemble switch 'case' labels inside decl contexts.
Swift SVN r6211