Christoph Thiede uploaded a new version of Compiler to project The Trunk: http://source.squeak.org/trunk/Compiler-ct.496.mcz
==================== Summary ====================
Name: Compiler-ct.496 Author: ct Time: 24 February 2024, 9:33:48.264459 pm UUID: 8600e29a-71b6-3347-9990-efef5c84e76d Ancestors: Compiler-mt.495
Fixes source logging after fixing a syntax error. In the past, the old source was stored in the logs instead of the new one.
=============== Diff against Compiler-mt.495 ===============
Item was changed: ----- Method: Compiler>>compiledMethodFor:in:to:notifying:ifFail: (in category 'public access') ----- compiledMethodFor: textOrStream in: aContext to: receiver notifying: aRequestor ifFail: failBlock - "Compiles the sourceStream into a parse tree, then generates code - into a method, and answers it. If receiver is not nil, then the text can - refer to instance variables of that receiver (the Inspector uses this). - If aContext is not nil, the text can refer to temporaries in that context - (the Debugger uses this). If aRequestor is not nil, then it will receive a - notify:at: message before the attempt to evaluate is aborted."
+ ^ self + compiledMethodFor: textOrStream + in: aContext + to: receiver - | methodNode method | - methodNode := self - compileNoPattern: textOrStream - in: (self classForReceiver: receiver context: aContext) - context: aContext notifying: aRequestor + ifFail: failBlock + logged: false! - ifFail: [^failBlock value]. - method := self interactive - ifTrue: [ methodNode generateWithTempNames ] - ifFalse: [ methodNode generate ]. - ^method!
Item was changed: ----- Method: Compiler>>compiledMethodFor:in:to:notifying:ifFail:logged: (in category 'public access logging') ----- compiledMethodFor: textOrStream in: aContext to: receiver notifying: aRequestor ifFail: failBlock logged: logFlag "Compiles the sourceStream into a parse tree, then generates code into a method, and answers it. If receiver is not nil, then the text can refer to instance variables of that receiver (the Inspector uses this). If aContext is not nil, the text can refer to temporaries in that context (the Debugger uses this). If aRequestor is not nil, then it will receive a notify:at: message before the attempt to evaluate is aborted."
+ | methodNode method | + methodNode := self + compileNoPattern: textOrStream + in: (self classForReceiver: receiver context: aContext) + context: aContext - | method | - method := self - compiledMethodFor: textOrStream - in: aContext - to: receiver notifying: aRequestor ifFail: [^failBlock value]. + method := self interactive + ifTrue: [ methodNode generateWithTempNames ] + ifFalse: [ methodNode generate ]. + logFlag ifTrue: + [SystemChangeNotifier uniqueInstance + evaluated: (methodNode basicSourceText ifNil: [cue stringToLog]) "honor possible source updates (e.g., due to ReparseAfterSourceEditing)" + context: aContext]. + - [SystemChangeNotifier uniqueInstance evaluated: cue stringToLog context: aContext]. ^method!
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."
+ ^ self + evaluateCue: aCue + ifFail: failBlock + logged: false! - | 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 - !
Item was changed: ----- Method: Compiler>>evaluateCue:ifFail:logged: (in category 'private') ----- evaluateCue: aCue ifFail: failBlock logged: logFlag "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 := self evaluateCue: aCue ifFail: [^failBlock value]. logFlag ifTrue: + [SystemChangeNotifier uniqueInstance + evaluated: (methodNode basicSourceText ifNil: [cue stringToLog]) "honor possible source updates (e.g., due to ReparseAfterSourceEditing)" + context: cue context]. + + ^ value! - [SystemChangeNotifier uniqueInstance evaluated: cue stringToLog context: cue context]. - ^ value - !
Item was added: + ----- Method: MethodNode>>basicSourceText (in category 'printing') ----- + basicSourceText + + ^ sourceText!
packages@lists.squeakfoundation.org