Commit Graph

15 Commits

Author SHA1 Message Date
Martin Svensson
9f6dc70d58 [Parser] Handle REPL raw multi-line string literal input
Extend handling of incomplete multi-line string literals during input in
REPL to also cover raw multi-line strings.

Fixes #52840 and apple/llvm-project#4628
2023-02-02 13:23:28 +09:00
Argyrios Kyrtzidis
1f117b4848 [parser] Make sure the isInputIncomplete() function works as expected for multi-line strings 2018-08-09 17:30:49 -07:00
Argyrios Kyrtzidis
82be1a5d47 [parser] Make sure the isInputIncomplete() function works as expected when there is an empty string interpolation segment
Previously it was erroneously treating such invalid interpolation segment as 'incomplete',
even though additional user input, will not 'complete' it.

rdar://28498239
2018-08-09 17:03:44 -07:00
Dmitri Gribenko
d175b3b66d Migrate FileCheck to %FileCheck in tests 2016-08-10 23:52:02 -07:00
Chris Lattner
8d81349fe1 fix rdar://24029542 "Postfix '.' is reserved" error message" isn't helpful
This adds some heuristics so we can emit a fixit to remove extraneous
whitespace after a . and diagnose the case where a member just hasn't
been written yet better.  This also improves handling of tok::unknown
throughout the parser a bit.

This is a re-commit of ff4ea54 with an update for a SourceKit test.
2016-01-11 15:11:20 -08:00
Erik Eckstein
acc243a002 Revert "fix rdar://24029542 "Postfix '.' is reserved" error message" isn't helpful"
It's probably the cause for the fail of SourceKit/SyntaxMapData/syntaxmap-edit-del.swift

This reverts commit ff4ea54614.
2016-01-11 10:43:39 -08:00
Chris Lattner
ff4ea54614 fix rdar://24029542 "Postfix '.' is reserved" error message" isn't helpful
This adds some heuristics so we can emit a fixit to remove extraneous
whitespace after a . and diagnose the case where a member just hasn't
been written yet better.  This also improves handling of tok::unknown
throughout the parser a bit.
2016-01-10 15:28:03 -08:00
Dmitri Hrybenko
caabe782e4 Parser: when recovering from an incomplete 'for' statement, don't set the
source location of synthesized AST nodes to point to EOF.  This causes the
source range to span more tokens than the parent node does.

rdar://17630645


Swift SVN r21282
2014-08-19 15:56:52 +00:00
Ted Kremenek
fad874708e Adjust test cases.
Swift SVN r17964
2014-05-12 22:01:52 +00:00
Argyrios Kyrtzidis
286927effa [Parser] Fix source range for an incomplete function that has no open paren.
Swift SVN r15182
2014-03-18 05:31:28 +00:00
Dmitri Hrybenko
c5f0a44c60 Parser: don't use EOF as source location for an error expr, AST verifier
rightfully complains about improper source range nesting

<rdar://problem/16276969> Crash in swift::ide::isSourceInputComplete()


Swift SVN r15115
2014-03-16 21:49:47 +00:00
Argyrios Kyrtzidis
e38950ca4f [Parser] Fix verifier crash with incomplete switch case statement.
Swift SVN r13437
2014-02-04 18:19:31 +00:00
Argyrios Kyrtzidis
0e12f527b3 [Parser] Fix verifier crash with case statements in incomplete source.
Swift SVN r13315
2014-02-02 03:14:35 +00:00
Argyrios Kyrtzidis
fa240a959b [Parser] Fix verifier crash when a switch statement has unmatched brace.
Swift SVN r13314
2014-02-02 03:14:34 +00:00
Argyrios Kyrtzidis
8758451a43 [Parser/IDE] Introduce ide::isSourceInputComplete() which returns true if the input source is fully formed,
or false if, for example, a closing brace is missing.

This is useful for the REPL.
rdar://15948039

Swift SVN r13313
2014-02-02 03:14:33 +00:00