Skip to content

Commit

Permalink
- #notifty:at: is just used in OCSemanticError Hierarchy, remove it f…
Browse files Browse the repository at this point in the history
…rom OCSemanticWarning

- OCReadOnlyVMWarning is not needed anymore: all VMs support read only objects
- add #requestor to OCSemanticError and simplify notify:at: there
  • Loading branch information
MarcusDenker committed May 13, 2020
1 parent f4de0cb commit 2cd549c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 58 deletions.
2 changes: 0 additions & 2 deletions src/OpalCompiler-Core/CompilationContext.class.st
Expand Up @@ -274,8 +274,6 @@ CompilationContext class >> optionReadOnlyLiterals [

{ #category : #'options - settings API' }
CompilationContext class >> optionReadOnlyLiterals: aBoolean [
(aBoolean and: [ Smalltalk vm supportsWriteBarrier not]) ifTrue: [ ^ OCReadOnlyVMWarning signal ].

^ self writeDefaultOption: #optionReadOnlyLiterals value: aBoolean
]

Expand Down
33 changes: 0 additions & 33 deletions src/OpalCompiler-Core/OCReadOnlyVMWarning.class.st

This file was deleted.

15 changes: 9 additions & 6 deletions src/OpalCompiler-Core/OCSemanticError.class.st
Expand Up @@ -23,7 +23,7 @@ OCSemanticError >> compilationContext: anObject [

{ #category : #exceptiondescription }
OCSemanticError >> defaultAction [
^self notify: messageText at: node start.
^self notify: messageText at: node start
]

{ #category : #accessing }
Expand All @@ -48,17 +48,20 @@ OCSemanticError >> node: aNode [

{ #category : #'error handling' }
OCSemanticError >> notify: aString at: location [
"Refer to the comment in Object|notify:."

^compilationContext requestor
^self requestor
ifNil: [SyntaxErrorNotification
inClass: self methodClass
withCode: self methodNode source
doitFlag: false
errorMessage: aString
location: location]
ifNotNil: [compilationContext requestor
ifNotNil: [self requestor
notify: aString , ' ->'
at: location
in: compilationContext requestor text]
in: self requestor text]
]

{ #category : #accessing }
OCSemanticError >> requestor [
^ compilationContext requestor
]
17 changes: 0 additions & 17 deletions src/OpalCompiler-Core/OCSemanticWarning.class.st
Expand Up @@ -67,23 +67,6 @@ OCSemanticWarning >> node: anObject [
node := anObject
]

{ #category : #correcting }
OCSemanticWarning >> notify: aString at: location [
"Refer to the comment in Object|notify:."

^self requestor
ifNil: [SyntaxErrorNotification
inClass: self methodClass
withCode: self methodNode source
doitFlag: false
errorMessage: aString
location: location]
ifNotNil: [self requestor
notify: aString , ' ->'
at: location
in: self requestor text]
]

{ #category : #correcting }
OCSemanticWarning >> openMenuIn: aBlock [
self subclassResponsibility
Expand Down

0 comments on commit 2cd549c

Please sign in to comment.