[Pharo-dev] Multiline method definition in Tonel

Peter Uhnak i.uhnak at gmail.com
Sun Dec 9 16:27:54 EST 2018


That's just whitespace... or more specifically any of these are fine
(TonelParser>>extractSelector:)

```
separators := {
Character space.
Character tab.
Character lf.
Character newPage.
Character cr.
$: "not me though"}.
```

You can also try to parse it directly and see the result:

```
def := 'Class {
#name : #Whatever,
#superclass : #Object,
#category : ''Wherever''
}

{ #category : #protocol }
Whatever >> testWith: arg1
with: arg2
with: arg3 [
^ 42
]
'.
TonelParser parseStream: def readStream.
```

Note that exporting it will result in a "normalized" format, so if you keep
it in git you will see a change (this also applies to the ordering of
methods and some optional stuff)

Peter

On Fri, Dec 7, 2018 at 5:57 PM Mariano Martinez Peck <marianopeck at gmail.com>
wrote:

> Hi guys,
>
> I was reading the Tonel spec here [1] but it is not clear to me the case
> of the multiline method definitions. Are those allowed or not?  Say I have
> a method like this:
>
> testWith: arg1
>      with: arg2
>      with: arg3
>
> ^ 42
>
> Is that valid as Tonel format? Or tonel expects to have method definition
> in a one liner like:
>
> testWith: arg1 with: arg2 with: arg3
>
> ^ 42
>
>
> Thanks in advance,
>
>
> [1] https://github.com/pharo-vcs/tonel
>
> --
> Mariano
> https://twitter.com/MartinezPeck
> http://marianopeck.wordpress.com
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pharo.org/pipermail/pharo-dev_lists.pharo.org/attachments/20181209/88537131/attachment.html>


More information about the Pharo-dev mailing list