From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/106767 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Gerben Wierda Newsgroups: gmane.comp.tex.context Subject: Trying to understand this ctxlua error Date: Mon, 6 Apr 2020 00:41:29 +0200 Message-ID: <2EBF1308-12F4-4EF1-B309-89B403D3FAD6@rna.nl> Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.14\)) Content-Type: multipart/mixed; boundary="===============2460598754461995859==" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="121779"; mail-complaints-to="usenet@ciao.gmane.io" To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Mon Apr 06 00:41:48 2020 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane-mx.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jLDxb-000VZ6-UU for gctc-ntg-context-518@m.gmane-mx.org; Mon, 06 Apr 2020 00:41:47 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 8F7B91830BB; Mon, 6 Apr 2020 00:41:33 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id SRiZYJ-Ff07l; Mon, 6 Apr 2020 00:41:32 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 9B98D1830C1; Mon, 6 Apr 2020 00:41:32 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id F22CC1830BB for ; Mon, 6 Apr 2020 00:41:30 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4qe_CfAKrqgP for ; Mon, 6 Apr 2020 00:41:30 +0200 (CEST) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=213.125.118.53; helo=mail.rna.nl; envelope-from=gerben.wierda@rna.nl; receiver= Original-Received: from mail.rna.nl (mail.rna.nl [213.125.118.53]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id 482B418308D for ; Mon, 6 Apr 2020 00:41:30 +0200 (CEST) Original-Received: from hermione.rna.nl (hermione.rna.nl [192.168.2.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.rna.nl (Postfix) with ESMTPSA id B2ACC3CE36DE for ; Mon, 6 Apr 2020 00:41:29 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rna.nl; s=dkim_rsa2048; t=1586126489; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=vd+XPgIUcuMVZ0T9W9bu6yFDnHeD5I43dDyTQGEJ0rU=; b=cwWsPjkqR5jvRCB/vBnmnpThDU/jRrdp6uCMJd2DX2915DMuqdxLTaqMEyC7gTfcLZc3LG fhVuT7apqUkAhRmo4J5g5maWH+CJH6TZ+wJqLrjMKm71/qGWQXnv3curWhbocPvntlGhLa C/1eL/kX7dDniXySKBY66GCulbN5s4DprPBYwCCLB3brFPaTHmMOe7KGEE3PWdk2hFNRLV jOWYj3y9saMK4HfFqD6mNm7eCMVCtcPeSWTaoPJ0jftXEOEzEF+x8vXFHL9LqYFpUzMYVR gJtbtkU6cyq2cuOMCyT38Dbg3yYyIzxujkZz3Gdu9cVgBJI1n5JcJutlS0GrFQ== X-Mailer: Apple Mail (2.3445.104.14) X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.26 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" Xref: news.gmane.io gmane.comp.tex.context:106767 Archived-At: --===============2460598754461995859== Content-Type: multipart/alternative; boundary="Apple-Mail=_C8C2DC62-E52E-4508-BF3D-BEC94F9152A4" --Apple-Mail=_C8C2DC62-E52E-4508-BF3D-BEC94F9152A4 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 I got this error after I had changed some lua code: tex error > tex error on line 272 in file archimate-lua.new: ! = Undefined control sequence warnIfVerbose( "Breaking off the processing of node %s\nNo=20 l...eak = xsi:type", node) \luat_start_lua_code_indeed ...ormalexpanded {\endgroup \noexpand = \directlua {#1 = }} l.272 \stopluacode =20 The control sequence at the end of the top line of your error message = was never \def'ed. You can just continue as I'll forget about whatever was = undefined. I have been looking at that code for over two hours, not seeing anything = wrong with it. But I=E2=80=99ve now finally found the culprit and I = still do not get it. The culprit was: warnIfVerbose( "Breaking off the processing of %s\n No = elementRef", node) The problem goes away when I use: warnIfVerbose( "Breaking off the processing of %s\nNo = elementRef", node) (I don=E2=80=99t want the line after the node is printed to begin with a = space). But the lack of space between \n and N kills lua (apparently). For = completeness (as string.format and texio.write_nl are also in play): function warnWithLabelIfVerbose( str, ... ) if verboseProgram then texio.write_nl( str .. string.format(...)) end end function warnIfVerbose( ... ) warnWithLabelIfVerbose("-----> ", ...) end Is this a lua bug? A ConTeXt bug? Expected behaviour? And if so, why is = reported that on line 272 (where \stopluacode is) is the error? Or is = the error message indeed helpful and do I just lack the know how to = interpret it? G (Took me three hours, this one. Just removing that space that happened = with some other changes was the culprit. Totally unexpected for me.)= --Apple-Mail=_C8C2DC62-E52E-4508-BF3D-BEC94F9152A4 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 I got this error = after I had changed some lua code:

tex error       > tex = error on line 272 in file archimate-lua.new: ! Undefined control = sequence

  =       warnIfVerbose( "Breaking off the processing of node = %s\nNo 
      l...eak        =                     =                     =                     = xsi:type", node)
\luat_start_lua_code_indeed ...ormalexpanded {\endgroup = \noexpand \directlua {#1
          =                     =                     =                     =           }}
l.272 \stopluacode

               =  


<empty file>


The control sequence at the end of the = top line of your error message was never
\def'ed. You can just continue as I'll = forget about whatever was undefined.

I have been = looking at that code for over two hours, not seeing anything wrong with = it. But I=E2=80=99ve now finally found the culprit and I still do not = get it.

The = culprit was:

        =   warnIfVerbose( "Breaking off the processing of %s\n No = elementRef", node)

The problem goes away when I = use:

          warnIfVerbose( = "Breaking off the processing of %s\nNo elementRef", = node)

(I don=E2=80=99t want the line after the node is printed to = begin with a space).

But the lack of space between \n and N kills lua = (apparently). For completeness (as string.format and texio.write_nl are = also in play):

function = warnWithLabelIfVerbose( str, ... )
  if verboseProgram = then
    = texio.write_nl( str .. string.format(...))
  end
end

function warnIfVerbose( ... = )
  = warnWithLabelIfVerbose("-----> ", ...)
end

Is this a lua bug? A ConTeXt bug? = Expected behaviour? And if so, why is reported that on line 272 (where = \stopluacode is) is the error? Or is the error message indeed helpful = and do I just lack the know how to interpret it?

G

(Took me three hours, this one. Just = removing that space that happened with some other changes was the = culprit. Totally unexpected for me.)
= --Apple-Mail=_C8C2DC62-E52E-4508-BF3D-BEC94F9152A4-- --===============2460598754461995859== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly9jb250ZXh0LmFhbmhldC5uZXQKYXJjaGl2ZSAgOiBodHRwczovL2JpdGJ1Y2tldC5v cmcvcGhnL2NvbnRleHQtbWlycm9yL2NvbW1pdHMvCndpa2kgICAgIDogaHR0cDovL2NvbnRleHRn YXJkZW4ubmV0Cl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCg== --===============2460598754461995859==--