[PATCH 056/188] fix comments scanning

From 4933bad2fb89f856c5cfc5d60378e619c92a5413 Mon Sep 17 00:00:00 2001
From: Dmitry Boyarintsev <skalogryz.lists@gmail.com>
Date: Sun, 24 Nov 2019 20:18:09 -0500

git-svn-id: branches/wasm@46052 -
This commit is contained in:
nickysn 2020-08-03 12:59:45 +00:00
parent 47a39bb01b
commit 8b1d615a77
2 changed files with 6 additions and 8 deletions

View File

@ -222,7 +222,8 @@ begin
if isSubStrMatch(s, index, substr) then begin
inc(index, length(substr));
Break;
end;
end else
inc(index);
end;
Result:=Copy(s, i, index-i);
end;

View File

@ -192,13 +192,12 @@ begin
Result := idx<=length(buf);
if not Result then Exit;
ofs:=idx;
has2chars := idx<length(buf);
if has2chars then begin
if (buf[idx]=';') and (buf[idx+1]=';') then begin
if (idx<length(buf)) and (buf[idx] in [';','(']) and (buf[idx+1]=';') then begin
if (buf[idx]=';') then begin
// comment until the end of the line
cmt := ScanTo(buf, idx, EoLnChars);
ScanWhile(buf, idx, EoLnChars);
end else if (buf[idx]='(') and (buf[idx+1]=';') then
end else
// comment until the ;)
cmt := ScanToSubstr(buf, idx, ';)');
@ -207,9 +206,7 @@ begin
done:=true;
end else
DoComment(cmt);
end;
if not done then begin
end else begin
done:=true;
if buf[idx] = '(' then begin
token:=weOpenBrace;