Skip to content

Commit

Permalink
fix(lua): Ignore accessor with empty parameters
Browse files Browse the repository at this point in the history
This will now not match `AccessorFunc()` and `AccessorFuncDT()` . (nothing, not even whitespace in between the parentheses)

While this is still not perfect it prevents matching these in string literals in lua code files.
  • Loading branch information
Histalek committed Dec 11, 2023
1 parent 1e84f65 commit 56bab65
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion source/DataStructures/Lua/Accessor.cs
Expand Up @@ -8,7 +8,7 @@ public class Accessor : DataStructure
{
public override Regex GetRegex()
{
return new Regex(@"\s*AccessorFunc(DT)?\s*\("); // RegEx matches "hook.Run(" or "hook.Call("
return new Regex(@"\s*AccessorFunc(DT)?\s*\((\w|,|\s)+\)"); // RegEx matches "hook.Run(" or "hook.Call("
}

public override bool CheckMatch(string line)
Expand Down

0 comments on commit 56bab65

Please sign in to comment.