[squeak-dev] The Inbox: Compiler-ct.404.mcz
Christoph Thiede
christoph.thiede at outlook.de
Tue Jun 18 07:02:58 UTC 2019
Hi Marcel,
I recently wrote a similar extension method for own purposes:
resumeWithSource: aString
self
reparse: aString notifying: nil ifFail: nil;
resumeUnchecked: self defaultResumeValue
But it does have a different semantic than #retryUsing, which usually takes
a block?
This will work for
[Compiler evaluate: '6 times 7']
on: SyntaxErrorNotification
do: [:ex | ex resumeWithSource: '6*7'].
but not for
[Compiler evaluate: '''''''']
on: SyntaxErrorNotification
do: [:ex | ex resumeWithSource: ''''''''''].
Changing #parseCue:noPattern:ifFail: so that the initializing calls are also
handled when raising ReparseSourceAfterEditing would solve the problem:
...
doitFlag := noPattern.
[self encoder init: aCue notifying: self.
self init: myStream cue: aCue failBlock: [^ aBlock value].
subSelection := self interactive and: [cue requestor selectionInterval =
(p + 1 to: p + s size)].
failBlock:= aBlock.
methNode := self method: noPattern context: cue context]
on: ReparseAfterSourceEditing
do: [ :ex | ...
However, would this be a good approach?
Best,
Christoph
--
Sent from: http://forum.world.st/Squeak-Dev-f45488.html
More information about the Squeak-dev
mailing list
|