Fixing the compiler (http://smalltalk.gnu.org/project/issue/527)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Fixing the compiler (http://smalltalk.gnu.org/project/issue/527)

MrGwen
Hi,

index a98719d..550ae39 100644
--- a/packages/stinst/compiler/StartCompiler.st
+++ b/packages/stinst/compiler/StartCompiler.st
@@ -84,14 +84,13 @@ Behavior extend [

     evalString: aString to: anObject [
        <category: 'compiling'>
-       ^STInST.STEvaluationDriver new parseSmalltalk: aString
-           with: self evaluatorClass
+       ^ self evalString: aString to: anObject ifError: [ :f :l :m |
self error: (m displayString) ]
     ]

     evalString: aString to: anObject ifError: aBlock [
        <category: 'compiling'>
        ^STInST.STEvaluationDriver new
-           parseSmalltalk: aString
+           parseSmalltalk: '^ [', aString, ' ] value'
            with: self evaluatorClass
            onError:
                [:m :l |

Gwen

_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: Fixing the compiler (http://smalltalk.gnu.org/project/issue/527)

Paolo Bonzini-2
On 12/11/2010 05:29 PM, Gwenaël Casaccio wrote:

> Hi,
>
> index a98719d..550ae39 100644
> --- a/packages/stinst/compiler/StartCompiler.st
> +++ b/packages/stinst/compiler/StartCompiler.st
> @@ -84,14 +84,13 @@ Behavior extend [
>
>       evalString: aString to: anObject [
>          <category: 'compiling'>
> -       ^STInST.STEvaluationDriver new parseSmalltalk: aString
> -           with: self evaluatorClass
> +       ^ self evalString: aString to: anObject ifError: [ :f :l :m |
> self error: (m displayString) ]
>       ]
>
>       evalString: aString to: anObject ifError: aBlock [
>          <category: 'compiling'>
>          ^STInST.STEvaluationDriver new
> -           parseSmalltalk: aString
> +           parseSmalltalk: '^ [', aString, ' ] value'
>              with: self evaluatorClass
>              onError:
>                  [:m :l |
>
> Gwen
>
> _______________________________________________
> help-smalltalk mailing list
> [hidden email]
> http://lists.gnu.org/mailman/listinfo/help-smalltalk
>

Thanks!

Paolo

_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: Fixing the compiler (http://smalltalk.gnu.org/project/issue/527)

Paolo Bonzini-2
In reply to this post by MrGwen
On 12/11/2010 05:29 PM, Gwenaël Casaccio wrote:
>       evalString: aString to: anObject ifError: aBlock [
>          <category: 'compiling'>
>          ^STInST.STEvaluationDriver new
> -           parseSmalltalk: aString
> +           parseSmalltalk: '^ [', aString, ' ] value'
>              with: self evaluatorClass
>              onError:
>                  [:m :l |

Here is the correct fix, but the above code definitely set me on the right track, so thanks!

diff --git a/packages/stinst/parser/STFileParser.st b/packages/stinst/parser/STFileParser.st
index 205a595..cdc4914 100644
--- a/packages/stinst/parser/STFileParser.st
+++ b/packages/stinst/parser/STFileParser.st
@@ -128,4 +128,5 @@ RBParser subclass: STFileParser [
  tags := nil.
  node := self parseStatements.
+ node addReturn.
  node comments isNil
     ifTrue: [node comments: comments]

Paolo

_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk