Changed preprocessor binary literal prefix to 0b, 0y is still supported for now

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@6470 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
anders_k 2014-05-10 20:36:06 +00:00
parent 8193e73b31
commit 38966457e7
2 changed files with 4 additions and 4 deletions

View file

@ -28,7 +28,7 @@ Released on ?, 2014
\b !execute supports comparing the exit code with the same syntax as !system
\b Preprocessor supports MASM style 0n and 0y radix prefix on numbers
\b Preprocessor supports \cw{0n} and \cw{0b} radix prefix on number literals
\H{v3.0a2} 3.0 Alpha 2

View file

@ -116,9 +116,9 @@ int LineParser::gettoken_int(int token, int *success/*=0*/) const
++p, ++neg;
if (_T('0') == p[0])
{
// Special support for 0n and 0y MASM style radix prefix:
// Special support for 0n and 0y MASM style and 0b Python style radix prefix:
if (_T('n') == (p[1]|32)) parse=&p[2], base=10;
if (_T('y') == (p[1]|32)) parse=&p[2], base=2;
if (_T('b') == (p[1]|32) || _T('y') == (p[1]|32)) parse=&p[2], base=2;
}
if (neg)
{
@ -142,7 +142,7 @@ double LineParser::gettoken_number(int token, int *success/*=0*/) const
{
if (_T('x') == (str[1]|32)) ++forceint;
if (_T('n') == (str[1]|32)) ++forceint;
if (_T('y') == (str[1]|32)) ++forceint;
if (_T('b') == (str[1]|32) || _T('y') == (str[1]|32)) ++forceint;
}
return forceint ? gettoken_int(token,success) : gettoken_float(token,success);
}