David T. Lewis uploaded a new version of Compiler to project The Trunk:
http://source.squeak.org/trunk/Compiler-jr.329.mcz ==================== Summary ==================== Name: Compiler-jr.329 Author: jr Time: 28 February 2017, 12:19:04.434081 am UUID: 6053da84-5a5b-b043-8dcc-019bc75762df Ancestors: Compiler-nice.328 add method variants with environment parameters =============== Diff against Compiler-nice.328 =============== Item was added: + ----- Method: CompilationCue class>>source:context:class:environment:requestor: (in category 'instance creation') ----- + source: aTextOrStream context: aContext class: aClass environment: anEnvironment requestor: reqObject + ^ self basicNew + initializeWithSource: aTextOrStream + context: aContext + receiver: (aContext ifNotNil: [aContext receiver]) + class: aClass + environment: anEnvironment + requestor: reqObject! Item was added: + ----- Method: CompilationCue class>>source:environment:requestor: (in category 'instance creation') ----- + source: aString environment: anEnvironment requestor: aRequestor + ^ self + source: aString + context: nil + receiver: nil + class: UndefinedObject + environment: anEnvironment + requestor: aRequestor! Item was added: + ----- Method: Compiler class>>evaluate:in:notifying:logged: (in category 'evaluating logged') ----- + evaluate: textOrString in: anEnvironment notifying: aController logged: logFlag + "Compile and execute the argument, textOrString in anEnvironment. + If a compilation error occurs, notify aController. If both + compilation and execution are successful then, if logFlag is true, log + (write) the text onto a system changes file so that it can be replayed if + necessary." + + ^ self new + evaluate: textOrString + in: anEnvironment + notifying: aController + logged: logFlag.! Item was added: + ----- Method: Compiler>>compile:in:environment:notifying:ifFail: (in category 'public access') ----- + compile: textOrStream in: aClass environment: anEnvironment notifying: aRequestor ifFail: failBlock + "Answer a MethodNode for the argument, textOrStream. If the + MethodNode can not be created, notify the argument, aRequestor; if + aRequestor is nil, evaluate failBlock instead. The MethodNode is the root + of a parse tree. It can be told to generate a CompiledMethod to be + installed in the method dictionary of the argument, aClass." + + ^self + compileCue: (CompilationCue + source: textOrStream + class: aClass + environment: anEnvironment + requestor: aRequestor) + noPattern: false + ifFail: failBlock + ! Item was added: + ----- Method: Compiler>>compileNoPattern:in:context:environment:notifying:ifFail: (in category 'public access') ----- + compileNoPattern: textOrStream in: aClass context: aContext environment: anEnvironment notifying: aRequestor ifFail: failBlock + "Similar to #compile:in:notifying:ifFail:, but the compiled code is + expected to be a do-it expression, with no message pattern, + and it will be in an explicit environment." + + ^self + compileCue: (CompilationCue + source: textOrStream + context: aContext + class: aClass + environment: anEnvironment + requestor: aRequestor) + noPattern: true + ifFail: failBlock + ! Item was added: + ----- Method: Compiler>>evaluate:in:environment:notifying:ifFail:logged: (in category 'public access logging') ----- + evaluate: textOrStream in: aContext environment: anEnvironment notifying: aRequestor ifFail: failBlock logged: logFlag + "Compiles the sourceStream into a parse tree, then generates code into + a method. 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. Finally, the + compiled method is invoked from here via withArgs:executeMethod:, hence + the system no longer creates Doit method litter on errors." + ^self + evaluateCue: (CompilationCue + source: textOrStream + context: aContext + receiver: nil + class: UndefinedObject + environment: anEnvironment + requestor: aRequestor) + ifFail: failBlock + logged: logFlag! Item was added: + ----- Method: Compiler>>evaluate:in:notifying:logged: (in category 'public access logging') ----- + evaluate: textOrString in: anEnvironment notifying: aController logged: logFlag + "Compile and execute the argument, textOrString in anEnvironment. + If a compilation error occurs, notify aController. If both + compilation and execution are successful then, if logFlag is true, log + (write) the text onto a system changes file so that it can be replayed if + necessary." + + ^self + evaluate: textOrString + in: nil + environment: anEnvironment + notifying: aController + ifFail: [^nil] + logged: logFlag! Item was added: + ----- Method: Compiler>>evaluate:in:to:environment:notifying:ifFail:logged: (in category 'public access logging') ----- + evaluate: textOrStream in: aContext to: receiver environment: anEnvironment notifying: aRequestor ifFail: failBlock logged: logFlag + "Same as #evaluate:in:to:notifying:ifFail:logged: but with an explicit environment" + | theClass | + theClass := (aContext == nil ifTrue: [receiver class] ifFalse: [aContext methodClass]). + ^self + evaluateCue: (CompilationCue + source: textOrStream + context: aContext + receiver: receiver + class: theClass + environment: anEnvironment + requestor: aRequestor) + ifFail: failBlock + logged: logFlag! |
Free forum by Nabble | Edit this page |