From 44bb85683c4356997aa8fc9c6fc8a05fd7101196 Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Mon, 25 Aug 2008 14:41:40 +0200 Subject: MLKForm class cluster: Add missing pieces of declaration handling. --- MLKForm.m | 30 ++++++++++++++++++++++++++++-- 1 file 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 -- cgit v1.2.3