]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/lily-lexer.cc
Fix typo in warning message
[lilypond.git] / lily / lily-lexer.cc
index d3673f2cdfbbea141d3edf80b56727be4285953f..1160fe69f6e18b0af582a74789c95eb412b57dc5 100644 (file)
@@ -1,7 +1,7 @@
 /*
   This file is part of LilyPond, the GNU music typesetter.
 
-  Copyright (C) 1997--2010 Han-Wen Nienhuys <hanwen@xs4all.nl>
+  Copyright (C) 1997--2011 Han-Wen Nienhuys <hanwen@xs4all.nl>
 
   LilyPond is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
@@ -109,7 +109,7 @@ Lily_lexer::Lily_lexer (Sources *sources, Lily_parser *parser)
   chord_repetition_ = Chord_repetition ();
   smobify_self ();
 
-  add_scope (ly_make_anonymous_module (false));
+  add_scope (ly_make_module (false));
   push_note_state (scm_c_make_hash_table (0));
   chordmodifier_tab_ = scm_make_vector (scm_from_int (1), SCM_EOL);
 }
@@ -136,7 +136,7 @@ Lily_lexer::Lily_lexer (Lily_lexer const &src, Lily_parser *parser)
   SCM *tail = &scopes;
   for (SCM s = src.scopes_; scm_is_pair (s); s = scm_cdr (s))
     {
-      SCM newmod = ly_make_anonymous_module (false);
+      SCM newmod = ly_make_module (false);
       ly_module_copy (newmod, scm_car (s));
       *tail = scm_cons (newmod, SCM_EOL);
       tail = SCM_CDRLOC (*tail);
@@ -295,9 +295,9 @@ Lily_lexer::set_identifier (SCM path, SCM val)
 
       if (scm_is_pair (path))
        {
-         SCM prev = scm_module_lookup (mod, sym);
-         if (prev != SCM_UNDEFINED)
-           val = nested_property_alist (prev, path, val);
+         SCM prev = ly_module_lookup (mod, sym);
+         if (prev != SCM_BOOL_F)
+           val = nested_property_alist (scm_variable_ref (prev), path, val);
        }
       scm_module_define (mod, sym, val);
     }
@@ -391,3 +391,9 @@ Lily_lexer::print_smob (SCM s, SCM port, scm_print_state*)
   scm_puts (" >", port);
   return 1;
 }
+
+bool
+Lily_lexer::is_clean () const
+{
+  return include_stack_.empty ();
+}