<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p>Yahoo, merge party! ðŸŽ‰</p>
<br>
<div style="color: rgb(0, 0, 0);">
<div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>Von:</b> Squeak-dev <squeak-dev-bounces@lists.squeakfoundation.org> im Auftrag von commits@source.squeak.org <commits@source.squeak.org><br>
<b>Gesendet:</b> Donnerstag, 18. Februar 2021 14:19 Uhr<br>
<b>An:</b> squeak-dev@lists.squeakfoundation.org; packages@lists.squeakfoundation.org<br>
<b>Betreff:</b> [squeak-dev] The Trunk: Compiler-ct.449.mcz</font>
<div> </div>
</div>
</div>
<font size="2"><span style="font-size:10pt;">
<div class="PlainText">Marcel Taeumel uploaded a new version of Compiler to project The Trunk:<br>
<a href="http://source.squeak.org/trunk/Compiler-ct.449.mcz">http://source.squeak.org/trunk/Compiler-ct.449.mcz</a><br>
<br>
==================== Summary ====================<br>
<br>
Name: Compiler-ct.449<br>
Author: ct<br>
Time: 24 October 2020, 12:12:47.879256 am<br>
UUID: f4dcd413-ed53-bf47-8762-a0e1c23f7a7f<br>
Ancestors: Compiler-tobe.448<br>
<br>
Redesigns SyntaxErrorNotification to hold a CompilationCue instead of 'inClass' and 'code', in orderto allow for recompilation of syntax errors where other compilation parameters have been specified, e.g. context or environment.<br>
<br>
For example, the following syntax error could not be resolved before this patch:<br>
<br>
        Compiler new<br>
                evaluate: 'aCue yourself:'<br>
                in: thisContext sender<br>
                to: thisContext sender receiver.<br>
<br>
=============== Diff against Compiler-tobe.448 ===============<br>
<br>
Item was added:<br>
+ ----- Method: CompilationCue>>source: (in category 'accessing') -----<br>
+ source: aString<br>
+ <br>
+        source := aString.<br>
+        sourceStream := source readStream.!<br>
<br>
Item was changed:<br>
  ----- Method: Parser>>notify:at: (in category 'error handling') -----<br>
  notify: string at: location <br>
         | messageText |<br>
         messageText := '"' , string , ' ->"'.<br>
         cue requestor isNil<br>
                 ifTrue: [<br>
                         | notification |<br>
                         (encoder == self or: [encoder isNil])<br>
                                 ifTrue: [^ self fail "failure setting up syntax error"].<br>
                         (notification := SyntaxErrorNotification<br>
+                                cue: (cue copy<br>
+                                        source: (source contents asText<br>
+                                                copyReplaceFrom: location<br>
+                                                to: location - 1<br>
+                                                with: messageText);<br>
+                                        yourself)<br>
-                                inClass: encoder classEncoding<br>
-                                withCode: (source contents asText<br>
-                                        copyReplaceFrom: location<br>
-                                        to: location - 1<br>
-                                        with: messageText)<br>
                                 doitFlag: doitFlag<br>
                                 errorMessage: string<br>
                                 location: location) signal.<br>
                         notification tryNewSourceIfAvailable]<br>
                 ifFalse: [cue requestor<br>
                         notify: messageText<br>
                         at: location<br>
                         in: source].<br>
         ^ self fail!<br>
<br>
Item was changed:<br>
  Error subclass: #SyntaxErrorNotification<br>
+        instanceVariableNames: 'cue doitFlag errorMessage location newSource'<br>
-        instanceVariableNames: 'inClass code doitFlag errorMessage location newSource'<br>
         classVariableNames: ''<br>
         poolDictionaries: ''<br>
         category: 'Compiler-Exceptions'!<br>
  <br>
+ !SyntaxErrorNotification commentStamp: 'ct 10/24/2020 00:01' prior: 0!<br>
- !SyntaxErrorNotification commentStamp: 'nice 9/18/2013 22:16' prior: 0!<br>
  A SyntaxErrorNotification is an Exception occuring when compiling a Smalltalk source code with incorrect syntax.<br>
  Note that in interactive mode, this exception is not raised because the Compiler will interact directly with source code editor.<br>
  The defaultAction is to raise a SyntaxError pop up window so as to enable interactive handling even in non interactive mode.<br>
  <br>
  Instance Variables<br>
+        cue:            <CompilationCue><br>
-        category:               <String | nil><br>
-        code:           <String | Text | Stream><br>
         doitFlag:               <Boolean><br>
         errorMessage:           <String><br>
-        inClass:                <Behavior><br>
         location:               <Integer><br>
         newSource:              <String | Text | Stream | nil><br>
  <br>
+ cue<br>
+        - the cue for compilation, including receiver class, optional context, and original source code<br>
- category<br>
-        - the category in which the method will be classified<br>
  <br>
- code<br>
-        - the source code to be compiled or evaluated<br>
- <br>
  doitFlag<br>
         - true if this is a doIt (code to evaluate), false if this is a method (code of a method to be compiled)<br>
  <br>
  errorMessage<br>
         - contains information about the syntax error<br>
  <br>
- inClass<br>
-        - target class in which to compile the method<br>
- <br>
  location<br>
         - position in the source code where the syntax error occured<br>
  <br>
  newSource<br>
+        - eventually hold a source code replacement typically passed by the SyntaxError window!<br>
-        - eventually hold a source code replacement typically passed by the SyntaxError window<br>
- !<br>
<br>
Item was added:<br>
+ ----- Method: SyntaxErrorNotification class>>cue:doitFlag:errorMessage:location: (in category 'instance creation') -----<br>
+ cue: aCue doitFlag: doitFlag errorMessage: errorString location: location<br>
+ <br>
+        ^ self new<br>
+                setCue: aCue<br>
+                doitFlag: doitFlag<br>
+                errorMessage: errorString<br>
+                location: location!<br>
<br>
Item was changed:<br>
+ ----- Method: SyntaxErrorNotification class>>inClass:withCode:doitFlag:errorMessage:location: (in category 'instance creation') -----<br>
- ----- Method: SyntaxErrorNotification class>>inClass:withCode:doitFlag:errorMessage:location: (in category 'exceptionInstantiator') -----<br>
  inClass: aClass withCode: codeString doitFlag: doitFlag errorMessage: errorString location: location<br>
+ <br>
+        self deprecated: 'ct: Use #cue:doitFlag:errorMessage:location:'.<br>
+        ^ self<br>
+                cue: (CompilationCue source: codeString class: aClass requestor: nil)<br>
-        ^self new<br>
-                setClass: aClass<br>
-                code: codeString<br>
                 doitFlag: doitFlag<br>
                 errorMessage: errorString<br>
                 location: location!<br>
<br>
Item was added:<br>
+ ----- Method: SyntaxErrorNotification>>context (in category 'accessing') -----<br>
+ context<br>
+ <br>
+        ^ cue context!<br>
<br>
Item was changed:<br>
  ----- Method: SyntaxErrorNotification>>errorClass (in category 'accessing') -----<br>
  errorClass<br>
+ <br>
+        ^ cue getClass!<br>
-        ^inClass!<br>
<br>
Item was changed:<br>
  ----- Method: SyntaxErrorNotification>>errorCode (in category 'accessing') -----<br>
  errorCode<br>
+ <br>
+        ^ cue source!<br>
-        ^code!<br>
<br>
Item was changed:<br>
  ----- Method: SyntaxErrorNotification>>messageText (in category 'accessing') -----<br>
  messageText<br>
         ^ super messageText<br>
+                ifEmpty: [messageText := self errorCode]!<br>
-                ifEmpty: [messageText := code]!<br>
<br>
Item was changed:<br>
  ----- Method: SyntaxErrorNotification>>reparse:notifying:ifFail: (in category 'accessing') -----<br>
  reparse: aString notifying: aController ifFail: failBlock<br>
         "Try to parse if aString has correct syntax, but do not evaluate/install any code.<br>
         In case of incorrect syntax, execute failBlock and let a Compiler interact with the requestor.<br>
         In case of correct syntax, set newSource."<br>
+ <br>
+        (doitFlag ifTrue: [nil class] ifFalse: [self errorClass]) newCompiler<br>
+                compileCue: (cue copy<br>
+                        source: aString;<br>
+                        requestor: aController;<br>
+                        yourself)<br>
+                noPattern: doitFlag<br>
+                ifFail: failBlock.<br>
+        newSource := aString.!<br>
-        doitFlag<br>
-                ifTrue: [nil class newCompiler compileNoPattern: aString in: nil class notifying: aController ifFail: failBlock]<br>
-                ifFalse: [inClass newCompiler compile: aString in: inClass notifying: aController ifFail: failBlock].<br>
-        newSource := aString!<br>
<br>
Item was removed:<br>
- ----- Method: SyntaxErrorNotification>>setClass:code:doitFlag:errorMessage:location: (in category 'accessing') -----<br>
- setClass: aClass code: codeString doitFlag: aBoolean errorMessage: errorString location: anInteger<br>
-        inClass := aClass.<br>
-        code := codeString.<br>
-        doitFlag := aBoolean.<br>
-        errorMessage := errorString.<br>
-        location := anInteger!<br>
<br>
Item was added:<br>
+ ----- Method: SyntaxErrorNotification>>setCue:doitFlag:errorMessage:location: (in category 'initialize-release') -----<br>
+ setCue: aCue doitFlag: aBoolean errorMessage: errorString location: anInteger<br>
+ <br>
+        cue := aCue.<br>
+        doitFlag := aBoolean.<br>
+        errorMessage := errorString.<br>
+        location := anInteger!<br>
<br>
<br>
</div>
</span></font></div>
</div>
</body>
</html>