From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/78131 Path: news.gmane.org!not-for-mail From: luigi scarso Newsgroups: gmane.comp.tex.context Subject: Re: Lua conditionals fail inside \starttexdefinition Date: Tue, 4 Sep 2012 21:41:38 +0200 Message-ID: References: <20120904142109.32f088b2@homerow> <827CE8D8-8E41-4267-B70C-FCACF6A0C2FC@gmail.com> <5AB862EA-153B-4485-A376-8618568826C7@gmail.com> <20120904204419.595d2f3b@homerow> <50464EDF.6020300@FU-Berlin.DE> <20120904210525.725f8b90@homerow> <504653F7.9050605@FU-Berlin.DE> <20120904213525.59460800@homerow> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1454549998==" X-Trace: ger.gmane.org 1346787708 22302 80.91.229.3 (4 Sep 2012 19:41:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 4 Sep 2012 19:41:48 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Tue Sep 04 21:41:49 2012 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1T8z0O-0002PU-1Q for gctc-ntg-context-518@m.gmane.org; Tue, 04 Sep 2012 21:41:48 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 066451024D; Tue, 4 Sep 2012 21:41:45 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id t0PVmp5llPBH; Tue, 4 Sep 2012 21:41:43 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id EA62B101F8; Tue, 4 Sep 2012 21:41:42 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 1A4D0101F8 for ; Tue, 4 Sep 2012 21:41:41 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id MGpfCLobSjz8 for ; Tue, 4 Sep 2012 21:41:40 +0200 (CEST) Original-Received: from filter3-til.mf.surf.net (filter3-til.mf.surf.net [194.171.167.219]) by balder.ntg.nl (Postfix) with ESMTP id 08946101EB for ; Tue, 4 Sep 2012 21:41:39 +0200 (CEST) Original-Received: from mail-wg0-f45.google.com (mail-wg0-f45.google.com [74.125.82.45]) by filter3-til.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id q84Jfd9b028481 for ; Tue, 4 Sep 2012 21:41:39 +0200 Original-Received: by wgbdq12 with SMTP id dq12so4604491wgb.2 for ; Tue, 04 Sep 2012 12:41:39 -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=l55HLTitRcjnognhLQ7ixwPJ1CplMgD1Kt9zBGl0IBU=; b=lO8GyRbr9N84TeZjzxGp7GPOwZVICKV01kIc18uyJGdTXdQish4oEPrLkBvGujcb4V /uoAOknjhSgMWF5+4/5Oe0GWIxK7r80MKUetGsj8NagCWPL1t7M1a7PZws+OWPNA9KtL F8o41Wge1UF/5VCZw2/Fgj+JLXouoVtIrmgPG9UvpHo0hJG5deBWcJKqwhhslCSySt30 EqhIcgXBeiXZkaDlMDIVtajOI/v9/DFU0T/jU5DbO18UWszehKw1SXZMWKMfG5gV6AOv LLqmKmC23lsxGRPafS+J3K2wZeDXMMMXxNCiT5MtQDVhP24XaWHfo3TKFBwzfuRVUL5B WlzA== Original-Received: by 10.180.85.167 with SMTP id i7mr32751464wiz.8.1346787699028; Tue, 04 Sep 2012 12:41:39 -0700 (PDT) Original-Received: by 10.223.75.155 with HTTP; Tue, 4 Sep 2012 12:41:38 -0700 (PDT) In-Reply-To: <20120904213525.59460800@homerow> X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=74.125.82.45; country=US; region=CA; city=Mountain View; postalcode=94043; latitude=37.4192; longitude=-122.0574; metrocode=807; areacode=650; http://maps.google.com/maps?q=37.4192,-122.0574&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 06HT7FDbi - d4efd7f58566 - 20120904 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.219 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.14 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:78131 Archived-At: --===============1454549998== Content-Type: multipart/alternative; boundary=f46d0444ed856372fc04c8e57263 --f46d0444ed856372fc04c8e57263 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Tue, Sep 4, 2012 at 9:35 PM, Marco Patzer wrote: > On 2012-09-04 Herbert Voss wrote: > > > voss@shania:~/ConTeXt> lua zzz.lua > > lua: zzz.lua:1: unexpected symbol near ';' > > marco@homerow:/tmp$ lua t.lua > true > > > voss@shania:~/ConTeXt> lua -v > > Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio > > marco@homerow:/tmp$ lua -v > Lua 5.2.1 Copyright (C) 1994-2012 Lua.org, PUC-Rio > > Because in Lua 5.2 there is the empty statements http://www.lua.org/manual/5.2/manual.html#3 """ 3.3.1 =E2=80=93 Blocks A block is a list of statements, which are executed sequentially: block ::=3D {stat} Lua has empty statements that allow you to separate statements with semicolons, start a block with a semicolon or write two semicolons in sequence: stat ::=3D =E2=80=98;=E2=80=99 """ So stat ::=3D if exp then block {elseif exp then block} [else block] end means that if exp then ; else ; end is valid. Luatex still uses lua 5.1.4 --=20 luigi --f46d0444ed856372fc04c8e57263 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

On Tue, Sep 4, 2012 at 9:35 PM, Marco Pa= tzer <homerow@lavabit.com> wrote:
On 2012-09-04 Herbert Voss <Herbert.Voss@FU-Berlin.DE&= gt; wrote:

> voss@shania:~/ConTeXt> lua zzz.lua
> lua: zzz.lua:1: unexpected symbol near ';'

marco@homerow:/tmp$ lua t.lua
true

> voss@shania:~/ConTeXt> lua -v
> Lua 5.1.4 =C2=A0Copyright (C) 1994-2008 Lua.org, PUC-Rio

marco@homerow:/tmp$ lua -v
Lua 5.2.1 =C2=A0Copyright (C) 1994-2012 Lua.org, PUC-Rio

=C2=A0
Because in Lua 5.2 = there is the empty statements
"""
3.3.1 =E2=80=93 Blocks

A block is a list of statements, which are executed sequentially:

block ::=3D {stat}
Lua has empty statements that allow you to separate statements with se= micolons, start a block with a semicolon or write two semicolons in sequenc= e:

stat ::=3D =E2=80=98;=E2=80=99
"""
So
stat ::=3D if exp then= block {elseif exp then block} [else block] end

me= ans that
if exp then
;
else
;
end
is valid.

Luatex still uses lua= 5.1.4


--
luigi

--f46d0444ed856372fc04c8e57263-- --===============1454549998== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ --===============1454549998==--