Return-Path: X-Original-To: apmail-site-dev-archive@www.apache.org Delivered-To: apmail-site-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B915417F44 for ; Fri, 4 Sep 2015 13:50:02 +0000 (UTC) Received: (qmail 96191 invoked by uid 500); 4 Sep 2015 13:49:58 -0000 Delivered-To: apmail-site-dev-archive@apache.org Received: (qmail 96056 invoked by uid 500); 4 Sep 2015 13:49:58 -0000 Mailing-List: contact site-dev-help@apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list site-dev@apache.org Received: (qmail 96042 invoked by uid 99); 4 Sep 2015 13:49:58 -0000 Received: from Unknown (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Sep 2015 13:49:58 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 08AB8182107; Fri, 4 Sep 2015 13:49:58 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.102 X-Spam-Level: X-Spam-Status: No, score=-0.102 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id v94xifGFP11G; Fri, 4 Sep 2015 13:49:57 +0000 (UTC) Received: from mail-ig0-f171.google.com (mail-ig0-f171.google.com [209.85.213.171]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with ESMTPS id CC0F220751; Fri, 4 Sep 2015 13:49:56 +0000 (UTC) Received: by igcrk20 with SMTP id rk20so12697272igc.1; Fri, 04 Sep 2015 06:49:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=8zbZe9VaJ2h64gI+98T/e7iVKpEXZl+2MqsecZM6Vxs=; b=AqqbPxFrWC0HdbibolQhq1ANwYnaRiS+TLsX5Q2t5b3AVgflj5kTBJu54F7qU4dTso 04Q6UKN8/dcpdYhxN8BOnsgy/RItxo7X2UZGRJsfi6uJmD81KhieePoD4ZNvV3cojVKe TECsnpyId24BVZNQegRp9RC02EUBPgTFF3gT9dCj7iQeGXK3eiBXfKTlqhfbmwXjSwx2 loQK+Dmm56G8cvWe+Zp6/4dGzUiEwp4Bv/TK/lmzMitA1OwDRFi7PZYx8yL4uhfJdfr9 ylv3D4yLlNKKEP8h6PNcH3X1dlyJMYr1Qu7CCj4sDnsyEGYY5UcVdLCXB1hEmteLPtq8 jYUA== MIME-Version: 1.0 X-Received: by 10.50.60.37 with SMTP id e5mr7493107igr.91.1441374589871; Fri, 04 Sep 2015 06:49:49 -0700 (PDT) Received: by 10.107.135.199 with HTTP; Fri, 4 Sep 2015 06:49:49 -0700 (PDT) In-Reply-To: <20150903162315.52E52AC0054@hades.apache.org> References: <20150903162315.52E52AC0054@hades.apache.org> Date: Fri, 4 Sep 2015 14:49:49 +0100 Message-ID: Subject: Re: svn commit: r1701061 - /infrastructure/site/trunk/content/dyn/closer.lua From: sebb To: site-dev@apache.org, humbedooh@apache.org Content-Type: text/plain; charset=UTF-8 On 3 September 2015 at 17:23, wrote: > Author: humbedooh > Date: Thu Sep 3 16:23:14 2015 > New Revision: 1701061 > > URL: http://svn.apache.org/r1701061 > Log: > new parser works, put in production \o/ > > Modified: > infrastructure/site/trunk/content/dyn/closer.lua > > Modified: infrastructure/site/trunk/content/dyn/closer.lua > URL: http://svn.apache.org/viewvc/infrastructure/site/trunk/content/dyn/closer.lua?rev=1701061&r1=1701060&r2=1701061&view=diff > ============================================================================== > --- infrastructure/site/trunk/content/dyn/closer.lua (original) > +++ infrastructure/site/trunk/content/dyn/closer.lua Thu Sep 3 16:23:14 2015 > @@ -74,44 +74,11 @@ function recurse(url, defs, tdata, r, ez > end > ) > > + -- Parse EZT > + local structure = ezt:import("[ezt]"..tdata.."[end]") Why is the data wrapped in [ezt]/[end] ? Is that really needed? It messes up reporting of mismatched [end] markers. The line number is shown for the wrapper [end] rather than the one in the template > - if defs.debug then > - local structure = ezt:import("[ezt]"..tdata.."[end]") > - return ezt:construct(structure, ezt_defs) > - else > - tdata = tdata:gsub("%[if%-any%s+([a-z0-9_]+)%](.-)%[end%]", > - function(tag, middle) > - --print("Got if-any", tag, " recursing it...", #middle) > - if url[tag] or mymap[tag] then > - > - tdata = recurse(url, defs, middle, r) > - return tdata > - else > - return "" > - end > - end > - ) > - tdata = tdata:gsub("%[for%s+([a-z0-9_]+)%](.-)%[end%]", > - function(tag, middle) > - if mymap and mymap[tag] then > - -- print("Got for:", tag, "recursing") > - local m = "" > - -- print(middle) > - for _, val in pairs(mymap[tag] or {}) do > - defs[tag] = val > - -- print("def", tag, val) > - m = m .. recurse(url, defs, middle, r) > - > - end > - return m > - else > - return "" > - end > - end > - ) > - end > - tdata = tdata:gsub("%[([a-z0-9_]+)%]", function(a) return defs[a] or "[" .. a .. "]" end) > - return tdata > + -- Render output > + return ezt:construct(structure, ezt_defs) > end > > function handle(r) > >