]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/lily-lexer.cc
Add some missing regtests for warnings
[lilypond.git] / lily / lily-lexer.cc
index 5d87c83872d25052496f800de539760a71264c69..6c1336744b3286f6e2f0ca21d13ad8c5d4a508ca 100644 (file)
@@ -75,8 +75,6 @@ static Keyword_ent the_key_tab[]
   {"once", ONCE},
   {"override", OVERRIDE},
   {"paper", PAPER},
-  {"partial", PARTIAL},
-  {"relative", RELATIVE},
   {"remove", REMOVE},
   {"repeat", REPEAT},
   {"rest", REST},
@@ -85,11 +83,9 @@ 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},
@@ -108,6 +104,7 @@ Lily_lexer::Lily_lexer (Sources *sources, Lily_parser *parser)
   is_main_input_ = false;
   start_module_ = SCM_EOL;
   chord_repetition_ = Chord_repetition ();
+  extra_tokens_ = SCM_EOL;
   smobify_self ();
 
   add_scope (ly_make_module (false));
@@ -130,6 +127,7 @@ Lily_lexer::Lily_lexer (Lily_lexer const &src, Lily_parser *parser)
   is_main_input_ = src.is_main_input_;
 
   scopes_ = SCM_EOL;
+  extra_tokens_ = SCM_EOL;
 
   smobify_self ();
 
@@ -310,7 +308,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 +317,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 +389,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_;
 }