mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-02 19:24:46 +01:00
codetools: reduced debugging
git-svn-id: trunk@22808 -
This commit is contained in:
parent
58f1799eae
commit
7d0ed7d072
@ -48,23 +48,23 @@ end;
|
||||
begin
|
||||
e:=TExpressionEvaluator.Create;
|
||||
e.Variables['A']:='123';
|
||||
//Test('defined A','1');
|
||||
//Test('defined(A)','1');
|
||||
//Test('undefined(A)','0');
|
||||
//Test('not undefined(A)','1');
|
||||
//Test('not defined A','0');
|
||||
//Test('A or B','123');
|
||||
//Test('defined(B)','0');
|
||||
//Test('B or A','1');
|
||||
//Test('defined(B) or defined(A)','1');
|
||||
//Test('defined(B) or not defined(A)','0');
|
||||
//Test('not defined(B) or not defined(A)','1');
|
||||
//Test('not defined(B) or defined(A)','1');
|
||||
//Test('1 << 2','4');
|
||||
//Test('4 >> 1','2');
|
||||
//Test('4 = ''4''','1');
|
||||
//Test('(1+1)=2','1');
|
||||
//Test('(1+(2+4))=7','1');
|
||||
Test('defined A','1');
|
||||
Test('defined(A)','1');
|
||||
Test('undefined(A)','0');
|
||||
Test('not undefined(A)','1');
|
||||
Test('not defined A','0');
|
||||
Test('A or B','1');
|
||||
Test('defined(B)','0');
|
||||
Test('B or A','1');
|
||||
Test('defined(B) or defined(A)','1');
|
||||
Test('defined(B) or not defined(A)','0');
|
||||
Test('not defined(B) or not defined(A)','1');
|
||||
Test('not defined(B) or defined(A)','1');
|
||||
Test('1 << 2','4');
|
||||
Test('4 >> 1','2');
|
||||
Test('4 = ''4''','1');
|
||||
Test('(1+1)=2','1');
|
||||
Test('(1+(2+4))=7','1');
|
||||
Test('(1+2*3)=7','1');
|
||||
e.Free;
|
||||
end.
|
||||
|
||||
@ -1271,7 +1271,9 @@ var
|
||||
else
|
||||
inc(p);
|
||||
end;
|
||||
{$IFDEF VerboseExprEval}
|
||||
DebugLn(['ReadNextAtom ',GetAtom]);
|
||||
{$ENDIF}
|
||||
end;
|
||||
|
||||
procedure Error(NewErrorPos: PChar; const NewErrorMsg: string);
|
||||
@ -1281,7 +1283,9 @@ var
|
||||
else
|
||||
FErrorPos:=0;
|
||||
ErrorMsg:=NewErrorMsg;
|
||||
{$IFDEF VerboseExprEval}
|
||||
DebugLn(['Error ',ErrorMsg,' at ',ErrorPosition]);
|
||||
{$ENDIF}
|
||||
end;
|
||||
|
||||
procedure Error(NewErrorPos: PChar; E: Exception);
|
||||
@ -1390,7 +1394,9 @@ var
|
||||
begin
|
||||
Result:=false;
|
||||
if AtomStart>=ExprEnd then exit;
|
||||
{$IFDEF VerboseExprEval}
|
||||
DebugLn(['ReadOperand ',GetAtom]);
|
||||
{$ENDIF}
|
||||
case UpChars[AtomStart^] of
|
||||
'N':
|
||||
if CompareIdentifiers(AtomStart,'NOT')=0 then begin
|
||||
@ -1465,10 +1471,14 @@ var
|
||||
begin
|
||||
ReadNextAtom;
|
||||
if AtomStart>=ExprEnd then exit;
|
||||
{$IFDEF VerboseExprEval}
|
||||
DebugLn(['ReadOperand BRACKET OPEN']);
|
||||
{$ENDIF}
|
||||
if not EvalPChar(AtomStart,ExprLen-(AtomStart-Expression),Operand) then
|
||||
exit;
|
||||
{$IFDEF VerboseExprEval}
|
||||
DebugLn(['ReadOperand BRACKET CLOSED => skip bracket']);
|
||||
{$ENDIF}
|
||||
BracketLvl:=1;
|
||||
while AtomStart<ExprEnd do begin
|
||||
case AtomStart^ of
|
||||
@ -1513,7 +1523,9 @@ var
|
||||
// compute stack item
|
||||
Op:=ExprStack[StackPtr].theOperator;
|
||||
StackOperand:=@ExprStack[StackPtr].Operand;
|
||||
{$IFDEF VerboseExprEval}
|
||||
DebugLn(['ExecuteStack Operator^=',ExprStack[StackPtr].theOperator^]);
|
||||
{$ENDIF}
|
||||
case UpChars[Op^] of
|
||||
'*': // multiply
|
||||
begin
|
||||
@ -1566,7 +1578,6 @@ var
|
||||
Number1:=OperandToInt64(StackOperand^);
|
||||
Number2:=OperandToInt64(Operand);
|
||||
NumberResult:=Number1 shl Number2;
|
||||
DebugLn(['ExecuteStack ',Number1,' ',Number2,' ',NumberResult]);
|
||||
SetOperandValueInt64(Operand,NumberResult);
|
||||
end;
|
||||
else
|
||||
|
||||
Loading…
Reference in New Issue
Block a user