# HG changeset patch # User HackEso # Date 1575576328 0 # Node ID 44379732c06bc9d4730b51f29d676461ed8c9276 # Parent fb0eea93d4e98aefa27313b0396a685eba844fe0 fetch /hackenv/bin/whatis https://hack.esolangs.org/get/bin/whatis diff -r fb0eea93d4e9 -r 44379732c06b bin/whatis --- a/bin/whatis Thu Dec 05 13:42:21 2019 +0000 +++ b/bin/whatis Thu Dec 05 20:05:28 2019 +0000 @@ -13,11 +13,14 @@ foundv.append(False) with open(os.environ.get("HACKENV","/hackenv") + "/share/whatis", errors="surrogateescape") as whatisdb: for line in whatisdb: - parts = re.match(r"([^()]+)\(([0-9A-Z_a-z]+)\)", line) + parts = re.match(r"([^()]+)\(([0-9A-Z_a-z])([0-9A-Z_a-z]*)\)", line) if parts: match = False for argind, argfold in enumerate(argfoldv): - if argfold == parts.group(1).casefold(): + if (argfold == parts.group(1).casefold() or + argfold == parts.group(1) + "(" + parts.group(2) + parts.group(3) + ")" or + argfold == parts.group(1) + "(" + parts.group(3) + ")") \ + : match = True foundv[argind] = True if match: @@ -25,3 +28,4 @@ for arg, found in zip(argorg, foundv): if not found: print(arg + ": nothing appropriate.") +