X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?a=blobdiff_plain;f=ginac%2Fparser%2Flexer.cpp;h=437db17542ca6175e5c68ca42780f4bfe6e453b6;hb=866b3eb23253a272788d8791b1ed023e63674d50;hp=050c85f73454a865750932297b0d0885a1bb934f;hpb=1602530f716ba1d425a0667b897182b99c374823;p=ginac.git diff --git a/ginac/parser/lexer.cpp b/ginac/parser/lexer.cpp index 050c85f7..437db175 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-2010 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 @@ -26,6 +26,7 @@ #include #include #include +#include namespace GiNaC { @@ -42,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;