On Tue, Jun 28, 2016 at 9:31 PM, Marcus Denker <marcus.den...@inria.fr> wrote:
>
> On 28 Jun 2016, at 15:09, Guillermo Polito <guillermopol...@gmail.com>
> wrote:
>
> Ding dong Marcus!
>
>
> … is on Holidays… with the option #optionParseErrors you can compile code
> with syntax errors:

wow! quite an intelligent bot you are there.  written in Smalltalk?
maybe when Marcus is back you can ask him to share the source ;)
cheers -ben

>
> method := Smalltalk compiler
> class: UndefinedObject;
> options: #(+ optionParseErrors);
> compile: 'errorMethod ^1+'.
> method valueWithReceiver: nil arguments: #()
> This is really compiled to raise a syntax error at runtime. see
>
> OCASTTranslator>>#visitParseErrorNode: anErrorNode
> methodBuilder
> pushLiteralVariable: #error -> anErrorNode asSyntaxErrorNotification;
> send: #signal.
>
> with
>
> RBParseErrorNode>>#asSyntaxErrorNotification
> ^SyntaxErrorNotification new
> setClass: self methodNode methodClass
> category: nil
> code: self methodNode source
> doitFlag: false
> errorMessage: errorMessage
> location: self start
>
>
> Marcus

Reply via email to