[squeak-dev] question on Parser>>pattern:inContext: and method:context:encoder:

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

[squeak-dev] question on Parser>>pattern:inContext: and method:context:encoder:

Eliot Miranda-2

Hi All,


I noticed when merging the base and Tweak compilers that Andreas wrote different versions of Parser>>method:context:encoder: and Parser>>pattern:inContext: for the Tweak compiler (in CParser) that "do the right thing".  His versions in CParser bind the arguments in pattern:inContext: as each arg name is encountered.  The versions in Parser bind the arguments in Parser>>method:context:encoder: all in one go *after* pattern:inContext: has parsed all arguments.  This means that if there is an error (e.g. use the same arg name twice) the Parser methods insert the error at the wrong point since prevMark is now always pointing to the last argument not necessarily to the argument that is repeated.


yes, you guessed it I just repeated an argument name and was confused as hell for a while since the damn compiler pointed to the error at the wrong place.


So I clearly want to replace the methods in Parser with Andreas' mo' betta ones in CParser.  The annoying question is why did anyone change the original Parser methods to do the wrong thing in the first place?  Until I know that I have a nagging doubt that I'm missing something.


I've gone through the update history up to version 3.6 and don't see the new behaviour in Parser in any update there-in.  Anyone know why this changed or can point me to where to look next?


AdvThanksance


Eliot



Reply | Threaded
Open this post in threaded view
|

[squeak-dev] Re: question on Parser>>pattern:inContext: and method:context:encoder:

Eliot Miranda-2
I should say that this is in a 3.8 Croquet (actually Qwaq) image.

On Wed, Jun 25, 2008 at 5:54 PM, Eliot Miranda <[hidden email]> wrote:

Hi All,


I noticed when merging the base and Tweak compilers that Andreas wrote different versions of Parser>>method:context:encoder: and Parser>>pattern:inContext: for the Tweak compiler (in CParser) that "do the right thing".  His versions in CParser bind the arguments in pattern:inContext: as each arg name is encountered.  The versions in Parser bind the arguments in Parser>>method:context:encoder: all in one go *after* pattern:inContext: has parsed all arguments.  This means that if there is an error (e.g. use the same arg name twice) the Parser methods insert the error at the wrong point since prevMark is now always pointing to the last argument not necessarily to the argument that is repeated.


yes, you guessed it I just repeated an argument name and was confused as hell for a while since the damn compiler pointed to the error at the wrong place.


So I clearly want to replace the methods in Parser with Andreas' mo' betta ones in CParser.  The annoying question is why did anyone change the original Parser methods to do the wrong thing in the first place?  Until I know that I have a nagging doubt that I'm missing something.


I've gone through the update history up to version 3.6 and don't see the new behaviour in Parser in any update there-in.  Anyone know why this changed or can point me to where to look next?


AdvThanksance


Eliot




Reply | Threaded
Open this post in threaded view
|

[squeak-dev] Re: question on Parser>>pattern:inContext: and method:context:encoder:

Eliot Miranda-2
No worries.  We worked it out.  Sorry for the noise.

On Wed, Jun 25, 2008 at 6:08 PM, Eliot Miranda <[hidden email]> wrote:
I should say that this is in a 3.8 Croquet (actually Qwaq) image.


On Wed, Jun 25, 2008 at 5:54 PM, Eliot Miranda <[hidden email]> wrote:

Hi All,


I noticed when merging the base and Tweak compilers that Andreas wrote different versions of Parser>>method:context:encoder: and Parser>>pattern:inContext: for the Tweak compiler (in CParser) that "do the right thing".  His versions in CParser bind the arguments in pattern:inContext: as each arg name is encountered.  The versions in Parser bind the arguments in Parser>>method:context:encoder: all in one go *after* pattern:inContext: has parsed all arguments.  This means that if there is an error (e.g. use the same arg name twice) the Parser methods insert the error at the wrong point since prevMark is now always pointing to the last argument not necessarily to the argument that is repeated.


yes, you guessed it I just repeated an argument name and was confused as hell for a while since the damn compiler pointed to the error at the wrong place.


So I clearly want to replace the methods in Parser with Andreas' mo' betta ones in CParser.  The annoying question is why did anyone change the original Parser methods to do the wrong thing in the first place?  Until I know that I have a nagging doubt that I'm missing something.


I've gone through the update history up to version 3.6 and don't see the new behaviour in Parser in any update there-in.  Anyone know why this changed or can point me to where to look next?


AdvThanksance


Eliot





Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Re: question on Parser>>pattern:inContext: and method:context:encoder:

timrowledge

On 25-Jun-08, at 10:26 PM, Eliot Miranda wrote:

> No worries.  We worked it out.  Sorry for the noise.
Well you could at least tell us what you found....

tim
--
tim Rowledge; [hidden email]; http://www.rowledge.org/tim
"Oh bother" said Pooh, as he reached for the reset button



Reply | Threaded
Open this post in threaded view
|

[squeak-dev] Re: question on Parser>>pattern:inContext: and method:context:encoder:

Andreas.Raab
tim Rowledge wrote:
>
> On 25-Jun-08, at 10:26 PM, Eliot Miranda wrote:
>
>> No worries.  We worked it out.  Sorry for the noise.
> Well you could at least tell us what you found....

It was a change that I made - pretty stupid, too ;-) I remembered the
reason why I made it (attribute shadowed variable references using
Class>>selector) but it was done in a hurry without much thought.
Nothing to worry about.

Cheers,
   - Andreas

Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] question on Parser>>pattern:inContext: and method:context:encoder:

stephane ducasse
In reply to this post by Eliot Miranda-2
eliot

if you change the old compiler could publish the changes somewhere.
For the new compiler we want to have an interface with a context  
object instead of passing 5 or 6 rguments
all the time.

Stef

On Jun 26, 2008, at 2:54 AM, Eliot Miranda wrote:

> Hi All,
>
> I noticed when merging the base and Tweak compilers that Andreas  
> wrote different versions of Parser>>method:context:encoder: and  
> Parser>>pattern:inContext: for the Tweak compiler (in CParser) that  
> "do the right thing".  His versions in CParser bind the arguments in  
> pattern:inContext: as each arg name is encountered.  The versions in  
> Parser bind the arguments in Parser>>method:context:encoder: all in  
> one go *after* pattern:inContext: has parsed all arguments.  This  
> means that if there is an error (e.g. use the same arg name twice)  
> the Parser methods insert the error at the wrong point since  
> prevMark is now always pointing to the last argument not necessarily  
> to the argument that is repeated.
>
> yes, you guessed it I just repeated an argument name and was  
> confused as hell for a while since the damn compiler pointed to the  
> error at the wrong place.
>
> So I clearly want to replace the methods in Parser with Andreas' mo'  
> betta ones in CParser.  The annoying question is why did anyone  
> change the original Parser methods to do the wrong thing in the  
> first place?  Until I know that I have a nagging doubt that I'm  
> missing something.
>
> I've gone through the update history up to version 3.6 and don't see  
> the new behaviour in Parser in any update there-in.  Anyone know why  
> this changed or can point me to where to look next?
>
> AdvThanksance
>
> Eliot
>