From: fred Date: Mon, 2 Dec 1996 20:49:17 +0000 (+0000) Subject: lilypond-0.0.14 X-Git-Tag: release/1.5.59~6696 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=9383836a84ccd77855fd15337f344da7d2022773;p=lilypond.git lilypond-0.0.14 --- diff --git a/src/lexer.l b/src/lexer.l index ab97197fa9..aaacf06df5 100644 --- a/src/lexer.l +++ b/src/lexer.l @@ -44,18 +44,24 @@ REAL [0-9]+(\.[0-9]*)? %% \$ { - BEGIN(notes); return '$'; + BEGIN(notes); } {NOTECOMMAND} { String c = YYText() +1; + int l = lookup_keyword(c); - if (l == -1) { - String e("unknown NOTECOMMAND: \\"); - e += c; - yyerror(e); + if (l != -1) + return l; + Identifier * id = lookup_identifier(c); + if (id) { + yylval.id = id; + return IDENTIFIER; } - return l; + String *sp = new String( c); + mtor << "new id: " << *sp; + yylval.string=sp; + return NEWIDENTIFIER; } {RESTNAME} { @@ -84,7 +90,7 @@ REAL [0-9]+(\.[0-9]*)? } \$ { - BEGIN(INITIAL); return '$'; + BEGIN(INITIAL); } [{}] { return YYText()[0]; @@ -120,15 +126,16 @@ REAL [0-9]+(\.[0-9]*)? yyterminate(); } {WORD} { - int l = lookup_keyword(YYText()); + String c = YYText(); + int l = lookup_keyword(c); if (l != -1) return l; - Identifier * id = lookup_identifier(YYText()); + Identifier * id = lookup_identifier(c); if (id) { yylval.id = id; return IDENTIFIER; } - String *sp = new String( YYText()); + String *sp = new String( c); mtor << "new id: " << *sp; yylval.string=sp; return NEWIDENTIFIER;