Hi
I encountered a strange bug that you can reproduce with the two methods below. Apparently RBParser changed in 7.6. Is it true? Then the bug is fishy because we get a NonBoolean receiver but when I inspect and executed each of the statement of patchLiteralArrayToken (self patchLiteralArrayEmbeddedAssignmentToken or: [self patchLiteralArraySpecialToken or: [self patchLiteralArrayDottedNameToken ifFalse: [self patchLiteralArraySymbolToken ]]]) ifFalse: [^self parserError: #InvalidToken << #browser >> 'Invalid token'] I get booleans. and patchLiteralArraySymbolToken is returning boolean. So I do not understand why I get an exception telling to me that receiver is not a boolean. In addition we looked at the byte and it looks correct. May be we missed something obvious. Stef test "self new test" ^Refactory.Browser.RBParser parseMethod: (ZorkTest sourceCodeAt: #modelVersion3) onError: [:aString :pos | ^nil] modelVersion3 ^ #(Moose.Model (entity (FAMIX.Namespace (id: 1) (name aNamespace)) (FAMIX.Class (id: 2) (name ClassA) (belongsTo (idref: 1)) (packagedIn (idref: 201))) (FAMIX.Method (name methodA1) (signature 'methodA1()') (belongsTo (idref: 2)) (LOC 4)) (FAMIX.Method (name methodA2) (signature 'methodA2()') (belongsTo (idref: 2)) (LOC 5)) (FAMIX.Attribute (name attributeA1) (belongsTo (idref: 2))) (FAMIX.Attribute (name attributeA2) (belongsTo (idref: 2))) (FAMIX.Class (id: 3) (name ClassB) (belongsTo (idref: 1)) (packagedIn (idref: 201))) (FAMIX.Attribute (name attributeB1) (belongsTo (idref: 3))) (FAMIX.InheritanceDefinition (subclass (idref: 3)) (superclass (idref: 2))) (FAMIX.Class (id: 4) (name ClassC) (belongsTo (idref: 1)) (packagedIn (idref: 202))) (FAMIX.Method (name methodC1) (signature 'methodC1()') (belongsTo (idref: 4)) (LOC 4)) (FAMIX.Method (name methodC2) (signature 'methodC2()') (belongsTo (idref: 4)) (LOC 10)) (FAMIX.Method (name methodC3) (signature 'methodC3()') (belongsTo (idref: 4)) (LOC 7)) (FAMIX.Attribute (name attributeC1) (belongsTo (idref: 4))) (FAMIX.Attribute (name attributeC2) (belongsTo (idref: 4))) (FAMIX.InheritanceDefinition (subclass (idref: 4)) (superclass (idref: 2))) (FAMIX.Class (id: 5) (name ClassD) (belongsTo (idref: 1)) (packagedIn (idref: 202))) (FAMIX.Method (name methodD1) (signature 'methodD1()') (belongsTo (idref: 5)) (LOC 3)) (FAMIX.InheritanceDefinition (subclass (idref: 5)) (superclass (idref: 4))) (FAMIX.Package (id: 201) (name aPackage)) (FAMIX.Package (id: 202) (name anotherPackage)) )) _______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc |
stéphane ducasse schrieb:
> Hi > > I encountered a strange bug that you can reproduce with the two > methods below. > Apparently RBParser changed in 7.6. > Is it true? > > Then the bug is fishy because we get a NonBoolean receiver but when I > inspect and executed each of the statement > > of > > patchLiteralArrayToken > (self patchLiteralArrayEmbeddedAssignmentToken > or: > [self patchLiteralArraySpecialToken > or: > [self patchLiteralArrayDottedNameToken > ifFalse: [self patchLiteralArraySymbolToken ]]]) > ifFalse: > [^self parserError: #InvalidToken << #browser >> 'Invalid token'] > > I get booleans. > and patchLiteralArraySymbolToken is returning boolean. > So I do not understand why I get an exception telling to me that > receiver is not a boolean. > In addition we looked at the byte and it looks correct. > May be we missed something obvious. "self patchLiteralArrayDottedNameToken" lacks an ifTrue: patchLiteralArrayToken ( self patchLiteralArrayEmbeddedAssignmentToken or: [ self patchLiteralArraySpecialToken or: [ self patchLiteralArrayDottedNameToken ifTrue: [ self halt: 'hmmm what shall we do here?' ] ifFalse: [ self patchLiteralArraySymbolToken ] ] ]) ifFalse: [ ^ self parserError: #InvalidToken << #browser >> 'Invalid token' ]. _______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc |
In reply to this post by stéphane ducasse-2
Hi Stef,
that's my bug, I saw it first :-) On Mon, 21 Apr 2008 22:36:01 +0200 stéphane ducasse <[hidden email]> wrote: > Then the bug is fishy because we get a NonBoolean receiver but when I > inspect and executed each of the statement > > of > > patchLiteralArrayToken > (self patchLiteralArrayEmbeddedAssignmentToken > or: > [self patchLiteralArraySpecialToken > or: > [self patchLiteralArrayDottedNameToken > ifFalse: [self patchLiteralArraySymbolToken ]]]) > ifFalse: > [^self parserError: #InvalidToken << #browser >> 'Invalid token'] > > I get booleans. > and patchLiteralArraySymbolToken is returning boolean. The problem is one line above: #patchLiteralArrayDottedNameToken might return true, and 'true ifFalse: [0]' evaluates to nil. There is an AR open for this already, #54201 or #54202. s. _______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc |
In reply to this post by stéphane ducasse-2
On Apr 21, 2008, at 1:36 PM, stéphane ducasse wrote: > Hi > > I encountered a strange bug that you can reproduce with the two > methods below. > Apparently RBParser changed in 7.6. > Is it true? > > Then the bug is fishy because we get a NonBoolean receiver but when I > inspect and executed each of the statement > > of > > patchLiteralArrayToken > (self patchLiteralArrayEmbeddedAssignmentToken > or: > [self patchLiteralArraySpecialToken > or: > [self patchLiteralArrayDottedNameToken > ifFalse: [self patchLiteralArraySymbolToken ]]]) > ifFalse: > [^self parserError: #InvalidToken << #browser >> 'Invalid token'] > > I get booleans. > and patchLiteralArraySymbolToken is returning boolean. > So I do not understand why I get an exception telling to me that > receiver is not a boolean. > In addition we looked at the byte and it looks correct. > May be we missed something obvious. > > Stef > > > > test > "self new test" > ^Refactory.Browser.RBParser parseMethod: (ZorkTest sourceCodeAt: > #modelVersion3) > onError: [:aString :pos | ^nil] > > modelVersion3 > ^ > #(Moose.Model (entity > (FAMIX.Namespace (id: 1) (name aNamespace)) > > (FAMIX.Class (id: 2) (name ClassA) (belongsTo (idref: 1)) (packagedIn > (idref: 201))) > (FAMIX.Method (name methodA1) (signature 'methodA1()') (belongsTo > (idref: 2)) (LOC 4)) > (FAMIX.Method (name methodA2) (signature 'methodA2()') (belongsTo > (idref: 2)) (LOC 5)) > (FAMIX.Attribute (name attributeA1) (belongsTo (idref: 2))) > (FAMIX.Attribute (name attributeA2) (belongsTo (idref: 2))) > > (FAMIX.Class (id: 3) (name ClassB) (belongsTo (idref: 1)) (packagedIn > (idref: 201))) > (FAMIX.Attribute (name attributeB1) (belongsTo (idref: 3))) > > (FAMIX.InheritanceDefinition (subclass (idref: 3)) (superclass > (idref: 2))) > > (FAMIX.Class (id: 4) (name ClassC) (belongsTo (idref: 1)) (packagedIn > (idref: 202))) > (FAMIX.Method (name methodC1) (signature 'methodC1()') (belongsTo > (idref: 4)) (LOC 4)) > (FAMIX.Method (name methodC2) (signature 'methodC2()') (belongsTo > (idref: 4)) (LOC 10)) > (FAMIX.Method (name methodC3) (signature 'methodC3()') (belongsTo > (idref: 4)) (LOC 7)) > (FAMIX.Attribute (name attributeC1) (belongsTo (idref: 4))) > (FAMIX.Attribute (name attributeC2) (belongsTo (idref: 4))) > > (FAMIX.InheritanceDefinition (subclass (idref: 4)) (superclass > (idref: 2))) > > (FAMIX.Class (id: 5) (name ClassD) (belongsTo (idref: 1)) (packagedIn > (idref: 202))) > (FAMIX.Method (name methodD1) (signature 'methodD1()') (belongsTo > (idref: 5)) (LOC 3)) > > (FAMIX.InheritanceDefinition (subclass (idref: 5)) (superclass > (idref: 4))) > > (FAMIX.Package (id: 201) (name aPackage)) > (FAMIX.Package (id: 202) (name anotherPackage)) > )) Nope, just a 7.6 bug. I introduced it. I'll add another test now. And whip self. :) Stefan Schmiedl noticed this the other day too. Thanks for reporting it. -- Travis Griggs Objologist "An idea, like a ghost, must be spoken to a little before it will explain itself." - Charles Dickens _______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc |
Ok thanks
'modelVersion3 ^ #(Moose.Model #(grgrgr))' this was a smaller testcase stef On Apr 21, 2008, at 11:53 PM, Travis Griggs wrote: > > On Apr 21, 2008, at 1:36 PM, stéphane ducasse wrote: > >> Hi >> >> I encountered a strange bug that you can reproduce with the two >> methods below. >> Apparently RBParser changed in 7.6. >> Is it true? >> >> Then the bug is fishy because we get a NonBoolean receiver but when I >> inspect and executed each of the statement >> >> of >> >> patchLiteralArrayToken >> (self patchLiteralArrayEmbeddedAssignmentToken >> or: >> [self patchLiteralArraySpecialToken >> or: >> [self patchLiteralArrayDottedNameToken >> ifFalse: [self patchLiteralArraySymbolToken ]]]) >> ifFalse: >> [^self parserError: #InvalidToken << #browser >> 'Invalid token'] >> >> I get booleans. >> and patchLiteralArraySymbolToken is returning boolean. >> So I do not understand why I get an exception telling to me that >> receiver is not a boolean. >> In addition we looked at the byte and it looks correct. >> May be we missed something obvious. >> >> Stef >> >> >> >> test >> "self new test" >> ^Refactory.Browser.RBParser parseMethod: (ZorkTest sourceCodeAt: >> #modelVersion3) >> onError: [:aString :pos | ^nil] >> >> modelVersion3 >> ^ >> #(Moose.Model (entity >> (FAMIX.Namespace (id: 1) (name aNamespace)) >> >> (FAMIX.Class (id: 2) (name ClassA) (belongsTo (idref: 1)) >> (packagedIn >> (idref: 201))) >> (FAMIX.Method (name methodA1) (signature 'methodA1()') (belongsTo >> (idref: 2)) (LOC 4)) >> (FAMIX.Method (name methodA2) (signature 'methodA2()') (belongsTo >> (idref: 2)) (LOC 5)) >> (FAMIX.Attribute (name attributeA1) (belongsTo (idref: 2))) >> (FAMIX.Attribute (name attributeA2) (belongsTo (idref: 2))) >> >> (FAMIX.Class (id: 3) (name ClassB) (belongsTo (idref: 1)) >> (packagedIn >> (idref: 201))) >> (FAMIX.Attribute (name attributeB1) (belongsTo (idref: 3))) >> >> (FAMIX.InheritanceDefinition (subclass (idref: 3)) (superclass >> (idref: 2))) >> >> (FAMIX.Class (id: 4) (name ClassC) (belongsTo (idref: 1)) >> (packagedIn >> (idref: 202))) >> (FAMIX.Method (name methodC1) (signature 'methodC1()') (belongsTo >> (idref: 4)) (LOC 4)) >> (FAMIX.Method (name methodC2) (signature 'methodC2()') (belongsTo >> (idref: 4)) (LOC 10)) >> (FAMIX.Method (name methodC3) (signature 'methodC3()') (belongsTo >> (idref: 4)) (LOC 7)) >> (FAMIX.Attribute (name attributeC1) (belongsTo (idref: 4))) >> (FAMIX.Attribute (name attributeC2) (belongsTo (idref: 4))) >> >> (FAMIX.InheritanceDefinition (subclass (idref: 4)) (superclass >> (idref: 2))) >> >> (FAMIX.Class (id: 5) (name ClassD) (belongsTo (idref: 1)) >> (packagedIn >> (idref: 202))) >> (FAMIX.Method (name methodD1) (signature 'methodD1()') (belongsTo >> (idref: 5)) (LOC 3)) >> >> (FAMIX.InheritanceDefinition (subclass (idref: 5)) (superclass >> (idref: 4))) >> >> (FAMIX.Package (id: 201) (name aPackage)) >> (FAMIX.Package (id: 202) (name anotherPackage)) >> )) > > Nope, just a 7.6 bug. I introduced it. I'll add another test now. And > whip self. :) > > Stefan Schmiedl noticed this the other day too. > > Thanks for reporting it. > > -- > Travis Griggs > Objologist > "An idea, like a ghost, must be spoken to a little before it will > explain itself." - Charles Dickens > > > _______________________________________________ > vwnc mailing list > [hidden email] > http://lists.cs.uiuc.edu/mailman/listinfo/vwnc > _______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc |
In reply to this post by Travis Griggs-3
Is the fix available somewhere?
Stef On Apr 21, 2008, at 11:53 PM, Travis Griggs wrote: > > On Apr 21, 2008, at 1:36 PM, stéphane ducasse wrote: > >> Hi >> >> I encountered a strange bug that you can reproduce with the two >> methods below. >> Apparently RBParser changed in 7.6. >> Is it true? >> >> Then the bug is fishy because we get a NonBoolean receiver but when I >> inspect and executed each of the statement >> >> of >> >> patchLiteralArrayToken >> (self patchLiteralArrayEmbeddedAssignmentToken >> or: >> [self patchLiteralArraySpecialToken >> or: >> [self patchLiteralArrayDottedNameToken >> ifFalse: [self patchLiteralArraySymbolToken ]]]) >> ifFalse: >> [^self parserError: #InvalidToken << #browser >> 'Invalid token'] >> >> I get booleans. >> and patchLiteralArraySymbolToken is returning boolean. >> So I do not understand why I get an exception telling to me that >> receiver is not a boolean. >> In addition we looked at the byte and it looks correct. >> May be we missed something obvious. >> >> Stef >> >> >> >> test >> "self new test" >> ^Refactory.Browser.RBParser parseMethod: (ZorkTest sourceCodeAt: >> #modelVersion3) >> onError: [:aString :pos | ^nil] >> >> modelVersion3 >> ^ >> #(Moose.Model (entity >> (FAMIX.Namespace (id: 1) (name aNamespace)) >> >> (FAMIX.Class (id: 2) (name ClassA) (belongsTo (idref: 1)) >> (packagedIn >> (idref: 201))) >> (FAMIX.Method (name methodA1) (signature 'methodA1()') (belongsTo >> (idref: 2)) (LOC 4)) >> (FAMIX.Method (name methodA2) (signature 'methodA2()') (belongsTo >> (idref: 2)) (LOC 5)) >> (FAMIX.Attribute (name attributeA1) (belongsTo (idref: 2))) >> (FAMIX.Attribute (name attributeA2) (belongsTo (idref: 2))) >> >> (FAMIX.Class (id: 3) (name ClassB) (belongsTo (idref: 1)) >> (packagedIn >> (idref: 201))) >> (FAMIX.Attribute (name attributeB1) (belongsTo (idref: 3))) >> >> (FAMIX.InheritanceDefinition (subclass (idref: 3)) (superclass >> (idref: 2))) >> >> (FAMIX.Class (id: 4) (name ClassC) (belongsTo (idref: 1)) >> (packagedIn >> (idref: 202))) >> (FAMIX.Method (name methodC1) (signature 'methodC1()') (belongsTo >> (idref: 4)) (LOC 4)) >> (FAMIX.Method (name methodC2) (signature 'methodC2()') (belongsTo >> (idref: 4)) (LOC 10)) >> (FAMIX.Method (name methodC3) (signature 'methodC3()') (belongsTo >> (idref: 4)) (LOC 7)) >> (FAMIX.Attribute (name attributeC1) (belongsTo (idref: 4))) >> (FAMIX.Attribute (name attributeC2) (belongsTo (idref: 4))) >> >> (FAMIX.InheritanceDefinition (subclass (idref: 4)) (superclass >> (idref: 2))) >> >> (FAMIX.Class (id: 5) (name ClassD) (belongsTo (idref: 1)) >> (packagedIn >> (idref: 202))) >> (FAMIX.Method (name methodD1) (signature 'methodD1()') (belongsTo >> (idref: 5)) (LOC 3)) >> >> (FAMIX.InheritanceDefinition (subclass (idref: 5)) (superclass >> (idref: 4))) >> >> (FAMIX.Package (id: 201) (name aPackage)) >> (FAMIX.Package (id: 202) (name anotherPackage)) >> )) > > Nope, just a 7.6 bug. I introduced it. I'll add another test now. And > whip self. :) > > Stefan Schmiedl noticed this the other day too. > > Thanks for reporting it. > > -- > Travis Griggs > Objologist > "An idea, like a ghost, must be spoken to a little before it will > explain itself." - Charles Dickens > > > _______________________________________________ > vwnc mailing list > [hidden email] > http://lists.cs.uiuc.edu/mailman/listinfo/vwnc > _______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc |
On Apr 21, 2008, at 11:04 PM, stéphane ducasse wrote: > Is the fix available somewhere? > > Stef > patchLiteralArrayToken (self patchLiteralArrayEmbeddedAssignmentToken or: [self patchLiteralArraySpecialToken or: [self patchLiteralArrayDottedNameToken or: [self patchLiteralArraySymbolToken]]]) ifFalse: [^self parserError: #InvalidToken << #browser >> 'Invalid token'] It was an incomplete refactoring of a large method into a set of smaller intention revealing ones. -- Travis Griggs Objologist "Dying men never wish they'd spent more time at the office" _______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc |
Free forum by Nabble | Edit this page |