Small Improvement for logging FileIn or Load Errors

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

Small Improvement for logging FileIn or Load Errors

jtuchel
Hi there,

I thought I'd FileIn the new Regex Matcher that Michel Bany just announced. It does support Repetitions - Hooray!!!

During FileIn I found a little bug on insufficiency in what's getting logged to the Trancsript. You cannot see what method did not get loaded or loaded incomplete due to a Compiler Error. To clarify what I mean, look at this excerpt of my log output:

Info: 42   RxmRepeatOptional overriding #matchAgainst: from RxmBranch.
Info: 42   RxsBranch overriding #isNullable from RxsNode.
initialize
    "RxMatcher initialize"

    Cr :=
compiler error "undefined"
--> TextConstants at: #CR.
    Lf := TextConstants at: #LF

Info: 42   RxmRepeat overriding #printOccurencesOn: from RxmRepeatOptional.
Info: 42   RxmRepeat overriding #matchAgainst: from RxmRepeatOptional.
Info: 42   RxsPredicate class overriding #initialize from Class.

There's no way to tell which class the method #initialize is part of. You don't know that this is the #initialize method of RxMatcher. Luckily, The method has a comment that indicates this...

So if someone at Instantiations feels like, they could add another line of output to the log that clearly says what class will be loaded incomplete or erronous.
This is going to be of great help for anybody using either FileOut30 form VisualWorks or the MonticelloImporter to suck in great new stuff into our little corner of the Smalltalk universe, but it will also help when you load code from your envy repository and you have to resolve conflicts...

Joachim

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/va-smalltalk?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: Small Improvement for logging FileIn or Load Errors

dmacq

Joachim,

Here is a quick hack that works from the Application Manager if you right click in the middle pane and select Import/Export -> File In...

It prepends the class name and '>>' to the error. The new code is in bold. This is  obviously not the final version, but it should get you moving forward so you can find other places where the information is insufficient. ;-)

EtTranscript>>compilerError: error
"Display the compiler error errorString in the receiver.
This can be safely executed from non-UI processes."

| sourceString |

sourceString := error sourceString.
error startPosition > 0
ifTrue: [
self
cr;
show: (
error context printString , '>>' , (sourceString
copyFrom: 1
to: error startPosition - 1))].
self
cr;
show: (MxEST57 bindWith: error message); "$NLS$ compiler error %1"
cr.
error startPosition <= sourceString size
ifTrue: [
self
show: MxEST58; "$NLS$ --> "
show: (sourceString copyFrom: error startPosition to: sourceString size);
cr]

 

Donald [|]



On Thursday, May 2, 2013 2:28:51 AM UTC-4, [hidden email] wrote:
Hi there,

I thought I'd FileIn the new Regex Matcher that Michel Bany just announced. It does support Repetitions - Hooray!!!

During FileIn I found a little bug on insufficiency in what's getting logged to the Trancsript. You cannot see what method did not get loaded or loaded incomplete due to a Compiler Error. To clarify what I mean, look at this excerpt of my log output:

Info: 42   RxmRepeatOptional overriding #matchAgainst: from RxmBranch.
Info: 42   RxsBranch overriding #isNullable from RxsNode.
initialize
    "RxMatcher initialize"

    Cr :=
compiler error "undefined"
--> TextConstants at: #CR.
    Lf := TextConstants at: #LF

Info: 42   RxmRepeat overriding #printOccurencesOn: from RxmRepeatOptional.
Info: 42   RxmRepeat overriding #matchAgainst: from RxmRepeatOptional.
Info: 42   RxsPredicate class overriding #initialize from Class.

There's no way to tell which class the method #initialize is part of. You don't know that this is the #initialize method of RxMatcher. Luckily, The method has a comment that indicates this...

So if someone at Instantiations feels like, they could add another line of output to the log that clearly says what class will be loaded incomplete or erronous.
This is going to be of great help for anybody using either FileOut30 form VisualWorks or the MonticelloImporter to suck in great new stuff into our little corner of the Smalltalk universe, but it will also help when you load code from your envy repository and you have to resolve conflicts...

Joachim

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/va-smalltalk.
For more options, visit https://groups.google.com/groups/opt_out.