X-Git-Url: https://ginac.de/ginac.git//ginac.git?a=blobdiff_plain;f=ginac%2Fparser%2Flexer.cpp;h=abbe75162bae4fc614ca6aa8bd87cfe205b22353;hb=1109fafaa3f5da6d1483744c4bdee6f01a37c5c5;hp=1cc2f49671d20023edb9c31e150ad03628479a3e;hpb=cd6f949add6caf2f0cc52731e34252aea9c9ad2d;p=ginac.git diff --git a/ginac/parser/lexer.cpp b/ginac/parser/lexer.cpp index 1cc2f496..abbe7516 100644 --- a/ginac/parser/lexer.cpp +++ b/ginac/parser/lexer.cpp @@ -3,7 +3,7 @@ * Implementation of GiNaC's lexer. */ /* - * GiNaC Copyright (C) 1999-2009 Johannes Gutenberg University Mainz, Germany + * GiNaC Copyright (C) 1999-2018 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;