help-smalltalk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-smalltalk] ParseTreeRewriter tests & behavior


From: Stephen Compall
Subject: Re: [Help-smalltalk] ParseTreeRewriter tests & behavior
Date: Wed, 10 Jan 2007 22:53:36 -0600

On Wed, 2007-01-10 at 14:14 -0600, Stephen Compall wrote:
> That will hide the example I've given, because arguments in the notFound
> messages are rewritten.  This means, however, that certain arguments, or
> parts thereof, will be rewritten *again*.  This can be seen by adding a
> 'address@hidden value' => 'address@hidden' rewrite rule.  I'll add this to 
> ptrtests.st
> later.

I've named the two issues non-messages-are-found and rsic-doesnt-copy,
respectively.  Below are three new tests demonstrating three situations.

If you agree that both issues should be fixed, attached is a patch that
fixes them.  They succeed against a different version of the tests in:

http://scompall.nocandysw.com/gst/ptrtests-post-nmaf+rdc.st

Meanwhile, from http://scompall.nocandysw.com/gst/ptrtests.st :

    [| rsicCopiesPRewriter sourceExp |
     rsicCopiesPRewriter := self rewriterClass new
           replace: 'address@hidden display: address@hidden' with: 
'address@hidden';
           replace: 'address@hidden value' with: 'address@hidden';
           yourself.
     sourceExp := RBParser parseExpression:
         'qqq display: (qqq display: sss value value);
              display: [qqq display: sss value value]'.
     self assert: (self rewriting: sourceExp
                        with: rsicCopiesPRewriter
                        yields:
                            'qqq display: (qqq display: sss value value);
                              display: [[sss value]]')
          description:
              'neither non-messages-are-found nor rsic-doesnt-copy fixed'.
     self deny: (self rewriting: sourceExp
                      with: rsicCopiesPRewriter
                      yields:
                          'qqq display: [sss value];
                            display: [[sss]]')
          description:
              'non-messages-are-found fixed, but not rsic-doesnt-copy'.
     self deny: (self rewriting: sourceExp
                      with: rsicCopiesPRewriter
                      yields:
                          'qqq display: [sss value];
                            display: [[sss value]]')
          description:
              'both non-messages-are-found and rsic-doesnt-copy fixed'.]
        value.

-- 
Stephen Compall
http://scompall.nocandysw.com/blog

Attachment: pts-nmaf+rdc+rbsmalldict.diff
Description: Text Data

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

[Prev in Thread] Current Thread [Next in Thread]