--- lily/parser.yy 2006-06-28 07:13:15.000000000 +0200 +++ ../lilypond29/lily/parser.yy 2006-07-13 19:22:57.000000000 +0200 @@ -160,7 +160,7 @@ %token ADDQUOTE "\\addquote" %token ALIAS "\\alias" %token ALTERNATIVE "\\alternative" -%token BOOK "\book" +%token BOOK "\\book" %token CHANGE "\\change" %token CHORDMODE "\\chordmode" %token CHORDS "\\chords" @@ -223,8 +223,10 @@ %token CHORD_COLON ":" %token CHORD_MINUS "-" %token CHORD_SLASH "/" -%token DOUBLE_ANGLE_CLOSE ">>" +%token ANGLE_OPEN "<" +%token ANGLE_CLOSE ">" %token DOUBLE_ANGLE_OPEN "<<" +%token DOUBLE_ANGLE_CLOSE ">>" %token E_BACKSLASH "\\" %token E_ANGLE_CLOSE "\\>" %token E_CHAR "\\C[haracter]" @@ -348,7 +350,6 @@ %type simple_music_property_def %type string_number_event %type tempo_event -%type toplevel_music %type output_def_body %type output_def_head @@ -477,7 +478,7 @@ scm_call_2 (proc, PARSER->self_scm (), score->self_scm ()); score->unprotect (); } - | toplevel_music { + | composite_music { Music *music = unsmob_music ($1); SCM proc = PARSER->lexer_->lookup_identifier ("toplevel-music-handler"); scm_call_2 (proc, PARSER->self_scm (), music->self_scm ()); @@ -502,11 +503,6 @@ } ; -toplevel_music: - composite_music { - } - ; - embedded_scm: SCM_T | SCM_IDENTIFIER @@ -902,7 +898,7 @@ SIMULTANEOUS '{' music_list '}'{ $$ = MAKE_SYNTAX ("simultaneous-music", @$, scm_car ($3)); } - | simul_open music_list simul_close { + | DOUBLE_ANGLE_OPEN music_list DOUBLE_ANGLE_CLOSE { $$ = MAKE_SYNTAX ("simultaneous-music", @$, scm_car ($2)); } ; @@ -1331,20 +1327,8 @@ } ; -chord_open: '<' - ; - -chord_close: '>' - ; - -simul_open: DOUBLE_ANGLE_OPEN - ; - -simul_close: DOUBLE_ANGLE_CLOSE - ; - chord_body: - chord_open chord_body_elements chord_close + ANGLE_OPEN chord_body_elements ANGLE_CLOSE { $$ = MAKE_SYNTAX ("event-chord", @$, scm_reverse_x ($2, SCM_EOL)); } @@ -1766,7 +1750,7 @@ | '|' { $$ = scm_makfrom0str ("Bar"); } - | '>' { + | ANGLE_CLOSE { $$ = scm_makfrom0str ("Larger"); } | '.' { --- lily/lexer.ll 2006-06-20 21:08:20.000000000 +0200 +++ ../lilypond29/lily/lexer.ll 2006-07-13 19:23:19.000000000 +0200 @@ -179,6 +179,12 @@ } } +{ + \" { + start_quote (); + } +} + \\version{WHITE}* { yy_push_state (version); } @@ -318,13 +324,23 @@ return SCM_T; } { - \<\< { + \<\< { return DOUBLE_ANGLE_OPEN; } - \>\> { + \>\> { return DOUBLE_ANGLE_CLOSE; } } + +{ + \< { + return ANGLE_OPEN; + } + \> { + return ANGLE_CLOSE; + } +} + { _ { return FIGURE_SPACE; @@ -362,36 +378,9 @@ yylval.i = String_convert::dec2int (string (YYText () +1)); return E_UNSIGNED; } - \" { - start_quote (); - } } -\" { - start_quote (); -} -{ - \\{ESCAPED} { - *yylval.string += to_string (escaped_char (YYText ()[1])); - } - [^\\"]+ { - *yylval.string += YYText (); - } - \" { - - yy_pop_state (); - - /* yylval is union. Must remember STRING before setting SCM*/ - string *sp = yylval.string; - yylval.scm = scm_makfrom0str (sp->c_str ()); - delete sp; - return STRING; - } - . { - *yylval.string += YYText (); - } -} -{ +{ \\{ESCAPED} { *yylval.string += to_string (escaped_char (YYText ()[1])); } @@ -406,7 +395,7 @@ string *sp = yylval.string; yylval.scm = scm_makfrom0str (sp->c_str ()); delete sp; - return LYRICS_STRING; + return is_lyric_state () ? LYRICS_STRING : STRING; } . { *yylval.string += YYText (); @@ -465,9 +454,6 @@ yylval.i = String_convert::dec2int (string (YYText ())); return UNSIGNED; } - \" { - start_quote (); - } - { return CHORD_MINUS; } @@ -490,9 +476,6 @@ { - \" { - start_quote (); - } \\score { return SCORE; }