[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Shortcut for \repeat unfold

From: David Kastrup
Subject: Re: Shortcut for \repeat unfold
Date: Mon, 27 Sep 2021 23:59:31 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Jean Abou Samra <> writes:

> I *think* it means a token of lookahead is required
> after most curly braces, which *may* have consequences
> on synchronization between lexer and parser around mode
> boundaries — at any rate, parser.yy contains the comment
> // We must not have lookahead tokens parsed in lyric mode.
> Perhaps David can tell more?

There is not much more to tell.  Once a token has been lexed in some
mode, it's fixed.  So you don't want to require a lookahead token for
deciding whether to switch to a different lexing mode.

Tokens that are the same in different modes are not an issue, but lyric
mode lexes a whole lot of stuff into quite different tokens than other
modes do.

> I know, but is it significantly easier to write
> \defaultRepeatType percent
> compared to
> per = \repeat percent \etc
> ? The latter is allowed with David's patch, which
> has now become
> ­— thank you David!
> If it's a matter of discoverability, then it's the job
> of the documentation to advertise the possibility of
> defining these shortcuts, possibly mentioning it around
> repeats and possibly presenting \etc prominently in the
> learning manual next to variables.

I am somewhat loth to overstress \repeat ... \etc right now when \repeat
is hopefully slated to eventually become an ordinary music function
rather than an exception (it would be a real nuisance to explain why
\alternative does not work with \etc forms in the current version).
Once \repeat is a proper music functions, it may be a prime example for
\etc usage.

David Kastrup

reply via email to

[Prev in Thread] Current Thread [Next in Thread]