]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/lily-parser-scheme.cc
Merge branch 'jneeman' of git+ssh://jneem@git.sv.gnu.org/srv/git/lilypond into jneeman
[lilypond.git] / lily / lily-parser-scheme.cc
index 3092c6ca9d610d32e4c8a2da18a2222bdecdee94..83c3826dbdf7bf625f4becc951695b18e19a2d01 100644 (file)
@@ -11,7 +11,6 @@
 #include "file-name-map.hh"
 #include "file-name.hh"
 #include "file-path.hh"
-#include "input.hh"
 #include "international.hh"
 #include "lily-lexer.hh"
 #include "lily-parser.hh"
@@ -132,6 +131,7 @@ LY_DEFINE (ly_parse_file, "ly:parse-file",
 
       error = parser->error_level_;
 
+      parser->clear ();
       parser->unprotect ();
     }
 
@@ -163,7 +163,15 @@ LY_DEFINE (ly_parse_string, "ly:parse-string",
   return SCM_UNSPECIFIED;
 }
 
-LY_DEFINE (ly_clone_parser, "ly:clone-parser",
+LY_DEFINE (ly_parser_lexer, "ly:parser-lexer",
+          1, 0, 0, (SCM parser_smob),
+          "Return the lexer for PARSER_SMOB.")
+{
+  Lily_parser *parser = unsmob_lily_parser (parser_smob);
+  return parser->lexer_->self_scm ();
+}
+
+LY_DEFINE (ly_parser_clone, "ly:parser-clone",
           1, 0, 0, (SCM parser_smob),
           "Return a clone of PARSER_SMOB.")
 {