mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-14 23:29:12 +02:00
* fix for bug0124 and better error position info
This commit is contained in:
parent
f58a4b485c
commit
ca165f8343
@ -308,9 +308,10 @@ var
|
|||||||
c:=current_scanner^.asmgetchar;
|
c:=current_scanner^.asmgetchar;
|
||||||
{ Possiblities for first token in a statement: }
|
{ Possiblities for first token in a statement: }
|
||||||
{ Local Label, Label, Directive, Prefix or Opcode.... }
|
{ Local Label, Label, Directive, Prefix or Opcode.... }
|
||||||
|
if not (c in [newline,#13,'{',';']) then
|
||||||
|
current_scanner^.gettokenpos;
|
||||||
if firsttoken and not (c in [newline,#13,'{',';']) then
|
if firsttoken and not (c in [newline,#13,'{',';']) then
|
||||||
begin
|
begin
|
||||||
current_scanner^.gettokenpos;
|
|
||||||
firsttoken := FALSE;
|
firsttoken := FALSE;
|
||||||
{ directive or local labe }
|
{ directive or local labe }
|
||||||
if c = '.' then
|
if c = '.' then
|
||||||
@ -3923,7 +3924,10 @@ end.
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.35 1999-04-17 22:16:55 pierre
|
Revision 1.36 1999-04-18 00:32:22 pierre
|
||||||
|
* fix for bug0124 and better error position info
|
||||||
|
|
||||||
|
Revision 1.35 1999/04/17 22:16:55 pierre
|
||||||
* ifdef USE_OP3 released (changed into ifndef NO_OP3)
|
* ifdef USE_OP3 released (changed into ifndef NO_OP3)
|
||||||
* SHRD and SHLD first operand (ATT syntax) can only be CL reg or immediate const
|
* SHRD and SHLD first operand (ATT syntax) can only be CL reg or immediate const
|
||||||
|
|
||||||
|
@ -309,9 +309,10 @@ var
|
|||||||
c := current_scanner^.asmgetchar;
|
c := current_scanner^.asmgetchar;
|
||||||
{ Possiblities for first token in a statement: }
|
{ Possiblities for first token in a statement: }
|
||||||
{ Local Label, Label, Directive, Prefix or Opcode.... }
|
{ Local Label, Label, Directive, Prefix or Opcode.... }
|
||||||
|
if not (c in [newline,#13,'{',';']) then
|
||||||
|
current_scanner^.gettokenpos;
|
||||||
if firsttoken and not (c in [newline,#13,'{',';']) then
|
if firsttoken and not (c in [newline,#13,'{',';']) then
|
||||||
begin
|
begin
|
||||||
current_scanner^.gettokenpos;
|
|
||||||
firsttoken := FALSE;
|
firsttoken := FALSE;
|
||||||
if c = '@' then
|
if c = '@' then
|
||||||
begin
|
begin
|
||||||
@ -2614,10 +2615,24 @@ end;
|
|||||||
end;
|
end;
|
||||||
{ [...*SCALING+expr] ... }
|
{ [...*SCALING+expr] ... }
|
||||||
AS_PLUS: Begin
|
AS_PLUS: Begin
|
||||||
if instr.operands[operandnum].ref.offset <> 0 then
|
Consume(AS_PLUS);
|
||||||
Message(assem_f_internal_error_in_buildscale);
|
if actasmtoken=AS_REGISTER then
|
||||||
instr.operands[operandnum].ref.offset :=
|
begin
|
||||||
BuildRefExpression;
|
if instr.operands[operandnum].ref.base <> R_NO then
|
||||||
|
Message(assem_e_defining_base_more_than_once)
|
||||||
|
else
|
||||||
|
instr.operands[operandnum].ref.base :=
|
||||||
|
findregister(actasmpattern);
|
||||||
|
consume(AS_REGISTER);
|
||||||
|
if actasmtoken=AS_RBRACKET then
|
||||||
|
consume(AS_RBRACKET);
|
||||||
|
end;
|
||||||
|
if (actasmtoken in [AS_PLUS,AS_MINUS]) then
|
||||||
|
if instr.operands[operandnum].ref.offset <> 0 then
|
||||||
|
Message(assem_f_internal_error_in_buildscale)
|
||||||
|
else
|
||||||
|
instr.operands[operandnum].ref.offset :=
|
||||||
|
BuildRefExpression;
|
||||||
end;
|
end;
|
||||||
{ [...*SCALING] ... }
|
{ [...*SCALING] ... }
|
||||||
AS_RBRACKET: Consume(AS_RBRACKET);
|
AS_RBRACKET: Consume(AS_RBRACKET);
|
||||||
@ -2808,9 +2823,15 @@ end;
|
|||||||
{*********************************************************************}
|
{*********************************************************************}
|
||||||
var
|
var
|
||||||
l:longint;
|
l:longint;
|
||||||
|
again : boolean;
|
||||||
|
|
||||||
Begin
|
Begin
|
||||||
Consume(AS_LBRACKET);
|
Consume(AS_LBRACKET);
|
||||||
initAsmRef(instr);
|
initAsmRef(instr);
|
||||||
|
again:=true;
|
||||||
|
while again do
|
||||||
|
begin
|
||||||
|
again:=false;
|
||||||
Case actasmtoken of
|
Case actasmtoken of
|
||||||
{ Constant reference expression OR variable reference expression }
|
{ Constant reference expression OR variable reference expression }
|
||||||
AS_ID: Begin
|
AS_ID: Begin
|
||||||
@ -2832,7 +2853,12 @@ end;
|
|||||||
else if NOT var_prefix then
|
else if NOT var_prefix then
|
||||||
Begin
|
Begin
|
||||||
InitAsmRef(instr);
|
InitAsmRef(instr);
|
||||||
if not CreateVarInstr(instr,actasmpattern,operandnum) then
|
if CreateVarInstr(instr,actasmpattern,operandnum) then
|
||||||
|
begin
|
||||||
|
var_prefix:=true;
|
||||||
|
again:=true;
|
||||||
|
end
|
||||||
|
else
|
||||||
Message1(assem_e_unknown_id,actasmpattern);
|
Message1(assem_e_unknown_id,actasmpattern);
|
||||||
Consume(AS_ID);
|
Consume(AS_ID);
|
||||||
{ is there a constant expression following }
|
{ is there a constant expression following }
|
||||||
@ -2841,7 +2867,7 @@ end;
|
|||||||
Begin
|
Begin
|
||||||
Inc(instr.operands[operandnum].ref.offset, BuildRefExpression);
|
Inc(instr.operands[operandnum].ref.offset, BuildRefExpression);
|
||||||
end
|
end
|
||||||
else
|
else if not again then
|
||||||
Consume(AS_RBRACKET);
|
Consume(AS_RBRACKET);
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
@ -2877,7 +2903,12 @@ end;
|
|||||||
else if NOT var_prefix then
|
else if NOT var_prefix then
|
||||||
Begin
|
Begin
|
||||||
InitAsmRef(instr);
|
InitAsmRef(instr);
|
||||||
if not CreateVarInstr(instr,actasmpattern,operandnum) then
|
if CreateVarInstr(instr,actasmpattern,operandnum) then
|
||||||
|
begin
|
||||||
|
var_prefix:=true;
|
||||||
|
again:=true;
|
||||||
|
end
|
||||||
|
else
|
||||||
Message1(assem_e_unknown_id,actasmpattern);
|
Message1(assem_e_unknown_id,actasmpattern);
|
||||||
Consume(AS_ID);
|
Consume(AS_ID);
|
||||||
{ is there a constant expression following }
|
{ is there a constant expression following }
|
||||||
@ -2887,7 +2918,7 @@ end;
|
|||||||
Inc(instr.operands[operandnum].ref.offset,
|
Inc(instr.operands[operandnum].ref.offset,
|
||||||
BuildRefExpression);
|
BuildRefExpression);
|
||||||
end
|
end
|
||||||
else
|
else if not again then
|
||||||
Consume(AS_RBRACKET);
|
Consume(AS_RBRACKET);
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
@ -2953,6 +2984,7 @@ end;
|
|||||||
Consume(actasmtoken);
|
Consume(actasmtoken);
|
||||||
end;
|
end;
|
||||||
end; { end case }
|
end; { end case }
|
||||||
|
end;{ while }
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -3590,7 +3622,10 @@ begin
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.27 1999-04-17 22:16:58 pierre
|
Revision 1.28 1999-04-18 00:32:23 pierre
|
||||||
|
* fix for bug0124 and better error position info
|
||||||
|
|
||||||
|
Revision 1.27 1999/04/17 22:16:58 pierre
|
||||||
* ifdef USE_OP3 released (changed into ifndef NO_OP3)
|
* ifdef USE_OP3 released (changed into ifndef NO_OP3)
|
||||||
* SHRD and SHLD first operand (ATT syntax) can only be CL reg or immediate const
|
* SHRD and SHLD first operand (ATT syntax) can only be CL reg or immediate const
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user