Re: [NTG-context] (MkVI) Regression in named parameters, TL2013 to current

2014-03-01 Thread Rik Kabel

On 2014-03-01 04:59, Wolfgang Schuster wrote:


Am 01.03.2014 um 04:39 schrieb Rik Kabel <mailto:cont...@rik.users.panix.com>>:


And as I wrote in the first note, accepting non-letters (that is, 
other than the basic unaccented Aa--Zz) makes delimited parameter 
patterns difficult to use with Mark VI parameter names. Thus, we have 
the situation described in the following example, when in fact all 
should work without error (as I understand it, but perhaps 
\starttexdefinition has other limits of which I am not aware).


% macros=mkvi

% Fails to compile with TL2013 and current beta
%\starttexdefinition Test #1¦#2.
%  #1, #2!
%\stopdefinition

% Fails to compile with TL2013 and current beta
%\starttexdefinition Test #PARAM¦#ETER.
%  #PARAM, #ETER!
%\stopdefinition


1. You have a spelling error in the stop command.

2. Put braces around the argument names.


% macros=mkvi

\starttexdefinition Test #{PARAM}¦#{ETER}.
  #{PARAM}, #{ETER}!
\stoptexdefinition

\starttext

\Test No soap¦{radio}.

\stoptext


Wolfgang

Thank you, Wolfgang, for that. My usual mistake there is to type 
stoptextdefinition, with an extra t.


--
Rik
___
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
___

Re: [NTG-context] (MkVI) Regression in named parameters, TL2013 to current

2014-03-01 Thread Wolfgang Schuster

Am 01.03.2014 um 04:39 schrieb Rik Kabel :

> And as I wrote in the first note, accepting non-letters (that is, other than 
> the basic unaccented Aa–Zz) makes delimited parameter patterns difficult to 
> use with Mark VI parameter names. Thus, we have the situation described in 
> the following example, when in fact all should work without error (as I 
> understand it, but perhaps \starttexdefinition has other limits of which I am 
> not aware).
> 
> % macros=mkvi
> 
> % Fails to compile with TL2013 and current beta
> %\starttexdefinition Test #1¦#2.
> %  #1, #2!
> %\stopdefinition
> 
> % Fails to compile with TL2013 and current beta
> %\starttexdefinition Test #PARAM¦#ETER.
> %  #PARAM, #ETER!
> %\stopdefinition
1. You have a spelling error in the stop command.

2. Put braces around the argument names.


% macros=mkvi

\starttexdefinition Test #{PARAM}¦#{ETER}.
  #{PARAM}, #{ETER}!
\stoptexdefinition

\starttext

\Test No soap¦{radio}.

\stoptext


Wolfgang___
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
___

Re: [NTG-context] (MkVI) Regression in named parameters, TL2013 to current

2014-02-28 Thread Rik Kabel

On 2014-02-28 20:32, Hans Hagen wrote:

On 3/1/2014 12:45 AM, Rik Kabel wrote:

% macros=mkvi

\setupwhitespace[small]

\def\ä<^>?z{Ä<^>?}


only letters can make a \cs (not symbols)


Clearly this is not currently the case, although I would agree that it 
should be. Is there any way to enforce it? The definition above 
processes cleanly on TL2013 and the current beta. The log file shows 
nothing.


And as I wrote in the first note, accepting non-letters (that is, other 
than the basic unaccented Aa--Zz) makes delimited parameter patterns 
difficult to use with Mark VI parameter names. Thus, we have the 
situation described in the following example, when in fact all should 
work without error (as I understand it, but perhaps \starttexdefinition 
has other limits of which I am not aware).


   % macros=mkvi

   % Fails to compile with TL2013 and current beta
   %\starttexdefinition Test #1¦#2.
   %  #1, #2!
   %\stopdefinition

   % Fails to compile with TL2013 and current beta
   %\starttexdefinition Test #PARAM¦#ETER.
   %  #PARAM, #ETER!
   %\stopdefinition

   % Works with TL2013 and processes with errors on current beta
   %\def\Test#PARAM¦#ETER.{#PARAM, #ETER!}

   % Works with TL2013 and current beta
   \def\Test#1¦#2.{#1, #2!}

   \starttext

   \Test No soap¦{radio}.

   \stoptext

Perhaps these are two different problems, but they smell the same to me.

Finally, assuming that I am correct that

   \starttexdefinition Test #PARAM¦#ETER.

 should work, should

   \starttexdefinition Test #PARAM ¦ #ETER .

work the same. That is, are spaces allowed for readability in the 
definition pattern, or are they significant?
___
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
___

Re: [NTG-context] (MkVI) Regression in named parameters, TL2013 to current

2014-02-28 Thread Hans Hagen

On 3/1/2014 12:45 AM, Rik Kabel wrote:

% macros=mkvi

\setupwhitespace[small]

\def\ä<^>?z{Ä<^>?}


only letters can make a \cs (not symbols)


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-
___
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
___


[NTG-context] (MkVI) Regression in named parameters, TL2013 to current

2014-02-28 Thread Rik Kabel

% macros=mkvi

\setupwhitespace[small]

\def\ä<^>?z{Ä<^>?}

\def\Named[#PARAMETERNAME]{¦#PARAMETERNAME¦}

\def\Numbered[#1]{¦#1¦}

\starttext

\subject{Regression between TL2013 and current beta}

There does appear to have been some change or regression in the
definition of allowed characters in parameter names between the
versions of TL2013 ({\tt ConTeXt ver: 2013.05.28 00:36 MKIV current
fmt: 2013.12.11}) and the current standalone beta ({\tt ConTeXt ver:
2014.02.14 17:07 MKIV beta fmt:2014.2.14})

The definition
\type{\def\Named[#PARAMETERNAME]{¦#PARAMETERNAME¦}} (using BROKEN
BAR, U00A6) is processed without error and gives an acceptable
result under TL2013. Under the current beta it fails.

When warnings are skipped in the current beta, the generated PDF
shows that the trailing BROKEN BAR appears to be treated as a part
of the parameter name: \Named[value].

With numbered parameters (\type{\def\Numbered[#1]{¦#1¦}}), all is
well in both versions: \Numbered[value].

This issue makes it difficult to convert macros that use delimiters
(for example, \type{\def\ABC#1×#2¦{#1\ #2}}) to Mark VI syntax, and
difficult to create such macros under Mark VI.

\subject{What is allowed \ä<^>?z}

What characters are acceptable in Mark VI parameter names?

What characters are acceptable in Mark IV and Mark VI macro names?

The wiki states: \quotation{Mark VI is identical to Mark IV in
every respect, except that when you define a new macro you can give
parameters names instead of numbers.} Other than that, there is no
guidance.

Experimentation shows that many more characters are allowed in
\CONTEXT{} identifiers than are generally allowed with other \TeX{}
engines. The definition providing the last part of the subject of
this section, \type{\def\ä<^>?z{Ä<^>?}}, presents no problems.
(That definition fails in Lua\TeX, \pdfTeX, and \XeTeX. I have never
used Mark II, and do not have Ruby installed to enable a test.)

-\hbox{}-~\crlf
Rik Kabel

\stoptext

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


Re: [NTG-context] [mkvi] comment handling bug

2012-05-15 Thread Hans Hagen

On 14-5-2012 15:59, Philipp Gesang wrote:

+ leadingcomment


ok

--

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-
___
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
___


Re: [NTG-context] [mkvi] comment handling bug

2012-05-14 Thread Philipp Gesang
On 2012-05-14 15:22, Philipp Gesang wrote:
> On 2012-05-14 09:35, Hans Hagen wrote:
> > On 13-5-2012 13:12, Philipp Gesang wrote:
> > >Hi all,
> > >
> > >seems the mkvi-style macros have trouble with groups in comments:
> > >
> > >····
> > >% macros=mkvi
> > >\def\dosomething#content{%%%<= fine with “#1”
> > >   % { %%% Open unbalanced brace breaks macros.
> > >}
> > >
> > >\starttext \dosomething {foo} \stoptext
> > >
> > >
> > >Fails here with:
> > >
> > >   
> > > c
> > >   l.2 \def\dosomething#c
> > > ontent{%%%<= fine with “#1”
> > >
> > >Removing the comment, closing the group or reverting to TEX-style
> > >argument numbering makes this behavior disappear.
> > 
> > Indeed there are some limitations to the parser. I'll note it down
> > as low priority issue.
> 
> Would it be possible to modify the comment pattern so that it
> accept initial spaces? At least it fixes my problem.

I take that back, sorry for the noise. The better solution
appears to be adding the “leadingcomment” pattern to the rule
that handles balanced braces:



--- /home/laokoon/base/luat-mac.lua 2012-05-14 14:52:40.674091445 +0200
+++ luat-mac.lua2012-05-14 15:55:50.683559201 +0200
@@ -110,7 +110,7 @@
 
 local commenttoken   = P("%")
 local crorlf = S("\n\r")
-local commentline= commenttoken * ((Carg(1) * 
C((1-crorlf)^0))/function(strip,s) return strip and "" or s end)
+--local commentline= commenttoken * ((Carg(1) * 
C((1-crorlf)^0))/function(strip,s) return strip and "" or s end)
 local commentline= commenttoken * ((1-crorlf)^0)
 local leadingcomment = (commentline * crorlf^1)^1
 local furthercomment = (crorlf^1 * commentline)^1
@@ -160,6 +160,7 @@
 + V("texcode")
 + V("braced")
 + furthercomment
++ leadingcomment
 + nobrace
   )^0
  -- * rightbrace^-1, -- the -1 catches errors



Now definitions with commented-out unbalanced stuff like

  \def\dosomething#content{%%% {{
% { }{{ %%
\bgroup\italic#content\egroup
  }

will work too.

Philipp




pgpD2je4rZr8c.pgp
Description: PGP signature
___
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
___

Re: [NTG-context] [mkvi] comment handling bug

2012-05-14 Thread Philipp Gesang
On 2012-05-14 09:35, Hans Hagen wrote:
> On 13-5-2012 13:12, Philipp Gesang wrote:
> >Hi all,
> >
> >seems the mkvi-style macros have trouble with groups in comments:
> >
> >
> >% macros=mkvi
> >\def\dosomething#content{%%%<= fine with “#1”
> >   % { %%% Open unbalanced brace breaks macros.
> >}
> >
> >\starttext \dosomething {foo} \stoptext
> >
> >
> >Fails here with:
> >
> >   
> > c
> >   l.2 \def\dosomething#c
> > ontent{%%%<= fine with “#1”
> >
> >Removing the comment, closing the group or reverting to TEX-style
> >argument numbering makes this behavior disappear.
> 
> Indeed there are some limitations to the parser. I'll note it down
> as low priority issue.

Would it be possible to modify the comment pattern so that it
accept initial spaces? At least it fixes my problem.

Philipp

--- /home/laokoon/base/luat-mac.lua 2012-05-14 14:52:40.674091445 +0200
+++ luat-mac.lua2012-05-14 15:18:35.968999022 +0200
@@ -110,8 +110,10 @@
 
 local commenttoken   = P("%")
 local crorlf = S("\n\r")
-local commentline= commenttoken * ((Carg(1) * 
C((1-crorlf)^0))/function(strip,s) return strip and "" or s end)
-local commentline= commenttoken * ((1-crorlf)^0)
+--local commentline= commenttoken * ((Carg(1) * 
C((1-crorlf)^0))/function(strip,s) return strip and "" or s end)
+--local commentline= commenttoken * ((1-crorlf)^0)
+local commentstart   = space^0 * commenttoken
+local commentline= commentstart * ((1-crorlf)^0)
 local leadingcomment = (commentline * crorlf^1)^1
 local furthercomment = (crorlf^1 * commentline)^1


pgpRRztvZEQT4.pgp
Description: PGP signature
___
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
___

Re: [NTG-context] [mkvi] comment handling bug

2012-05-14 Thread Hans Hagen

On 13-5-2012 13:12, Philipp Gesang wrote:

Hi all,

seems the mkvi-style macros have trouble with groups in comments:


% macros=mkvi
\def\dosomething#content{%%%<= fine with “#1”
   % { %%% Open unbalanced brace breaks macros.
}

\starttext \dosomething {foo} \stoptext


Fails here with:

   
 c
   l.2 \def\dosomething#c
 ontent{%%%<= fine with “#1”

Removing the comment, closing the group or reverting to TEX-style
argument numbering makes this behavior disappear.


Indeed there are some limitations to the parser. I'll note it down as 
low priority issue.


Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-
___
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
___


[NTG-context] [mkvi] comment handling bug

2012-05-13 Thread Philipp Gesang
Hi all,

seems the mkvi-style macros have trouble with groups in comments:


% macros=mkvi
\def\dosomething#content{%%% <= fine with “#1”
  % { %%% Open unbalanced brace breaks macros.
}

\starttext \dosomething {foo} \stoptext


Fails here with:

   
c
  l.2 \def\dosomething#c
ontent{%%% <= fine with “#1”

Removing the comment, closing the group or reverting to TEX-style
argument numbering makes this behavior disappear.

Philipp


-- 
()  ascii ribbon campaign - against html e-mail
/\  www.asciiribbon.org   - against proprietary attachments


pgpCwiy8mxOvG.pgp
Description: PGP signature
___
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
___

Re: [NTG-context] \starttexdefinition and @ in macroname in mkvi

2011-12-30 Thread Hans Hagen

On 30-12-2011 10:43, Aditya Mahajan wrote:

Hi,

@, !, _ etc.\ are not recognized as part of the macro name when using
MkVI named
arguments with \starttexdefinition. For example, consider the following
example:

\unprotect
\starttexdefinition test@again #name
Name is #name
\stoptexdefinition
\protect

Processing this file using

mtxrun --script interface --preprocess test.mkvi --force

shows that #name is not recognized as a parameter. The preprocessing
works if I
remove the @ from the macro name.


ok, supported now, but of course it will only work out in unprotected mode

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-
___
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
___


[NTG-context] \starttexdefinition and @ in macroname in mkvi

2011-12-30 Thread Aditya Mahajan

Hi,

@, !, _ etc.\ are not recognized as part of the macro name when using MkVI named
arguments with \starttexdefinition. For example, consider the following example:

\unprotect
\starttexdefinition test@again #name
  Name is #name
\stoptexdefinition
\protect

Processing this file using

mtxrun --script interface --preprocess test.mkvi --force

shows that #name is not recognized as a parameter. The preprocessing works if I
remove the @ from the macro name.

Aditya
___
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
___