]> www.ginac.de Git - ginac.git/blobdiff - ginac/parser/lexer.cpp
Happy New Year!
[ginac.git] / ginac / parser / lexer.cpp
index 1cc2f49671d20023edb9c31e150ad03628479a3e..b5d59ba6f7eedb332c6dd95a1ae89815591fd4cb 100644 (file)
@@ -3,7 +3,7 @@
  *  Implementation of GiNaC's lexer. */
 
 /*
- *  GiNaC Copyright (C) 1999-2009 Johannes Gutenberg University Mainz, Germany
+ *  GiNaC Copyright (C) 1999-2019 Johannes Gutenberg University Mainz, Germany
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -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;