* 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 end
{ ugly, but delphi allows it } { ugly, but delphi allows it }
else if (eq=te_incompatible) and 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 (m_delphi in current_settings.modeswitches) and
(cdo_explicit in cdoptions) then (cdo_explicit in cdoptions) then
begin begin

View File

@ -79,26 +79,32 @@ unit raatt;
type type
tattreader = class(tasmreader) tattreader = class(tasmreader)
protected
actasmtoken : tasmtoken; actasmtoken : tasmtoken;
prevasmtoken : tasmtoken; prevasmtoken : tasmtoken;
procedure SetupTables; procedure BuildRecordOffsetSize(const expr: string;var offset:aint;var size:aint; var mangledname: string; needvmtofs: boolean);
procedure BuildConstant(constsize: byte); 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 BuildConstantOperand(oper : toperand);
procedure BuildConstant(constsize: byte);
procedure BuildRealConstant(typ : tfloattype); procedure BuildRealConstant(typ : tfloattype);
procedure BuildStringConstant(asciiz: boolean); procedure BuildStringConstant(asciiz: boolean);
procedure BuildRecordOffsetSize(const expr: string;var offset:aint;var size:aint; var mangledname: string; needvmtofs: boolean); private
procedure BuildConstSymbolExpression(allowref,betweenbracket,needofs:boolean;var value:aint;var asmsym:string;var asmsymtyp:TAsmsymtype); procedure SetupTables;
function BuildConstExpression(allowref,betweenbracket:boolean): aint; public
function Assemble: tlinkedlist;override; function Assemble: tlinkedlist;override;
protected
procedure handleopcode;virtual;abstract; procedure handleopcode;virtual;abstract;
function is_asmopcode(const s: string) : boolean;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_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; 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; end;
tcattreader = class of tattreader; tcattreader = class of tattreader;