mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-17 11:02:07 +02:00
fcl-res: support octal numbers
Reintegrate fpcres-rc branch by Martok git-svn-id: trunk@46382 -
This commit is contained in:
parent
b88adc8e64
commit
3a65c1912b
packages/fcl-res/src
File diff suppressed because it is too large
Load Diff
@ -59,6 +59,7 @@ end;
|
||||
%}
|
||||
%x INCOMLINE INCOMMENT INSTRING INSTRINGL
|
||||
|
||||
O [0-7]
|
||||
D [0-9]
|
||||
H [0-9a-fA-F]
|
||||
IDENT [a-zA-Z_]([a-zA-Z0-9_])*
|
||||
@ -76,6 +77,7 @@ IDENT [a-zA-Z_]([a-zA-Z0-9_])*
|
||||
|
||||
{D}+L? return(_NUMBER);
|
||||
0x{H}+L? return(_NUMBER);
|
||||
0o{O}+L? return(_NUMBER);
|
||||
L\" begin start(INSTRINGL); strbuf_begin(); end;
|
||||
\" begin start(INSTRING); strbuf_begin(); end;
|
||||
<INSTRING,INSTRINGL>\"\" strbuf_append('"');
|
||||
|
@ -120,6 +120,8 @@ begin
|
||||
Exit(0);
|
||||
if Copy(s, 1, 2) = '0x' then
|
||||
Exit(StrToInt('$' + Copy(s, 3, Maxint)));
|
||||
if Copy(s, 1, 2) = '0o' then
|
||||
Exit(StrToInt('&' + Copy(s, 3, Maxint)));
|
||||
if Copy(s, 1, 1) = '0' then
|
||||
Exit(StrToInt('&' + Copy(s, 2, Maxint)));
|
||||
Result:= StrToInt(s);
|
||||
|
Loading…
Reference in New Issue
Block a user