[squeak-dev] The Inbox: System-ct.1303.mcz
commits at source.squeak.org
commits at source.squeak.org
Mon Feb 7 20:46:11 UTC 2022
A new version of System was added to project The Inbox:
http://source.squeak.org/inbox/System-ct.1303.mcz
==================== Summary ====================
Name: System-ct.1303
Author: ct
Time: 7 February 2022, 9:46:07.019465 pm
UUID: 84c77d47-9ac2-644a-a2d0-2bf8cc5ff4d0
Ancestors: System-mt.1302
Proposal: Adds support for translations of the pattern "withCRs translated". This is a first iteration of this pattern; if the proposal is well received, the implementation by be generalized. However, we must not forget that we only should support a minimal pattern of selectors here; #translated should only be sent to literal expressions such as 'hello' or 'hello\world' withCRs.
See http://lists.squeakfoundation.org/pipermail/squeak-dev/2022-February/218959.html.
=============== Diff against System-mt.1302 ===============
Item was changed:
----- Method: TranslatedReceiverFinder>>findWordsWith:in: (in category 'accessing') -----
findWordsWith: aSymbol in: aMethodReference
"Find words for translation with the symbol in a method. See
LanguageEditorTest >>testFindTranslatedWords"
"| message |
message := MethodReference new setStandardClass: Morph class
methodSymbol: #supplementaryPartsDescriptions.
self new findWordsWIth: #translatedNoop in: message"
| messages keywords aParseNode |
aParseNode := aMethodReference decompile.
"Find from string literal"
messages := Set new.
self
search: aSymbol
messageNode: aParseNode
addTo: messages.
keywords := OrderedCollection new.
messages
select: [:aMessageNode | aMessageNode receiver isMemberOf: LiteralNode]
thenDo: [:aMessageNode | aMessageNode receiver key
literalStringsDo: [:literal | keywords add: literal]].
+ messages
+ select: [:aMessageNode | (aMessageNode receiver isMemberOf: MessageNode)
+ and: [aMessageNode receiver selector key = #withCRs]
+ and: [aMessageNode receiver receiver isMemberOf: LiteralNode]]
+ thenDo: [:aMessageNode | aMessageNode receiver receiver key
+ literalStringsDo: [:literal | keywords add: literal withCRs]].
"Find from array literal"
self
arraySearch: aSymbol
messageNode: aParseNode
addTo: keywords.
^ keywords!
More information about the Squeak-dev
mailing list
|