summaryrefslogtreecommitdiff
path: root/MLKForm.m
diff options
context:
space:
mode:
Diffstat (limited to 'MLKForm.m')
-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