File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11-- Test data files are Lua data/config files (e.g. WoW SavedVariables format)
22-- that define top-level globals and are not executed as scripts.
3- files [" **/tests/data/Assignments.lua" ].ignore = {" " }
4- files [" **/tests/data/WoWSavedVariables.lua" ].ignore = {" " }
3+ files [" **/tests/data/Assignments.lua" ].ignore = {" 111 " , " 112 " }
4+ files [" **/tests/data/WoWSavedVariables.lua" ].ignore = {" 111 " , " 112 " }
Original file line number Diff line number Diff line change 2929 if ($Key -match ' ^[a-zA-Z_][a-zA-Z0-9_]*$' -and $Key -notin $reservedWords ) {
3030 return $Key
3131 }
32- $escaped = $Key -replace ' \\' , ' \\\\' -replace ' "' , ' \"'
32+ $escaped = $Key `
33+ -replace ' \\' , ' \\\\' `
34+ -replace ' "' , ' \"' `
35+ -replace " `n " , ' \n' `
36+ -replace " `r " , ' \r' `
37+ -replace " `t " , ' \t' `
38+ -replace " `b " , ' \b' `
39+ -replace " `f " , ' \f'
3340 return " [`" $escaped `" ]"
3441 }
3542
Original file line number Diff line number Diff line change 153153 break
154154 }
155155 }
156- $null = $result.Append ([char ][int ]$numStr )
156+ $byteValue = [int ]$numStr
157+ if ($byteValue -gt 255 ) {
158+ throw " Invalid decimal escape sequence '\$numStr '. Lua decimal escapes must be in the range 0-255."
159+ }
160+ $null = $result.Append ([char ]$byteValue )
157161 } else {
158162 # Unknown escape - just pass through
159163 $null = $result.Append ($nextChar )
Original file line number Diff line number Diff line change 3939 $script :luaPos = $eqStart + $eqCount + 1
4040 $closePattern = ' ]' + (' =' * $eqCount ) + ' ]'
4141 $closeLen = $closePattern.Length
42+ $foundClosingDelimiter = $false
4243 while ($script :luaPos -lt $script :luaString.Length ) {
4344 if ($script :luaPos + $closeLen - 1 -lt $script :luaString.Length -and
4445 $script :luaString.Substring ($script :luaPos , $closeLen ) -eq $closePattern ) {
4546 $script :luaPos += $closeLen
47+ $foundClosingDelimiter = $true
4648 break
4749 }
4850 $script :luaPos ++
4951 }
52+ if (-not $foundClosingDelimiter ) {
53+ throw " Unterminated long-bracket comment."
54+ }
5055 } else {
5156 # Not a long bracket - treat as single-line comment
5257 while ($script :luaPos -lt $script :luaString.Length -and
You can’t perform that action at this time.
0 commit comments