Commit Graph

18 Commits

Author SHA1 Message Date
Henrik G. Olsson
cbc0ec3b88 Add -verify-ignore-unrelated where necessary (NFC)
These are tests that fail in the next commit without this flag. This
does not add -verify-ignore-unrelated to all tests with -verify, only
the ones that would fail without it. This is NFC since this flag is
currently a no-op.
2025-10-04 14:19:52 -07:00
Suyash Srijan
fd8d7afc5b [Parse] Fix variable identifier parsing including code on newline as part of the identifier (#61036) 2022-09-12 23:05:20 +01:00
Varun Gandhi
a1716fe2a6 [Diagnostics] Update compiler diagnostics to use less jargon. (#31315)
Fixes rdar://problem/62375243.
2020-04-28 14:11:39 -07:00
Hamish Knight
565634c2cc Handle decl modifier keywords in isStartOfSwiftDecl
Previously we would always return true if we
encountered a decl modifier keyword, however this
could cause us to incorrectly consider SIL's
usage of such keywords, e.g 'private', to be the
start of a Swift decl.

Adjust the logic to check the next token for the
start of a Swift decl.
2020-02-04 13:00:42 -08:00
Slava Pestov
1c2ac8ee17 Parse: Parse entire top level in one shot 2019-12-19 23:46:01 -05:00
Rintaro Ishizaki
70d53525e7 [Parse] Add testcases for tokenizing SIL keywords as identifiers in non-SIL mode 2017-01-17 03:10:50 +09:00
Robin Kunde
ab415e6b3e [Parse] Improve parser diagnostics for keyword-as-identifer errors (#6045)
Instead of the simple "expected identifier in declaration", the error will now read "keyword '%' cannot be used as an identifier here", and will be accompanied by a note suggesting escaping the keyword with backticks, as well as a fixit.

https://bugs.swift.org/browse/SR-3167
2016-12-13 16:12:53 -08:00
David Farler
b7d17b25ba Rename -parse flag to -typecheck
A parse-only option is needed for parse performance tracking and the
current option also includes semantic analysis.
2016-11-28 10:50:55 -08:00
Manav Gabhawala
7928140f79 [SE-0046] Implements consistent function parameter labels by discarding extraneous parameter names and adding _ where necessary 2016-04-06 20:21:58 -04:00
Chris Lattner
0bfacde242 Fix: <rdar://problem/16230507> Cannot use a negative constant as the second operator of ... operator
This is a case that the operator splitting code didn't handle because of
the bizarre lexer code for handling operators with periods in them.  We had
accreted some weird special case logic for what is valid in an operator
(but which even had a special case hack for ..<).  The policy is now very
simple: if an operator name starts with a dot, it is allowed to include other
dots in its name.  If it doesn't, it doesn't.  This allows us to get lexer
level operator splitting in cases like x=.Foo, allowing our existing operator
set that have dots in them without hacks, and provides a superior QoI
experience due to operator splitting.

This is technically a language change, but the TSPL operator grammar was
incorrect for it anyway.  I will file an internal radar to get TSPL updated
with the actual behavior (now that it is defensible).
2015-12-16 22:16:19 -08:00
Chris Lattner
ada5487153 add fixit tests to random other tests.
Swift SVN r31006
2015-08-04 20:35:36 +00:00
Joe Groff
9e0b290f81 Parser: Always parse '.foo' as expr-postfix when possible.
When a line begins with '.', it's almost always due to a method chain, not an attempt to start an expression with a contextual member lookup. This is a more principled grammar rule than the long tail of hacks we've been putting up to try to accommodate "builder pattern" usages. Fixes rdar://problem/20238557.

Swift SVN r29606
2015-06-24 14:39:34 +00:00
Dmitri Hrybenko
f46f16ae82 stdlib: implement new print() API
rdar://20775683

Swift SVN r28309
2015-05-08 01:37:59 +00:00
John McCall
426510cd4e Create an ErrorExpr when expression parsing consumes tokens
but doesn't build anything.

I have no idea why this test case needed to change.

Swift SVN r27897
2015-04-29 00:23:15 +00:00
Argyrios Kyrtzidis
a935e7c13e [Lexer] Recognize editor placeholders as identifiers and provide a specific error when encountered.
Swift SVN r26212
2015-03-17 01:52:59 +00:00
Dmitri Hrybenko
3b04d1b013 tests: reorganize tests so that they actually use the target platform
Most tests were using %swift or similar substitutions, which did not
include the target triple and SDK.  The driver was defaulting to the
host OS.  Thus, we could not run the tests when the standard library was
not built for OS X.

Swift SVN r24504
2015-01-19 06:52:49 +00:00
Ted Kremenek
fad874708e Adjust test cases.
Swift SVN r17964
2014-05-12 22:01:52 +00:00
Joe Groff
1013781bcc Parse: Allow Unicode identifier characters.
Extend the character set for identifiers according to WG14 N1518, which recommends an extended character set for identifier start and continuation characters in C. Mangle identifiers containing non-ASCII characters by borrowing the Punycode encoding used for international domain names.

No Unicode operators just yet.

Swift SVN r4968
2013-04-28 21:39:02 +00:00