original.sol 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. pragma solidity ^0.8.8;
  2. function doIt() {}
  3. contract WhileStatement {
  4. function test() external {
  5. uint256 i1;
  6. while ( i1 < 10 ) {
  7. i1++;
  8. }
  9. while (i1<10) i1++;
  10. while (i1<10)
  11. while (i1<10)
  12. i1++;
  13. uint256 i2;
  14. while ( i2 < 10) { i2++; }
  15. uint256 i3; while (
  16. i3 < 10
  17. ) { i3++; }
  18. uint256 i4; while (i4 < 10)
  19. { i4 ++ ;}
  20. uint256 someLongVariableName;
  21. while (
  22. someLongVariableName < 10 && someLongVariableName < 11 && someLongVariableName < 12
  23. ) { someLongVariableName ++; } someLongVariableName++;
  24. bool condition;
  25. while(condition) doIt();
  26. while(condition) { doIt(); }
  27. while
  28. (condition) doIt();
  29. while // comment1
  30. (condition) doIt();
  31. while (
  32. condition // comment2
  33. ) doIt();
  34. while ( someLongVariableName < 10 && someLongVariableName < 11 && someLongVariableName < 12) doIt();
  35. }
  36. }