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

Eliot Miranda eliot.miranda at gmail.com
Thu Jun 26 00:54:42 UTC 2008

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

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?


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20080625/e7e3b12d/attachment.htm

More information about the Squeak-dev mailing list