Skip to content

Commit

Permalink
fix quoted object names removing wrong quotes
Browse files Browse the repository at this point in the history
see #326
  • Loading branch information
Banaanae committed Jan 9, 2025
1 parent 14e2fdf commit d3bbc9a
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ConvertFuncs.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -838,7 +838,7 @@ _convertLines(ScriptString, finalize:=!gUseMasking) ; 2024-06-26 RENAMED to ac
Line := RegExReplace(Line, "im)^(.*\s\?.*\:\s*)(\)|$)", '$1 ""$2')
}

; Fix quote object properties [{"A": "B"}] => [{A: "B"}]
; Fix quoted object properties [{"A": "B"}] => [{A: "B"}]
if InStr(Line, "{") and InStr(Line, '"') and InStr(Line, ":") {
maskStrings(&Line)
if InStr(Line, "{") and !InStr(Line, '"') and InStr(Line, ":") {
Expand All @@ -853,7 +853,7 @@ _convertLines(ScriptString, finalize:=!gUseMasking) ; 2024-06-26 RENAMED to ac
codeArray.Push(tempCode)
tempCode := ""
inObj++
} else if (char = ":" and inObj) {
} else if (char ~= ":|," and inObj) {
codeArray.Push(tempCode)
tempCode := ""
} else if (char = "}") {
Expand Down
1 change: 1 addition & 0 deletions tests/Test_Folder/String/QuotedObjLiterals_ex2.ah1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
obj := {"A": "A", 1: "1"}
1 change: 1 addition & 0 deletions tests/Test_Folder/String/QuotedObjLiterals_ex2.ah2
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
obj := {A: "A", 1: "1"}

0 comments on commit d3bbc9a

Please sign in to comment.