* fixed reading of constants from token streams

git-svn-id: trunk@14792 -
This commit is contained in:
florian 2010-01-24 12:35:03 +00:00
parent fc148f4aec
commit e7bff9f5c1

View File

@ -32,9 +32,9 @@ uses
tokens; tokens;
const const
Version = 'Version 2.3.1'; Version = 'Version 2.5.1';
Title = 'PPU-Analyser'; Title = 'PPU-Analyser';
Copyright = 'Copyright (c) 1998-2007 by the Free Pascal Development Team'; Copyright = 'Copyright (c) 1998-2010 by the Free Pascal Development Team';
{ verbosity } { verbosity }
v_none = $0; v_none = $0;
@ -886,6 +886,9 @@ var
first : boolean; first : boolean;
tokenbufsize : longint; tokenbufsize : longint;
tokenbuf : pbyte; tokenbuf : pbyte;
len : sizeint;
wstring : widestring;
astring : ansistring;
begin begin
writeln(space,'** Definition Id ',ppufile.getlongint,' **'); writeln(space,'** Definition Id ',ppufile.getlongint,' **');
writeln(space,s); writeln(space,s);
@ -942,24 +945,30 @@ begin
_CWSTRING : _CWSTRING :
begin begin
inc(i); inc(i);
{ len:=psizeint(@tokenbuf[i])^;
replaytokenbuf.read(wlen,sizeof(SizeInt)); inc(i,sizeof(sizeint));
setlengthwidestring(patternw,wlen); setlength(wstring,len);
replaytokenbuf.read(patternw^.data^,patternw^.len*sizeof(tcompilerwidechar)); move(tokenbuf[i],wstring[1],len*2);
pattern:=''; write(' ',wstring);
} inc(i,len*2);
end;
_CSTRING:
begin
inc(i);
len:=psizeint(@tokenbuf[i])^;
inc(i,sizeof(sizeint));
setlength(astring,len);
move(tokenbuf[i],astring[1],len);
write(' ',astring);
inc(i,len);
end; end;
_CCHAR, _CCHAR,
_CSTRING,
_INTCONST, _INTCONST,
_REALNUMBER : _REALNUMBER :
begin begin
inc(i); inc(i);
{ write(' ',pshortstring(@tokenbuf[i])^);
replaytokenbuf.read(pattern[0],1); inc(i,tokenbuf[i]+1);
replaytokenbuf.read(pattern[1],length(pattern));
orgpattern:='';
}
end; end;
_ID : _ID :
begin begin