]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/lily-parser.cc
Add pango_fc_font_unlock_face call to possibly free a fontface
[lilypond.git] / lily / lily-parser.cc
index ba3bd0f99be8c0f5a503d5dffe50d7cb007f047a..5c1a3d358d61f390212f14915fa60e1d5c3536ce 100644 (file)
@@ -163,6 +163,36 @@ Lily_parser::parse_string (string ly_code)
   error_level_ = error_level_ | lexer_->error_level_;
 }
 
+SCM
+Lily_parser::parse_string_expression (string ly_code)
+{
+  // TODO: use $parser
+  lexer_->set_identifier (ly_symbol2scm ("parser"),
+                          self_scm ());
+
+  lexer_->main_input_name_ = "<string>";
+  lexer_->is_main_input_ = true;
+  lexer_->new_input (lexer_->main_input_name_, ly_code, sources_);
+
+  SCM mod = lexer_->set_current_scope ();
+  lexer_->push_embedded_token ();
+  do_yyparse ();
+  SCM result = lexer_->lookup_identifier_symbol (ly_symbol2scm ("$parseStringResult"));
+  // $parseStringResult is set in the grammar rule for embedded_lilypond
+  
+  scm_set_current_module (mod);
+
+  if (!define_spots_.empty ())
+    {
+      if (define_spots_.empty ()
+          && !error_level_)
+        programming_error ("define_spots_ don't match, but error_level_ not set.");
+    }
+
+  error_level_ = error_level_ | lexer_->error_level_;
+  return result;
+}
+
 void
 Lily_parser::include_string (string ly_code)
 {