X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Flexer.ll;h=b1c3afab5dca3ee29c1377b9595ba6f1d74253e4;hb=4b40ecf0af9b4ff3fcf4287ae685ac1a9cc89523;hp=208e7034205c25f956e9ba673a80ba4486eba89a;hpb=7181c77e5d46a271f5f76e99bee7f844611e23e4;p=lilypond.git diff --git a/lily/lexer.ll b/lily/lexer.ll index 208e703420..b1c3afab5d 100644 --- a/lily/lexer.ll +++ b/lily/lexer.ll @@ -38,9 +38,12 @@ #include "musical-request.hh" #include "identifier.hh" #include "version.hh" -#include "mudela-version.hh" +#include "lilypond-input-version.hh" #include "translator-def.hh" +/* +RH 7 fix (?) +*/ #define isatty HORRIBLEKLUDGE void strip_trailing_white (String&); @@ -240,9 +243,6 @@ HYPHEN -- return SCM_T; } yylval.scm = ly_parse_scm (s, &n); - DEBUG_OUT << "Scheme: "; - if (flower_dstream) - ly_display_scm (yylval.scm); for (int i=0; i < n; i++) { @@ -401,7 +401,6 @@ HYPHEN -- } [{}] { - DEBUG_OUT << "parens\n"; return YYText ()[0]; } @@ -487,10 +486,14 @@ My_lily_lexer::scan_escaped_word (String str) yylval.scm = sid; return dynamic_cast (mus) ? REQUEST_IDENTIFIER : MUSIC_IDENTIFIER; + } else if (unsmob_duration (sid)) { + yylval.scm = sid; + return DURATION_IDENTIFIER; } + Identifier * id = unsmob_identifier (sid); if (id) { yylval.id = id; @@ -501,13 +504,11 @@ My_lily_lexer::scan_escaped_word (String str) } if ((YYSTATE != notes) && (YYSTATE != chords)) { - SCM pitch = scm_hashq_ref (pitchname_tab_, sym, SCM_BOOL_F); + SCM pitch = scm_hashq_get_handle (pitchname_tab_, sym); - if (pitch != SCM_BOOL_F) + if (gh_pair_p (pitch)) { - yylval.pitch = new Musical_pitch (pitch); - yylval.pitch->set_spot (Input (source_file_l (), - here_ch_C ())); + yylval.scm = gh_cdr (pitch); return NOTENAME_PITCH; } } @@ -524,17 +525,13 @@ My_lily_lexer::scan_bare_word (String str) { SCM sym = ly_symbol2scm (str.ch_C ()); if ((YYSTATE == notes) || (YYSTATE == chords)) { - SCM pitch = scm_hashq_ref (pitchname_tab_, sym, SCM_BOOL_F); - if (pitch != SCM_BOOL_F) { - yylval.pitch = new Musical_pitch (pitch); - yylval.pitch->set_spot (Input (source_file_l (), - here_ch_C ())); + SCM pitch = scm_hashq_get_handle (pitchname_tab_, sym); + if (gh_pair_p (pitch)) { + yylval.scm = gh_cdr (pitch); return (YYSTATE == notes) ? NOTENAME_PITCH : TONICNAME_PITCH; - } else if ((pitch = scm_hashq_ref (chordmodifier_tab_, sym, SCM_BOOL_F))!= SCM_BOOL_F) + } else if ((pitch = scm_hashq_get_handle (chordmodifier_tab_, sym))!= SCM_BOOL_F) { - yylval.pitch = new Musical_pitch (pitch); - yylval.pitch->set_spot (Input (source_file_l (), - here_ch_C ())); + yylval.scm = gh_cdr (pitch); return CHORDMODIFIER_PITCH; } } @@ -593,12 +590,12 @@ strip_trailing_white (String&s) bool valid_version_b (String s) { - Mudela_version current ( MAJOR_VERSION "." MINOR_VERSION "." PATCH_LEVEL ); - Mudela_version ver (s); + Lilypond_version current ( MAJOR_VERSION "." MINOR_VERSION "." PATCH_LEVEL ); + Lilypond_version ver (s); if (!((ver >= oldest_version) && (ver <= current))) { - non_fatal_error (_f ("incorrect mudela version: %s (%s, %s)", ver.str (), oldest_version.str (), current.str ())); - non_fatal_error (_("Consider converting the input with the convert-mudela script")); + non_fatal_error (_f ("incorrect lilypond version: %s (%s, %s)", ver.str (), oldest_version.str (), current.str ())); + non_fatal_error (_("Consider converting the input with the convert-ly script")); return false; } return true;