]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/includable-lexer.cc
* lily/tab-note-heads-engraver.cc: listen to string number events
[lilypond.git] / lily / includable-lexer.cc
index 6d5207a084b33289766b7d557e537c91ac368f6d..929397042501302787e52ec5bb1a6edf410bda3d 100644 (file)
@@ -7,10 +7,10 @@
 */
 
 #include <sstream>
+#include "config.h"
 
-
-#include "file-path.hh"
 #include "includable-lexer.hh"
+#include "file-path.hh"
 #include "source-file.hh"
 #include "source.hh"
 #include "warn.hh"
 #define YYSTATE YY_START
 #endif
 
+/* Flex >= 2.5.29 has include stack; but we don't use that yet.  */
+#ifndef HAVE_FLEXLEXER_YY_CURRENT_BUFFER
+#define yy_current_buffer \
+  (yy_buffer_stack != 0 ? yy_buffer_stack[yy_buffer_stack_top] : 0)
+#endif
+
 Includable_lexer::Includable_lexer ()
 {
+#ifdef HAVE_FLEXLEXER_YY_CURRENT_BUFFER
   yy_current_buffer = 0;
+#endif
   allow_includes_b_ = true;
 }
 
@@ -106,10 +114,14 @@ Includable_lexer::close_input ()
   if (verbose_global_b)
     progress_indication ("]");
   yy_delete_buffer (yy_current_buffer);
+#ifdef HAVE_FLEXLEXER_YY_CURRENT_BUFFER  
   yy_current_buffer = 0;
+#endif  
   if (state_stack_.empty ())
     {
+#ifdef HAVE_FLEXLEXER_YY_CURRENT_BUFFER  
       yy_current_buffer = 0;
+#endif  
       return false;
     }
   else