[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:
nickysn 2020-08-03 13:00:29 +00:00
parent 9383c8af45
commit 5f20c9b269

View File

@ -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);