Need help with Rewrite Rule

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

Need help with Rewrite Rule

jtuchel
Hi there,

I´m stuck in a problem with a seemingly simple rewrite rule. For some reason I want to rename a lot of methods without replacing the existing and also not replacing the senders. In a second step I want to rewrite the exisitin methods.

So what I try to do is to find methods using this find rule:

oldMethod
  | `@Temps |
  ``@.Statements.

and copy them using this replace rule:

newMethod
| `@Temps | ``@.Statements.

Using the find button I see all implementors of oldMethod, but pressing Replace (together with checking "All Method") in the rewrite editor brings up the following error:

newMethod
| MetaVar not in search text ->`@Temps | ``@.Statements.

But as you can see the meta var `@Temps is in the search text. So what is my problem?

Thank you in advance

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/va-smalltalk/-/uzg7qa5SzIEJ.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/va-smalltalk?hl=en.
Reply | Threaded
Open this post in threaded view
|

Re: Need help with Rewrite Rule

SebastianHC
Hi Joachim,

I had those messages while just trying out the examples.
In my case it was jsut a typo! Try to use ' instead of `  this helped in my case.

Sebastian


Am 30.03.2012 06:30, schrieb [hidden email]:
Hi there,

I´m stuck in a problem with a seemingly simple rewrite rule. For some reason I want to rename a lot of methods without replacing the existing and also not replacing the senders. In a second step I want to rewrite the exisitin methods.

So what I try to do is to find methods using this find rule:

oldMethod
  | `@Temps |
  ``@.Statements.

and copy them using this replace rule:

newMethod
  | `@Temps |
  ``@.Statements.

Using the find button I see all implementors of oldMethod, but pressing Replace (together with checking "All Method") in the rewrite editor brings up the following error:

newMethod
  | MetaVar not in search text  ->`@Temps |
  ``@.Statements.

But as you can see the meta var `@Temps is in the search text. So what is my problem?

Thank you in advance
--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/va-smalltalk/-/uzg7qa5SzIEJ.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/va-smalltalk?hl=en.

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

Re: Need help with Rewrite Rule

jtuchel


Sebastian,

unfortunately it's not that easy:

oldMethod
  | '@Temps |
  ''@.StatementsUnmatched ' in string literal. ->.

this time it's the search pattern in which I get the error.
So do I have to multiply the ' in order to make them match, or is it only one of the two uses of ` (meta var and recursion) that I have to replace?


Joachim



Am Freitag, 30. März 2012 17:21:22 UTC+2 schrieb Sebastian Heidbrink:
Hi Joachim,

I had those messages while just trying out the examples.
In my case it was jsut a typo! Try to use ' instead of `  this helped in my case.

Sebastian


Am 30.03.2012 06:30, schrieb jtuchel:
Hi there,

I´m stuck in a problem with a seemingly simple rewrite rule. For some reason I want to rename a lot of methods without replacing the existing and also not replacing the senders. In a second step I want to rewrite the exisitin methods.

So what I try to do is to find methods using this find rule:

oldMethod
  | `@Temps |
  ``@.Statements.

and copy them using this replace rule:

newMethod
  | `@Temps |
  ``@.Statements.

Using the find button I see all implementors of oldMethod, but pressing Replace (together with checking "All Method") in the rewrite editor brings up the following error:

newMethod
  | MetaVar not in search text  ->`@Temps |
  ``@.Statements.

But as you can see the meta var `@Temps is in the search text. So what is my problem?

Thank you in advance


--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/va-smalltalk/-/7iZTrFBe89QJ.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/va-smalltalk?hl=en.
Reply | Threaded
Open this post in threaded view
|

Re: Need help with Rewrite Rule

Richard Sargent (again)
In reply to this post by jtuchel
This looks like a defect has been introduced.

In VisualAge 6.0.2, the Rewrite Tool works as you would expect:
Find:
asString

    | ``@temps |
    ``@.statements

Replacement:
asStringReplacement

    | ``@temps |
    ``@.statements

Works as you would expect. Under VASmalltalk 8.0, you get the "MetaVar not in search text  ->" error when you click Replace..
On Friday, March 30, 2012 3:30:55 PM UTC+2, [hidden email] wrote:
Hi there,

I´m stuck in a problem with a seemingly simple rewrite rule. For some reason I want to rename a lot of methods without replacing the existing and also not replacing the senders. In a second step I want to rewrite the exisitin methods.

So what I try to do is to find methods using this find rule:

oldMethod
  | `@Temps |
  ``@.Statements.

and copy them using this replace rule:

newMethod
| `@Temps | ``@.Statements.

Using the find button I see all implementors of oldMethod, but pressing Replace (together with checking "All Method") in the rewrite editor brings up the following error:

newMethod
| MetaVar not in search text ->`@Temps | ``@.Statements.

But as you can see the meta var `@Temps is in the search text. So what is my problem?

Thank you in advance

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/va-smalltalk/-/EdsyyjP14BoJ.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/va-smalltalk?hl=en.
Reply | Threaded
Open this post in threaded view
|

Re: Need help with Rewrite Rule

jtuchel
Rick,

thanks for comparing with 6.0.2. I had a similar idea: I just tried in Pharo and also came to the conclusion that this must be some bug or incompatibility in VAST.

So let's hope someone at Instantiations takes some time to look into this. 
The Rewrite tool is a cool way of proving how superior Smalltalk can be in code maintenance. Refactoring is the first step, and Rewriting can be so much more powerful!

Joachim



Am Sonntag, 1. April 2012 15:59:33 UTC+2 schrieb Richard Sargent:
This looks like a defect has been introduced.

In VisualAge 6.0.2, the Rewrite Tool works as you would expect:
Find:
asString

    | ``@temps |
    ``@.statements

Replacement:
asStringReplacement

    | ``@temps |
    ``@.statements

Works as you would expect. Under VASmalltalk 8.0, you get the "MetaVar not in search text  ->" error when you click Replace..
On Friday, March 30, 2012 3:30:55 PM UTC+2, [hidden email] wrote:
Hi there,

I´m stuck in a problem with a seemingly simple rewrite rule. For some reason I want to rename a lot of methods without replacing the existing and also not replacing the senders. In a second step I want to rewrite the exisitin methods.

So what I try to do is to find methods using this find rule:

oldMethod
  | `@Temps |
  ``@.Statements.

and copy them using this replace rule:

newMethod
| `@Temps | ``@.Statements.

Using the find button I see all implementors of oldMethod, but pressing Replace (together with checking "All Method") in the rewrite editor brings up the following error:

newMethod
| MetaVar not in search text ->`@Temps | ``@.Statements.

But as you can see the meta var `@Temps is in the search text. So what is my problem?

Thank you in advance

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/va-smalltalk/-/DoM9Pr3QZPAJ.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/va-smalltalk?hl=en.
Reply | Threaded
Open this post in threaded view
|

Re: Need help with Rewrite Rule

jtuchel
In reply to this post by Richard Sargent (again)
Richard,

VisualAge 6.02 didn't ship with RB, so the version you're using must be imported from somewhere. Could you tell me where it's from and/or what exact version it is? 
I have contacted VAST support and they need the exact version to compare the results.

Thanks in advance

Joachim

Am Sonntag, 1. April 2012 15:59:33 UTC+2 schrieb Richard Sargent:
This looks like a defect has been introduced.

In VisualAge 6.0.2, the Rewrite Tool works as you would expect:
Find:
asString

    | ``@temps |
    ``@.statements

Replacement:
asStringReplacement

    | ``@temps |
    ``@.statements

Works as you would expect. Under VASmalltalk 8.0, you get the "MetaVar not in search text  ->" error when you click Replace..
On Friday, March 30, 2012 3:30:55 PM UTC+2, [hidden email] wrote:
Hi there,

I´m stuck in a problem with a seemingly simple rewrite rule. For some reason I want to rename a lot of methods without replacing the existing and also not replacing the senders. In a second step I want to rewrite the exisitin methods.

So what I try to do is to find methods using this find rule:

oldMethod
  | `@Temps |
  ``@.Statements.

and copy them using this replace rule:

newMethod
| `@Temps | ``@.Statements.

Using the find button I see all implementors of oldMethod, but pressing Replace (together with checking "All Method") in the rewrite editor brings up the following error:

newMethod
| MetaVar not in search text ->`@Temps | ``@.Statements.

But as you can see the meta var `@Temps is in the search text. So what is my problem?

Thank you in advance

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/va-smalltalk/-/HPLT8uO8HL0J.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/va-smalltalk?hl=en.
Reply | Threaded
Open this post in threaded view
|

Re: Need help with Rewrite Rule

Adriaan van Os-3
Joachim,

Have a look at http://customrefactor.sourceforge.net/stable.htm for versions of RB for VASt (from the pre-http://vastgoodies.com days of the projects http://vastgoodies.com/projects/Custom%20Refactoring%20and%20Rewrite%20Editor%20Usability days).

Cheers,
Adriaan.

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/va-smalltalk/-/bT4p-fFHR8IJ.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/va-smalltalk?hl=en.
Reply | Threaded
Open this post in threaded view
|

Re: Need help with Rewrite Rule

Richard Sargent (again)
In reply to this post by jtuchel
It is version R3.5.1 with a couple of minor changes that are definitely unrelated to the rewrite tool.
(One change is to remove the #-> method which became part of the CLDT application with VAST 6.0. The other change is to prevent refactorings on methods such as #abtBuildInternals.)

I could not upload it to the VAST Goodies site. However, I have attached it as a zip file.


At this point in time, I no longer have any idea from where I got the original R3.5.1 code.
      Richard

On Tuesday, April 3, 2012 5:29:37 AM UTC+2, [hidden email] wrote:
Richard,

VisualAge 6.02 didn't ship with RB, so the version you're using must be imported from somewhere. Could you tell me where it's from and/or what exact version it is? 
I have contacted VAST support and they need the exact version to compare the results.

Thanks in advance

Joachim

Am Sonntag, 1. April 2012 15:59:33 UTC+2 schrieb Richard Sargent:
This looks like a defect has been introduced.

In VisualAge 6.0.2, the Rewrite Tool works as you would expect:
Find:
asString

    | ``@temps |
    ``@.statements

Replacement:
asStringReplacement

    | ``@temps |
    ``@.statements

Works as you would expect. Under VASmalltalk 8.0, you get the "MetaVar not in search text  ->" error when you click Replace..
On Friday, March 30, 2012 3:30:55 PM UTC+2, [hidden email] wrote:
Hi there,

I´m stuck in a problem with a seemingly simple rewrite rule. For some reason I want to rename a lot of methods without replacing the existing and also not replacing the senders. In a second step I want to rewrite the exisitin methods.

So what I try to do is to find methods using this find rule:

oldMethod
  | `@Temps |
  ``@.Statements.

and copy them using this replace rule:

newMethod
| `@Temps | ``@.Statements.

Using the find button I see all implementors of oldMethod, but pressing Replace (together with checking "All Method") in the rewrite editor brings up the following error:

newMethod
| MetaVar not in search text ->`@Temps | ``@.Statements.

But as you can see the meta var `@Temps is in the search text. So what is my problem?

Thank you in advance

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/va-smalltalk/-/cLHypN824S0J.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/va-smalltalk?hl=en.

RB351plus.zip (1M) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Need help with Rewrite Rule

jtuchel
Richard,

thanks a lot for your help. I hope this will help Instantiations hunt down the problem. 

Joachim

Am Dienstag, 3. April 2012 12:49:32 UTC+2 schrieb Richard Sargent:
It is version R3.5.1 with a couple of minor changes that are definitely unrelated to the rewrite tool.
(One change is to remove the #-> method which became part of the CLDT application with VAST 6.0. The other change is to prevent refactorings on methods such as #abtBuildInternals.)

I could not upload it to the VAST Goodies site. However, I have attached it as a zip file.


At this point in time, I no longer have any idea from where I got the original R3.5.1 code.
      Richard

On Tuesday, April 3, 2012 5:29:37 AM UTC+2, [hidden email] wrote:
Richard,

VisualAge 6.02 didn't ship with RB, so the version you're using must be imported from somewhere. Could you tell me where it's from and/or what exact version it is? 
I have contacted VAST support and they need the exact version to compare the results.

Thanks in advance

Joachim

Am Sonntag, 1. April 2012 15:59:33 UTC+2 schrieb Richard Sargent:
This looks like a defect has been introduced.

In VisualAge 6.0.2, the Rewrite Tool works as you would expect:
Find:
asString

    | ``@temps |
    ``@.statements

Replacement:
asStringReplacement

    | ``@temps |
    ``@.statements

Works as you would expect. Under VASmalltalk 8.0, you get the "MetaVar not in search text  ->" error when you click Replace..
On Friday, March 30, 2012 3:30:55 PM UTC+2, [hidden email] wrote:
Hi there,

I´m stuck in a problem with a seemingly simple rewrite rule. For some reason I want to rename a lot of methods without replacing the existing and also not replacing the senders. In a second step I want to rewrite the exisitin methods.

So what I try to do is to find methods using this find rule:

oldMethod
  | `@Temps |
  ``@.Statements.

and copy them using this replace rule:

newMethod
| `@Temps | ``@.Statements.

Using the find button I see all implementors of oldMethod, but pressing Replace (together with checking "All Method") in the rewrite editor brings up the following error:

newMethod
| MetaVar not in search text ->`@Temps | ``@.Statements.

But as you can see the meta var `@Temps is in the search text. So what is my problem?

Thank you in advance

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/va-smalltalk/-/hSVIHxbhJX0J.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/va-smalltalk?hl=en.
Reply | Threaded
Open this post in threaded view
|

Re: Need help with Rewrite Rule

SebastianHC
In reply to this post by Richard Sargent (again)
Hi!

I think I got my version at that time from here:

http://sourceforge.net/projects/customrefactor/files/customrefactor/CS11%20Release%20Candidate%202/

As far as I can remember the Rewrite Tool was part of the Refactoring Browser and there once also was a download at Refactory Inc. 's homepage...

Sebastian



Am 03.04.2012 03:49, schrieb Richard Sargent:
It is version R3.5.1 with a couple of minor changes that are definitely unrelated to the rewrite tool.
(One change is to remove the #-> method which became part of the CLDT application with VAST 6.0. The other change is to prevent refactorings on methods such as #abtBuildInternals.)

I could not upload it to the VAST Goodies site. However, I have attached it as a zip file.


At this point in time, I no longer have any idea from where I got the original R3.5.1 code.
      Richard

On Tuesday, April 3, 2012 5:29:37 AM UTC+2, [hidden email] wrote:
Richard,

VisualAge 6.02 didn't ship with RB, so the version you're using must be imported from somewhere. Could you tell me where it's from and/or what exact version it is? 
I have contacted VAST support and they need the exact version to compare the results.

Thanks in advance

Joachim

Am Sonntag, 1. April 2012 15:59:33 UTC+2 schrieb Richard Sargent:
This looks like a defect has been introduced.

In VisualAge 6.0.2, the Rewrite Tool works as you would expect:
Find:
asString

    | ``@temps |
    ``@.statements

Replacement:
asStringReplacement

    | ``@temps |
    ``@.statements

Works as you would expect. Under VASmalltalk 8.0, you get the "MetaVar not in search text  ->" error when you click Replace..
On Friday, March 30, 2012 3:30:55 PM UTC+2, [hidden email] wrote:
Hi there,

I´m stuck in a problem with a seemingly simple rewrite rule. For some reason I want to rename a lot of methods without replacing the existing and also not replacing the senders. In a second step I want to rewrite the exisitin methods.

So what I try to do is to find methods using this find rule:

oldMethod
  | `@Temps |
  ``@.Statements.

and copy them using this replace rule:

newMethod
  | `@Temps |
  ``@.Statements.

Using the find button I see all implementors of oldMethod, but pressing Replace (together with checking "All Method") in the rewrite editor brings up the following error:

newMethod
  | MetaVar not in search text  ->`@Temps |
  ``@.Statements.

But as you can see the meta var `@Temps is in the search text. So what is my problem?

Thank you in advance
--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/va-smalltalk/-/cLHypN824S0J.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/va-smalltalk?hl=en.

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

Re: Need help with Rewrite Rule

Solveig
In reply to this post by jtuchel
this corresponds to Instantiations case 49471

On Mar 30, 9:30 am, "[hidden email]"
<[hidden email]> wrote:

> Hi there,
>
> I´m stuck in a problem with a seemingly simple rewrite rule. For some
> reason I want to rename a lot of methods without replacing the existing and
> also not replacing the senders. In a second step I want to rewrite the
> exisitin methods.
>
> So what I try to do is to find methods using this find rule:
>
> oldMethod
>
>   | `@Temps |
>   ``@.Statements.
>
> and copy them using this replace rule:
>
> newMethod
>   | `@Temps |
>   ``@.Statements.
>
> Using the find button I see all implementors of oldMethod, but pressing
> Replace (together with checking "All Method") in the rewrite editor brings
> up the following error:
>
> newMethod
>   | *MetaVar not in search text  ->*`@Temps |
>   ``@.Statements.
>
> But as you can see the meta var `@Temps is in the search text. So what is
> my problem?
>
> Thank you in advance

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/va-smalltalk?hl=en.