X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fmy-lily-lexer.cc;h=59e8d2f4a346347d6c481b58a4b81fd7a97f80b7;hb=a73704817cffadad65b2a9842a499cb6aac6eb5e;hp=c27bf01d0dad0c5464d853e402fd80bf91d35326;hpb=4995fea559cd5399b4f462de546a15195d76f4c3;p=lilypond.git diff --git a/lily/my-lily-lexer.cc b/lily/my-lily-lexer.cc index c27bf01d0d..59e8d2f4a3 100644 --- a/lily/my-lily-lexer.cc +++ b/lily/my-lily-lexer.cc @@ -3,7 +3,7 @@ source file of the GNU LilyPond music typesetter - (c) 1997--2001 Han-Wen Nienhuys + (c) 1997--2002 Han-Wen Nienhuys */ #include @@ -20,7 +20,6 @@ #include "debug.hh" #include "source-file.hh" #include "main.hh" -#include "scope.hh" #include "input.hh" #include "moment.hh" @@ -49,10 +48,9 @@ static Keyword_ent the_key_tab[]={ {"denies", DENIES}, {"duration", DURATION}, {"dynamicscript", DYNAMICSCRIPT}, - {"elementdescriptions", ELEMENTDESCRIPTIONS}, - {"font", FONT}, + {"grobdescriptions", GROBDESCRIPTIONS}, + {"figures",FIGURES}, {"grace", GRACE}, - {"ngrace", NGRACE}, {"glissando", GLISSANDO}, {"header", HEADER}, {"in", IN_T}, @@ -70,6 +68,7 @@ static Keyword_ent the_key_tab[]={ {"outputproperty", OUTPUTPROPERTY}, {"override", OVERRIDE}, {"set", SET}, + {"rest", REST}, {"revert", REVERT}, {"partial", PARTIAL}, {"paper", PAPER}, @@ -97,9 +96,7 @@ My_lily_lexer::My_lily_lexer () { keytable_p_ = new Keyword_table (the_key_tab); toplevel_variable_tab_ = new Scheme_hash_table ; - scope_p_ = new Scope (toplevel_variable_tab_); - - scope_l_arr_.push (scope_p_); + scope_l_arr_.push (toplevel_variable_tab_); errorlevel_i_ = 0; main_input_b_ = false; @@ -133,21 +130,25 @@ My_lily_lexer::start_main_input () } void -My_lily_lexer::set_identifier (String name_str, SCM s) +My_lily_lexer::set_identifier (SCM name, SCM s) { - if (lookup_keyword (name_str) >= 0) + assert (gh_string_p (name)); + + if (lookup_keyword (ly_scm2string (name)) >= 0) { - warning (_f ("Identifier name is a keyword: `%s'", name_str)); + size_t sz; + char * str = gh_scm2newstr (name, &sz) ; + warning (_f ("Identifier name is a keyword: `%s'", str)); + free (str); } - scope_l_arr_.top ()->set (name_str, s); + scope_l_arr_.top ()->set (scm_string_to_symbol (name), s); } My_lily_lexer::~My_lily_lexer () { delete keytable_p_; - scm_unprotect_object (toplevel_variable_tab_->self_scm ()); - delete scope_p_ ; + scm_gc_unprotect_object (toplevel_variable_tab_->self_scm ()); }