[PATCH] D85099: [UpdateTestChecks] Match unnamed values like "@[0-9]+" and "![0-9]+"

Johannes Doerfert via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 10 18:29:20 PDT 2020


jdoerfert added a comment.

(I'm going to sneak in `!range !` as well)



================
Comment at: llvm/utils/UpdateTestChecks/common.py:330
+    IR_VALUE_REGEXP_STRING += nameless_value.ir_prefix + r'(' + nameless_value.ir_regexp + r')'
+IR_VALUE_REGEXP_SUFFIX = r'([,\s\(\)]|\Z)'
+IR_VALUE_RE = re.compile(IR_VALUE_REGEXP_PREFIX + r'(' + IR_VALUE_REGEXP_STRING + r')' + IR_VALUE_REGEXP_SUFFIX)
----------------
MaskRay wrote:
> Can the suffix use `(?:...)`?
We use the captured value later, and I guess people want to keep the exact same "spaces". TBH, it won't make much difference to the logic anywhere (we'd still use `match.lastindex`). All it would do is it would make us "unify" the output, unsure if that is what we want.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D85099/new/

https://reviews.llvm.org/D85099



More information about the cfe-commits mailing list