[squeak-dev] The Trunk: Morphic-ct.1893.mcz

Marcel Taeumel marcel.taeumel at hpi.de
Mon Feb 14 10:06:00 UTC 2022

Okay. ;-)

Am 12.02.2022 16:33:51 schrieb commits at source.squeak.org <commits at source.squeak.org>:
Christoph Thiede uploaded a new version of Morphic to project The Trunk:

==================== Summary ====================

Name: Morphic-ct.1893
Author: ct
Time: 12 February 2022, 4:33:08.438701 pm
UUID: 7db558ba-ba08-1748-9019-1151f7528b79
Ancestors: Morphic-mt.1892

Adds optional model hook #evaluateExpression:requestor: to TextEditor, allowing models to pass the original requestor to the compiler.

=============== Diff against Morphic-mt.1892 ===============

Item was changed:
----- Method: TextEditor>>evaluateSelectionAndDo: (in category 'do-its') -----
evaluateSelectionAndDo: aBlock
"Treat the current selection as an expression; evaluate it and invoke aBlock with the result."
| result rcvr ctxt |
self lineSelectAndEmptyCheck: [^ nil].
+ (model respondsTo: #evaluateExpression:requestor:) ifTrue: [
+ ^ aBlock value: (model perform: #evaluateExpression:requestor: with: self selection with: self)].
(model respondsTo: #evaluateExpression:) ifTrue: [
^ aBlock value: (model perform: #evaluateExpression: with: self selection)].
(model respondsTo: #doItReceiver)
ifTrue: [ rcvr := model doItReceiver.
ctxt := model doItContext]
ifFalse: [rcvr := ctxt := nil].
result := [
rcvr class evaluatorClass new
evaluate: self selectionAsStream
in: ctxt
to: rcvr
environment: (model environment ifNil: [Smalltalk globals])
notifying: self
+ ifFail: [self flash. ^ nil]
- ifFail: [morph flash. ^ nil]
logged: true.
on: OutOfScopeNotification
do: [ :ex | ex resume: true].

(model respondsTo: #expressionEvaluated:result:) ifTrue: [
model perform: #expressionEvaluated:result: with: self selection with: result].

^aBlock value: result!

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20220214/54706606/attachment.html>

More information about the Squeak-dev mailing list