forked from mmikeww/AHK-v2-script-converter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix V1 to V2 label name conversion mmikeww#48, mmikeww#201
Fix V1 to V2 label name conversion. Does not address variable names, that will be handled separately
- Loading branch information
Showing
8 changed files
with
377 additions
and
132 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
| ||
; these are all VALID V1 label names | ||
; V1 allows all character except whitespace, comma, and escape char. | ||
; V2 allows ascii alphanumeric and underscore. But cannot start with a number. Does allow non-ascii characters. | ||
|
||
; looks like a comment | ||
`;notACommentAnymore: | ||
|
||
; looks like variable de-reference path | ||
%A_Desktop%\List.txt: | ||
|
||
; looks like ahk directive | ||
#Persistent: | ||
|
||
; begins with digit and has dot | ||
3.14: | ||
|
||
; valid in v2 | ||
MYLABEL: | ||
|
||
; non-ascii characters (Valid in v2) | ||
★a★b★c: | ||
|
||
; non-ascii characters (NOT valid due to digit prefix) | ||
1★a★b★c: | ||
|
||
; begins with colon FIXED | ||
:a: | ||
|
||
; looks like file path FIXED | ||
c:\user\desktop\List.txt: | ||
|
||
; looks like regex needle FIXED | ||
\w+\(.*?\): | ||
|
||
; looks like an if statement FIXED | ||
if(a&&b){: | ||
|
||
; looks like a function FIXED | ||
IThoughtIWasAFunc(param1:=""){: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
| ||
; these are all VALID V1 label names | ||
; V1 allows all character except whitespace, comma, and escape char. | ||
; V2 allows ascii alphanumeric and underscore. But cannot start with a number. Does allow non-ascii characters. | ||
|
||
; looks like a comment | ||
__notACommentAnymore: | ||
|
||
; looks like variable de-reference path | ||
_A_Desktop__List_txt: | ||
|
||
; looks like ahk directive | ||
_Persistent: | ||
|
||
; begins with digit and has dot | ||
_3_14: | ||
|
||
; valid in v2 | ||
MYLABEL: | ||
|
||
; non-ascii characters (Valid in v2) | ||
★a★b★c: | ||
|
||
; non-ascii characters (NOT valid due to digit prefix) | ||
_1★a★b★c: | ||
|
||
; begins with colon FIXED | ||
_a: | ||
|
||
; looks like file path FIXED | ||
c__user_desktop_List_txt: | ||
|
||
; looks like regex needle FIXED | ||
_w________: | ||
|
||
; looks like an if statement FIXED | ||
if_a__b__: | ||
|
||
; looks like a function FIXED | ||
IThoughtIWasAFunc_param1______: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
; Part of issue #201 | ||
#Requires AutoHotkey v1.1.33+ | ||
; show foo bar | ||
|
||
gosub 1)(miro#_r | ||
|
||
MsgBox, % "bar" | ||
Return | ||
|
||
; label | ||
1)(miro#_r: | ||
MsgBox, % "foo" | ||
Return |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
; Part of issue #201 | ||
#Requires Autohotkey v2.0 | ||
; show foo bar | ||
|
||
_1__miro__r() | ||
|
||
MsgBox("bar") | ||
Return | ||
|
||
; label | ||
_1__miro__r() | ||
{ ; V1toV2: Added bracket | ||
global ; V1toV2: Made function global | ||
MsgBox("foo") | ||
Return | ||
} ; V1toV2: Added bracket in the end |