summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Andreas Benkard <matthias@benkard.de>2008-08-25 14:41:40 +0200
committerMatthias Andreas Benkard <matthias@benkard.de>2008-08-25 14:41:40 +0200
commit44bb85683c4356997aa8fc9c6fc8a05fd7101196 (patch)
tree21f12186568d1ca76724e6226c0bc66613b49fd2
parentddf15826a5c2d7e2c1800ca976ffaa4049b29993 (diff)
MLKForm class cluster: Add missing pieces of declaration handling.
-rw-r--r--MLKForm.m30
1 files changed, 28 insertions, 2 deletions
diff --git a/MLKForm.m b/MLKForm.m
index edf3368..2105ef8 100644
--- a/MLKForm.m
+++ b/MLKForm.m
@@ -294,10 +294,23 @@
@implementation MLKDeclaringForm
-(void) splitDeclarationsAndBody:(id)object
{
+ id rest;
+
+ LASSIGN (_body, nil);
+
MLKSplitDeclarationsDocAndForms(&_declarations, NULL, &_body, object, NO);
LRETAIN (_declarations);
LRETAIN (_body);
- _declarationForms = nil;
+
+ _declarationForms = [[NSMutableArray alloc] init];
+
+ for (rest = _declarations; rest; rest = [rest cdr])
+ {
+ [(NSMutableArray*)_declarationForms addObject:[MLKDeclarationForm
+ formWithObject:[rest car]
+ inContext:_context
+ forCompiler:_compiler]];
+ }
}
-(id) declarationsWithForms:(id)object
@@ -323,10 +336,23 @@
@implementation MLKDocstringForm
-(void) splitDeclarationsAndBody:(id)object
{
+ id rest;
+
+ LASSIGN (_body, nil);
+
MLKSplitDeclarationsDocAndForms(&_declarations, &_documentation, &_body, object, YES);
LRETAIN (_declarations);
LRETAIN (_body);
- _declarationForms = nil;
+
+ _declarationForms = [[NSMutableArray alloc] init];
+
+ for (rest = _declarations; rest; rest = [rest cdr])
+ {
+ [(NSMutableArray*)_declarationForms addObject:[MLKDeclarationForm
+ formWithObject:[rest car]
+ inContext:_context
+ forCompiler:_compiler]];
+ }
}
-(void) dealloc