]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/lily-parser.cc
* lily/modified-font-metric.cc (text_dimension): try
[lilypond.git] / lily / lily-parser.cc
index d83528ccc59e863c27cb138c97c3c1f3c9784e3d..fb09a41e5290f3356b5d99eeae0e425fc444694d 100644 (file)
@@ -7,18 +7,16 @@
        Jan Nieuwenhuizen <janneke@gnu.org>
 */
 
+#include "lily-parser.hh"
 
 #include "book.hh"
 #include "lilypond-key.hh"
-#include "context-selector.hh"
-#include "grob-selector.hh"
 #include "file-name.hh"
 #include "file-path.hh"
 #include "lily-version.hh"
 #include "ly-module.hh"
 #include "main.hh"
 #include "lily-lexer.hh"
-#include "lily-parser.hh"
 #include "output-def.hh"
 #include "paper-book.hh"
 #include "parser.hh"
@@ -26,7 +24,6 @@
 #include "source.hh"
 #include "warn.hh"
 
-
 Lily_parser::Lily_parser (Sources *sources)
 {
   book_count_ = 0;
@@ -104,19 +101,11 @@ Lily_parser::parse_file (String init, String name, String out_name)
   set_yydebug (0);
 
   lexer_->new_input (init, sources_);
-#ifdef TWEAK
+
   File_name f (name);
   String s = global_path.find (f.base_ + ".twy");
-  if (s == "")
-    Grob_selector::set_tweaks (SCM_EOL);
-  else
-    {
-      s = gulp_file_to_string (s, false);
-      SCM tweaks = scm_eval_string (scm_makfrom0str (s.to_str0 ()));
-      Grob_selector::set_tweaks (tweaks);
-    }
-  Context_selector::set_tweaks (SCM_EOL);
-#endif  
+  s = gulp_file_to_string (s, false);
+  scm_eval_string (scm_makfrom0str (s.to_str0 ()));
 
   /* Read .ly IN_FILE, lex, parse, write \score blocks from IN_FILE to
      OUT_FILE (unless IN_FILE redefines output file name).  */
@@ -157,8 +146,9 @@ Lily_parser::parse_string (String ly_code)
   
   if (!define_spots_.is_empty ())
     {
-      define_spots_.top ().warning (_ ("Braces don't match"));
-      error_level_ = 1;
+      if (define_spots_.is_empty()
+         && !error_level_ )
+       programming_error ("Braces don't match, but error_level_ not set.");
     }
 
   error_level_ = error_level_ | lexer_->error_level_;
@@ -236,9 +226,9 @@ LY_DEFINE (ly_set_point_and_click, "ly:set-point-and-click",
   /* UGH. */
   SCM val = SCM_BOOL_F;
   if (ly_symbol2scm ("line-column") == what)
-    val = ly_scheme_function ("line-column-location");
+    val = ly_lily_module_constant ("line-column-location");
   else if (what == ly_symbol2scm ("line"))
-    val = ly_scheme_function ("line-location");
+    val = ly_lily_module_constant ("line-location");
 
   scm_module_define (global_lily_module, ly_symbol2scm ("point-and-click"),
                     val);
@@ -368,7 +358,7 @@ LY_DEFINE (ly_parser_lookup, "ly:parser-lookup",
   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)));
+  SCM val = parser->lexer_->lookup_identifier (ly_scm2string (scm_symbol_to_string (symbol)));
   if (val != SCM_UNDEFINED)
     return val;
   else