Simplifies pure documentation in the CG.
Removes old information about lists and articulates everything in terms
of unpure-pure-containers.
Issue 3727: Allow header blocks and output definitions in \score to precede music

This addresses a frequent complaint of users.
Regularize score handling (origin and copying)

Scores get their origin set when score_body is called, and when encountered
in \xxx and  constructs, are properly copied.
Issue 3728: Allow score and book identifiers at top level, and score identifiers in book(part)s

Instead of

xxx = \score { ... }
yyy = \book { ... }
\score { \xxx }
\book { \yyy }

you can now just write

xxx = \score { ... }
yyy = \book { ... }
\xxx
\yyy

Book and bookparts at top level are distinguished by virtue of only
books having a \paper block.
Issue 3726: toplevel-music-functions should be a session variable

We don't want changes in a .ly file to bleed into subsequent files.
Move the extra_token mechanism out of the lexer proper

Calling lex->pop_extra_token explicitly in the parser's yylex function
makes things considerably more robust.  It also allows pushing and
popping the EOF condition, necessary for backing up right at the end
of a file, like with ##{ \relative { c d e f } #} where the music
expression is checked against being a pitch, and then is backed up.
Parser: let MYREPARSE and MYBACKUP back up even in presence of lookahead

This implies that the lookahead token must not yet have made an impact
on the state stack other than causing the reduction of the current
rule, or switching the lookahead token while Bison is mulling it over
will cause trouble.

Since an LALR(1) works on the top of the stack, this can usually be
guaranteed.  The "Too much lookahead" message is not produced.  If
these constructs are misused, the parser should typically complain
about the replacement token being unexpected.

The advantage is the ability to vastly simplify syntax rules that up
to now have to avoid lookahead tokens with a lot of drudgework.
Add location data to extra_tokens_ stack in lexer.
Permit event functions to use a non-closed argument list.
Remove all closed music expressions
Parser: inline a few "common" expressions occuring only once now
Parser: remove pitch_arg and PITCH_ARG
Parser: remove command_element and command_event synonyms of tempo_event
Parser: properly disambiguate pitches from music in function arguments

In many instances, function arguments were parsed greedily without
looking at the function argument predicates first.  This did not allow
using subsequent function arguments of type pitch and duration since
they were combined into one music expression.
Adapt documentation for optional arguments now that lookahead is permissible
Merge branch 'issue3723' into staging