Commit Graph

160 Commits

Author SHA1 Message Date
Doug Gregor
bbd5dfcfdf Allow variables with a getter or setter to be declared in a
struct/oneof/class extension, making them instance methods. Normal
variables are still not allowed in these contexts, however.

The fact that we set DeclContexts late causes some consternation here,
because it's not clear just how far we need to recurse in
DeclContext. I've done enough to make properties work, but I'm still
rather uneasy about the current state of affairs.


Swift SVN r1423
2012-04-13 21:45:27 +00:00
Doug Gregor
0cc17a2481 Revert r1416; it shouldn't be committed until all tests have also been
updated.


Swift SVN r1422
2012-04-13 21:42:43 +00:00
Ted Kremenek
525ae6ad51 Add LangRef commentary that nested assignments are illegal, by design.
Swift SVN r1421
2012-04-13 20:26:50 +00:00
Ted Kremenek
91322c33ae Expound commentary on restricting the use of '=' as an operator.
Also comment that '->' cannot be used as an operator either.

Swift SVN r1420
2012-04-13 20:23:50 +00:00
Howard Hinnant
b15fcd6172 Make types have upper case first letter. Fixes <rdar://problem/10964069>.
Swift SVN r1418
2012-04-13 18:54:01 +00:00
Ted Kremenek
d571b747d6 Add comment to LangRef that '=' is not a user customizable operator identifier.
Swift SVN r1417
2012-04-13 18:29:38 +00:00
Doug Gregor
9def4fadf3 Actually make my getter/setter example well-formed. Thanks, Eli
Swift SVN r1409
2012-04-13 00:03:32 +00:00
Doug Gregor
6ce55acfc4 Parse getters and setters for variables.
Swift SVN r1408
2012-04-12 23:59:53 +00:00
Chris Lattner
2599a55231 add ~ as an operator.
Swift SVN r1407
2012-04-12 23:24:11 +00:00
Chris Lattner
b01c3bd989 We need to eventually add unicode identifier support, but it is beyond the scope of
what I intend to do right now.



Swift SVN r1405
2012-04-12 23:14:48 +00:00
Ted Kremenek
3e487d7ca9 Add HTML anchors for 'operator' grammar rules.
Swift SVN r1404
2012-04-12 22:52:55 +00:00
Chris Lattner
2e3c720e46 fix regex's for floating_literal because "0" is an integer literal not floating.
Swift SVN r1396
2012-04-11 22:22:27 +00:00
Chris Lattner
8b1244b072 fix an out of date example ted noticed.
Swift SVN r1391
2012-04-11 16:58:01 +00:00
Chris Lattner
1bb2443498 document and lex the basic and unicode escape characters.
IRGen after lunch.



Swift SVN r1361
2012-04-10 19:30:18 +00:00
Chris Lattner
e31361f174 Progress towards rdar://11216049 - Strings cannot span multiple lines, and \ is an
escape character (not yet implemented).


Swift SVN r1360
2012-04-10 18:14:27 +00:00
Chris Lattner
2745679df9 these types got renamed.
Swift SVN r1353
2012-04-10 01:47:27 +00:00
Chris Lattner
5650d08ddf implement parsing, AST, and sema support for simple strings,
no irgen yet.


Swift SVN r1351
2012-04-10 01:25:51 +00:00
Chris Lattner
c78bdcff0e Initial lexer support for string literals. The regex is trivial and will be extended in the future.
Swift SVN r1348
2012-04-10 00:38:13 +00:00
Chris Lattner
fbfb76a515 rename 'plus' methods to 'static' methods, resolving:
<rdar://problem/10718220> Need a better name than 'plus' for "static" functions



Swift SVN r1340
2012-04-06 17:50:43 +00:00
Eli Friedman
2493d2e862 Make LangRef for 'var' reflect what is currently implemented.
Swift SVN r1326
2012-04-05 02:20:41 +00:00
Eli Friedman
b65f969193 Replace ":foo" syntax for oneof members with ".foo".
Swift SVN r1288
2012-03-29 01:58:55 +00:00
Eli Friedman
8ece7c0103 Fix a few minor typos.
Swift SVN r1241
2012-03-20 01:23:44 +00:00
Eli Friedman
e52c4d6e1b Misc LangRef fixes.
Swift SVN r1222
2012-03-16 23:54:00 +00:00
Chris Lattner
90e3ac1355 document the auto_closure attribute, wrapping up
rdar://10983400 - Need function argument attribute to enable autoclosure


Swift SVN r1193
2012-03-11 14:22:35 +00:00
Chris Lattner
6151913713 remove obsolete description of logic_value.
Swift SVN r1177
2012-03-10 22:05:21 +00:00
Chris Lattner
f13a615e78 rename expr-anon-closure -> expr-explicit-closure.
Change the wording to claim that $0 is only valid in an explicit
closure.  Add a note about possibly generalizing closure syntax in the future.


Swift SVN r1155
2012-03-04 04:33:58 +00:00
Chris Lattner
601e401dfa document the forthcoming expr-anon-closure syntax, part of rdar://10666917
Swift SVN r1151
2012-03-02 01:30:18 +00:00
Chris Lattner
e40a27c6cb update langref for r1142
Swift SVN r1145
2012-03-01 23:58:48 +00:00
Chris Lattner
f8b363fc1f enforce a syntactic form that function argument lists must be parenthesized, part of
rdar://10666966


Swift SVN r1144
2012-03-01 23:46:14 +00:00
Chris Lattner
21c8b4dae9 implement a more-sane floating point literal syntax, adding support for
exponents.  This resolves rdar://10877508


Swift SVN r1140
2012-03-01 21:42:10 +00:00
Chris Lattner
1076367d73 implement rdar://10962528 - split up the int/fp literal lexing and grammar.
This cleans up handling of int/fp literals by splitting them appart at the
lexer level.


Swift SVN r1137
2012-03-01 19:06:55 +00:00
Chris Lattner
aa39667cae disallow destructuring a struct with a var, e.g.:
struct point { x : int, y : int }
var (a, b) = foo()  // when foo returns a 'point'

allowing this breaks our fragility model (e.g. members can be added/removed from the struct) and this generally needs to be integrated with our pattern matching stuff.  rdar://10934540



Swift SVN r1135
2012-03-01 18:45:15 +00:00
Chris Lattner
abb70d73eb remove dot syntax for tuple elements. Instead of (.x = 4, .y = 5) use the
simpler and newfangled (x = 4, y = 5) syntax.  rdar://10962605


Swift SVN r1134
2012-03-01 18:40:31 +00:00
Chris Lattner
17ea0a6670 finish my pass over LangRef, updating it and changing it and the parser to keep the grammars in sync.
Swift SVN r1132
2012-03-01 16:55:09 +00:00
Chris Lattner
af553c2cc3 random minor updates
Swift SVN r1131
2012-02-29 01:17:33 +00:00
Chris Lattner
831894eb8d checkpoint progress updating langref (down to 'var'), still much to do.
Swift SVN r1130
2012-02-26 19:11:20 +00:00
John McCall
7b29a420f6 Design and implement the [byref] attribute, checking that
it doesn't appear in places it shouldn't.  The only limits on
this checking right now is the inadequacy of location information
for types, which is something we ought to fix.

Fix type-checking of byref applications.  Fix IR generation
of byref variables.  Whole lotta fixin' goin' on.

But hey, byref calls work.



Swift SVN r1111
2012-02-10 09:42:50 +00:00
John McCall
7f60469fdf Introduce the notion of a "fully-typed" type, necessary
because tuple types can have defaulted elements.  Check for
it and complain in function signatures.



Swift SVN r1109
2012-02-07 03:48:23 +00:00
John McCall
3b4f155029 Update the language reference for the basic pattern grammar
and the function signature changes.



Swift SVN r1102
2012-01-26 07:05:44 +00:00
Chris Lattner
2eac7d8a07 random updates.
Swift SVN r1087
2012-01-19 00:49:23 +00:00
Chris Lattner
578686379d start updating some dox.
Swift SVN r1082
2012-01-18 22:58:18 +00:00
Chris Lattner
94cc3533b4 add missing newlines at end of files.
Swift SVN r1062
2012-01-18 01:51:09 +00:00
Chris Lattner
f1db6de509 remove the :: token and DCE UnresolvedScopedIdentifierExpr.
Swift SVN r1043
2012-01-14 07:00:45 +00:00
Chris Lattner
4b8a147952 change the type grammar from qualifying a type with module::typename to module.typename.
Swift SVN r1036
2012-01-13 05:45:59 +00:00
Chris Lattner
17b11e9bbd implement parsing, AST, and LangRef support for 'plus' methods. Dot syntax will need some work though to actually use them.
Swift SVN r949
2011-12-21 23:21:58 +00:00
Chris Lattner
e08e493630 fully rip the :: form out of the dox
Swift SVN r948
2011-12-21 22:46:32 +00:00
Chris Lattner
cc0529ba34 remove support for "func foo::bar() {}". "Just use extensions".
Swift SVN r947
2011-12-21 22:45:37 +00:00
John McCall
88d0f28698 Correctly call oneof injections.
Swift SVN r940
2011-12-15 03:20:02 +00:00
John McCall
cf0935576d Incremental check-in of resilience document.
Swift SVN r934
2011-12-14 23:38:01 +00:00
Chris Lattner
0302a0c036 fix broken tag
Swift SVN r909
2011-12-06 21:07:22 +00:00