ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Lua conditionals fail inside \starttexdefinition
@ 2012-09-04 12:21 Marco Patzer
  2012-09-04 12:26 ` Wolfgang Schuster
  0 siblings, 1 reply; 17+ messages in thread
From: Marco Patzer @ 2012-09-04 12:21 UTC (permalink / raw)
  To: ntg-context

Hi,

I discovered strange behaviour concerning Lua conditionals within
texdefinitions.

ConTeXt complains: 'then' expected near 'thenelseend'.

I guess it has something to do with how the content of a
texdefinitions is grabbed. Seems like a bug or is this by design?


% This works fine
\def\mycmd{%
  \startluacode
    if true then
    else
    end
  \stopluacode}

% This one fails
% \starttexdefinition mycmd
%   \startluacode
%     if true then
%     else
%     end
%   \stopluacode
% \stoptexdefinition

\startluacode
  userdata = userdata or { }
  function userdata.myfun()
    if true then
    else
    end
  end
\stopluacode

% This also works fine
\starttexdefinition mycmd
  \luacode{userdata.myfun()}
\stoptexdefinition

\mycmd


Marco

___________________________________________________________________________________
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2012-09-05  9:09 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-04 12:21 Lua conditionals fail inside \starttexdefinition Marco Patzer
2012-09-04 12:26 ` Wolfgang Schuster
2012-09-04 18:24   ` Aditya Mahajan
2012-09-04 18:34     ` Wolfgang Schuster
2012-09-04 18:44       ` Marco Patzer
2012-09-04 18:56         ` Herbert Voss
2012-09-04 19:05           ` Marco Patzer
2012-09-04 19:15             ` luigi scarso
2012-09-04 19:18             ` Herbert Voss
2012-09-04 19:35               ` Marco Patzer
2012-09-04 19:39                 ` Herbert Voss
2012-09-04 19:47                   ` Marco Patzer
2012-09-04 19:41                 ` luigi scarso
2012-09-04 19:05           ` Aditya Mahajan
2012-09-04 19:22             ` luigi scarso
2012-09-04 19:28               ` Herbert Voss
2012-09-05  9:09         ` Hans Hagen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).