X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Flily-lexer.cc;h=b6cbda7f976160ee0b9cd5f0463a446eee9aa686;hb=255d19c2edfe2ec4dc648b582a96e6fcb0039197;hp=c02143da4ccc556323dab062f9b2649b9e3e0725;hpb=00b9619cea1020f6773f23df8764ef85ee2912bf;p=lilypond.git diff --git a/lily/lily-lexer.cc b/lily/lily-lexer.cc index c02143da4c..b6cbda7f97 100644 --- a/lily/lily-lexer.cc +++ b/lily/lily-lexer.cc @@ -1,7 +1,7 @@ /* This file is part of LilyPond, the GNU music typesetter. - Copyright (C) 1997--2014 Han-Wen Nienhuys + Copyright (C) 1997--2015 Han-Wen Nienhuys LilyPond is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -35,6 +35,7 @@ using namespace std; #include "warn.hh" #include "program-option.hh" #include "lily-parser.hh" +#include "ly-module.hh" static Keyword_ent the_key_tab[] = @@ -56,6 +57,7 @@ static Keyword_ent the_key_tab[] {"description", DESCRIPTION}, {"drummode", DRUMMODE}, {"drums", DRUMS}, + {"etc", ETC}, {"figuremode", FIGUREMODE}, {"figures", FIGURES}, {"header", HEADER}, @@ -123,8 +125,8 @@ Lily_lexer::Lily_lexer (Lily_lexer const &src, Lily_parser *parser, main_input_level_ = 0; extra_tokens_ = SCM_EOL; - if (Input::unsmob (override_input)) - override_input_ = *Input::unsmob (override_input); + if (unsmob (override_input)) + override_input_ = *unsmob (override_input); smobify_self (); @@ -193,7 +195,7 @@ Lily_lexer::keyword_list () const SCM *tail = &l; for (vsize i = 0; i < keytable_->table_.size (); i++) { - *tail = scm_acons (scm_from_locale_string (keytable_->table_[i].name_), + *tail = scm_acons (scm_from_utf8_string (keytable_->table_[i].name_), scm_from_int (keytable_->table_[i].tokcode_), SCM_EOL); @@ -209,7 +211,7 @@ Lily_lexer::lookup_identifier_symbol (SCM sym) for (SCM s = scopes_; scm_is_pair (s); s = scm_cdr (s)) { SCM var = ly_module_lookup (scm_car (s), sym); - if (var != SCM_BOOL_F) + if (scm_is_true (var)) return scm_variable_ref (var); } @@ -281,7 +283,7 @@ Lily_lexer::set_identifier (SCM path, SCM val) if (scm_is_pair (path)) { SCM prev = ly_module_lookup (mod, sym); - if (prev != SCM_BOOL_F) + if (scm_is_true (prev)) val = nested_property_alist (scm_variable_ref (prev), path, val); } scm_module_define (mod, sym, val); @@ -299,7 +301,7 @@ Lily_lexer::LexerError (char const *s) { error_level_ |= 1; Input spot (*lexloc_); - spot.error (s); + spot.non_fatal_error (s); } } @@ -368,7 +370,7 @@ Lily_lexer::add_lexed_char (int count) const char Lily_lexer::type_p_name_[] = "ly:lily-lexer?"; SCM -Lily_lexer::mark_smob () +Lily_lexer::mark_smob () const { ASSERT_LIVE_IS_ALLOWED (self_scm ()); @@ -382,12 +384,10 @@ Lily_lexer::mark_smob () } int -Lily_lexer::print_smob (SCM s, SCM port, scm_print_state *) +Lily_lexer::print_smob (SCM port, scm_print_state *) const { - Lily_lexer *lexer = Lily_lexer::unsmob (s); - scm_puts ("#scopes_, port); + scm_display (scopes_, port); scm_puts (" >", port); return 1; }