]> git.donarmstrong.com Git - lilypond.git/commitdiff
abc2ly new tempo syntax
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 5 Nov 2006 13:20:51 +0000 (13:20 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 5 Nov 2006 13:20:51 +0000 (13:20 +0000)
Lily_parser* arg for copy ctor too.
bump version
catch all GUILE exceptions
end context snippet with '\n'

.gitignore
ChangeLog
VERSION
lily/include/lily-lexer.hh
lily/input.cc
lily/lily-lexer.cc
lily/lily-parser.cc
lily/parse-scm.cc
scripts/abc2ly.py

index 9526956a35b288df570402c6bdfaea48129885dd..499dcc5c0217e561e91987e19ee25175fa6fe0bd 100644 (file)
@@ -25,4 +25,5 @@ gcstat*.scm
 .htaccess
 *.tfm
 *.afm
-
+*.orig
+*.rej
index 982bd5144ec16fee5032b68a377712cf6b2f5eba..421c7e322c9de9acc36feac43134169ea8780326 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,22 @@
+2006-11-05  Han-Wen Nienhuys  <hanwen@lilypond.org>
+
+       * lily/input.cc: 
+       end context snippet with '\n'
+
+       * lily/parse-scm.cc: 
+       catch all GUILE exceptions
+
+       * VERSION: 
+       bump version
+
+       * lily/include/lily-lexer.hh: 
+       * lily/lily-lexer.cc: 
+       * lily/lily-parser.cc: 
+       Lily_parser* arg for copy ctor too.
+
+       * scripts/abc2ly.py: 
+       abc2ly new tempo syntax
+
 2006-11-04  Heikki Junes  <hjunes@gmail.com>
 
        * po/fi.po: update Finnish translation.
diff --git a/VERSION b/VERSION
index b60133ba581e604e426f2b8c1f1e39fb7880d573..412d689a196ae233677e6c32c3fc3ff604c22849 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1,6 +1,6 @@
 PACKAGE_NAME=LilyPond
 MAJOR_VERSION=2
 MINOR_VERSION=9
-PATCH_LEVEL=28
+PATCH_LEVEL=29
 MY_PATCH_LEVEL=
 
index b64798823b7dce81e6f4b579f690cd1fc8051179..543178ca257be56136b83d8dbdf8c03c4b69a5c0 100644 (file)
@@ -53,7 +53,7 @@ public:
   Input last_input_;
 
   Lily_lexer (Sources *, Lily_parser *);
-  Lily_lexer (Lily_lexer const &);
+  Lily_lexer (Lily_lexer const &, Lily_parser *);
   int yylex ();
 
   void add_lexed_char (int);
index 5ab2be4c7864830cd5d2b6f196c58ec09554f86b..14b281fbb87baadb49e10b2b1032d1a4c776bbaa 100644 (file)
@@ -71,7 +71,7 @@ Input::message (string s) const
 {
   if (source_file_)
     s = location_string () + ": " + s + "\n"
-      + source_file_->quote_input (start_);
+      + source_file_->quote_input (start_) + "\n";
   ::message (s);
 }
 
index 1f39bd242584647489e93efcdffdbf0a16d301a7..394e20089b9586676e6e40048d6196e14d76feee 100644 (file)
@@ -100,9 +100,10 @@ Lily_lexer::Lily_lexer (Sources *sources, Lily_parser *parser)
   chordmodifier_tab_ = scm_make_vector (scm_from_int (1), SCM_EOL);
 }
 
-Lily_lexer::Lily_lexer (Lily_lexer const &src)
+Lily_lexer::Lily_lexer (Lily_lexer const &src, Lily_parser *parser)
   : Includable_lexer ()
 {
+  parser_ = parser; 
   keytable_ = (src.keytable_) ? new Keyword_table (*src.keytable_) : 0;
   chordmodifier_tab_ = src.chordmodifier_tab_;
   pitchname_tab_stack_ = src.pitchname_tab_stack_;
index a339e8a8f5d7c6585b98c3ef034a28b43224a1dc..e71176c873e51b570d7136cb23e4f18dd1d366a9 100644 (file)
@@ -50,8 +50,10 @@ Lily_parser::Lily_parser (Lily_parser const &src)
 
   smobify_self ();
   if (src.lexer_)
-    lexer_ = new Lily_lexer (*src.lexer_);
-
+    {
+      lexer_ = new Lily_lexer (*src.lexer_, this);
+    }
+  
   lexer_->unprotect ();
 }
 
index 0769083cfa6c4f1371659a4612f3bd9fee4c0d52..c8d8d36bfab2f2ca2a393d9c17c6e00c7dd42917 100644 (file)
@@ -94,21 +94,13 @@ parse_handler (void *data, SCM tag, SCM args)
   return SCM_UNDEFINED;
 }
 
-/*
-  Do some magical incantations: if not, lily will exit on the first
-  GUILE error, leaving no location trace.
-*/
-
-#if GUILE_MINOR_VERSION < 7
-#define READ_ERROR "misc-error"
-#else
-#define READ_ERROR "read-error"
-#endif
-
 SCM
 protected_ly_parse_scm (Parse_start *ps)
 {
-  return scm_internal_catch (ly_symbol2scm (READ_ERROR),
+  /*
+    Catch #t : catch all Scheme level errors.
+   */
+  return scm_internal_catch (SCM_BOOL_T, 
                             &catch_protected_parse_body,
                             (void *) ps,
                             &parse_handler, (void *) ps);
index 91067a9e1a052c5a69841ac89ef2bb76561bf43f..e28577fb1c88b9eaed15d91b6b3309c5f42fc616 100644 (file)
@@ -33,6 +33,7 @@
 # %%LY now supported.
 # \breve and \longa supported.
 # M:none doesn't crash lily.
+# lilypond '--' supported.
 
 # Enhancements (Guy Gascoigne-Piggford)
 #
@@ -254,13 +255,13 @@ def try_parse_q(a):
     if string.count(a, '/') == 1:
         array=string.split(a,'/')
         numerator=array[0]
-        if numerator != 1:
+        if int(numerator) != 1:
             sys.stderr.write("abc2ly: Warning, unable to translate a Q specification with a numerator of %s: %s\n" % (numerator, a))
         array2=string.split(array[1],'=')
         denominator=array2[0]
         perminute=array2[1]
         duration=str(string.atoi(denominator)/string.atoi(numerator))
-        midi_specs=string.join(["\\tempo", duration, "=", perminute])
+        midi_specs=string.join(["    \n\t\t\context {\n\t\t \Score tempoWholesPerMinute = #(ly:make-moment ", perminute, " ", duration, ")\n\t\t }\n"])
     else:
         sys.stderr.write("abc2ly: Warning, unable to parse Q specification: %s\n" % a)
     
@@ -616,8 +617,7 @@ def fix_lyric(str):
 
 def slyrics_append(a):
     a = re.sub ( '_', ' _ ', a)        # _ to ' _ '
-    a = re.sub ( '-', '- ', a)        # split words with -
-    a = re.sub ( ' - - ', ' -- ', a)  # unless was originally " -- "
+    a = re.sub ( '([^-])-([^-])', '\\1- \\2', a)        # split words with "-" unless was originally "--" 
     a = re.sub ( '\\\\- ', '-', a)         # unless \-
     a = re.sub ( '~', '_', a)        # ~ to space('_')
     a = re.sub ( '\*', '_ ', a)        # * to to space