Hi Ned and all,
First of all, congratulations for your latest work on the RB. Having the rewrite tool in Squeak is really nice.
I just noticed a bug in the RB parser, which prevents it from working on some code. For an unknown reason I ended up with an array using the brace notation which was parenthesized, and this made the RBParser choke with the stack trace attached.
A sample expression reproducing this behavior is :
RBParser parseExpression: ' ({1 @ 3. 3 @ 4}) halt '
Cheers, Romain
3 March 2005 2:39:07 pm
VM: Mac OS - a SmalltalkImage Image: Squeak3.8gamma [latest update: #6550]
SecurityManager state: Restricted: false FileAccess: true SocketAccess: true Working Dir HD:Users:romain:Squeak:sq:Squeak3.8g-6527 Trusted Dir HD:Users:romain:Squeak:sq:Squeak3.8g-6527 Untrusted Dir foobar:tooBar:forSqueak:bogus
RBArrayNode(Object)>>doesNotUnderstand: #addParenthesis: Receiver: RBArrayNode({ (SystemNavigation forPackage: r getPackageName) allCallsOn: r getMessage. ...etc... Arguments and temporary variables: aMessage: addParenthesis: (306 to: 463) Receiver's instance variables: parent: nil comments: nil leftBrace: 307 rightBrace: 462 statements: an OrderedCollection(RBMessageNode((SystemNavigation forPackage: r ...etc...
RBParser>>parseParenthesizedExpression Receiver: a RBParser Arguments and temporary variables: leftParen: 306 node: RBArrayNode({ (SystemNavigation forPackage: r getPackageName) allCallsO...etc... Receiver's instance variables: scanner: a RBScanner #() currentToken: RBSpecialCharacterToken($)) nextToken: nil emptyStatements: true negatedNumbers: true errorBlock: [] in Metaclass(Behavior)>>parseTreeFor: {[:aString :pos | ^ nil]} tags: nil source: a Text for 'browseSendersPackageService ^ (ToolService id: #SendersP...etc...
RBParser>>parsePrimitiveObject Receiver: a RBParser Arguments and temporary variables:
Receiver's instance variables: scanner: a RBScanner #() currentToken: RBSpecialCharacterToken($)) nextToken: nil emptyStatements: true negatedNumbers: true errorBlock: [] in Metaclass(Behavior)>>parseTreeFor: {[:aString :pos | ^ nil]} tags: nil source: a Text for 'browseSendersPackageService ^ (ToolService id: #SendersP...etc...
RBParser>>parseUnaryMessage Receiver: a RBParser Arguments and temporary variables: node: nil Receiver's instance variables: scanner: a RBScanner #() currentToken: RBSpecialCharacterToken($)) nextToken: nil emptyStatements: true negatedNumbers: true errorBlock: [] in Metaclass(Behavior)>>parseTreeFor: {[:aString :pos | ^ nil]} tags: nil source: a Text for 'browseSendersPackageService ^ (ToolService id: #SendersP...etc...
--- The full stack --- RBArrayNode(Object)>>doesNotUnderstand: #addParenthesis: RBParser>>parseParenthesizedExpression RBParser>>parsePrimitiveObject RBParser>>parseUnaryMessage - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - RBParser>>parseBinaryMessage RBParser>>parseKeywordMessageWith: RBParser>>parseKeywordMessage RBParser>>parseCascadeMessage RBParser>>parseAssignment RBParser>>parseStatementList:into: RBParser>>parseStatements: RBParser>>parseBlock RBParser>>parsePrimitiveObject RBParser>>parseUnaryMessage RBParser>>parseBinaryMessage RBParser>>parseKeywordMessageWith: RBParser>>parseKeywordMessage RBParser>>parseCascadeMessage RBParser>>parseAssignment RBParser>>parseParenthesizedExpression RBParser>>parsePrimitiveObject RBParser>>parseUnaryMessage RBParser>>parseBinaryMessage RBParser>>parseKeywordMessage RBParser>>parseCascadeMessage RBParser>>parseAssignment RBParser>>parseStatementList:into: RBParser>>parseStatements: RBParser>>parseMethod RBParser>>parseMethod: RBParser class>>parseMethod:onError: Metaclass(Behavior)>>parseTreeFor: [] in FinderTool>>searchFor:when: {[:currentClass :currentSelector | searchClass := currentClass. methodTree ...]} [] in SelectorEnvironment(BrowserEnvironment)>>classesAndSelectorsDo: {[:sel | aBlock value: class value: sel]} [] in SelectorEnvironment>>selectorsForClass:do: {[:each | (aClass includesSelector: each) ifTrue: [aBlock value: each]]} Set>>do: SelectorEnvironment>>selectorsForClass:do: [] in SelectorEnvironment(BrowserEnvironment)>>classesAndSelectorsDo: {[:class | self selectorsForClass: class do: [:sel | aBlock value: class ...]} [] in SelectorEnvironment>>classesDo: {[:each | class := Smalltalk at: each ifAbsent: []. class notNil ...]} [] in IdentityDictionary(Dictionary)>>keysDo: {[:association | aBlock value: association key]} IdentityDictionary(Set)>>do: IdentityDictionary(Dictionary)>>associationsDo: IdentityDictionary(Dictionary)>>keysDo: SelectorEnvironment>>classesDo: SelectorEnvironment(BrowserEnvironment)>>classesAndSelectorsDo: FinderTool>>searchFor:when: ...etc...
Thank you for your report. I have transfered your report to Squeak's Mantis Database and you can followup on the issue if desired by going to http://bugs.impara.de/view.php?id=916 .
In the future please report new issues on Squeak's Mantis Database at http://bugs.impara.de/ .
Thanks!
romain could you publish incorporate the changes of ned in the RB squeaksource version and add ned as maintainer?
Stef
On 3 mars 05, at 14:45, Romain Robbes wrote:
Hi Ned and all,
First of all, congratulations for your latest work on the RB. Having the rewrite tool in Squeak is really nice.
I just noticed a bug in the RB parser, which prevents it from working on some code. For an unknown reason I ended up with an array using the brace notation which was parenthesized, and this made the RBParser choke with the stack trace attached.
A sample expression reproducing this behavior is :
RBParser parseExpression: ' ({1 @ 3. 3 @ 4}) halt '
Cheers, Romain
3 March 2005 2:39:07 pm
VM: Mac OS - a SmalltalkImage Image: Squeak3.8gamma [latest update: #6550]
SecurityManager state: Restricted: false FileAccess: true SocketAccess: true Working Dir HD:Users:romain:Squeak:sq:Squeak3.8g-6527 Trusted Dir HD:Users:romain:Squeak:sq:Squeak3.8g-6527 Untrusted Dir foobar:tooBar:forSqueak:bogus
RBArrayNode(Object)>>doesNotUnderstand: #addParenthesis: Receiver: RBArrayNode({ (SystemNavigation forPackage: r getPackageName) allCallsOn: r getMessage. ...etc... Arguments and temporary variables: aMessage: addParenthesis: (306 to: 463) Receiver's instance variables: parent: nil comments: nil leftBrace: 307 rightBrace: 462 statements: an OrderedCollection(RBMessageNode((SystemNavigation forPackage: r ...etc...
RBParser>>parseParenthesizedExpression Receiver: a RBParser Arguments and temporary variables: leftParen: 306 node: RBArrayNode({ (SystemNavigation forPackage: r getPackageName) allCallsO...etc... Receiver's instance variables: scanner: a RBScanner #() currentToken: RBSpecialCharacterToken($)) nextToken: nil emptyStatements: true negatedNumbers: true errorBlock: [] in Metaclass(Behavior)>>parseTreeFor: {[:aString :pos | ^ nil]} tags: nil source: a Text for 'browseSendersPackageService ^ (ToolService id: #SendersP...etc...
RBParser>>parsePrimitiveObject Receiver: a RBParser Arguments and temporary variables:
Receiver's instance variables: scanner: a RBScanner #() currentToken: RBSpecialCharacterToken($)) nextToken: nil emptyStatements: true negatedNumbers: true errorBlock: [] in Metaclass(Behavior)>>parseTreeFor: {[:aString :pos | ^ nil]} tags: nil source: a Text for 'browseSendersPackageService ^ (ToolService id: #SendersP...etc...
RBParser>>parseUnaryMessage Receiver: a RBParser Arguments and temporary variables: node: nil Receiver's instance variables: scanner: a RBScanner #() currentToken: RBSpecialCharacterToken($)) nextToken: nil emptyStatements: true negatedNumbers: true errorBlock: [] in Metaclass(Behavior)>>parseTreeFor: {[:aString :pos | ^ nil]} tags: nil source: a Text for 'browseSendersPackageService ^ (ToolService id: #SendersP...etc...
--- The full stack --- RBArrayNode(Object)>>doesNotUnderstand: #addParenthesis: RBParser>>parseParenthesizedExpression RBParser>>parsePrimitiveObject RBParser>>parseUnaryMessage
RBParser>>parseBinaryMessage RBParser>>parseKeywordMessageWith: RBParser>>parseKeywordMessage RBParser>>parseCascadeMessage RBParser>>parseAssignment RBParser>>parseStatementList:into: RBParser>>parseStatements: RBParser>>parseBlock RBParser>>parsePrimitiveObject RBParser>>parseUnaryMessage RBParser>>parseBinaryMessage RBParser>>parseKeywordMessageWith: RBParser>>parseKeywordMessage RBParser>>parseCascadeMessage RBParser>>parseAssignment RBParser>>parseParenthesizedExpression RBParser>>parsePrimitiveObject RBParser>>parseUnaryMessage RBParser>>parseBinaryMessage RBParser>>parseKeywordMessage RBParser>>parseCascadeMessage RBParser>>parseAssignment RBParser>>parseStatementList:into: RBParser>>parseStatements: RBParser>>parseMethod RBParser>>parseMethod: RBParser class>>parseMethod:onError: Metaclass(Behavior)>>parseTreeFor: [] in FinderTool>>searchFor:when: {[:currentClass :currentSelector | searchClass := currentClass. methodTree ...]} [] in SelectorEnvironment(BrowserEnvironment)>>classesAndSelectorsDo: {[:sel | aBlock value: class value: sel]} [] in SelectorEnvironment>>selectorsForClass:do: {[:each | (aClass includesSelector: each) ifTrue: [aBlock value: each]]} Set>>do: SelectorEnvironment>>selectorsForClass:do: [] in SelectorEnvironment(BrowserEnvironment)>>classesAndSelectorsDo: {[:class | self selectorsForClass: class do: [:sel | aBlock value: class ...]} [] in SelectorEnvironment>>classesDo: {[:each | class := Smalltalk at: each ifAbsent: []. class notNil ...]} [] in IdentityDictionary(Dictionary)>>keysDo: {[:association | aBlock value: association key]} IdentityDictionary(Set)>>do: IdentityDictionary(Dictionary)>>associationsDo: IdentityDictionary(Dictionary)>>keysDo: SelectorEnvironment>>classesDo: SelectorEnvironment(BrowserEnvironment)>>classesAndSelectorsDo: FinderTool>>searchFor:when: ...etc...
squeak-dev@lists.squeakfoundation.org