]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/lily-parser.cc
* lily/hairpin.cc: lengthen hairpin if space is available.
[lilypond.git] / lily / lily-parser.cc
index c489c356f2982e5220af812f60767fcce6d04601..8ad9b9c47e4224e9b6aac15e4ca2fc4565230ba0 100644 (file)
@@ -118,10 +118,6 @@ Lily_parser::parse_file (String init, String name, String out_name)
 void
 Lily_parser::parse_string (String ly_code)
 {
-#if 0
-  SCM parent_prot = lexer_ ? lexer_->self_scm () : SCM_EOL;
-#endif
-
   Lily_lexer * parent = lexer_;
   lexer_ = (parent == 0 ? new Lily_lexer (sources_)
            : new Lily_lexer (*parent));
@@ -150,24 +146,6 @@ Lily_parser::parse_string (String ly_code)
 
   error_level_ = error_level_ | lexer_->error_level_;
 
-#if 0
-  if (Lily_lexer::unsmob (parent_prot))
-    {
-      /*
-       what the fuck is this good for?
-       */
-      parent->encoding_ = lexer_->encoding_;
-      parent->chordmodifier_tab_ = lexer_->chordmodifier_tab_;
-      parent->pitchname_tab_stack_ = lexer_->pitchname_tab_stack_;
-      parent->sources_ = lexer_->sources_;
-      parent->scopes_ = lexer_->scopes_;
-      parent->error_level_ = lexer_->error_level_; 
-      parent->main_input_b_ = lexer_->main_input_b_;
-    }
-  
-  scm_remember_upto_here_1 (parent_prot);
-#endif
-  
   scm_set_current_module (oldmod);
   lexer_ = 0;
 }
@@ -256,8 +234,8 @@ LY_DEFINE (ly_parse_file, "ly:parse-file",
           "Parse a single @code{.ly} file.  "
           "Upon failure, throw @code{ly-file-failed} key.")
 {
-  SCM_ASSERT_TYPE (ly_c_string_p (name), name, SCM_ARG1, __FUNCTION__, "string");
-  char const *file = SCM_STRING_CHARS (name);
+  SCM_ASSERT_TYPE (scm_is_string (name), name, SCM_ARG1, __FUNCTION__, "string");
+  char const *file = scm_i_string_chars (name);
   char const *extensions[] = {"ly", "", 0};
 
   String file_name = global_path.find (file, extensions);
@@ -326,7 +304,7 @@ LY_DEFINE (ly_parse_string, "ly:parse-string",
           "Parse the string LY_CODE.  "
           "Upon failure, throw @code{ly-file-failed} key.")
 {
-  SCM_ASSERT_TYPE (ly_c_string_p (ly_code), ly_code, SCM_ARG1, __FUNCTION__, "string");
+  SCM_ASSERT_TYPE (scm_is_string (ly_code), ly_code, SCM_ARG1, __FUNCTION__, "string");
   
   Sources sources;
   sources.set_path (&global_path);
@@ -356,7 +334,7 @@ LY_DEFINE (ly_parser_define, "ly:parser-define",
           "Bind SYMBOL to VAL in PARSER_SMOB's module.")
 {
   Lily_parser *parser = unsmob_my_lily_parser (parser_smob);
-  SCM_ASSERT_TYPE (ly_c_symbol_p (symbol), symbol, SCM_ARG2, __FUNCTION__, "symbol");
+  SCM_ASSERT_TYPE (scm_is_symbol (symbol), symbol, SCM_ARG2, __FUNCTION__, "symbol");
   SCM_ASSERT_TYPE (parser, parser_smob, SCM_ARG2, __FUNCTION__, "parser");  
 
   parser->lexer_->set_identifier (scm_symbol_to_string (symbol), val);
@@ -370,7 +348,7 @@ LY_DEFINE (ly_parser_lookup, "ly:parser-lookup",
 {
   Lily_parser *parser = unsmob_my_lily_parser (parser_smob);
 
-  SCM_ASSERT_TYPE (ly_c_symbol_p (symbol), symbol, SCM_ARG2, __FUNCTION__, "symbol");
+  SCM_ASSERT_TYPE (scm_is_symbol (symbol), symbol, SCM_ARG2, __FUNCTION__, "symbol");
   SCM_ASSERT_TYPE (parser, parser_smob, SCM_ARG2, __FUNCTION__, "parser");  
 
   SCM val= parser->lexer_->lookup_identifier (ly_scm2string (scm_symbol_to_string (symbol)));
@@ -388,7 +366,7 @@ LY_DEFINE (ly_parser_parse_string, "ly:parser-parse-string",
   Lily_parser *parser = unsmob_my_lily_parser (parser_smob);
 
   SCM_ASSERT_TYPE (parser, parser_smob, SCM_ARG1, __FUNCTION__, "parser");
-  SCM_ASSERT_TYPE (ly_c_string_p (ly_code), ly_code, SCM_ARG2, __FUNCTION__, "string");
+  SCM_ASSERT_TYPE (scm_is_string (ly_code), ly_code, SCM_ARG2, __FUNCTION__, "string");
   
   parser->parse_string (ly_scm2string (ly_code));
   
@@ -456,14 +434,14 @@ LY_DEFINE (ly_parser_print_score, "ly:parser-print-score",
   SCM os = scm_makfrom0str (outname.to_string ().to_str0 ());
   SCM bookpaper = get_bookpaper (parser)->self_scm ();
   for (int i = 0; i < score->defs_.size (); i++)
-    default_rendering (score->music_, score->defs_[i]->self_scm (),
+    default_rendering (score->get_music (), score->defs_[i]->self_scm (),
                       bookpaper,
                       header, os);
 
   if (score->defs_.is_empty ())
     {
       Output_def *paper = get_paper (parser);
-      default_rendering (score->music_, paper->self_scm (),
+      default_rendering (score->get_music(), paper->self_scm (),
                         get_bookpaper (parser)->self_scm (),
                         header, os);
       scm_gc_unprotect_object (paper->self_scm ());