Skip to content

Instantly share code, notes, and snippets.

@peteruhnak
Created November 11, 2017 15:05
Show Gist options
  • Save peteruhnak/e2235e43a25feb6cf0d7196192cf8aea to your computer and use it in GitHub Desktop.
Save peteruhnak/e2235e43a25feb6cf0d7196192cf8aea to your computer and use it in GitHub Desktop.
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