[Pharo-dev] Compilation code in grease not compatible with Pharo 3.0

Damien Cassou damien.cassou at gmail.com
Tue Aug 27 13:19:21 EDT 2013


Hi,

how can I make the following code compile in Pharo 3.0? This is part of
Grease (
https://ci.inria.fr/pharo-contribution/job/Grease/PHARO=30,VERSION=stable,VM=vm/
):

GRPharoPlatform>>compile: aString into: aClass classified: aSymbol
    "The trick here is to be as silently a possible so that the package is
not marked dirty when running WAFileLibrary test.
    This also makes running tests much faster."
    | methodNode compiledMethod selector methodAndNode |
    methodNode := aClass compilerClass new
        compile: aString
        in: aClass
        notifying: nil
        ifFail: [ GRError signal: 'syntax error' ].
    selector := methodNode selector.
    methodAndNode := CompiledMethodWithNode
        generateMethodFromNode: methodNode
        trailer: aClass defaultMethodTrailer.
    compiledMethod := methodAndNode method.
    compiledMethod
        putSource: aString
        fromParseNode: methodAndNode node
        inFile: 2
        withPreamble: [ :file |
            aClass
                printCategoryChunk: aSymbol asString
                on: file priorMethod: (aClass compiledMethodAt: selector
ifAbsent: [ nil ]).
            file cr ].
    aClass
        addSelectorSilently: selector
        withMethod: compiledMethod.
    self doSilently:  [
        aClass organization
            classify: selector
            under: aSymbol ]

-- 
Damien Cassou
http://damiencassou.seasidehosting.st

"Success is the ability to go from one failure to another without losing
enthusiasm."
Winston Churchill
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pharo.org/pipermail/pharo-dev_lists.pharo.org/attachments/20130827/245df87a/attachment-0002.html>


More information about the Pharo-dev mailing list