ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <pragma@wxs.nl>
Subject: Re: \doifnextcharelse problem
Date: Thu, 26 Feb 2004 19:00:33 +0100	[thread overview]
Message-ID: <6.0.1.1.2.20040226185816.01febec0@server-1> (raw)
In-Reply-To: <20040226163813.GG26896@puritan.pcp.ath.cx>

At 17:38 26/02/2004, you wrote:

>which case the first character in the body of the command is checked
>\doifnextcharelse[... which thus fails but in some manner eats it (even

tricky indeed (will think about it)

go the etex way:

\definecomplexorsimpleempty\startbnfgrammar

\long\def\complexstartbnfgrammar[#1]#2\stopbnfgrammar
   {\bgroup%
    \global\firstruletrue%
    \global\newruletrue%
    \global\donerulefalse%
    \setupbnfgrammar[#1]%
    \setcatcodes%
    \starttable[|r|c|l|]\scantokens{#2}\LR\stoptable
    \egroup}

beware, use

\def\BNFsomecommand

to avoid future nameclashes; also, no % are needed after a \cs:

\long\def\complexstartbnfgrammar[#1]#2\stopbnfgrammar
   {\bgroup
    \global\firstruletrue
    \global\newruletrue
    \global\donerulefalse
    \setupbnfgrammar[#1]%
    \setcatcodes
    \starttable[|r|c|l|]\scantokens{#2}\LR\stoptable
    \egroup}

I assume that you know that \setcatcodes is an internal command

Hans  

  reply	other threads:[~2004-02-26 18:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-26 16:38 Nikolai Weibull
2004-02-26 18:00 ` Hans Hagen [this message]
2004-02-26 19:05   ` Nikolai Weibull
2004-02-27  7:53     ` Hans Hagen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6.0.1.1.2.20040226185816.01febec0@server-1 \
    --to=pragma@wxs.nl \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).