Chris Lattner
80e1ae6104
Rework a bunch of stuff in the type system: now the *only* way to name a type is through a 'typealias' and there is no such thing as a OneOfDecl. Instead, we have OneOfType's, which are always anonymous. "oneof declarations" and "struct declarations" are now both just sugar.
...
This eliminates the NamedTypeDecl class (because there is now only one named type decl), eliminates OneOfDecl, renames AliasTypeDecl to NameAliasTypeDecl for good measure, and introduces OneOfType.
This preserves all existing syntax, and allows stuff like this:
func test6(checkboxenabled : oneof { Yep, Nope }) {
test6(:Yep)
}
Which is an anonymous oneof.
Swift SVN r237
2011-02-26 02:03:01 +00:00
Chris Lattner
93eea9c8bc
Simplify ASTContext's transforming of NamedTypeDecls into types. It now doesn't unique them, the decls do for themselves. ASTContext still has the type symbol table.
...
Swift SVN r228
2011-02-22 06:07:32 +00:00
Chris Lattner
ad4389edc8
Introduce a new TypeAliasDecl class and NamedTypeDecl parent class. We're not creating it yet, but hey it's there.
...
Swift SVN r226
2011-02-22 05:37:01 +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
ad438c55e3
Implement the rest of sema for scoped identifier references (X::Y) we now get a proper DeclRefExpr, and this:
...
var def = DataSearchFlags::None;
-ast-dump's into:
(vardecl 'def' type='DataSearchFlags'
(declref_expr type='DataSearchFlags' decl=None))
Swift SVN r182
2010-10-09 23:46:16 +00:00
Chris Lattner
10e3eacc83
Create a DataElementDecl to represent the elements of a data, and wire up sema support for creating them when the data is defined.
...
Swift SVN r181
2010-10-09 23:24:56 +00:00
Chris Lattner
0ad8498114
declare DeclData and create it in sema.
...
Swift SVN r174
2010-10-09 20:40:19 +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
1bef5bd648
Bertrand prefers $0 to _1 for anonymous closure arguments.
...
Swift SVN r165
2010-09-18 16:57:10 +00:00
Chris Lattner
d5f834512e
Next step to allow use of named arguments: Create a new ArgDecl AST node, and have SemaDecl form them. We now correctly diagnose argument name redefinitions (though the diagnostic sucks because we don't have loc info)
...
Swift SVN r159
2010-08-07 20:25:05 +00:00
Chris Lattner
429ecb81da
Finish ast and sema support for name binding elements of tuples in var decls.
...
Swift SVN r152
2010-08-05 22:22:22 +00:00
Chris Lattner
667078650a
Implement support for anonymous closure arguments. For example, we can now compile this:
...
var func6 : ((int,int) -> int) -> (); // Takes a function, returns nothing.
func funcdecl5() {
func6(_0 + _1); // Closure with two named anonymous arguments
}
into:
(apply_expr type='()'
(declref_expr type='(int, int) -> int -> ()' decl=func6)
(closure_expr type='(int, int) -> int'
(anondecl '_0' type='int')
(anondecl '_1' type='int')
(tuple_expr type='int'
(binary_expr '+' type='int'
(declref_expr type='int' decl=_0)
(declref_expr type='int' decl=_1))))))))
However, there are still some problems with this (and we're definitely not doing type inference yet, all anon args are assumed 'int').
Swift SVN r111
2010-07-28 06:25:16 +00:00
Chris Lattner
1afe647841
add basic sema support for funcdecl, not verifying types yet though.
...
Swift SVN r96
2010-07-27 05:38:12 +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
769c4a034a
fix a bug in my refactoring.
...
Swift SVN r78
2010-07-24 20:13:26 +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
ed1be4f17a
add printing support for Identifier, switch VarDecl to have an
...
identifier instead of a stringref.
Swift SVN r63
2010-07-23 03:50:09 +00:00
Chris Lattner
f7c8e53359
implement isa/dyncast and dumping support for exprs.
...
We can now parse and print this:
var x3 = 4+5*4+12/97;
into:
(vardecl 'x3'
(binary_expr
(binary_expr
(integer_literal 4)
(binary_expr
(integer_literal 5)
(integer_literal 4)))
(binary_expr
(integer_literal 12)
(integer_literal 97))))
Swift SVN r46
2010-07-19 06:52:08 +00:00
Chris Lattner
547b2a8003
implement vardecl dumping and Casting.h support for decls.
...
Swift SVN r45
2010-07-19 06:39:56 +00:00
Chris Lattner
340a7faa01
stub out Decl AST's.
...
Swift SVN r37
2010-07-19 04:59:13 +00:00