Chris Lattner
0871b128f8
add support for /**/ comments to the lexer, allow nesting of them since we won't
...
have the #if 0 hack to handle nesting.
Swift SVN r506
2011-08-12 00:37:01 +00:00
Chris Lattner
9e6817b3cd
implement lexer, parser, and dox support for while loops, everything is hooked up now.
...
Swift SVN r502
2011-08-11 20:47:33 +00:00
Chris Lattner
ce6f6a83cd
add AST support for WhileStmt. This isn't important, but is easy to add.
...
Swift SVN r501
2011-08-11 20:33:34 +00:00
Doug Gregor
41fc50e9dc
Remove the ability for protocol<P1, P2, P3> to refer to a type. Plus,
...
some minor syntactic fixes and clarifications.
Swift SVN r499
2011-08-10 06:01:36 +00:00
Chris Lattner
3e8e0a0bf5
Fix the examples for oneof's with elements that have an associated type,
...
the grammar and parser already require a :, but the examples never got
updated.
Swift SVN r498
2011-08-10 05:00:52 +00:00
Doug Gregor
35ec6171b7
Update generics proposal based on today's discussion. Major changes:
...
- Use implicit conformance to protocols (duck typing)
- Treat protocols as types, eliminating the any<proto1, proto2, ...>
syntax in favor of...
- Introduce a syntax for anonymous protocols
- Switch [] syntax over to be more C++-like
- Switch protocol inheritance -> protocol refinement, and use : to
separate a protocol from those protocols it refines
- Clarify our intent w.r.t. type argument deduction
- Note that we don't intend to implement run-time overload
resolution out of the box
Swift SVN r497
2011-08-09 03:11:58 +00:00
Doug Gregor
02d66f866f
Minor fixes and tweaks based on feedback from Chris
...
Swift SVN r496
2011-08-08 16:45:02 +00:00
Doug Gregor
b64c49f97a
Generics manifesto
...
Swift SVN r495
2011-08-06 00:38:23 +00:00
Chris Lattner
39660b5017
add langref and lexer support for return stmt.
...
Swift SVN r492
2011-08-03 22:43:57 +00:00
Chris Lattner
b7049da44c
clean up the grammar by introducing an explicit 'decl' production.
...
It turns out we already allow nested functions, how about that.
Swift SVN r490
2011-08-03 22:31:01 +00:00
Chris Lattner
c86e786ab5
switch langref to new func syntax, switch implementation to use FuncExpr instead of LambdaExpr.
...
Swift SVN r487
2011-08-03 00:32:15 +00:00
Chris Lattner
ea9cd782d8
lambda expressions now require a type that start with a tuple, such as (x : int).
...
John can fix func decls.
Swift SVN r485
2011-08-03 00:18:12 +00:00
Chris Lattner
0265e3cbd1
make 'else if' a special case, disallowing things like "else ;".
...
Swift SVN r482
2011-08-02 21:31:31 +00:00
Chris Lattner
aca2ef8c94
add notes on "not having headers" from our discussion yesterday.
...
Swift SVN r481
2011-08-02 21:12:24 +00:00
Chris Lattner
dc56b324a8
linkify some grammar references, add testcase, remove entry from readme.
...
Swift SVN r479
2011-08-01 17:47:36 +00:00
Chris Lattner
350b89e6e4
Represent assignments as their own AssignStmt, preserving the model we had
...
before, but removing the hack where we'd represent them as a binary operator
with a null operator function. We still have no clear semantics for what
is valid or not.
Swift SVN r478
2011-08-01 17:45:21 +00:00
Chris Lattner
ebc33d306f
add AST support for semicolon statements and clean up the parser. While noone cares, it is trivial
...
to support and good for completeness.
Swift SVN r475
2011-07-31 21:09:23 +00:00
Chris Lattner
c3bbefcbaa
add support for lambda expressions (anonymous functions), which are the thing that
...
func is sugar for. Unfortunately, we can't use 'func' without introducing ambiguity
since decls and exprs can exist in the same context, I'm not wed to 'lambda' as the
keyword, thoughts welcome.
Swift SVN r467
2011-07-31 20:12:20 +00:00
Chris Lattner
d232974df1
introduce a new FuncExpr AST node. No clients yet though.
...
Swift SVN r465
2011-07-31 18:10:24 +00:00
Chris Lattner
63ce0be641
make the big switch: {} are now statements, not expressions. This removes some
...
annoying things from the grammar (like expr-non-brace), and makes it so that
the body/else of an if is just a statement.
This patch has a fairly serious caveat that we just drop function bodies on the
floor now, since we have no "stmtexpr" sort of thing to represent the syntactic
sugar that is func. We'll fix that soon.
Swift SVN r462
2011-07-31 17:39:13 +00:00
Chris Lattner
382f33ec74
introduce statements, make if (and ;) a statement. This includes a
...
few horrible hacks, but is the right direction to go.
Swift SVN r457
2011-07-31 06:52:11 +00:00
Chris Lattner
0e95d1ba29
start carving out a place for statements, this is obviously in progress, I made the mistake of upgrading Xcode and now it doesn't launch...
...
Swift SVN r455
2011-07-29 23:16:47 +00:00
Chris Lattner
91e6174d8b
add a skeletal place to talk about some of the decisions we've (at least
...
tentatively) made w.r.t. statements.
Swift SVN r454
2011-07-29 22:31:54 +00:00
Chris Lattner
7146e550f0
don't lose the changes from r443
...
Swift SVN r453
2011-07-29 22:17:15 +00:00
Chris Lattner
698d88000c
convert to plaintext.
...
Swift SVN r452
2011-07-29 22:13:38 +00:00
Chris Lattner
66271c8ddb
add some notes on top level code and how namespace level vars should be handled, per our discussion on monday.
...
Swift SVN r451
2011-07-29 22:09:25 +00:00
Chris Lattner
4071deceb1
update whitepaper for new syntax.
...
Swift SVN r445
2011-07-24 21:19:22 +00:00
Chris Lattner
0fc77abf5c
Per discussion on swift-dev, unify 'meth' and 'func' syntax into just 'func' syntax
...
where you can optionally declare a receiver type. This is cleaner both conceptually
and in implementation, and eliminates drug references. :)
Swift SVN r444
2011-07-24 20:11:35 +00:00
Chris Lattner
4dc572ddd7
per discussion on swift dev, remove the "=" syntax for defining a body of a function.
...
Swift SVN r435
2011-07-24 00:29:22 +00:00
Chris Lattner
ba2793aa6b
implement parser support for methods, including dox and
...
a testcase. No AST or sema yet.
Swift SVN r415
2011-07-19 04:46:07 +00:00
Chris Lattner
504ee85c0e
introduce a 'meth' keyword.
...
Swift SVN r414
2011-07-19 04:19:40 +00:00
Chris Lattner
ed09f95ec7
notes from doug's feedback
...
Swift SVN r413
2011-07-19 03:49:54 +00:00
Doug Gregor
207ede0bec
Add my notes from skimming the implementation
...
Swift SVN r412
2011-07-19 00:32:23 +00:00
Chris Lattner
244b31c115
add some more notes.
...
Swift SVN r411
2011-07-18 06:39:01 +00:00
Chris Lattner
dd4c4e7268
add some typestate notes from a review of plaid papers.
...
Swift SVN r409
2011-07-18 06:10:45 +00:00
Doug Gregor
023c9cc431
Fix a typo
...
Swift SVN r402
2011-07-13 18:17:18 +00:00
Chris Lattner
b9e7823656
Implement lexing and parsing support for a proper if expression. There
...
is no AST building or typechecking support yet. Document the intended
semantics in LangRef. This is clearly subject to change, but is a starting
point.
Swift SVN r393
2011-06-05 02:03:48 +00:00
Chris Lattner
724b49515d
Fix int to not be a typealias for __builtin_int64_type - it is
...
a struct containing one now. This allows different operators
to be defined (some day) for uint and int, even though both are
i32's.
Swift SVN r391
2011-05-31 03:55:58 +00:00
Chris Lattner
de094d7cde
Introduce i1/i8/i16/i64 types, and switch int to be 64-bit.
...
Swift SVN r390
2011-05-31 03:48:36 +00:00
Chris Lattner
471e52b85d
add some half thought out ideas of error handling for some future design
...
discussion.
Swift SVN r388
2011-05-07 02:53:30 +00:00
Chris Lattner
d3d1278c7e
John points out that struct foo { ... } is more consistent with oneof and generally makes more sense than struct foo (...). Switch!
...
Swift SVN r372
2011-04-22 06:12:21 +00:00
Chris Lattner
27da5891b1
various updates.
...
Swift SVN r371
2011-04-22 05:48:22 +00:00
Chris Lattner
3cce5623cb
add a bunch of random documents
...
Swift SVN r369
2011-04-14 22:05:07 +00:00
Chris Lattner
8c833bc36d
More writing.
...
Swift SVN r360
2011-04-10 23:55:52 +00:00
Chris Lattner
c45c9295cf
Describe expressions.
...
Swift SVN r359
2011-04-10 23:36:11 +00:00
Chris Lattner
0d54f3e6f6
Major cleanups to decls and types section of langref.html. Expressions needs to be largely rewritten.
...
Swift SVN r358
2011-04-10 17:43:26 +00:00
Chris Lattner
eb9d1353d2
Allow name binding to bind to struct elements.
...
Swift SVN r332
2011-03-23 06:36:01 +00:00
Chris Lattner
c9ee19e269
Implement parser, sema, doc, and name lookup support for refined import declarations. You can still only do top level references, but that's because we don't have namespaces or anything else interesting yet.
...
This allows "import swift.int" for example.
Swift SVN r329
2011-03-23 05:18:29 +00:00
Chris Lattner
2205513c45
Add a comment acknowledging that conversions are ambiguous and give an example. Simplify some code.
...
Swift SVN r328
2011-03-23 04:50:15 +00:00
Chris Lattner
c9eb885752
Introduce top-level expressions and simplify TranslationUnitDecl (and various things that hack on it) by making it hold a single BraceExpr instead of a list of exprs and decls.
...
Swift SVN r293
2011-03-20 06:59:37 +00:00