using namespace std;
#include "book.hh"
+#include "context.hh"
#include "context-def.hh"
#include "context-mod.hh"
#include "dimensions.hh"
%token EVENT_IDENTIFIER
%token EVENT_FUNCTION
%token FRACTION
+%token LOOKUP_IDENTIFIER
%token LYRIC_ELEMENT
%token MARKUP_FUNCTION
%token MARKUP_LIST_FUNCTION
}
;
+lookup:
+ LOOKUP_IDENTIFIER
+ | LOOKUP_IDENTIFIER '.' symbol_list_rev
+ {
+ $$ = loc_on_music (parser, @$,
+ nested_property ($1, scm_reverse_x ($3, SCM_EOL)));
+ }
+ ;
+
embedded_scm_bare:
SCM_TOKEN
{
embedded_scm_active:
SCM_IDENTIFIER
| scm_function_call
+ | lookup
;
embedded_scm_bare_arg:
| book_block
| bookpart_block
| output_def
+ | lookup
;
/* The generic version may end in music, or not */
embedded_scm:
embedded_scm_bare
| scm_function_call
+ | lookup
;
/* embedded_scm_arg is _not_ casting pitches to music by default, this
symbol_list_part:
symbol_list_element
{
- $$ = try_string_variants (Lily::symbol_list_p, $1);
+ $$ = try_string_variants (Lily::key_list_p, $1);
if (SCM_UNBNDP ($$)) {
- parser->parser_error (@1, _("not a symbol"));
+ parser->parser_error (@1, _("not a key"));
$$ = SCM_EOL;
} else
$$ = scm_reverse ($$);
symbol_list_element:
STRING
| embedded_scm_bare
+ | UNSIGNED
;
} else if (unsmob<Score> (sid)) {
*destination = unsmob<Score> (sid)->clone ()->unprotect ();
return SCM_IDENTIFIER;
+ } else if (scm_is_pair (sid)
+ && scm_is_true (Lily::key_list_p (sid))) {
+ *destination = sid;
+ return LOOKUP_IDENTIFIER;
}
-
return -1;
}
if (scm_is_true (scm_call_1 (pred, str)))
return str;
// a symbol may be interpreted as a list of symbols if it helps
- if (scm_is_symbol (str)) {
+ if (scm_is_true (Lily::key_p (str))) {
str = scm_list_1 (str);
if (scm_is_true (scm_call_1 (pred, str)))
return str;