diff --git a/compiler/cg386inl.pas b/compiler/cg386inl.pas index 7138dacbe9..cce42de4ec 100644 --- a/compiler/cg386inl.pas +++ b/compiler/cg386inl.pas @@ -915,7 +915,7 @@ implementation { lineno } emit_const(A_PUSH,S_L,aktfilepos.line); { filename string } - hp:=genstringconstnode(current_module^.sourcefiles^.get_file_name(aktfilepos.fileindex)); + hp:=genstringconstnode(current_module^.sourcefiles^.get_file_name(aktfilepos.fileindex),st_shortstring); secondpass(hp); if codegenerror then exit; @@ -1510,7 +1510,12 @@ implementation end. { $Log$ - Revision 1.89 2000-01-09 12:35:00 jonas + Revision 1.90 2000-01-09 23:16:05 peter + * added st_default stringtype + * genstringconstnode extended with stringtype parameter using st_default + will do the old behaviour + + Revision 1.89 2000/01/09 12:35:00 jonas * changed edi allocation to use getexplicitregister32/ungetregister (adapted tgeni386 a bit for this) and enabled it by default * fixed very big and stupid bug of mine in cg386mat that broke the diff --git a/compiler/pexpr.pas b/compiler/pexpr.pas index 1867599977..21f9407019 100644 --- a/compiler/pexpr.pas +++ b/compiler/pexpr.pas @@ -496,7 +496,7 @@ unit pexpr; else begin { then insert an empty string } - p2:=genstringconstnode(''); + p2:=genstringconstnode('',st_default); end; statement_syssym:=geninlinenode(l,false,gencallparanode(p1,gencallparanode(p2,nil))); consume(_RKLAMMER); @@ -1777,7 +1777,7 @@ unit pexpr; p1:=gentypenode(pd,nil); end; _CSTRING : begin - p1:=genstringconstnode(pattern); + p1:=genstringconstnode(pattern,st_default); consume(_CSTRING); end; _CCHAR : begin @@ -2100,7 +2100,12 @@ _LECKKLAMMER : begin end. { $Log$ - Revision 1.165 2000-01-07 01:14:28 peter + Revision 1.166 2000-01-09 23:16:05 peter + * added st_default stringtype + * genstringconstnode extended with stringtype parameter using st_default + will do the old behaviour + + Revision 1.165 2000/01/07 01:14:28 peter * updated copyright to 2000 Revision 1.164 1999/12/20 21:24:29 pierre diff --git a/compiler/symconst.pas b/compiler/symconst.pas index 2e957e9f74..298a35d9b7 100644 --- a/compiler/symconst.pas +++ b/compiler/symconst.pas @@ -61,7 +61,7 @@ type ); { string types } - tstringtype = ( + tstringtype = (st_default, st_shortstring, st_longstring, st_ansistring, st_widestring ); @@ -212,7 +212,12 @@ implementation end. { $Log$ - Revision 1.9 2000-01-07 01:14:39 peter + Revision 1.10 2000-01-09 23:16:06 peter + * added st_default stringtype + * genstringconstnode extended with stringtype parameter using st_default + will do the old behaviour + + Revision 1.9 2000/01/07 01:14:39 peter * updated copyright to 2000 Revision 1.8 1999/12/18 14:55:21 florian diff --git a/compiler/symdef.inc b/compiler/symdef.inc index aa1912309e..0c13c5c101 100644 --- a/compiler/symdef.inc +++ b/compiler/symdef.inc @@ -595,7 +595,7 @@ function tstringdef.stringtypname:string; const - typname:array[tstringtype] of string[8]=( + typname:array[tstringtype] of string[8]=('', 'SHORTSTR','LONGSTR','ANSISTR','WIDESTR' ); begin @@ -689,8 +689,8 @@ function tstringdef.gettypename : string; const - names : array[tstringtype] of string[20] = - ('ShortString','LongString','AnsiString','WideString'); + names : array[tstringtype] of string[20] = ('', + 'ShortString','LongString','AnsiString','WideString'); begin gettypename:=names[string_typ]; @@ -3854,7 +3854,12 @@ Const local_symtable_index : longint = $8001; { $Log$ - Revision 1.186 2000-01-07 01:14:39 peter + Revision 1.187 2000-01-09 23:16:06 peter + * added st_default stringtype + * genstringconstnode extended with stringtype parameter using st_default + will do the old behaviour + + Revision 1.186 2000/01/07 01:14:39 peter * updated copyright to 2000 Revision 1.185 2000/01/03 19:26:03 peter diff --git a/compiler/tccnv.pas b/compiler/tccnv.pas index fd519e4e1b..ac40d166e0 100644 --- a/compiler/tccnv.pas +++ b/compiler/tccnv.pas @@ -298,7 +298,7 @@ implementation begin if p^.left^.treetype=ordconstn then begin - hp:=genstringconstnode(chr(p^.left^.value)); + hp:=genstringconstnode(chr(p^.left^.value),st_default); hp^.stringtype:=pstringdef(p^.resulttype)^.string_typ; firstpass(hp); disposetree(p); @@ -975,7 +975,12 @@ implementation end. { $Log$ - Revision 1.57 2000-01-07 01:14:44 peter + Revision 1.58 2000-01-09 23:16:07 peter + * added st_default stringtype + * genstringconstnode extended with stringtype parameter using st_default + will do the old behaviour + + Revision 1.57 2000/01/07 01:14:44 peter * updated copyright to 2000 Revision 1.56 1999/12/19 12:08:27 florian diff --git a/compiler/tree.pas b/compiler/tree.pas index ea00af0645..8fc8f2d75c 100644 --- a/compiler/tree.pas +++ b/compiler/tree.pas @@ -263,7 +263,7 @@ unit tree; function genmethodcallnode(v : pprocsym;st : psymtable;mp : ptree) : ptree; { allow pchar or string for defining a pchar node } - function genstringconstnode(const s : string) : ptree; + function genstringconstnode(const s : string;st:tstringtype) : ptree; { length is required for ansistrings } function genpcharconstnode(s : pchar;length : longint) : ptree; { helper routine for conststring node } @@ -850,7 +850,7 @@ unit tree; end; - function genstringconstnode(const s : string) : ptree; + function genstringconstnode(const s : string;st:tstringtype) : ptree; var p : ptree; @@ -873,16 +873,23 @@ unit tree; move(s[1],p^.value_str^,l); p^.value_str[l]:=#0; p^.lab_str:=nil; - if cs_ansistrings in aktlocalswitches then + if st=st_default then begin - p^.stringtype:=st_ansistring; - p^.resulttype:=cansistringdef; + if cs_ansistrings in aktlocalswitches then + p^.stringtype:=st_ansistring + else + p^.stringtype:=st_shortstring; end else - begin - p^.stringtype:=st_shortstring; - p^.resulttype:=cshortstringdef; - end; + p^.stringtype:=st; + case p^.stringtype of + st_shortstring : + p^.resulttype:=cshortstringdef; + st_ansistring : + p^.resulttype:=cansistringdef; + else + internalerror(44990099); + end; genstringconstnode:=p; end; @@ -1911,7 +1918,12 @@ unit tree; end. { $Log$ - Revision 1.108 2000-01-07 01:14:48 peter + Revision 1.109 2000-01-09 23:16:07 peter + * added st_default stringtype + * genstringconstnode extended with stringtype parameter using st_default + will do the old behaviour + + Revision 1.108 2000/01/07 01:14:48 peter * updated copyright to 2000 Revision 1.107 2000/01/06 01:10:33 pierre