[squeak-dev] The Trunk: Compiler-ct.468.mcz
commits at source.squeak.org
commits at source.squeak.org
Mon Feb 7 20:18:27 UTC 2022
Christoph Thiede uploaded a new version of Compiler to project The Trunk:
http://source.squeak.org/trunk/Compiler-ct.468.mcz
==================== Summary ====================
Name: Compiler-ct.468
Author: ct
Time: 7 February 2022, 9:15:41.34029 pm
UUID: 97a5d3e3-3885-474c-b539-57e0a2310dbb
Ancestors: Compiler-mt.467
Makes UndeclaredVariableWarning a notification and renames it into UndeclaredVariableNotification. UndeclaredVariableWarning is still available via 60Deprecated.
Note that in a later revision, we could also unify this exception with UndeclaredVariable, which is a subclass of ParserNotification.
See: http://lists.squeakfoundation.org/pipermail/squeak-dev/2022-January/218508.html
=============== Diff against Compiler-mt.467 ===============
Item was changed:
----- Method: Encoder>>undeclared: (in category 'encoding') -----
undeclared: name
| sym |
(requestor notNil and: [requestor interactive]) ifTrue:
[ requestor requestor == #error: ifTrue: [ requestor error: 'Undeclared' ].
^ self notify: 'Undeclared' ].
"Allow knowlegeable clients to squash the undeclared warning if they want (e.g.
Diffing pretty printers that are simply formatting text). As this breaks
compilation it should only be used by clients that want to discard the result
of the compilation. To squash the warning use e.g.
[Compiler format: code in: class notifying: nil decorated: false]
+ on: UndeclaredVariableNotification
- on: UndeclaredVariableWarning
do: [:ex| ex resume: false]"
sym := name asSymbol.
+ ^ (UndeclaredVariableNotification new
- ^ (UndeclaredVariableWarning new
name: name
selector: selector
class: cue getClass) signal
ifTrue:
[ | undeclared |
undeclared := cue environment undeclared.
[ undeclared
at: sym
put: nil ]
on: AttemptToWriteReadOnlyGlobal
do: [ : noti | noti resume: true ].
self
global: (undeclared associationAt: sym)
name: sym ]
ifFalse:
[ self
global: (Association key: sym)
name: sym ]!
Item was added:
+ Notification subclass: #UndeclaredVariableNotification
+ instanceVariableNames: 'name selector class'
+ classVariableNames: ''
+ poolDictionaries: ''
+ category: 'Compiler-Support'!
Item was added:
+ ----- Method: UndeclaredVariableNotification>>defaultAction (in category 'exceptionDescription') -----
+ defaultAction
+ "The user should be notified of the occurrence of an exceptional occurrence and
+ given an option of continuing or aborting the computation. The description of the
+ occurrence should include any text specified as the argument of the #signal: message."
+
+ selector ifNotNil: [Transcript cr; nextPutAll: class name, '>>', selector, ' ']
+ ifNil: [Transcript cr ].
+ Transcript show: '(' , name , ' is Undeclared) '.
+ ^true!
Item was added:
+ ----- Method: UndeclaredVariableNotification>>defaultResumeValue (in category 'initialize-release') -----
+ defaultResumeValue
+ "Answer the value that by default should be returned if the exception is resumed"
+ ^true!
Item was added:
+ ----- Method: UndeclaredVariableNotification>>name:selector:class: (in category 'initialize-release') -----
+ name: aString selector: aSymbolOrNil class: aBehavior
+ name := aString.
+ selector := aSymbolOrNil.
+ class := aBehavior!
Item was removed:
- Warning subclass: #UndeclaredVariableWarning
- instanceVariableNames: 'name selector class'
- classVariableNames: ''
- poolDictionaries: ''
- category: 'Compiler-Support'!
Item was removed:
- ----- Method: UndeclaredVariableWarning>>defaultAction (in category 'exceptionDescription') -----
- defaultAction
- "The user should be notified of the occurrence of an exceptional occurrence and
- given an option of continuing or aborting the computation. The description of the
- occurrence should include any text specified as the argument of the #signal: message."
-
- selector ifNotNil: [Transcript cr; nextPutAll: class name, '>>', selector, ' ']
- ifNil: [Transcript cr ].
- Transcript show: '(' , name , ' is Undeclared) '.
- ^true!
Item was removed:
- ----- Method: UndeclaredVariableWarning>>defaultResumeValue (in category 'initialize-release') -----
- defaultResumeValue
- "Answer the value that by default should be returned if the exception is resumed"
- ^true!
Item was removed:
- ----- Method: UndeclaredVariableWarning>>name:selector:class: (in category 'initialize-release') -----
- name: aString selector: aSymbolOrNil class: aBehavior
- name := aString.
- selector := aSymbolOrNil.
- class := aBehavior!
More information about the Squeak-dev
mailing list
|