]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.0.14
authorfred <fred>
Mon, 2 Dec 1996 20:49:17 +0000 (20:49 +0000)
committerfred <fred>
Mon, 2 Dec 1996 20:49:17 +0000 (20:49 +0000)
src/lexer.l

index ab97197fa9ae6ed15125c28f4e432a47641b955f..aaacf06df5840b453e9dea491c6cf92e93a1da88 100644 (file)
@@ -44,18 +44,24 @@ REAL                [0-9]+(\.[0-9]*)?
 %%
 
 \$             {
-       BEGIN(notes); return '$';
+       BEGIN(notes); 
 }
 
 <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;
 }
 
 <notes>{RESTNAME}      {
@@ -84,7 +90,7 @@ REAL          [0-9]+(\.[0-9]*)?
 
 }
 <notes>\$      {
-       BEGIN(INITIAL); return '$';
+       BEGIN(INITIAL); 
 }
 <notes>[{}]    {
        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;