diff options
author | Matthias Andreas Benkard <matthias@benkard.de> | 2008-08-25 14:41:40 +0200 |
---|---|---|
committer | Matthias Andreas Benkard <matthias@benkard.de> | 2008-08-25 14:41:40 +0200 |
commit | 44bb85683c4356997aa8fc9c6fc8a05fd7101196 (patch) | |
tree | 21f12186568d1ca76724e6226c0bc66613b49fd2 | |
parent | ddf15826a5c2d7e2c1800ca976ffaa4049b29993 (diff) |
MLKForm class cluster: Add missing pieces of declaration handling.
-rw-r--r-- | MLKForm.m | 30 |
1 files changed, 28 insertions, 2 deletions
@@ -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 |