* allow explicit conversion of enumeration values (in addition to integers) to object references in Delphi mode

git-svn-id: trunk@11398 -
This commit is contained in:
tom_at_work 2008-07-18 15:30:20 +00:00
parent 70e7932fe4
commit 6958bbfdda
2 changed files with 17 additions and 11 deletions

View File

@ -1259,7 +1259,7 @@ implementation
end
{ ugly, but delphi allows it }
else if (eq=te_incompatible) and
(def_from.typ=orddef) and
(def_from.typ in [orddef,enumdef]) and
(m_delphi in current_settings.modeswitches) and
(cdo_explicit in cdoptions) then
begin

View File

@ -79,26 +79,32 @@ unit raatt;
type
tattreader = class(tasmreader)
protected
actasmtoken : tasmtoken;
prevasmtoken : tasmtoken;
procedure SetupTables;
procedure BuildConstant(constsize: byte);
procedure BuildRecordOffsetSize(const expr: string;var offset:aint;var size:aint; var mangledname: string; needvmtofs: boolean);
function BuildConstExpression(allowref,betweenbracket:boolean): aint;
procedure BuildConstSymbolExpression(allowref,betweenbracket,needofs:boolean;var value:aint;var asmsym:string;var asmsymtyp:TAsmsymtype);
procedure BuildConstantOperand(oper : toperand);
procedure BuildConstant(constsize: byte);
procedure BuildRealConstant(typ : tfloattype);
procedure BuildStringConstant(asciiz: boolean);
procedure BuildRecordOffsetSize(const expr: string;var offset:aint;var size:aint; var mangledname: string; needvmtofs: boolean);
procedure BuildConstSymbolExpression(allowref,betweenbracket,needofs:boolean;var value:aint;var asmsym:string;var asmsymtyp:TAsmsymtype);
function BuildConstExpression(allowref,betweenbracket:boolean): aint;
private
procedure SetupTables;
public
function Assemble: tlinkedlist;override;
protected
procedure handleopcode;virtual;abstract;
function is_asmopcode(const s: string) : boolean;virtual;abstract;
Function is_asmdirective(const s: string):boolean;
function is_register(const s:string):boolean;virtual;
function is_locallabel(const s: string):boolean;
procedure GetToken;
function consume(t : tasmtoken):boolean;
procedure RecoverConsume(allowcomma:boolean);
procedure handlepercent;virtual;
private
Function is_asmdirective(const s: string):boolean;
procedure GetToken;
protected
function is_locallabel(const s: string):boolean;
procedure RecoverConsume(allowcomma:boolean);
function consume(t : tasmtoken):boolean;
end;
tcattreader = class of tattreader;