[squeak-dev] The Inbox: Compiler-ct.418.mcz
Levente Uzonyi
leves at caesar.elte.hu
Sun Feb 16 21:39:13 UTC 2020
Hi Christoph,
The idea with Environments was to move away from the SystemDictionary API.
It obviously didn't happen, but there's #classNamed: for class lookup by
name. Actually #classNamed: was there with SystemDictionary too, but it
was and still is underused.
Levente
On Sun, 16 Feb 2020, commits at source.squeak.org wrote:
> Christoph Thiede uploaded a new version of Compiler to project The Inbox:
> http://source.squeak.org/inbox/Compiler-ct.418.mcz
>
> ==================== Summary ====================
>
> Name: Compiler-ct.418
> Author: ct
> Time: 16 February 2020, 3:49:08.315 pm
> UUID: 3ca7ba74-6e8b-f64d-bc62-701ebc5df3e0
> Ancestors: Compiler-eem.416
>
> Small refactoring: Use SmalltalkImage >> #at:ifPresent:ifAbsent:.
>
> =============== Diff against Compiler-eem.416 ===============
>
> Item was changed:
> ----- Method: Compiler>>evaluateCue:ifFail: (in category 'private') -----
> evaluateCue: aCue ifFail: failBlock
> "Compiles the cue source into a parse tree, then generates code into
> a method. Finally, the compiled method is invoked from here via withArgs:executeMethod:, hence the system no longer creates Doit method
> litter on errors."
>
> | methodNode method value |
> methodNode := self compileCue: aCue noPattern: true ifFail: [^failBlock value].
>
> method := self interactive
> ifTrue: [methodNode generateWithTempNames]
> ifFalse: [methodNode generate].
>
> value := cue receiver
> withArgs: (cue context ifNil: [#()] ifNotNil: [{cue context}])
> executeMethod: method.
> + ^ value!
> - ^ value
> - !
>
> Item was changed:
> ----- Method: MethodNode>>asColorizedSmalltalk80Text (in category 'converting') -----
> asColorizedSmalltalk80Text
> "Answer a colorized Smalltalk-80-syntax string description of the parse tree whose root is the receiver."
>
> | printText |
> printText := self printString asText.
> + ^ Smalltalk
> + at: #SHTextStylerST80
> + ifPresent: [:stylerClass | stylerClass new styledTextFor: printText]
> + ifAbsent: [printText]!
> - ^(Smalltalk at: #SHTextStylerST80 ifAbsent: [nil])
> - ifNotNil: [:stylerClass| stylerClass new styledTextFor: printText]
> - ifNil: [printText]!
More information about the Squeak-dev
mailing list
|