Created
November 11, 2017 15:05
-
-
Save peteruhnak/e2235e43a25feb6cf0d7196192cf8aea to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
OpalCompiler>>compile | |
| cm | | |
[ [ ast := self parse. | |
self doSemanticAnalysis. | |
self callPlugins ] | |
on: OCSourceCodeChanged | |
do: [ :notification | | |
self source: notification newSourceCode. | |
notification retry ]. | |
cm := ast generate: self compilationContext compiledMethodTrailer ] | |
on: SyntaxErrorNotification | |
do: [ :exception | | |
self compilationContext requestor | |
ifNotNil: [ self compilationContext requestor | |
notify: exception errorMessage , ' ->' | |
at: exception location | |
in: exception errorCode. | |
^ self compilationContext failBlock value ] | |
ifNil: [ | code | | |
code := exception errorCode. | |
Transcript | |
show: | |
(code copyFrom: 1 to: exception location - 1) , exception errorMessage , ' ->' | |
, (code copyFrom: exception location to: code size); | |
cr. | |
^ self compilationContext failBlock value " exception pass" ] ]. | |
^ cm |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment