FuPeiJiang/ahk_parser.js

Legacy If var op value

Opened this issue · 1 comments

if a=b  ; old & new (incorrect)
if a="b"  ; correct

if a=  ; old & new (incorrect)
if a=""  ; correct

If Statement describes how to differentiate between legacy and expression If. Basically, check a list of legacy If patterns, and if none match, it's an expression.

For If var op value, value should be treated exactly like the last parameter of a command; i.e. it (unfortunately) accepts % to force an expression, but is otherwise unquoted text.

fixed


unquoted text.
so it's the same as v=HERE? so I do findV1Expression(), that's how I call unquoted text : v1Expression

what I had to fix is : in function endV1Str(, before, I always pushed 'v1String', even if text==='', now I only push empty if everything.length remained the same, meaning that no v1Expression was found..

and it will automatically become quoted, 'v1String' all get quoted.
it's more specifically 'v1String findV1Expression' and not 'v1String'
I do the quoting here : } else if (v1Str[eType]) {, you should be able to find it using vscode

these get quoted : const v1Str: stringIndexBool = {'v1String findV1Expression':true,'v1String findPercentVarV1Expression':true,'v1String findV1Expression beforeSingleComma':true}


I have yet to see any use from giving them different names, oh yeah, it helps when debugging, but then I shouldn't wrap them in functions... unfindable : how is anyone supposed to find this ? type:`v1String ${which}`
I should put comments above, so it's possible to ctrl+f
ok, done //'v1String findV1Expression' 'v1String resolveV1Continuation'