hedgewars/uScript.pas
changeset 14217 83e816254f2e
parent 14216 3d4a5a10d2cd
child 14219 de21f6eb2366
equal deleted inserted replaced
14216:3d4a5a10d2cd 14217:83e816254f2e
  3611                         CheckSum := CheckSum xor GetRandom($FFFFFFFF);
  3611                         CheckSum := CheckSum xor GetRandom($FFFFFFFF);
  3612                         end;
  3612                         end;
  3613                     lastChar := mybuf[i];
  3613                     lastChar := mybuf[i];
  3614                     // lua apparently allows --  [===============[  as a valid block comment start.  
  3614                     // lua apparently allows --  [===============[  as a valid block comment start.  
  3615                     // I can't be bothered to check for that nonsense. Will allow limited single line without [
  3615                     // I can't be bothered to check for that nonsense. Will allow limited single line without [
  3616                     if (byte(mybuf[i]) = $0D) or (byte(mybuf[i]) = $0A) or mybuf[i] = '[' then
  3616                     if (byte(mybuf[i]) = $0D) or (byte(mybuf[i]) = $0A) or (mybuf[i] = '[') then
  3617                         inComment := false
  3617                         inComment := false
  3618                 end;
  3618                 end;
  3619         end;
  3619         end;
  3620     ScriptReader:= mybuf
  3620     ScriptReader:= mybuf
  3621 end;
  3621 end;
  3649                         ((byte(mybuf[i]) > $60) and (byte(mybuf[i]) < $7B)) or
  3649                         ((byte(mybuf[i]) > $60) and (byte(mybuf[i]) < $7B)) or
  3650                         ((byte(mybuf[i]) >= $30) and (byte(mybuf[i]) < $3A))) then
  3650                         ((byte(mybuf[i]) >= $30) and (byte(mybuf[i]) < $3A))) then
  3651                         inc(wordCount);
  3651                         inc(wordCount);
  3652                     lastChar := mybuf[i];
  3652                     lastChar := mybuf[i];
  3653                     // this allows at least supporting the commented strings at end of line with lua script names
  3653                     // this allows at least supporting the commented strings at end of line with lua script names
  3654                     if (byte(mybuf[i]) = $0D) or (byte(mybuf[i]) = $0A) or mybuf[i] = '[' then
  3654                     if (byte(mybuf[i]) = $0D) or (byte(mybuf[i]) = $0A) or (mybuf[i] = '[') then
  3655                         inComment := false
  3655                         inComment := false
  3656                 end;
  3656                 end;
  3657         end;
  3657         end;
  3658     ScriptLocaleReader:= mybuf
  3658     ScriptLocaleReader:= mybuf
  3659 end;
  3659 end;