Joe Groff
5d8a7ff9e7
Allow multiple comma-separated enum elements in a 'case' decl.
...
Introduce an EnumCaseDecl for source fidelity to track the 'case' location and ordering of EnumElementDecls. Parse a comma-separated list of EnumElementDecls after a 'case' token.
Swift SVN r8509
2013-09-20 19:51:13 +00:00
Joe Groff
e109124186
Replace 'union' keyword with 'enum'.
...
This only touches the compiler and tests. Doc updates to follow.
Swift SVN r8478
2013-09-20 01:33:14 +00:00
Argyrios Kyrtzidis
d0d0978e19
[AST] Fix the parents in a few entries in DeclNodes.def.
...
Where's tablegen when you need it..
Swift SVN r8306
2013-09-16 23:37:23 +00:00
Dmitri Hrybenko
3cc01cf7d6
Introduce AbstractFunctionDecl -- a base class for ConstructorDecl,
...
DestructorDecl, FuncDecl -- and move some of the common concepts and logic
into it
No functionality change.
Swift SVN r8090
2013-09-11 04:04:01 +00:00
Dmitri Hrybenko
dae1d10c76
Fix an error in DeclNodes: ValueDecl did not include DestructorDecl
...
Found by reading code, so no tests.
Swift SVN r8024
2013-09-07 01:49:39 +00:00
Jordan Rose
fb74a12311
Fix indentation. No functionality change.
...
Swift SVN r7919
2013-09-04 22:18:44 +00:00
Doug Gregor
1ddb34fb71
Factor generic parameters and associated types into their own decl nodes.
...
Previously, TypeAliasDecl was used for typealiases, generic
parameters, and assocaited types, which is hideous and the source of
much confusion. Factor the latter two out into their own decl nodes,
with a common abstract base for "type parameters", and push these
nodes throughout the frontend.
No real functionality change, but this is a step toward uniquing
polymorphic types, among other things.
Swift SVN r7345
2013-08-19 23:36:58 +00:00
Jordan Rose
674a03b085
Replace "oneof" with "union"...everywhere.
...
We haven't fully updated references to union cases, and enums still are not
their own thing yet, but "oneof" is gone. Long live "union"!
Swift SVN r6783
2013-07-31 21:33:33 +00:00
Joe Groff
aeeda4ee12
Parser: Parse operator decls.
...
At the top level, if 'operator' is followed by 'infix', 'prefix', or 'postfix', consider it a contextual keyword, and parse an operator decl following it that looks like:
operator {infix|postfix|prefix} <+> {
attributes…
}
Prefix and postfix operator decls currently admit no attributes. Infix operators have 'associativity {left|right|none}' and 'precedence <int>' attributes.
This patch implements parsing for operator declarations but does not yet attach the declared attributes to func decls for the operators.
Swift SVN r4596
2013-04-03 23:30:50 +00:00
John McCall
0eb93abb96
Add the ability to metaprogram nominal type declarations.
...
Swift SVN r2403
2012-07-23 07:35:21 +00:00
Eli Friedman
6b4a248f04
Parsing and AST support for destructors on classes.
...
Swift SVN r2348
2012-07-12 01:26:02 +00:00
Eli Friedman
e5b4b924a1
More work on constructors. Basic testcases with "constructor" declarations appear to be working, although there's probably more work to be done. (Both old-style and new-style constructors work for the moment.)
...
Swift SVN r2163
2012-06-07 01:57:57 +00:00
Eli Friedman
75907029f1
Add parsing and semantic analysis for a basic ConstructorDecl. Still missing: no IRGen, and semantic analysis to actually call them.
...
Swift SVN r2159
2012-06-05 23:51:19 +00:00
Eli Friedman
5e206bc10f
Rename DistinctTypeDecl to NominalTypeDecl.
...
Swift SVN r1882
2012-05-17 01:54:15 +00:00
Eli Friedman
79c3276b07
AST representation for ClassDecls.
...
Swift SVN r1858
2012-05-15 21:53:38 +00:00
Eli Friedman
77fa49ec2b
Introduce StructDecl and StructType; use them for structs instead of OneOfDecl/OneOfType. To keep this patch small, I'm leaving in LookThroughOneOf etc. for the moment, but that's next on the agenda.
...
Swift SVN r1780
2012-05-09 00:27:44 +00:00
Doug Gregor
5f2344afe0
Introduce ProtocolDecl, which describes (*gasp*) a protocol. Move the
...
guts of ProtocolType over to ProtocolDecl.
Swift SVN r1778
2012-05-08 23:28:55 +00:00
Eli Friedman
4ca443d0f5
Add OneOfDecl; use it as a DeclContext for OneOfElementDecls instead of OneOfType, and get rid of the implicit TypeAliasDecl. Add TypeDecl as a base class for OneOfDecl and TypeAliasDecl (and StructDecl, once we have it). Adjust a whole bunch of stuff to this new scheme.
...
Swift SVN r1774
2012-05-08 21:09:42 +00:00
Chris Lattner
774a557e5c
Merge NamedDecl into ValueDecl, rdar://11379147.
...
Swift SVN r1737
2012-05-04 04:50:53 +00:00
Eli Friedman
255c5c0b14
Fix some obvious issues in DeclNodes.def found by inspection.
...
Swift SVN r1735
2012-05-04 00:51:03 +00:00
Doug Gregor
cd43490fb3
Implement semantic analysis for subscript expressions, using overload
...
resolution to pick the best subscript getter/setter pair. Does not yet
allow type coercion to influence overload resolution.
Swift SVN r1515
2012-04-19 23:01:04 +00:00
Eli Friedman
d5e7784010
Get rid of isModuleScope bit, since we don't like scattering bits across the AST; as a replacement, introduce TopLevelCodeDecl, which provides a DeclContext for all expressions and statements at the top level. <rdar://problem/11259941>.
...
Swift SVN r1503
2012-04-19 21:22:12 +00:00
Doug Gregor
06881faea2
Introduce an AST node for subscript declarations, and verify that the bodies of the getter and setter are being type-checked.
...
Swift SVN r1496
2012-04-19 20:29:48 +00:00
Eli Friedman
94244131f7
Remove ElementRefDecl and DeclVarName. Add the replacement, PatternBindingDecl. Use proper pattern parsing for variable declarations. Uniformly use PatternBindingDecl for variable initialization. Adapt type-checking and IRGen for this new style of variable declaration. <rdar://problem/11124980>.
...
Swift SVN r1312
2012-04-02 23:49:28 +00:00
John McCall
ce7780af04
I don't think we're really getting anything out of ArgDecl
...
at the moment. We can put it back if I'm wrong.
Swift SVN r1100
2012-01-26 02:08:52 +00:00
John McCall
286abfc5f7
Mostly kill off RValue. More tomorrow. :)
...
Swift SVN r1020
2012-01-12 10:18:40 +00:00
Chris Lattner
37cb633b12
Change TypeAliasDecl to be a ValueDecl, whose type is MetaTypeType.
...
Swift SVN r1004
2012-01-11 07:13:32 +00:00
Chris Lattner
e22a30a130
revert r995: "introduce MetaTypeDecl (though nothing creates it yet)".
...
After some pondering on this, I can just use DeclRefExpr(TypeAliasDecl) to
represent a named metatype, there is not need to have yet-another decl. I'm
glad about this, because it didn't seem right.
Swift SVN r999
2012-01-11 05:42:22 +00:00
Chris Lattner
f204abf010
introduce MetaTypeDecl (though nothing creates it yet)
...
Swift SVN r997
2012-01-06 20:50:56 +00:00
Chris Lattner
d666cc4fda
define ExtensionDecl.
...
Swift SVN r892
2011-11-29 22:40:24 +00:00
Chris Lattner
7e96d0d53e
embrace macro metaprogramming for decls.
...
Swift SVN r867
2011-11-10 22:08:46 +00:00