From patchwork Mon May 18 16:40:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 186897 Delivered-To: patch@linaro.org Received: by 2002:a92:5b0a:0:0:0:0:0 with SMTP id p10csp3055774ilb; Mon, 18 May 2020 09:44:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzy/g56IzcB7z02X2wR4fQ6+X8fnbLW+ukOe67twZa02D/zCLcc147HHsRv11i+fb7rWb2f X-Received: by 2002:ac8:4e16:: with SMTP id c22mr7654816qtw.281.1589820278459; Mon, 18 May 2020 09:44:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589820278; cv=none; d=google.com; s=arc-20160816; b=h2ZM6uEO5hz8ssbtmq5BzsyrIA9WC3wgfKn114IPEmVeJMdyQ9Rxoj1I15lUC8P4M6 w9X7wFDCLnk1eG2SeJqkEG17tWFnIN5xgfpCI/y6vD79BQp9u8EiGG4FhR57abn6WusR otge/B7GiDwdKkhSQXXVKkww7NrDnFNX68YSIn9Xc8nLlBLiAgydOr5ohHUz5MnuSaW4 bOPTeg78ASZlcLEdWfUTXSNxEKJei9RpAV7Wzjd82Mx1fZzGZ3MKPv9qdjgWI9gXJh7e Ys/Eur+ZRHBHiahdoOZWAoVmr5HTpn/3opDif9272M9gOwOQxt61ugGcQufbk3+fGdg/ Pvww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=uFTRRQZQW7zKIC58JAMoD76cKh/Xgd23HtxsN8e+2Qk=; b=Ag4lFAFIgNiawDhbDmcVHSjMYYji0SDZrarchQuklaYNeNuMx+y82WYduwVBWVwwtz zeJ4cbmjYN0eJ8J7uyvNA1NqqOIXlCSHr6xbS0e7WQrsfQcuO6Qf0+Q+CAK3aX9RHv7M GjFSwZLsf/dkpVTdmhIxS296TsrBzg46i7BF5WzCxnKyJ7ztv0F0FdmxlguZIa5abhr4 KSuU0hn57d9/d/0dMW2cRInB9PDUIv2gxAiYSDuCX1IClRiTe8CN9L61PkWaFEB6BXGr bWYApGGyoFoCxRmVxPB05TRqYMtYOSpT9AB3GCtkV+fp6DE7xVlPWO3gxrXtm9LecCZx IH/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BN6CrBuU; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id h22si5874553qtn.53.2020.05.18.09.44.38 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 18 May 2020 09:44:38 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BN6CrBuU; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:58182 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jaisY-0007cP-1d for patch@linaro.org; Mon, 18 May 2020 12:44:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60152) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jaip0-0001wB-Lh for qemu-devel@nongnu.org; Mon, 18 May 2020 12:40:58 -0400 Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]:36861) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jaioz-0005pH-Kg for qemu-devel@nongnu.org; Mon, 18 May 2020 12:40:58 -0400 Received: by mail-pl1-x630.google.com with SMTP id f15so4451133plr.3 for ; Mon, 18 May 2020 09:40:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=uFTRRQZQW7zKIC58JAMoD76cKh/Xgd23HtxsN8e+2Qk=; b=BN6CrBuU1DRAEwPUwW5flubL4z1nKZQ9L5ZB+miR0mfZ9zyNi3WpsQhKOhc7tl6jJ+ qZlIKK1Vwe1JLQJCtkvVCxAbqCMCm1VdVcV7vQemfaokSSJQEG60EUxIMJhxlmysVP/x E1KEaYXfYsFm9jQExDtslSPn6R12iI6Rm9iJk3CF2AUplAiqcheD8uuFROnOFvHrdeYt BsGlrBQ2rM4lwp0ayNXwmj52XvB3iqxj4eBkANgrBXWdI8n7ZvIdeLEyu2+++OtvzVkA ZIutUpJFGIpotVWYnitksSKQjZMhfOp+/OvHaC4hOSOLtuEBfVh4lZnU6DVlNbEFEIeC ETnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=uFTRRQZQW7zKIC58JAMoD76cKh/Xgd23HtxsN8e+2Qk=; b=VXtrc8Fmqi0cZ1CP5Ew1EULcCBMqMetbrP6AHPDetUfQ6mTBOKdw4jCASmMYDfNVUb 5KwRL4AN8yhuY3h3LQspk6PimdHPcQn2OgUjhRC0D76QCuVXPz4vXlR3KkXE3ycMUql0 Yoez5gxVQKTEuAD74YVlmdAm2/QlR3Hl4/YBzA4lf6kAvo7syE2JM/Bk8T+nXFp1ED7e wkN2H2KnueAM+TsLUq1YBQq1ABQIpT8BmfJyIb+FfG/CQfqbM9lr1Juu1L4hOtr0hiNA r8cBeP1JzOQl0D6jscAzK51kdxn3o4u39YTUMgWpZoCrQ0MpX8phWV1fzB5/un9unwA1 Jizg== X-Gm-Message-State: AOAM532OMBxHXoVYTTKrNB5jSjWQmTKgeDi9T3hxYZf7ZtVzDfmvl/Vd rDsNH0PcIU4hdpB0ngTAmu/opCrbqhc= X-Received: by 2002:a17:90a:8c01:: with SMTP id a1mr255381pjo.127.1589820055721; Mon, 18 May 2020 09:40:55 -0700 (PDT) Received: from localhost.localdomain (174-21-143-238.tukw.qwest.net. [174.21.143.238]) by smtp.gmail.com with ESMTPSA id x132sm5790610pfd.214.2020.05.18.09.40.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 May 2020 09:40:54 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 1/8] decodetree: Remove python 3.4 check Date: Mon, 18 May 2020 09:40:45 -0700 Message-Id: <20200518164052.18689-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200518164052.18689-1-richard.henderson@linaro.org> References: <20200518164052.18689-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::630; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x630.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" We are now guaranteed python 3.5 or later. Signed-off-by: Richard Henderson --- scripts/decodetree.py | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) -- 2.20.1 Reviewed-by: Philippe Mathieu-Daudé diff --git a/scripts/decodetree.py b/scripts/decodetree.py index 46ab917807..f9d204aa36 100755 --- a/scripts/decodetree.py +++ b/scripts/decodetree.py @@ -75,13 +75,6 @@ def output(*args): output_fd.write(a) -if sys.version_info >= (3, 4): - re_fullmatch = re.fullmatch -else: - def re_fullmatch(pat, str): - return re.match('^' + pat + '$', str) - - def output_autogen(): output('/* This file is autogenerated by scripts/decodetree.py. */\n\n') @@ -428,18 +421,18 @@ def parse_field(lineno, name, toks): width = 0 func = None for t in toks: - if re_fullmatch('!function=' + re_ident, t): + if re.fullmatch('!function=' + re_ident, t): if func: error(lineno, 'duplicate function') func = t.split('=') func = func[1] continue - if re_fullmatch('[0-9]+:s[0-9]+', t): + if re.fullmatch('[0-9]+:s[0-9]+', t): # Signed field extract subtoks = t.split(':s') sign = True - elif re_fullmatch('[0-9]+:[0-9]+', t): + elif re.fullmatch('[0-9]+:[0-9]+', t): # Unsigned field extract subtoks = t.split(':') sign = False @@ -488,11 +481,11 @@ def parse_arguments(lineno, name, toks): flds = [] extern = False for t in toks: - if re_fullmatch('!extern', t): + if re.fullmatch('!extern', t): extern = True anyextern = True continue - if not re_fullmatch(re_ident, t): + if not re.fullmatch(re_ident, t): error(lineno, 'invalid argument set token "{0}"'.format(t)) if t in flds: error(lineno, 'duplicate argument "{0}"'.format(t)) @@ -621,13 +614,13 @@ def parse_generic(lineno, is_format, name, toks): continue # 'Foo=%Bar' imports a field with a different name. - if re_fullmatch(re_ident + '=%' + re_ident, t): + if re.fullmatch(re_ident + '=%' + re_ident, t): (fname, iname) = t.split('=%') flds = add_field_byname(lineno, flds, fname, iname) continue # 'Foo=number' sets an argument field to a constant value - if re_fullmatch(re_ident + '=[+-]?[0-9]+', t): + if re.fullmatch(re_ident + '=[+-]?[0-9]+', t): (fname, value) = t.split('=') value = int(value) flds = add_field(lineno, flds, fname, ConstField(value)) @@ -635,7 +628,7 @@ def parse_generic(lineno, is_format, name, toks): # Pattern of 0s, 1s, dots and dashes indicate required zeros, # required ones, or dont-cares. - if re_fullmatch('[01.-]+', t): + if re.fullmatch('[01.-]+', t): shift = len(t) fms = t.replace('0', '1') fms = fms.replace('.', '0') @@ -652,7 +645,7 @@ def parse_generic(lineno, is_format, name, toks): fixedmask = (fixedmask << shift) | fms undefmask = (undefmask << shift) | ubm # Otherwise, fieldname:fieldwidth - elif re_fullmatch(re_ident + ':s?[0-9]+', t): + elif re.fullmatch(re_ident + ':s?[0-9]+', t): (fname, flen) = t.split(':') sign = False if flen[0] == 's':