Commit Graph

1143 Commits

Author SHA1 Message Date
Chris Lattner
cb9b1838a6 Introduce and create a new TypeAliasDecl for typealiases.
Swift SVN r227
2011-02-22 05:47:08 +00:00
Chris Lattner
f6d7adc4cb Parse tuple element types as value-specifier's, allowing them to have initializers. Sema isn't wired up yet though.
Swift SVN r218
2010-11-25 20:49:01 +00:00
Chris Lattner
bc616e9fcd Split the initializer syntax from var decls out to their own 'value-specifier' production
Swift SVN r217
2010-11-25 17:00:34 +00:00
Chris Lattner
906ba908fd Rename 'data' to 'oneof', resolving a fixme in the spec. Yay for CLU!
Swift SVN r212
2010-11-11 01:20:36 +00:00
Chris Lattner
154c0c6eb9 Resolve a fixme by eliminating the ; in func decls and making the grammar more restrictive.
Swift SVN r203
2010-10-15 11:07:49 +00:00
Chris Lattner
b9fbd77f58 Fix a bunch of minor bugs found through inspection:
1. Punctuation identifiers were missing some characters.
2. Some parser production and methods were misnamed.
3. Top level var decls don't need a ; after them.
4. Various parser comments were out of date.
5. We now allow any type in a struct decl, e.g. "struct foo int", even though it's weird.

Swift SVN r199
2010-10-12 07:24:33 +00:00
Chris Lattner
26e63c29ac rip out a bunch of special case parsing logic for function arguments now that tuples have a sane syntax.
Swift SVN r197
2010-10-11 21:05:07 +00:00
Chris Lattner
f92a3d56d7 Implement parser support for structs, improve datadecl dumping.
Swift SVN r192
2010-10-10 06:38:24 +00:00
Chris Lattner
43f2d1dfa5 wire up parser and basic sema support for scoped identifier expressions (X::Y).
Swift SVN r180
2010-10-09 23:01:17 +00:00
Chris Lattner
a43a8f27f5 Wire data decls up to -ast-dump. Fix some minor bugs exposed along the way.
Swift SVN r175
2010-10-09 20:46:10 +00:00
Chris Lattner
57c697172a Split NamedDecl into NamedDecl with a ValueDecl subclass that has the type and value of the decl.
Swift SVN r173
2010-10-09 20:28:11 +00:00
Chris Lattner
ecdc8da738 add parser support for type specifiers in data descriptors.
Swift SVN r171
2010-10-09 18:58:18 +00:00
Chris Lattner
17c36aa749 add parser support for simple data declarations
Swift SVN r170
2010-10-09 18:42:54 +00:00
Chris Lattner
19e5390b78 twinify more diagnostics.
Swift SVN r168
2010-10-09 17:50:40 +00:00
Chris Lattner
d2abfde434 introduce a new builtin type to represent the result of the else binary operator (which is a temporary hack until we get user defined types).
Use it to define ife/else.  Fix some precedence/parsing bugs that implementing else exposed. 

Swift SVN r162
2010-08-08 22:37:56 +00:00
Chris Lattner
45610c0ecc rework func argument parsing to be more consistent across ->'s.
Swift SVN r161
2010-08-08 21:36:26 +00:00
Chris Lattner
025143611f implement support for tuple expressions with names specified for the elements.
Swift SVN r157
2010-08-07 06:51:12 +00:00
Chris Lattner
bf63029ecd rework tuple element parsing to not use ParseDeclVar, since tuple elements are fundamentally different. While we're at it, switch to an arguably more natural syntax for field elements, naming them with .x : type instead of var x : type
Swift SVN r150
2010-08-05 05:03:55 +00:00
Chris Lattner
34a1beac31 inline ParseTypeOrDeclVar and ParseExprOrDeclVar into their single callers and simplify the code around them.
Swift SVN r149
2010-08-05 04:42:13 +00:00
Chris Lattner
43a526f1f5 a step towards parsing richer names. I need to do some refactoring of var parsing before going further.
Swift SVN r148
2010-08-05 04:28:32 +00:00
Chris Lattner
8f86874c19 add parser support for typealiases, we have to be able to exercise the canonical type system somehow.
Swift SVN r143
2010-08-04 04:42:13 +00:00
Chris Lattner
ce55229f0f Allow arbitrary expressions as the body of a function, don't require brace-expr.
Swift SVN r103
2010-07-27 06:36:04 +00:00
Chris Lattner
fef3e71b42 stub out parsing of func declarations.
Swift SVN r95
2010-07-27 05:32:16 +00:00
Chris Lattner
4a2ea23b23 Enhance the parser to parse infix decls. The AST it constructs is still not correct though. We have no way to represent function calls yet!
Swift SVN r80
2010-07-24 20:59:00 +00:00
Chris Lattner
94110869e0 add support for parsing attribute lists, and add the first attribute, infix=42. It is now parsed and slammed into the AST, but not used.
Swift SVN r79
2010-07-24 20:44:56 +00:00
Chris Lattner
2bafb0e8fb Introduce new NamedDecl and FuncDecl classes. The difference between the two is syntactic sugar, so most clients want NamedDecl. This doesn't implement FuncDecl yet, which isn't a high prio for me in the short term.
Swift SVN r77
2010-07-24 19:09:09 +00:00
Chris Lattner
315107d5c6 Use the new NullablePtr<> class to allow better error recovery when parsing invalid expressions.
Swift SVN r74
2010-07-24 18:48:37 +00:00
Chris Lattner
1103ff5227 Implement basic parser support for brace expressions.
Swift SVN r69
2010-07-23 18:33:49 +00:00
Chris Lattner
b1d25371e3 type things as VarDecl instead of as Decl, return things by value from
void parse methods.


Swift SVN r48
2010-07-22 00:47:53 +00:00
Chris Lattner
aa126e87f9 add a new SemaType module, add parser support for tuples.
Add lexer support for ->.  Expand the testcase.


Swift SVN r47
2010-07-21 07:17:43 +00:00
Chris Lattner
669c129ab0 introduce new ASTConsumer interface, have parser invoke methods
on it.


Swift SVN r41
2010-07-19 05:50:41 +00:00
Chris Lattner
2eeee5faca give ASTContext a SourceMgr reference, add diagnostic hooks to SemaBase.
Swift SVN r39
2010-07-19 05:13:55 +00:00
Chris Lattner
c5e54442b4 make the parser actually create VarDecl AST nodes.
Swift SVN r38
2010-07-19 05:08:21 +00:00
Chris Lattner
9e8489a042 make the parser build type asts.
Swift SVN r34
2010-07-19 04:37:51 +00:00
Chris Lattner
d6edeb7a8b thread Expr* results through the parser and SemaExpr.
Swift SVN r27
2010-07-19 00:15:02 +00:00
Chris Lattner
910f84b6ae thread astcontext from the driver, down through Sema.
Swift SVN r26
2010-07-19 00:07:47 +00:00
Chris Lattner
b45fe8abf5 set up semaexpr and sema base. Give SemaExpr a couple trivial methods.
Swift SVN r24
2010-07-18 23:54:47 +00:00
Chris Lattner
c02e462b58 wire sema up to the Parser.
Swift SVN r22
2010-07-18 23:00:47 +00:00
Chris Lattner
66fe17ffdb parse some trivial binary expression, like:
var x3 = 4+5*4+12/97;



Swift SVN r20
2010-07-18 22:55:11 +00:00
Chris Lattner
3e53d83874 implement support for parenthesized expressions.
Swift SVN r19
2010-07-18 22:36:34 +00:00
Chris Lattner
9460c31203 implement enough parser support to parse:
var x : int;
var x2 = 4;



Swift SVN r16
2010-07-18 21:31:34 +00:00
Chris Lattner
5450892284 Set up trivial parser support stuff and sketch out a few
productions.  We can now get this far:

simple.swift:4:5: error: expected a top level declaration
var x : int;
    ^
simple.swift:5:5: error: expected a top level declaration
var x2 = 4;
    ^

Yay for amazing error recovery!



Swift SVN r14
2010-07-18 21:00:30 +00:00
Chris Lattner
05f5028b7a stub out a parser hook.
Swift SVN r13
2010-07-18 20:17:04 +00:00