lilypond-devel
[Top][All Lists]
Advanced

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

Re: LilyPond strings and \markup


From: Joe Neeman
Subject: Re: LilyPond strings and \markup
Date: Mon, 17 Aug 2009 09:30:19 +1000

On Sun, 2009-08-16 at 14:05 -0700, Mark Polesky wrote:
> \version "2.13.4"
> 
> %%%%%%%%%%%%
> % QUESTION 1
> 
> % "quoted string" is STRING
> strA = "quoted string"
> 
> % #"hash-quoted string" is SCM_TOKEN
> strB = #"hash-quoted string"
> 
> % these are both 'unexpected STRING_IDENTIFIER's:
> % \strA \strB
> 
> % Why isn't \strB an 'unexpected SCM_IDENTIFIER'?
> 
> 
> %%%%%%%%%%%%
> % QUESTION 2
> 
> % A valid LilyPond unquoted 'STRING':
> % 1) must be entirely alphabetic, and
> % 2) cannot be interpreted as a number, pitch, rest, or operator.
> 
> % So, without quotes, these are all invalid LilyPond 'STRING's:
> % 3 f r + big-pr0bl3m!
> 
> % but \markup accepts all of these seamlessly:
> \markup { 3 f r + n0-pr0bl3m! }
> 
> % It's as if, behind the scenes, the parser silently adds quotes.
> % So how exactly does that happen? And does the parser read
> % them as LilyPond 'STRING's or as a Scheme strings?

Markups are parsed in a different lexer state. See lexer.ll:515, which
only takes effect inside a \markup (and grep parser.yy for
push_markup_state).

Cheers,
Joe






reply via email to

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