Chris Lattner
df74bc03c0
lang ref and parser support for for statements. AST and sema next.
...
Swift SVN r1493
2012-04-19 18:25:48 +00:00
Doug Gregor
6897b6ab44
Add support for parsing a subscripting declaration, e.g.,
...
subscript (i : Int) -> Double {
get { /* get ith element of something */ }
set { /* set ith element of something to value*/ }
}
Swift SVN r1476
2012-04-18 21:43:54 +00:00
Doug Gregor
c99e526ae8
Refactor var-get-set grammar to a more general get-set grammar, to
...
prepare for re-use in subscripting. No functionality change (yet).
Swift SVN r1475
2012-04-18 20:54:58 +00:00
Doug Gregor
b7b8f171b3
Treat a function application A(b) as a coercion of the expression 'b'
...
to the type named by A (when A is in fact a direct reference to a
type). If that coercion would fail, then fall back to invoking a
constructor. Fixes <rdar://problem/11272190>.
Swift SVN r1472
2012-04-18 17:04:34 +00:00
John McCall
71157c65d5
Add parsing support, but no type-checking or IR-generation,
...
for new expressions.
Swift SVN r1466
2012-04-18 08:09:18 +00:00
John McCall
e487813986
Update the language spec for the type-array grammar change.
...
Swift SVN r1463
2012-04-18 08:09:06 +00:00
John McCall
e6d56fd718
Require an unspaced [ to start a subscript or array-type suffix.
...
Per discussion, this should probably be "no newline since the last
token", but that decision should be made simultaneously for ( and [.
Swift SVN r1461
2012-04-18 08:08:58 +00:00
Howard Hinnant
8528c79819
Rename types to first-letter-upper-case try #2 . The test suite is now passing for me.
...
Swift SVN r1447
2012-04-17 01:27:23 +00:00
Eli Friedman
d5421f5b50
Update LangRef for the addition of '..'.
...
Swift SVN r1446
2012-04-17 00:37:48 +00:00
Ted Kremenek
b8127e1c7f
Make some topics in types <h3> instead of <h4> to show up in TOC
...
Swift SVN r1427
2012-04-13 22:07:06 +00:00
Ted Kremenek
8b6f142a26
Wordsmith presentation of "fully-typed" types, add HTML links to this topic,
...
and make header of this section match the name of the concept.
Swift SVN r1426
2012-04-13 22:07:05 +00:00
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