X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Flexer.ll;fp=lily%2Flexer.ll;h=6bf0084c70707c0e116929ee189a508cfc51df86;hb=cc9f25fa7ad9eecd1d1d9cfc2b3c50d96a847386;hp=534823118034810f182efae2f71898f1f70d74cf;hpb=192b0bcc1b2d5396b0f2ff53798dc33c571152ae;p=lilypond.git diff --git a/lily/lexer.ll b/lily/lexer.ll index 5348231180..6bf0084c70 100644 --- a/lily/lexer.ll +++ b/lily/lexer.ll @@ -1004,16 +1004,15 @@ Lily_lexer::scan_scm_id (SCM sid) } int -Lily_lexer::scan_bare_word (const string &str) +Lily_lexer::scan_word (SCM & output, SCM sym) { - SCM sym = ly_symbol2scm (str.c_str ()); if ((YYSTATE == notes) || (YYSTATE == chords)) { SCM handle = SCM_BOOL_F; if (scm_is_pair (pitchname_tab_stack_)) handle = scm_hashq_get_handle (scm_cdar (pitchname_tab_stack_), sym); if (scm_is_pair (handle)) { - yylval = scm_cdr (handle); + output = scm_cdr (handle); if (unsmob (yylval)) return (YYSTATE == notes) ? NOTENAME_PITCH : TONICNAME_PITCH; else if (scm_is_symbol (yylval)) @@ -1022,10 +1021,22 @@ Lily_lexer::scan_bare_word (const string &str) else if ((YYSTATE == chords) && scm_is_true (handle = scm_hashq_get_handle (chordmodifier_tab_, sym))) { - yylval = scm_cdr (handle); + output = scm_cdr (handle); return CHORD_MODIFIER; } } + output = SCM_UNDEFINED; + return -1; +} + +int +Lily_lexer::scan_bare_word (const string &str) +{ + int state = scan_word (yylval, ly_symbol2scm (str.c_str ())); + if (state >= 0) + { + return state; + } yylval = ly_string2scm (str); return STRING; }