From: Jens Vollinga Date: Wed, 15 Jul 2009 03:19:07 +0000 (+0200) Subject: Allow underscores in identifiers. X-Git-Tag: release_1-5-3~1 X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?a=commitdiff_plain;h=44f71c740cc727dc30436e240b9a27021a6d7fdf;p=ginac.git Allow underscores in identifiers. (cherry picked from commit 619879b5bd86a99334affe1f05d17616cc2c1898) --- diff --git a/ginac/parser/lexer.cpp b/ginac/parser/lexer.cpp index 1cc2f496..cc3be3d9 100644 --- a/ginac/parser/lexer.cpp +++ b/ginac/parser/lexer.cpp @@ -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;