Commit Graph

3461 Commits

Author SHA1 Message Date
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
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
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
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
a860fe44db implement support for printing types, add them to -ast-dump
Swift SVN r58
2010-07-22 06:33:03 +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