X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;ds=sidebyside;f=lily%2Fmy-lily-lexer.cc;h=43495eb06cf6a01b960febcc02baa7b151bd5ef0;hb=5cfb4ad642561dcb61593b1aeb24717c5eb110da;hp=13a479956c65a6f235cfa7f0b2df48059f938034;hpb=cec6dfa6bf0fb931eb7f42b1ee44ca2ec19a9f34;p=lilypond.git diff --git a/lily/my-lily-lexer.cc b/lily/my-lily-lexer.cc index 13a479956c..43495eb06c 100644 --- a/lily/my-lily-lexer.cc +++ b/lily/my-lily-lexer.cc @@ -23,6 +23,7 @@ static Keyword_ent the_key_tab[]={ {"accepts", ACCEPTS}, {"bar", BAR}, + {"break", BREAK}, {"cadenza", CADENZA}, {"clear", CLEAR}, {"clef", CLEF}, @@ -48,15 +49,15 @@ static Keyword_ent the_key_tab[]={ {"output", OUTPUT}, {"partial", PARTIAL}, {"paper", PAPER}, - {"plet", PLET}, {"property", PROPERTY}, {"pt", PT_T}, {"score", SCORE}, {"script", SCRIPT}, + {"shape", SHAPE}, {"skip", SKIP}, {"staff", STAFF}, {"table", TABLE}, - {"spandynamic", SPANDYNAMIC}, + {"spandynamic", SPANDYNAMIC}, {"symboltables", SYMBOLTABLES}, {"tempo", TEMPO}, {"texid", TEXID}, @@ -79,7 +80,7 @@ My_lily_lexer::My_lily_lexer() int My_lily_lexer::lookup_keyword (String s) { - return keytable_p_->lookup (s); + return keytable_p_->lookup (s.ch_C ()); } Identifier* @@ -87,7 +88,7 @@ My_lily_lexer::lookup_identifier (String s) { if (!identifier_p_dict_p_->elt_b (s)) return 0; - + return (*identifier_p_dict_p_)[s]; } @@ -96,9 +97,9 @@ void My_lily_lexer::set_identifier (String name_str, Identifier*i) { Identifier *old = lookup_identifier (name_str); - if (old) + if (old) { - old->warning("redeclaration of \\" + name_str); + old->warning(_("redeclaration of \\") + name_str); delete old; } (*identifier_p_dict_p_)[name_str] = i; @@ -109,7 +110,7 @@ My_lily_lexer::~My_lily_lexer() delete keytable_p_; for (Assoc_iter - ai (*identifier_p_dict_p_); ai.ok(); ai++) + ai (*identifier_p_dict_p_); ai.ok(); ai++) { DOUT << "deleting: " << ai.key()<<'\n'; delete ai.val(); @@ -121,9 +122,9 @@ void My_lily_lexer::print_declarations (bool init_b) const { for (Assoc_iter ai (*identifier_p_dict_p_); - ai.ok(); ai++) + ai.ok(); ai++) { - if (ai.val()->init_b_ == init_b) + if (ai.val()->init_b_ == init_b) { DOUT << ai.key() << '='; ai.val()->print (); @@ -134,11 +135,11 @@ My_lily_lexer::print_declarations (bool init_b) const void My_lily_lexer::LexerError (char const *s) { - if (include_stack_.empty()) + if (include_stack_.empty()) { - *mlog << "error at EOF" << s << '\n'; + *mlog << _("error at EOF") << s << '\n'; } - else + else { errorlevel_i_ |= 1; Input spot (source_file_l(),here_ch_C()); @@ -164,3 +165,21 @@ My_lily_lexer::clear_notenames() delete note_tab_p_; note_tab_p_ = new Notename_table; } + +char +My_lily_lexer::escaped_char(char c) const +{ + switch(c) + { + case 'n': + return '\n'; + case 't': + return '\t'; + + case '\'': + case '\"': + case '\\': + return c; + } + return 0; +}