From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mail.openembedded.org (Postfix) with ESMTP id 08C326FF9B for ; Thu, 4 Feb 2016 06:33:42 +0000 (UTC) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga104.fm.intel.com with ESMTP; 03 Feb 2016 22:33:43 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,393,1449561600"; d="scan'208,217";a="876684079" Received: from tbniels-mobl.ger.corp.intel.com (HELO [10.252.9.212]) ([10.252.9.212]) by orsmga001.jf.intel.com with ESMTP; 03 Feb 2016 22:33:41 -0800 User-Agent: Microsoft-MacOutlook/0.0.0.151105 Date: Thu, 04 Feb 2016 08:33:40 +0200 From: Markus Lehtonen To: Christopher Larson Message-ID: Thread-Topic: [bitbake-devel] [PATCH 1/2] data_smart: simple bracket matching inside python expressions References: <1454495619-15453-1-git-send-email-markus.lehtonen@linux.intel.com> <1454495619-15453-2-git-send-email-markus.lehtonen@linux.intel.com> In-Reply-To: Mime-version: 1.0 Cc: "bitbake-devel@lists.openembedded.org" Subject: Re: [PATCH 1/2] data_smart: simple bracket matching inside python expressions X-BeenThere: bitbake-devel@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussion that advance bitbake development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Feb 2016 06:33:46 -0000 Content-type: multipart/alternative; boundary="B_3537419622_617436366" --B_3537419622_617436366 Content-type: text/plain; charset="UTF-8" Content-transfer-encoding: quoted-printable Hi Christopher, On 03/02/16 17:56, "Christopher Larson" wrote: On Wed, Feb 3, 2016 at 3:33 AM, Markus Lehtonen wrote: This expands the python expansion regex by matching curly brackets inside python expressions. In its simplicity it is limited: e.g. it does not correctly handle nested curly brackets or open curly brackets (i.e. '{' without a matching '}') inside python expressions. Making python parsing inside data_smart fully error-free would require significantly more work, basically using/implementing python parser to correctly handle python strings etc. [YOCTO #8849] Signed-off-by: Markus Lehtonen Will this cause problems with regular variable expansion nested inside of i= nline python, which is allowed? I.e. ${@ ... '${FOO}'} No, it wont affect that. First of all because the variable expansion is don= e before python expansion =E2=80=93 ${FOO} would be expanded before the Python reg= exp is evaluated. Second, the limitation about nested brackets is only about= nested brackets inside the python expression (i.e. something like '${FOO${B= AR}}'). Thanks, Markus --B_3537419622_617436366 Content-type: text/html; charset="UTF-8" Content-transfer-encoding: quoted-printable
Hi Christopher,

On 03/02/16 17:56, "Christopher Larson" <kergoth@gmail.com on behalf of clarson@kergoth.com> wrote:


On = Wed, Feb 3, 2016 at 3:33 AM, Markus Lehtonen <markus.lehtonen@linux.= intel.com> wrote:
This expands the python expansion regex = by matching curly brackets
inside python expressions. In its simplicity it is limited: e.g. it does not correctly handle nested curly brackets or open curly brackets (i.e.
= '{' without a matching '}') inside python expressions. Making python
parsing inside data_smart fully error-free would require significantly
more work, basically using/implementing python parser to correctly
handle python strings etc.

[YOCTO #8849]

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Will this cause problems with regular variab= le expansion nested inside of inline python, which is allowed? I.e. ${@ ... = '${FOO}'}

No, it wont= affect that. First of all because the variable expansion is done before pyt= hon expansion – ${FOO} would be expanded before the Python regexp is e= valuated. Second, the limitation about nested brackets is only about nested = brackets inside the python expression (i.e. something like '${FOO${BAR}}').<= /div>

Thanks,
  Markus

--B_3537419622_617436366--