mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-23 06:49:49 +02:00
+ support for tai_string (in nested typed constant expressions)
git-svn-id: branches/hlcgllvm@28121 -
This commit is contained in:
parent
204adf82c7
commit
f89b2e2b26
@ -738,6 +738,8 @@ implementation
|
|||||||
var
|
var
|
||||||
hp2: tai;
|
hp2: tai;
|
||||||
s: string;
|
s: string;
|
||||||
|
i: longint;
|
||||||
|
ch: ansichar;
|
||||||
begin
|
begin
|
||||||
case hp.typ of
|
case hp.typ of
|
||||||
ait_comment :
|
ait_comment :
|
||||||
@ -803,8 +805,24 @@ implementation
|
|||||||
|
|
||||||
ait_string :
|
ait_string :
|
||||||
begin
|
begin
|
||||||
|
if fdecllevel=0 then
|
||||||
AsmWrite(target_asm.comment);
|
AsmWrite(target_asm.comment);
|
||||||
AsmWriteln('string');
|
AsmWrite('c"');
|
||||||
|
for i:=1 to tai_string(hp).len do
|
||||||
|
begin
|
||||||
|
ch:=tai_string(hp).str[i-1];
|
||||||
|
case ch of
|
||||||
|
#0, {This can't be done by range, because a bug in FPC}
|
||||||
|
#1..#31,
|
||||||
|
#128..#255,
|
||||||
|
'"',
|
||||||
|
'\' : s:='\'+tostr(ord(ch) shr 8)+tostr((ord(ch) and $f));
|
||||||
|
else
|
||||||
|
s:=ch;
|
||||||
|
end;
|
||||||
|
AsmWrite(s);
|
||||||
|
end;
|
||||||
|
AsmWriteLn('"');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
ait_label :
|
ait_label :
|
||||||
|
Loading…
Reference in New Issue
Block a user