Allow underscores in identifiers.
[ginac.git] / ginac / parser / lexer.cpp
index 1cc2f49671d20023edb9c31e150ad03628479a3e..cc3be3d91768c1f930b89bd71b12ca8a0672e410 100644 (file)
@@ -43,12 +43,12 @@ int lexer::gettok()
        // Skip any whitespace.
        c = skipspace(input, c, line_num);
 
-       // identifier: [a-zA-Z][a-zA-Z0-9]*
+       // identifier: [a-zA-Z][a-zA-Z0-9_]*
        if (isalpha(c)) { 
                str = c;
                do {
                        c = input->get();
-                       if (isalnum(c))
+                       if ( isalnum(c) || c=='_' )
                                str += c;
                        else
                                break;