mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-28 20:40:37 +02:00
[PATCH 093/188] update number parsing
From 3a04c920a0e521c9be7f61e5fc2d7f6725ade511 Mon Sep 17 00:00:00 2001 From: Dmitry Boyarintsev <skalogryz.lists@gmail.com> Date: Tue, 10 Mar 2020 09:07:24 -0400 git-svn-id: branches/wasm@46089 -
This commit is contained in:
parent
9383c8af45
commit
5f20c9b269
@ -198,10 +198,8 @@ end;
|
||||
|
||||
function TWatScanner.Next: Boolean;
|
||||
var
|
||||
has2chars: Boolean;
|
||||
cmt : string;
|
||||
done: boolean;
|
||||
ch : char;
|
||||
begin
|
||||
Result := idx<=length(buf);
|
||||
if not Result then Exit;
|
||||
@ -242,19 +240,11 @@ begin
|
||||
token:=weIdent;
|
||||
resText:=ScanWhile(buf, idx, IdBody);
|
||||
end else if buf[idx] in SignNumericChars then begin
|
||||
token:=weNumber;
|
||||
if buf[idx] in SignChars then begin
|
||||
ch:=buf[idx];
|
||||
inc(idx);
|
||||
resText:=ScanWhile(buf, idx, NumericChars);
|
||||
if resText = '' then begin
|
||||
token:=weError;
|
||||
Exit;
|
||||
end;
|
||||
if (ch='-') then
|
||||
resText:=ch+resText;
|
||||
if not ScanNumberC(buf, idx, resText) then begin
|
||||
token := weError;
|
||||
Exit;
|
||||
end else
|
||||
resText:=ScanWhile(buf, idx, Numericchars);
|
||||
token:=weNumber;
|
||||
end else if buf[idx] in AlphaNumChars then begin
|
||||
resText:=ScanWhile(buf, idx, GrammarChars);
|
||||
GetGrammar(resText, token, instrCode);
|
||||
|
Loading…
Reference in New Issue
Block a user