Bug 69425

Summary: Function collapsing in Pascal mode is confused by begin/end in identifier names
Product: [Applications] kate Reporter: Rolf Eike Beer <kde>
Component: generalAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: testcase for wrong function collapsing

Description Rolf Eike Beer 2003-12-01 11:22:00 UTC
Version:            (using KDE KDE 3.1.93)
Installed from:    SuSE RPMs
OS:          Linux

See testcase (which I will create as attachment soon). It's not KDevelop itself, it seems to be the editor componet because KWrite behaves the same.
Comment 1 Rolf Eike Beer 2003-12-01 11:25:27 UTC
Created attachment 3487 [details]
testcase for wrong function collapsing
Comment 2 Jesse 2003-12-07 09:24:32 UTC
Thanks for the test case.  Bug has been fixed in CVS and was a simple problem with the pascal.xml highlighting definition.
Comment 3 Rolf Eike Beer 2003-12-08 11:34:09 UTC
Subject: Re:  Function collapsing in Pascal mode is confused by begin/end in identifier names

Am Sonntag, 7. Dezember 2003 09:24 schrieben Sie:
> ------- You are receiving this mail because: -------
> You reported the bug, or are watching the reporter.
>
> http://bugs.kde.org/show_bug.cgi?id=69425
> yurkjes@iit.edu changed:
>
>            What    |Removed                     |Added
> ---------------------------------------------------------------------------
>- Status|UNCONFIRMED                 |RESOLVED
>          Resolution|                            |FIXED
>
>
>
> ------- Additional Comments From yurkjes@iit.edu  2003-12-07 09:24 -------
> Thanks for the test case.  Bug has been fixed in CVS and was a simple
> problem with the pascal.xml highlighting definition.

Is there also fixed that "case" and "try" are also a "begin"? Or should I open 
a new bug for this?

Eike

Comment 4 Rolf Eike Beer 2003-12-08 14:11:28 UTC
Subject: Re:  Function collapsing in Pascal mode is confused by begin/end in identifier names

> Thanks for the test case.  Bug has been fixed in CVS and was a simple
> problem with the pascal.xml highlighting definition.

Where do I find pascal.xml in CVS?

In the pascal.xml I'm using (from 3.1.4) there is:

      <comment name="multiLine" start="{" end="}" />

but this one should also be there:

      <comment name="multiLine" start="(*" end="*)" />

Eike

Comment 5 Jesse 2003-12-08 15:41:05 UTC
The file is located at $KDEDIR/share/apps/katepart/syntax

What do you mean that case and try appear as begin?  Do you mean they appear bold?
If this is the case then this is perfectly fine because 'case' is a pascal ISO keyword while 'try' is for Delphi ... keywords are in bold by default.

the (* and *) should be specified as multiLine but it has no affect even when you put it in (??)  I'm inclined to just leave this unchanged as well.
Comment 6 Rolf Eike Beer 2003-12-08 17:05:50 UTC
Subject: Re:  Function collapsing in Pascal mode is confused by begin/end in identifier names

> The file is located at $KDEDIR/share/apps/katepart/syntax

Yes, I know. I want to take the new file from CVS and put there to test it. I 
have not found it and don't want to checkout the whole source just to do a 
find ;)

> What do you mean that case and try appear as begin?  Do you mean they
> appear bold? If this is the case then this is perfectly fine because 'case'
> is a pascal ISO keyword while 'try' is for Delphi ... keywords are in bold
> by default.

case and try are acting as "begin" so they have to be closed with "end;". At 
least with my collapsing rules that is not the case.

> the (* and *) should be specified as multiLine but it has no affect even
> when you put it in (??)  I'm inclined to just leave this unchanged as well.

Hm, strange.

Eike

Comment 7 Jesse 2003-12-08 17:34:06 UTC
Ah oops wrong location question, silly me.  http://webcvs.kde.org/cgi-bin/cvsweb.cgi/kdelibs/kate/data/

You should see it in the list there.

For case and try do you mean you want them to be foldable?  Currently they are not but it would be trivial to add I suppose.
Comment 8 Rolf Eike Beer 2003-12-08 17:44:49 UTC
Subject: Re:  Function collapsing in Pascal mode is confused by begin/end in identifier names

Am Montag, 8. Dezember 2003 17:34 schrieben Sie:
> ------- You are receiving this mail because: -------
> You reported the bug, or are watching the reporter.
>
> http://bugs.kde.org/show_bug.cgi?id=69425
>
>
>
>
> ------- Additional Comments From yurkjes@iit.edu  2003-12-08 17:34 -------
> Ah oops wrong location question, silly me. 
> http://webcvs.kde.org/cgi-bin/cvsweb.cgi/kdelibs/kate/data/
>
> You should see it in the list there.
>
> For case and try do you mean you want them to be foldable?

That would be nice, but...

> Currently they
> are not but it would be trivial to add I suppose.

... now the "end" belonging to a "case" or "try" confuses the collapsing code.

Write this to test.pas an look:

begin
 case x of
  '1':	foo;
  '2':	bar;
 end; {case}
end; {begin}

Hm, inserting an "append;" (which is broken pascal code, but that should not 
confuse the highlighter) makes funny things, "append(foo);" works.

Eike

Comment 9 Anders Lund 2003-12-08 17:49:08 UTC
Subject: Re:  Function collapsing in Pascal mode is confused by begin/end in identifier names

On Monday 08 December 2003 17:05, Rolf Eike Beer wrote:
> > the (* and *) should be specified as multiLine but it has no affect even
> > when you put it in (??) 
Comment 10 Jesse 2003-12-08 17:57:58 UTC
Yes, the folding will get confused.  Either everything that ends with 'end' needs to be foldable or it will be confused.  Besides 'case' and 'try' ... what else can  end with 'end' ?   I don't have too much time to relearn pascal syntax :(  but I'm working on it...

The problem with (* and *) is that it "just works".  It doesn't matter if it has a multiLine attrib or not.  That's why I was gona leave it alone :)

Rolf, can you open a new bug so we can let this one die in peace ;). Something along the lines of "Folding in pascal syntax file is wrong" ...



Comment 11 Rolf Eike Beer 2003-12-08 18:02:48 UTC
Subject: Re:  Function collapsing in Pascal mode is confused by begin/end in identifier names

> Yes, the folding will get confused.  Either everything that ends with 'end'
> needs to be foldable or it will be confused.  Besides 'case' and 'try' ...
> what else can  end with 'end' ?   I don't have too much time to relearn
> pascal syntax :(  but I'm working on it...

class, record, object

That should be all.

> The problem with (* and *) is that it "just works".  It doesn't matter if
> it has a multiLine attrib or not.  That's why I was gona leave it alone :)
>
> Rolf, can you open a new bug so we can let this one die in peace ;).
> Something along the lines of "Folding in pascal syntax file is wrong" ...

No problem, it was just a "one question" that was growing too large ;)

Eike