From: Joe Neeman Date: Sun, 10 Jan 2010 01:43:01 +0000 (+1100) Subject: Add comment for Lily_lexer::set_identifier. X-Git-Tag: release/2.13.11-1~53 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=6ca3f1b0e92f37f9f4bc44bb3627b928a5aeccd4;hp=5827aa5fe64d59d5747779f7c568b20918a743ff;p=lilypond.git Add comment for Lily_lexer::set_identifier. --- diff --git a/lily/include/lily-lexer.hh b/lily/include/lily-lexer.hh index b660eb8831..1854252e74 100644 --- a/lily/include/lily-lexer.hh +++ b/lily/include/lily-lexer.hh @@ -110,7 +110,7 @@ public: void push_note_state (SCM tab); void pop_state (); void LexerError (char const *); - void set_identifier (SCM name_string, SCM); + void set_identifier (SCM path, SCM val); int get_state () const; bool is_note_state () const; bool is_chord_state () const; diff --git a/lily/lily-lexer.cc b/lily/lily-lexer.cc index 3d51d54903..1af201d434 100644 --- a/lily/lily-lexer.cc +++ b/lily/lily-lexer.cc @@ -270,11 +270,13 @@ Lily_lexer::new_input (string str, Sources *ss) Includable_lexer::new_input (str, ss); } +// PATH is either a single symbol (or string) or a list of symbols +// giving the path to a nested property. A symbol is treated the same +// as a list of length 1. void -Lily_lexer::set_identifier (SCM path, SCM s) +Lily_lexer::set_identifier (SCM path, SCM val) { SCM sym = path; - SCM val = s; if (scm_is_string (path)) sym = scm_string_to_symbol (path); else if (scm_is_pair (path)) @@ -297,7 +299,7 @@ Lily_lexer::set_identifier (SCM path, SCM s) { SCM prev = scm_module_lookup (mod, sym); if (prev != SCM_UNDEFINED) - val = nested_property_alist (prev, path, s); + val = nested_property_alist (prev, path, val); } scm_module_define (mod, sym, val); }