]> git.donarmstrong.com Git - lilypond.git/commitdiff
*** empty log message ***
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 2 Feb 2006 01:05:31 +0000 (01:05 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 2 Feb 2006 01:05:31 +0000 (01:05 +0000)
ChangeLog
lily/lexer.ll
lily/parser.yy
scm/output-ps.scm

index 4d76b12286dd8fdc624f7daf8e8fbe588fb2b2b5..37c119fe692b0f4cc57b8961743c0bafc7f32542 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,12 @@
 
 2006-02-02  Han-Wen Nienhuys  <hanwen@xs4all.nl>
 
+       * lily/parser.yy (output_def_head_with_mode_switch): new
+       production. Result: dashes and underscores may be used in the
+       \paper block.
+
+       * lily/lexer.ll: add DASHED_WORD.  Accept in INITIAL mode.
+
        * python/convertrules.py (conv): oops. One slash too much.
 
 2006-02-02  Jan Nieuwenhuizen  <janneke@gnu.org>
index 6b418db07c96d5aed2b3887f25003381acc232b8..abd0c101de8293f12f001f706d85ae46eb4f0b52 100644 (file)
@@ -124,6 +124,8 @@ ACCENT              \\[`'"^]
 NATIONAL       [\001-\006\021-\027\031\036\200-\377]
 TEX            {AA}|-|{PUNCT}|{ACCENT}|{NATIONAL}
 WORD           {A}{AN}*
+DASHED_WORD            {A}({AN}|-)*
+DASHED_KEY_WORD                \\{DASHED_WORD}
 ALPHAWORD      {A}+
 DIGIT          {N}
 UNSIGNED       {N}+
@@ -212,7 +214,7 @@ BOM_UTF8    \357\273\277
        LexerError (_ ("quoted string expected after \\version").c_str ());
        yy_pop_state ();
 }
-<sourcefilename>>.     {
+<sourcefilename>     {
        LexerError (_ ("quoted string expected after \\sourcefilename").c_str ());
        yy_pop_state ();
 }
@@ -559,6 +561,14 @@ BOM_UTF8   \357\273\277
                yyterminate ();
 }
 
+<INITIAL>{
+       {DASHED_WORD}   {
+               return scan_bare_word (YYText ());
+       }
+       {DASHED_KEY_WORD}       {
+               return scan_escaped_word (YYText () + 1);
+       }
+}
 
 {WORD} {
        return scan_bare_word (YYText ());
index 0f6e2c120ffcebfdc35fbc0fa7713fb7e6d60a46..4c5413acdd595138a48d1dfe441c97c63ce3f267 100644 (file)
@@ -342,6 +342,7 @@ If we give names, Bison complains.
 
 %type <outputdef> output_def_body
 %type <outputdef> output_def_head
+%type <outputdef> output_def_head_with_mode_switch
 %type <outputdef> output_def
 %type <outputdef> paper_block 
 
@@ -531,9 +532,13 @@ assignment:
        assignment_id '=' identifier_init  {
                if (! is_regular_identifier ($1))
                {
+#if 0
+                       /* no longer valid with dashes in \paper{} block. */ 
                        @1.warning (_ ("identifier should have alphabetic characters only"));
+#endif
                }
 
+
                THIS->lexer_->set_identifier ($1, $3);
 
 /*
@@ -758,21 +763,25 @@ output_def_head:
        }
        ;
 
+output_def_head_with_mode_switch:
+       output_def_head {
+               THIS->lexer_->push_initial_state ();
+               $$ = $1;
+       }
+       ;
 
 output_def_body:
-       output_def_head '{' {
+       output_def_head_with_mode_switch '{' {
                $$ = $1;
                $$->input_origin_.set_spot (@$);
-               THIS->lexer_->push_initial_state ();
        }
-       | output_def_head '{' OUTPUT_DEF_IDENTIFIER     {
+       | output_def_head_with_mode_switch '{' OUTPUT_DEF_IDENTIFIER    {
                $1->unprotect ();
                Output_def *o = unsmob_output_def ($3);
                o->input_origin_.set_spot (@$);
                $$ = o;
                THIS->lexer_->remove_scope ();
                THIS->lexer_->add_scope (o->scope_);
-               THIS->lexer_->push_initial_state ();
        }
        | output_def_body assignment  {
 
index f7d0ee5b44a5ba0890f3c5e686890498ef5da70d..e9e57d27503148e9efe991d4f63446571520779c 100644 (file)
    (ly:number->string y2) " lineto stroke"))
 
 (define (embedded-ps string)
-  (display (list "len " (string-length string) "\n"))
   string)
 
 (define (glyph-string