But the bar is a valid binary selector which takes a text parameter
| text
| text '|' expected ->
:= self requestPassword
You seem to suggest that the parser should use formatting, presence/absence
or spaces/newlines, but it never did so, it just skips/ignores spaces.
The parser process as much as possible until the first error. It never did
a global analysis to find the minimal error. That's a far more difficult
problem.
Note that for the same kind of reason, while we could make ^ a binary
selector as I proposed once, we didn't yet by fear of interpreting things
differently in case of missing period:
self seeThePeriodMissingAtEndOfThisSentence
^self
2016-08-13 0:02 GMT+02:00 Dale Henrichs <[email protected]>:
>
>
> On 08/12/2016 11:40 AM, Nicolai Hess wrote:
>
>
>
> 2016-08-12 20:30 GMT+02:00 Dale Henrichs <[email protected]
> >:
>
>> `'|' expected` is not the error message I would expect when the message
>> pattern is missing from a method and I try to accept in browser:
>>
>>
>> | text |
>> text '|' expected ->:= self requestPassword
>> ifTrue: [ UIManager default requestPassword: self prompt ]
>> ifFalse: [ UIManager default request: self prompt initialAnswer:
>> self template ].
>> ^ (text isNil or: [ text isEmpty ])
>> ifTrue: [ nil ]
>> ifFalse: [ text ]
>>
>> The highlighter was also confused turning red at the `->` instead at the
>> very beginning of the method ...
>>
>
> yeah, this is a funny one.
> I onced debugged the parser to find out why that's happening. Can you spot
> why this is a valid method :
>
> | text |
> | ^ text
>
> :)
>
> I cheated and used the syntax highlighting to give me subtle but import
> clues :) Things I missed when initially trying to figure out what I had
> done wrong ... perhaps an error message that special cases this would be
> called for: "'|' expected or missing message message pattern" ... There are
> at least two developers who expected the syntax highlighter to do a better
> job ... and I sent this thinking about newbies running into what I assume
> would be a common mistake ...
>
> Dale
>
>
>