X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=blobdiff_plain;f=ginac%2Fparser%2Flexer.cpp;h=3545ba9ac393ac4a6c8b6adf62e026de2428c2f8;hp=1cc2f49671d20023edb9c31e150ad03628479a3e;hb=cca88b51436e4b654d16a4d60cd0d1c66fcf5dd6;hpb=cd6f949add6caf2f0cc52731e34252aea9c9ad2d diff --git a/ginac/parser/lexer.cpp b/ginac/parser/lexer.cpp index 1cc2f496..3545ba9a 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-2014 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;