@@ -1,9 +1,9 @@ /* Jim - A small embeddable Tcl interpreter * Copyright 2005 Salvatore Sanfilippo * Copyright 2005 Clemens Hintze * - * $Id: jim.c,v 1.173 2008/06/15 21:03:26 oharboe Exp $ + * $Id: jim.c,v 1.174 2008/06/16 14:03:10 oharboe Exp $ * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -5971,18 +5971,26 @@ int JimParseExprNumber(struct JimParserCtx *pc) { int allowdot = 1; + int allowhex = 0; pc->tstart = pc->p; pc->tline = pc->linenr; if (*pc->p == '-') { pc->p++; pc->len--; } - while (isdigit((int)*pc->p) || (allowdot && *pc->p == '.') || - (pc->p-pc->tstart == 1 && *pc->tstart == '0' && - (*pc->p == 'x' || *pc->p == 'X'))) + while ( isdigit((int)*pc->p) + || (allowhex && isxdigit((int)*pc->p) ) + || (allowdot && *pc->p == '.') + || (pc->p-pc->tstart == 1 && *pc->tstart == '0' && + (*pc->p == 'x' || *pc->p == 'X')) + ) { + if ((*pc->p == 'x') || (*pc->p == 'X')) { + allowhex = 1; + allowdot = 0; + } if (*pc->p == '.') allowdot = 0; pc->p++; pc->len--; if (!allowdot && *pc->p == 'e' && *(pc->p+1) == '-') { @@ -11769,9 +11777,9 @@ fprintf(interp->stdout_, "Welcome to Jim version %d.%d, " "Copyright (c) 2005 Salvatore Sanfilippo" JIM_NL, JIM_VERSION / 100, JIM_VERSION % 100); fprintf(interp->stdout_, - "CVS ID: $Id: jim.c,v 1.173 2008/06/15 21:03:26 oharboe Exp $" + "CVS ID: $Id: jim.c,v 1.174 2008/06/16 14:03:10 oharboe Exp $" JIM_NL); Jim_SetVariableStrWithStr(interp, "jim_interactive", "1"); while (1) { char buf[1024];