[PATCH] Fix keyword attributes in STCompiler

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

[PATCH] Fix keyword attributes in STCompiler

Gwenaël Casaccio
Hi,

STCompiler can't handle keyword attributes here is a fix.

Gwen

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

0001-stinst-Fix-support-for-keyword-attributes.patch (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Fix keyword attributes in STCompiler

Holger Freyther
On Wed, Apr 02, 2014 at 04:46:46PM +0200, Gwenaël Casaccio wrote:

> Hi,
>
> STCompiler can't handle keyword attributes here is a fix.
>   arguments := WriteStream on: Array new.
>   currentToken := self scanTokenFrom: scanner.
> +        currentToken isIdentifier                                              
> +                    ifTrue: [ (self scanTokenFrom: scanner) value == #> ifFalse: [^self compileError: 'method attributes must end with ''>'''].  
> +                              selectorBuilder nextPutAll: currentToken value. ]
> +                    ifFalse: [
>   [currentToken isBinary and: [currentToken value == #>]] whileFalse:
>   [currentToken isKeyword
>      ifFalse: [^self compileError: 'keyword expected in method attribute'].
> @@ -994,7 +998,7 @@ indexed'' bytecode. The resulting stream is
>   node := argParser parseBinaryMessageNoGreater.
>   node := RBSequenceNode statements: {node}.
>   arguments nextPut: (self class evaluate: node parser: argParser).
> - currentToken := argParser currentToken].
> + currentToken := argParser currentToken]].

Oh ha? Formatting is very odd here. Can you fix/align it?

> +    testAttributes [
> +        <category: 'testing'>
> +
> +        self deny: (Smalltalk includesGlobalNamed: #CompilerAttributes).

> +        self assert: ((Smalltalk CompilerAttributes CAttributes) >> #foo2) attributes first arguments second = 234.

Can you delete the CompilerAttributes namespace and classes?
This way we can run the unit test multiple times (e.g. when VisualGST
works more reliable we will end up doing it).

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