Skip to content

Commit

Permalink
Require period before extension, make previous chargroup non-greedy
Browse files Browse the repository at this point in the history
This reduced the number of false positives by filtering out things like Grogg, editor-map, png and water/wav
  • Loading branch information
AI0867 authored and GregoryLundberg committed Nov 30, 2017
1 parent 343474f commit c417047
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion data/tools/wesnoth/wmltools3.py
Expand Up @@ -499,7 +499,7 @@ def __str__(self):

class CrossRef:
macro_reference = re.compile(r"\{([A-Z_][A-Za-z0-9_:]*)(?!\.)\b")
file_reference = re.compile(r"([A-Za-z0-9{}.][A-Za-z0-9_/+{}.@\-\[\],~\*]*(" + "|".join(resource_extensions) + "))((~[A-Z]+\(.*\))*)(:([0-9]+|\[[0-9,*~]*\]))?")
file_reference = re.compile(r"([A-Za-z0-9{}.][A-Za-z0-9_/+{}.@\-\[\],~\*]*?\.(" + "|".join(resource_extensions) + "))((~[A-Z]+\(.*\))*)(:([0-9]+|\[[0-9,*~]*\]))?")
tag_parse = re.compile("\s*([a-z_]+)\s*=(.*)")
def mark_matching_resources(self, pattern, fn, n):
"Mark all definitions matching a specified pattern with a reference."
Expand Down

0 comments on commit c417047

Please sign in to comment.