[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 04/16] Factor SCM_IDENTIFIER out from embedded_scm_arg*
From: |
David Kastrup |
Subject: |
[PATCH 04/16] Factor SCM_IDENTIFIER out from embedded_scm_arg* |
Date: |
Tue, 9 Oct 2012 20:59:49 +0200 |
SCM_IDENTIFIER indicates "active Scheme" introduced with $ that is
subject to copying and reinterpretation. While the parser had its own
*_IDENTIFIER category for everything interpreted specially, the
fallback SCM_IDENTIFIER itself never needed special or different
treatment from material generated with # (SCM_TOKEN). As the various
*_IDENTIFIER types are faded out, this is changing. As a consequence,
SCM_IDENTIFIER no longer shares the non-terminals with other
Scheme-type definitions.
---
lily/parser.yy | 42 ++++++++++++++++++++++++++++++++++++++++--
1 file changed, 40 insertions(+), 2 deletions(-)
diff --git a/lily/parser.yy b/lily/parser.yy
index 3fda842..de47a59 100644
--- a/lily/parser.yy
+++ b/lily/parser.yy
@@ -492,8 +492,11 @@ embedded_scm_active:
;
embedded_scm_bare_arg:
- embedded_scm_bare
- | STRING
+ STRING
+ | SCM_TOKEN
+ {
+ $$ = parser->lexer_->eval_scm_token ($1);
+ }
| full_markup
| full_markup_list
| context_modification
@@ -1221,6 +1224,10 @@ function_arglist_closed_nonbackup:
{
$$ = check_scheme_arg (parser, @4, $4, $3, $2);
}
+ | EXPECT_OPTIONAL EXPECT_SCM function_arglist SCM_IDENTIFIER
+ {
+ $$ = check_scheme_arg (parser, @4, $4, $3, $2);
+ }
| EXPECT_OPTIONAL EXPECT_SCM function_arglist_closed bare_number_closed
{
$$ = check_scheme_arg (parser, @4, $4, $3, $2);
@@ -1233,6 +1240,10 @@ function_arglist_nonbackup:
{
$$ = check_scheme_arg (parser, @4, $4, $3, $2);
}
+ | EXPECT_OPTIONAL EXPECT_SCM function_arglist SCM_IDENTIFIER
+ {
+ $$ = check_scheme_arg (parser, @4, $4, $3, $2);
+ }
| EXPECT_OPTIONAL EXPECT_SCM function_arglist_closed bare_number
{
$$ = check_scheme_arg (parser, @4, $4, $3, $2);
@@ -1260,6 +1271,16 @@ function_arglist_backup:
MYBACKUP (SCM_IDENTIFIER, $4, @4);
}
}
+ EXPECT_OPTIONAL EXPECT_SCM function_arglist_keep SCM_IDENTIFIER
+ {
+ if (scm_is_true (scm_call_1 ($2, $4)))
+ {
+ $$ = scm_cons ($4, $3);
+ } else {
+ $$ = scm_cons (loc_on_music (@3, $1), $3);
+ MYBACKUP (SCM_IDENTIFIER, $4, @4);
+ }
+ }
| EXPECT_OPTIONAL EXPECT_SCM function_arglist_closed_keep
post_event_nofinger
{
if (scm_is_true (scm_call_1 ($2, $4)))
@@ -1386,6 +1407,11 @@ function_arglist_backup:
$$ = check_scheme_arg (parser, @3,
$3, $1, $2);
}
+ | function_arglist_backup REPARSE SCM_IDENTIFIER
+ {
+ $$ = check_scheme_arg (parser, @3,
+ $3, $1, $2);
+ }
| function_arglist_backup REPARSE bare_number
{
$$ = check_scheme_arg (parser, @3,
@@ -1405,6 +1431,11 @@ function_arglist_common:
$$ = check_scheme_arg (parser, @3,
$3, $2, $1);
}
+ | EXPECT_SCM function_arglist_optional SCM_IDENTIFIER
+ {
+ $$ = check_scheme_arg (parser, @3,
+ $3, $2, $1);
+ }
| EXPECT_SCM function_arglist_closed_optional bare_number
{
$$ = check_scheme_arg (parser, @3,
@@ -1511,6 +1542,11 @@ function_arglist_closed_common:
$$ = check_scheme_arg (parser, @3,
$3, $2, $1);
}
+ | EXPECT_SCM function_arglist_optional SCM_IDENTIFIER
+ {
+ $$ = check_scheme_arg (parser, @3,
+ $3, $2, $1);
+ }
| EXPECT_SCM function_arglist_closed_optional bare_number
{
$$ = check_scheme_arg (parser, @3,
@@ -1945,6 +1981,7 @@ simple_string: STRING {
scalar:
embedded_scm_arg
+ | SCM_IDENTIFIER
| bare_number
| FRACTION
| lyric_element
@@ -1952,6 +1989,7 @@ scalar:
scalar_closed:
embedded_scm_arg_closed
+ | SCM_IDENTIFIER
| bare_number
| FRACTION
| lyric_element
--
1.7.9.5
- Context.Grob considered as symbol list, David Kastrup, 2012/10/09
- [PATCH 08/16] Allow property and grob paths to be constructed from strings, David Kastrup, 2012/10/09
- [PATCH 07/16] Add symbol-list? predicate, David Kastrup, 2012/10/09
- [PATCH 05/16] Let \accidentalStyle detect its optional context argument by looking at its letter case, David Kastrup, 2012/10/09
- [PATCH 11/16] Replace the rather fuzzy list-or-symbol? with symbol-list-or-symbol?, David Kastrup, 2012/10/09
- [PATCH 13/16] Change \accidentalStyle to get a symbol list as argument, David Kastrup, 2012/10/09
- [PATCH 03/16] parser.yy: make is_regular_identifier match the lexer definition, David Kastrup, 2012/10/09
- [PATCH 14/16] convert-ly rule for \alterbroken, \accidentalStyle, \overrideProperty, David Kastrup, 2012/10/09
- [PATCH 01/16] Assignments can't contain literal lyric music (wrong lexer mode), David Kastrup, 2012/10/09
- [PATCH 04/16] Factor SCM_IDENTIFIER out from embedded_scm_arg*,
David Kastrup <=
- [PATCH 02/16] parser.yy: FRACTION does not require a closed expression before it, David Kastrup, 2012/10/09
- [PATCH 16/16] Let \overrideProperty accept nested properties, David Kastrup, 2012/10/09
- [PATCH 12/16] Make \alterBroken, \hide, \omit, \overrideProperty, \shape take unquoted Context.Grob specs, David Kastrup, 2012/10/09
- [PATCH 09/16] Allow the string "xxx.yyy" to parse as a symbol list, David Kastrup, 2012/10/09
- [PATCH 06/16] Allow LilyPond strings to stand in for symbols when parsing, David Kastrup, 2012/10/09
- [PATCH 15/16] Run scripts/auxiliar/update-with-convert-ly.sh, David Kastrup, 2012/10/09
- [PATCH 10/16] Add symbol-list-or-music? predicate, David Kastrup, 2012/10/09
- Re: Context.Grob considered as symbol list, Colin Campbell, 2012/10/09