Bug in the smalltalk-mode.el

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

Bug in the smalltalk-mode.el

Mathieu Suen-2
Hi,

There is a bug of indentation.
Here is the situation:

When you are at the beginning of a metod:

   testStI [
    <category: 'test'>
    | state arg |
--> SEXP
  ]

The SEXP is not indent correctly.
I don't know whether is due to the fix I send you Paolo but I don't think so.
I am working on it.

Let me know if you experiment the same thing.

Thanks

-Mathieu





_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: Bug in the smalltalk-mode.el

Jan Vrany
Hi,

speaking of smalltalk-mode.el, does anybody know
how to modify it to support also end-of-line style comments
starting with "/ in addition to standard smalltalk "comments"?
Or where to start looking?

I'm using it to edit Smalltalk/X sources that uses such
(non-standard) style of comments.

Cheers, Jan



On Thu, 2010-07-29 at 15:57 +0000, Mathieu Suen wrote:

> Hi,
>
> There is a bug of indentation.
> Here is the situation:
>
> When you are at the beginning of a metod:
>
>    testStI [
>     <category: 'test'>
>     | state arg |
> --> SEXP
>   ]
>
> The SEXP is not indent correctly.
> I don't know whether is due to the fix I send you Paolo but I don't think so.
> I am working on it.
>
> Let me know if you experiment the same thing.
>
> Thanks
>
> -Mathieu
>
>
>
>      
>
> _______________________________________________
> help-smalltalk mailing list
> [hidden email]
> http://lists.gnu.org/mailman/listinfo/help-smalltalk



_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: Bug in the smalltalk-mode.el

Paolo Bonzini-2
On 07/29/2010 06:15 PM, Jan Vrany wrote:
> Hi,
>
> speaking of smalltalk-mode.el, does anybody know
> how to modify it to support also end-of-line style comments
> starting with "/ in addition to standard smalltalk "comments"?
> Or where to start looking?
>
> I'm using it to edit Smalltalk/X sources that uses such
> (non-standard) style of comments.

http://www.zvon.org/other/elisp/Output/SEC561.html

Maybe something like this:

--- a/smalltalk-mode.el
+++ b/smalltalk-mode.el
@@ -66,9 +66,10 @@
        (while (<= c ?z)
  (setq c (1+ c))
  (modify-syntax-entry c "w   " table)))
+    (modify-syntax-entry 10  "  > " table) ; Comment (generic)
      (modify-syntax-entry ?:  ".   " table) ; Symbol-char
      (modify-syntax-entry ?_  "_   " table) ; Symbol-char
-    (modify-syntax-entry ?\" "!   " table) ; Comment (generic)
+    (modify-syntax-entry ?\" "! 1 " table) ; Comment (generic)
      (modify-syntax-entry ?'  "\"  " table) ; String
      (modify-syntax-entry ?#  "'   " table) ; Symbol or Array constant
      (modify-syntax-entry ?\( "()  " table) ; Grouping
@@ -88,7 +89,7 @@
      (modify-syntax-entry ?+  ".   " table) ; math
      (modify-syntax-entry ?-  ".   " table) ; math
      (modify-syntax-entry ?*  ".   " table) ; math
-    (modify-syntax-entry ?/  ".   " table) ; math
+    (modify-syntax-entry ?/  ". 2 " table) ; math
      (modify-syntax-entry ?=  ".   " table) ; bool/assign
      (modify-syntax-entry ?%  ".   " table) ; valid selector
      (modify-syntax-entry ?&  ".   " table) ; boolean


If it works, let me know and I'll apply the patch.

Paolo

_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re : [Help-smalltalk] Bug in the smalltalk-mode.el

Mathieu Suen-2
In reply to this post by Mathieu Suen-2
Hi Paolo

I have add fix the issue so that only temp declaration are now recognize.
You can get it from my repository.

Mathieu



----- Message d'origine ----

> De : Mathieu Suen <[hidden email]>
>
> Hi,
>
> There is a bug of indentation.
> Here is the situation:
>
> When  you are at the beginning of a metod:
>
>    testStI [
>      <category: 'test'>
>     | state arg |
> --> SEXP
>    ]
>
> The SEXP is not indent correctly.
> I don't know whether is due to the  fix I send you Paolo but I don't think so.
> I am working on it.
>
> Let me  know if you experiment the same  thing.
>
> Thanks
>
> -Mathieu
>
>
>
>
>
> _______________________________________________
> help-smalltalk  mailing list
> [hidden email]
> http://lists.gnu.org/mailman/listinfo/help-smalltalk
>




_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: Re : Bug in the smalltalk-mode.el

Paolo Bonzini-2
On 07/30/2010 03:51 PM, Mathieu Suen wrote:
> Hi Paolo
>
> I have add fix the issue so that only temp declaration are now recognize.
> You can get it from my repository.

I'm still not sure that the regex cannot have exponential behavior.  For
now I'm not including the change.

Thanks anyway!

Paolo

_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re : Bug in the smalltalk-mode.el

Mathieu Suen-2
The regexp in question is when attempting to match all the temp list that is:

(\s*\w+\s?)*

\s any space
\w any alphabetic letter.

I guess that \w+\s? is boing to prevent prevent backtracking too often but I am not sure.
I just realize that it wont work when there is more than one space at the end of the temp list :S.

May be someone have  a better idea?
Regexp might not be the best solution.

        Mth




On Jul 31, 2010, at 10:03 AM, Paolo Bonzini wrote:

> On 07/30/2010 03:51 PM, Mathieu Suen wrote:
>> Hi Paolo
>>
>> I have add fix the issue so that only temp declaration are now recognize.
>> You can get it from my repository.
>
> I'm still not sure that the regex cannot have exponential behavior.  For now I'm not including the change.
>
> Thanks anyway!
>
> Paolo


       

       
               
___________________________________________________________________________
Yahoo! Mail réinvente le mail ! Découvrez le nouveau Yahoo! Mail et son interface révolutionnaire.
http://fr.mail.yahoo.com

_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: Re : Bug in the smalltalk-mode.el

Paolo Bonzini-2
On 07/31/2010 12:10 PM, Mathieu Suen wrote:
> The regexp in question is when attempting to match all the temp list that is:
>
> (\s*\w+\s?)*
>
> \s any space
> \w any alphabetic letter.
>
> I guess that \w+\s? is boing to prevent prevent backtracking too often but I am not sure.

The problem is when you're _not_ at temporaries.  Then you have an
exponential number of ways to try because any non-empty suffix of \w+ is
also a prefix of \w+.

Something like "&abcdefghijklmnopqrstuvwxyz|" should trigger it.

Paolo

_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: Bug in the smalltalk-mode.el

Mathieu Suen-2
Ok I manage to remove the regexp.
You can fetch the patch in my repository.
Let me know if it is ok now.

        Mth




On Jul 31, 2010, at 12:14 PM, Paolo Bonzini wrote:

> On 07/31/2010 12:10 PM, Mathieu Suen wrote:
>> The regexp in question is when attempting to match all the temp list that is:
>>
>> (\s*\w+\s?)*
>>
>> \s any space
>> \w any alphabetic letter.
>>
>> I guess that \w+\s? is boing to prevent prevent backtracking too often but I am not sure.
>
> The problem is when you're _not_ at temporaries.  Then you have an exponential number of ways to try because any non-empty suffix of \w+ is also a prefix of \w+.
>
> Something like "&abcdefghijklmnopqrstuvwxyz|" should trigger it.
>
> Paolo


       

       
               
___________________________________________________________________________
Yahoo! Mail réinvente le mail ! Découvrez le nouveau Yahoo! Mail et son interface révolutionnaire.
http://fr.mail.yahoo.com

_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk