Code: Select all
#SingleInstance Force
A_IconTip := "foo"
!':: Send("'")
If I remove A_IconTip line, it seems to work fine.
Code: Select all
#SingleInstance Force
A_IconTip := "foo"
!':: Send("'")
Code: Select all
a := 1
!':: MsgBox '"'
Code: Select all
!':: Send(Chr(39))
Code: Select all
a := 1
!'::
{
Send("'")
}
Code: Select all
parseexclamation.ahk (5) : ==> Missing """
Specifically: a := 1 !':: MsgBox '"'
Seems true. We can trigger the same error with the + (Shift key) hotkey modifier.Warvis wrote: ↑03 Feb 2022, 15:05It seems this is a side effect of the more relaxed line-continuation syntax in v2
...
The alt-modifier from the hotkey is parsed as logical-not on a continued line for the assignment expression.
...
the issue here is the switch from "script syntax" to "hotkey syntax".
Code: Select all
a := 1
+':: Send("'")
For " and ' hotkeys which starts with a modifier that is also an operator you can avoid the problem by not using a one-line hotkey (not needed if the line doesn't contain a matching " or ')src: script.cpp (IsSOLContExpr())Code: Select all
// Closing quote was found so "::" is probably inside a literal string of an // expression (further checking seems unnecessary given the fairly extreme // rarity of using '"' as a key in a hotkey definition).
Code: Select all
; ok:
msgbox
!'::{
('"')
}
; ok
msgbox
!'::("") ; no matching '
; not ok
msgbox
!"::("") ; matching "
Code: Select all
MsgBox
+":: Send "
lexikos, I think the reason I was so surprised that !':: Send("'") doesn't work is because the new send is a function and not a command, and so its quotation mark is clearly a function argument, and so it is clearly isolated from anything else, and so I haven't expected it may cause troubles.The only reason this can occur for !':: or +':: in v2 but not v1 is that v1 does not allow single quotes for quoted strings.
Code: Select all
MsgBox
+!'::'