Göran Krampe <goran <at> krampe.se> writes:
> > Mmmmmm, you mean for example in an array like: > > {"delta": { > "method-source-change": { > "class" : "SomeClass", > "protocol": "some-method-category", > "stamp" : "elder 3/21/1996 12:34", > "source": [ > "method line one with a \"comment\" in it.", > "method line two with two tabs: \t\t", > "method line three", > "method line four", > "method line five", > ] > } > } > ...well, sure. Not too shabby, I agree. Good idea! > > regards, Göran > > Goran, what is the advantage of above array over this syntax: builder addDelta: ( builder methodSourceChange class: 'SomeClass'; protocol: 'some-method-category'; stamp: 'elder 3/21/1996 12:34'; source: thisFile nextBracketedString). [method line one with a "comment" in it. method line two with two plain tabs: "who needs a \t?" method line three method line four method line five] Details for solving case of few methods having unbalanced brackets [] ? Just use thisFile nextBracketedStringWithEscapeSequence in this case. |
2009/3/13 Nicolas Cellier <[hidden email]>:
> Göran Krampe <goran <at> krampe.se> writes: > >> >> Mmmmmm, you mean for example in an array like: >> >> {"delta": { >> "method-source-change": { >> "class" : "SomeClass", >> "protocol": "some-method-category", >> "stamp" : "elder 3/21/1996 12:34", >> "source": [ >> "method line one with a \"comment\" in it.", >> "method line two with two tabs: \t\t", >> "method line three", >> "method line four", >> "method line five", >> ] >> } >> } >> ...well, sure. Not too shabby, I agree. Good idea! >> >> regards, Göran >> >> > > Goran, what is the advantage of above array over this syntax: > > builder addDelta: ( > builder methodSourceChange > class: 'SomeClass'; > protocol: 'some-method-category'; > stamp: 'elder 3/21/1996 12:34'; > source: thisFile nextBracketedString). > [method line one with a "comment" in it. > method line two with two plain tabs: "who needs a \t?" > method line three > method line four > method line five] > > Details for solving case of few methods having unbalanced brackets [] ? > Just use thisFile nextBracketedStringWithEscapeSequence in this case. > > ... source: thisFile uptoNewLineAndEnd). method line one with a "comment" in it. method line two with two plain tabs: "who needs a \t?" method line three method line four method line five END in this case you don't have to be careful about balanced brackets or escaping quotes. It can scan the source up to the cr, 'END' characters sequence. And in case if method source occasionally contains such sequence (which can be determined easily), then use different one, randomly choosen: source: (thisFile uptoCrWith:'xyz'). method line one with a "comment" in it. method line two with two plain tabs: "who needs a \t?" method line three method line four method line five xyz > > > > -- Best regards, Igor Stasenko AKA sig. |
Free forum by Nabble | Edit this page |