| View previous topic :: View next topic |
| Author |
Message |
RobOtter
Joined: 30 Jan 2005 Posts: 125 Location: Darmstadt, Germany
|
Posted: Wed May 31, 2006 3:14 pm Post subject: |
|
|
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
Even worse, because I usually indent those lines with tabs, the outliner shows a square for every tab... |
|
| Back to top |
|
 |
RobOtter
Joined: 30 Jan 2005 Posts: 125 Location: Darmstadt, Germany
|
Posted: Wed May 31, 2006 3:28 pm Post subject: |
|
|
| 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 |
|
 |
PhiLho
Joined: 27 Dec 2005 Posts: 6721 Location: France (near Paris)
|
Posted: Wed May 31, 2006 3:39 pm Post subject: |
|
|
| RobOtter wrote: | A line like | Code: | | myVar := lastVar + nextVar | is outlined as label definition  | 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 |
|
 |
RobOtter
Joined: 30 Jan 2005 Posts: 125 Location: Darmstadt, Germany
|
Posted: Wed May 31, 2006 3:46 pm Post subject: |
|
|
| 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 |
|
 |
jonib
Joined: 09 May 2006 Posts: 66
|
Posted: Wed May 31, 2006 4:17 pm Post subject: |
|
|
| 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 |
|
 |
jonib
Joined: 09 May 2006 Posts: 66
|
Posted: Wed May 31, 2006 4:25 pm Post subject: |
|
|
| 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
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  |
|
| Back to top |
|
 |
jonib
Joined: 09 May 2006 Posts: 66
|
Posted: Wed May 31, 2006 4:30 pm Post subject: |
|
|
| 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 |
|
 |
jonib
Joined: 09 May 2006 Posts: 66
|
Posted: Wed May 31, 2006 4:34 pm Post subject: |
|
|
| 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 |
|
 |
jonib
Joined: 09 May 2006 Posts: 66
|
Posted: Sat Jun 10, 2006 12:06 am Post subject: |
|
|
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 |
|
 |
M'o
Joined: 09 Mar 2006 Posts: 7
|
Posted: Sun Dec 30, 2007 10:09 am Post subject: |
|
|
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 |
|
 |
jonib
Joined: 09 May 2006 Posts: 66
|
Posted: Sun Dec 30, 2007 10:41 am Post subject: |
|
|
| 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
jonib |
|
| Back to top |
|
 |
|