提交 3864d863 编写于 作者: M Michal Privoznik

apibuild: Substitute only pure number tokens

In 38df47c9 I've tried to prepare our apibuild.py script for
change made in 0628f349 (1U << 31). What I've done in the
former commit was to replace \d+U in parsed tokens with \d.
Problem was, my regular expression there was not quite right as
it also translated VIR_123U_VAL into VIR_123_VAL.
Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
上级 b099aa88
......@@ -1399,7 +1399,7 @@ class CParser:
while token[0] != "sep" or (token[1] != ',' and
token[1] != '}'):
# We might be dealing with '1U << 12' here
value = value + re.sub("(\d+)U","\\1", token[1])
value = value + re.sub("^(\d+)U$","\\1", token[1])
token = self.token()
else:
try:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册