X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Flily-lexer.cc;h=7f017a437bb8874b15b77b73e3741e07e090db2c;hb=418adb3cf974523a481a7b92975bea16e8b43472;hp=5d87c83872d25052496f800de539760a71264c69;hpb=bb8a0a5387af94dd2702877256334b160575a730;p=lilypond.git diff --git a/lily/lily-lexer.cc b/lily/lily-lexer.cc index 5d87c83872..7f017a437b 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--2011 Han-Wen Nienhuys + Copyright (C) 1997--2012 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 @@ -58,25 +58,19 @@ static Keyword_ent the_key_tab[] {"drums", DRUMS}, {"figuremode", FIGUREMODE}, {"figures", FIGURES}, - {"grobdescriptions", GROBDESCRIPTIONS}, {"header", HEADER}, - {"key", KEY}, {"layout", LAYOUT}, {"lyricmode", LYRICMODE}, {"lyrics", LYRICS}, {"lyricsto", LYRICSTO}, - {"mark", MARK}, {"markup", MARKUP}, - {"markuplines", MARKUPLINES}, + {"markuplist", MARKUPLIST}, {"midi", MIDI}, {"name", NAME}, {"new", NEWCONTEXT}, {"notemode", NOTEMODE}, - {"once", ONCE}, {"override", OVERRIDE}, {"paper", PAPER}, - {"partial", PARTIAL}, - {"relative", RELATIVE}, {"remove", REMOVE}, {"repeat", REPEAT}, {"rest", REST}, @@ -85,11 +79,7 @@ static Keyword_ent the_key_tab[] {"sequential", SEQUENTIAL}, {"set", SET}, {"simultaneous", SIMULTANEOUS}, - {"skip", SKIP}, {"tempo", TEMPO}, - {"time", TIME_T}, - {"times", TIMES}, - {"transpose", TRANSPOSE}, {"type", TYPE}, {"unset", UNSET}, {"with", WITH}, @@ -107,7 +97,7 @@ Lily_lexer::Lily_lexer (Sources *sources, Lily_parser *parser) error_level_ = 0; is_main_input_ = false; start_module_ = SCM_EOL; - chord_repetition_ = Chord_repetition (); + extra_tokens_ = SCM_EOL; smobify_self (); add_scope (ly_make_module (false)); @@ -124,12 +114,12 @@ Lily_lexer::Lily_lexer (Lily_lexer const &src, Lily_parser *parser) pitchname_tab_stack_ = src.pitchname_tab_stack_; sources_ = src.sources_; start_module_ = SCM_EOL; - chord_repetition_ = src.chord_repetition_; - error_level_ = src.error_level_; + error_level_ = 0; is_main_input_ = src.is_main_input_; scopes_ = SCM_EOL; + extra_tokens_ = SCM_EOL; smobify_self (); @@ -310,7 +300,7 @@ void Lily_lexer::LexerError (char const *s) { if (include_stack_.empty ()) - message (_f ("error at EOF: %s", s) + "\n"); + non_fatal_error (s, _f ("%s:EOF", s)); else { error_level_ |= 1; @@ -319,6 +309,18 @@ Lily_lexer::LexerError (char const *s) } } +void +Lily_lexer::LexerWarning (char const *s) +{ + if (include_stack_.empty ()) + warning (s, _f ("%s:EOF", s)); + else + { + Input spot (*lexloc_); + spot.warning (s); + } +} + char Lily_lexer::escaped_char (char c) const { @@ -379,6 +381,7 @@ Lily_lexer::mark_smob (SCM s) scm_gc_mark (lexer->parser_->self_scm ()); scm_gc_mark (lexer->pitchname_tab_stack_); scm_gc_mark (lexer->start_module_); + scm_gc_mark (lexer->extra_tokens_); return lexer->scopes_; }