X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Flily-lexer.cc;h=ddf8510e9dc99bc2c892383d8e04f61eb6f8cc8c;hb=cfee004dad1a3138b02a297884a41b8109d6df62;hp=dd4c5e1b1d3cefec46ecd1c6baa8cc8150dc81e2;hpb=75eebcb49e52d296b1da3e1074e0825d2c780db4;p=lilypond.git diff --git a/lily/lily-lexer.cc b/lily/lily-lexer.cc index dd4c5e1b1d..ddf8510e9d 100644 --- a/lily/lily-lexer.cc +++ b/lily/lily-lexer.cc @@ -12,14 +12,15 @@ #include using namespace std; -#include "scm-hash.hh" +#include "international.hh" #include "interval.hh" -#include "parser.hh" #include "keyword.hh" -#include "warn.hh" -#include "source-file.hh" #include "main.hh" #include "moment.hh" +#include "parser.hh" +#include "scm-hash.hh" +#include "source-file.hh" +#include "warn.hh" static Keyword_ent the_key_tab[] = { @@ -171,9 +172,9 @@ Lily_lexer::set_current_scope () } int -Lily_lexer::lookup_keyword (String s) +Lily_lexer::lookup_keyword (std::string s) { - return keytable_->lookup (s.to_str0 ()); + return keytable_->lookup (s.c_str ()); } SCM @@ -190,9 +191,9 @@ Lily_lexer::lookup_identifier_symbol (SCM sym) } SCM -Lily_lexer::lookup_identifier (String name) +Lily_lexer::lookup_identifier (std::string name) { - return lookup_identifier_symbol (ly_symbol2scm (name.to_str0 ())); + return lookup_identifier_symbol (ly_symbol2scm (name.c_str ())); } void @@ -206,7 +207,7 @@ Lily_lexer::start_main_input () scm_module_define (scm_car (scopes_), ly_symbol2scm ("input-file-name"), - scm_makfrom0str (main_input_name_.to_str0 ())); + scm_makfrom0str (main_input_name_.c_str ())); } void @@ -220,8 +221,8 @@ Lily_lexer::set_identifier (SCM name, SCM s) { if (lookup_keyword (ly_symbol2string (sym)) >= 0) { - String symstr = ly_symbol2string (sym); - warning (_f ("identifier name is a keyword: `%s'", symstr.to_str0 ())); + std::string symstr = ly_symbol2string (sym); + warning (_f ("identifier name is a keyword: `%s'", symstr.c_str ())); } SCM mod = scm_car (scopes_); @@ -235,7 +236,7 @@ Lily_lexer::set_identifier (SCM name, SCM s) void Lily_lexer::LexerError (char const *s) { - if (include_stack_.is_empty ()) + if (include_stack_.empty ()) message (_f ("error at EOF: %s", s) + "\n"); else { @@ -284,7 +285,7 @@ Lily_lexer::add_lexed_char (int count) char const *start = here_str0 (); lexloc->set (get_source_file (), start, start + count); - char_count_stack_.top () += count; + char_count_stack_.back () += count; } #include "ly-smobs.icc"