From 6ca3f1b0e92f37f9f4bc44bb3627b928a5aeccd4 Mon Sep 17 00:00:00 2001 From: Joe Neeman Date: Sun, 10 Jan 2010 12:43:01 +1100 Subject: [PATCH] Add comment for Lily_lexer::set_identifier. --- lily/include/lily-lexer.hh | 2 +- lily/lily-lexer.cc | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) 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); } -- 2.39.2