AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Syntax highlighter for Eclipse IDE
Goto page Previous  1, 2, 3
 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Wish List
View previous topic :: View next topic  
Author Message
RobOtter



Joined: 30 Jan 2005
Posts: 125
Location: Darmstadt, Germany

PostPosted: Wed May 31, 2006 3:14 pm    Post subject: Reply with quote

I agree with PhiLho that parsing ahk scripts is not an easy task... Iīve found one more annoyance the outliner stumbles over:
A line like
Code:
myVar := lastVar + nextVar
is outlined as label definition Sad
Even worse, because I usually indent those lines with tabs, the outliner shows a square for every tab...
Back to top
View user's profile Send private message
RobOtter



Joined: 30 Jan 2005
Posts: 125
Location: Darmstadt, Germany

PostPosted: Wed May 31, 2006 3:28 pm    Post subject: Reply with quote

Hi, one more question: how can I define the colors I want to use? I had a look at the ahk.hrc file but cannot find out where to set the colors...
Back to top
View user's profile Send private message
PhiLho



Joined: 27 Dec 2005
Posts: 6721
Location: France (near Paris)

PostPosted: Wed May 31, 2006 3:39 pm    Post subject: Reply with quote

RobOtter wrote:
A line like
Code:
myVar := lastVar + nextVar
is outlined as label definition Sad
No space in a label definition (which accepts otherwise almost all Ascii chars! Except comma, percent and backtick (and of course colon!). A label cannot start with these, nor with semi-colon (as it would be a comment!). And after the colon, you cannot have anything except comments.
[EDIT] Testing label syntax:
Code:
labels = !"#$&'()*+-./<=>?@{|}~
Loop Parse, labels
{
   c := A_LoopField
   Gosub %c%L
}
c = `;
Gosub L;L
MsgBox %r%
Return

!L:
"L:
#L:
$L:
; Not label %L:
&L:
'L:
(L:
)L:
*L:
+L:
; Not label ,L:
-L:
.L:
/L:
; Not label :L:
; Not label ;L:
L;L:
<L:
=L:
>L:
?L:
@L:
; Not label `L:
{L:
|L:
}L:
~L:
   r = %r%%c%
Return

_________________
vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")


Last edited by PhiLho on Wed May 31, 2006 3:52 pm; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
RobOtter



Joined: 30 Jan 2005
Posts: 125
Location: Darmstadt, Germany

PostPosted: Wed May 31, 2006 3:46 pm    Post subject: Reply with quote

PhiLho wrote:
No space in a label definition (which accepts otherwise almost all Ascii chars! Except comma, percent and backtick (experimental list! May be incomplete). A label cannot start with these, nor with colon and semi-colon... And after the colon, you cannot have anything except comments.
I think Iīll leave the exact recognizing regexp up to jonib but as quick hack, I was able to eliminate the false labels by altering the code in ahk.hrc from
Code:
<scheme name="Labels">
         <regexp match="/^(?{ahkOutline}%varname;:[^;]*)/i" region="Label"/>
</scheme>
to
Code:
<scheme name="Labels">
         <regexp match="/^(?{ahkOutline}%varname;:[^;=]*)/i" region="Label"/>
</scheme>
(note the equals character)

I donīt know if it will have some unwanted side effects...
Back to top
View user's profile Send private message
jonib



Joined: 09 May 2006
Posts: 66

PostPosted: Wed May 31, 2006 4:17 pm    Post subject: Reply with quote

RobOtter wrote:
Hi, one more question: how can I define the colors I want to use? I had a look at the ahk.hrc file but cannot find out where to set the colors...


You can change coloring style in Eclipse "preferences" "Colorer Library Editor"

If you want your own colors go to the directory where the "catalog.xml" file is and then the "hrd\rgb" directory, that seems to be where the colors are defined.
Back to top
View user's profile Send private message
jonib



Joined: 09 May 2006
Posts: 66

PostPosted: Wed May 31, 2006 4:25 pm    Post subject: Reply with quote

RobOtter wrote:
I agree with PhiLho that parsing ahk scripts is not an easy task... Iīve found one more annoyance the outliner stumbles over:
A line like
Code:
myVar := lastVar + nextVar
is outlined as label definition Sad
Even worse, because I usually indent those lines with tabs, the outliner shows a square for every tab...

There are probably many more like this as I wanted to know what I could get working while I learned the Colorer syntax, but if you find more problems and can fix them, less work for me Twisted Evil
Back to top
View user's profile Send private message
jonib



Joined: 09 May 2006
Posts: 66

PostPosted: Wed May 31, 2006 4:30 pm    Post subject: Reply with quote

PhiLho wrote:
No space in a label definition (which accepts otherwise almost all Ascii chars! Except comma, percent and backtick (and of course colon!). A label cannot start with these, nor with semi-colon (as it would be a comment!). And after the colon, you cannot have anything except comments.

I assumed labels used the same characters as variables. and thanks for the label syntax testing script.
Back to top
View user's profile Send private message
jonib



Joined: 09 May 2006
Posts: 66

PostPosted: Wed May 31, 2006 4:34 pm    Post subject: Reply with quote

RobOtter wrote:
Code:
<scheme name="Labels">
         <regexp match="/^(?{ahkOutline}%varname;:[^;=]*)/i" region="Label"/>
</scheme>
(note the equals character)

I donīt know if it will have some unwanted side effects...

It should at least work better then before.
Back to top
View user's profile Send private message
jonib



Joined: 09 May 2006
Posts: 66

PostPosted: Sat Jun 10, 2006 12:06 am    Post subject: Reply with quote

Hi

I finally had some time to work on this and made a new thread here.
Outlines should work better but functions still need to have "{" on the same line as the function name.
Back to top
View user's profile Send private message
M'o



Joined: 09 Mar 2006
Posts: 7

PostPosted: Sun Dec 30, 2007 10:09 am    Post subject: Reply with quote

Hi @ all,

anything changes made since jun2006, the date from the last post? An plugin for the eclipse ide is an very good idea...

Regards
M'o
Back to top
View user's profile Send private message
jonib



Joined: 09 May 2006
Posts: 66

PostPosted: Sun Dec 30, 2007 10:41 am    Post subject: Reply with quote

M'o wrote:
Hi @ all,

anything changes made since jun2006, the date from the last post? An plugin for the eclipse ide is an very good idea...

Regards
M'o


Hi M'o

Did you look at my thread here, it should have a functional but not complete syntax highlighting for Eclipse using Colorer plug-in.
I have not updated it in a while because I have not done much with AutoHotkey lately and there haven't been much interest, but that can change fast Very Happy

jonib
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Wish List All times are GMT
Goto page Previous  1, 2, 3
Page 3 of 3

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group