#include <cctype>
#include <cstdlib>
#include <cstdio>
+using namespace std;
#include "book.hh"
#include "context-def.hh"
#include "lily-imports.hh"
void
-Lily_parser::parser_error (Input const *i, Lily_parser *parser, SCM *, const std::string &s)
+Lily_parser::parser_error (Input const *i, Lily_parser *parser, SCM *, const string &s)
{
parser->parser_error (*i, s);
}
#define _(x) gettext (x)
#endif
-using std::string;
static Music *make_music_with_input (SCM name, Input where);
SCM check_scheme_arg (Lily_parser *parser, Input loc,
| pitch_or_music
| FRACTION
| string
- | embedded_scm
+ | embedded_scm
| partial_markup
| full_markup_list
| context_modification
TEMPO steno_duration '=' tempo_range {
$$ = MAKE_SYNTAX (tempo, @$, SCM_EOL, $2, $4);
}
- | TEMPO scalar steno_duration '=' tempo_range {
+ | TEMPO text steno_duration '=' tempo_range {
$$ = MAKE_SYNTAX (tempo, @$, $2, $3, $5);
}
- | TEMPO scalar {
+ | TEMPO text {
$$ = MAKE_SYNTAX (tempo, @$, $2);
} %prec ':'
;
;
string:
- STRING {
- $$ = $1;
- }
+ STRING
| full_markup
;
-simple_string: STRING {
- $$ = $1;
+text:
+ STRING
+ | full_markup
+ | embedded_scm_bare
+ {
+ if (Text_interface::is_markup ($1)) {
+ $$ = $1;
+ } else {
+ parser->parser_error (@1, (_ ("markup expected")));
+ $$ = scm_string (SCM_EOL);
+ }
}
+ ;
+
+simple_string: STRING
| embedded_scm_bare
{
if (scm_is_string ($1)) {
;
partial_markup:
- markup_mode markup_head_1_list ETC
+ markup_mode markup_partial_function ETC
{
$$ = MAKE_SYNTAX (partial_markup, @2, $2);
parser->lexer_->pop_state ();
}
;
+markup_partial_function:
+ MARKUP_FUNCTION markup_arglist_partial
+ {
+ $$ = scm_list_1 (scm_cons ($1, scm_reverse_x ($2, SCM_EOL)));
+ }
+ | markup_head_1_list MARKUP_FUNCTION markup_arglist_partial
+ {
+ $$ = scm_cons (scm_cons ($2, scm_reverse_x ($3, SCM_EOL)),
+ $1);
+ }
+ ;
+
+markup_arglist_partial:
+ EXPECT_MARKUP markup_arglist_partial
+ {
+ $$ = $2;
+ }
+ | EXPECT_SCM markup_arglist_partial
+ {
+ $$= $2;
+ }
+ | EXPECT_MARKUP markup_command_list_arguments
+ {
+ $$ = $2;
+ }
+ | EXPECT_SCM markup_command_list_arguments
+ {
+ $$ = $2;
+ }
+ ;
+
markup_head_1_item:
MARKUP_FUNCTION EXPECT_MARKUP markup_command_list_arguments {
$$ = scm_cons ($1, scm_reverse_x ($3, SCM_EOL));