Browse Source

fcl-js: simplified

git-svn-id: trunk@40203 -
Mattias Gaertner 6 years ago
parent
commit
1bd8e903d7
1 changed files with 4 additions and 11 deletions
  1. 4 11
      packages/fcl-js/src/jsscanner.pp

+ 4 - 11
packages/fcl-js/src/jsscanner.pp

@@ -504,22 +504,15 @@ begin
   SetLength(FCurTokenString,Len);
   if Len > 0 then
     Move(TokenStart^,FCurTokenString[1],Len);
- // Check if this is a keyword or identifier
- // !!!: Optimize this!
-  I:=FirstKeyword;
-  While (Result=tjsIdentifier) and (I<=Lastkeyword) do
-    begin
-    if (CurTokenString=TokenInfos[i]) then
+  // Check if this is a keyword or identifier
+  // !!!: Optimize this!
+  for i:=FirstKeyword to Lastkeyword do
+    if CurTokenString=TokenInfos[i] then
       begin
       Result := i;
       FCurToken := Result;
       exit;
       end;
-    {$Push}
-    {$R-}
-    I:=Succ(I);
-    {$Pop}
-    end
 end;
 
 Function TJSScanner.FetchToken: TJSToken;