Skip to content

Latest commit

 

History

History
63 lines (38 loc) · 874 Bytes

while_loop_rules.rst

File metadata and controls

63 lines (38 loc) · 874 Bytes

While Loop Rules

while_loop_001

This rule checks for indentation of the while keyword. Proper indentation enhances comprehension.

Violation

begin

while (temp /= 0) loop
    temp := temp/2;
  end loop;

Fix

begin

  while (temp /= 0) loop
    temp := temp/2;
  end loop;

while_loop_002

This rule checks for indentation of the end loop keywords. The end loop must line up with the while keyword. Proper indentation enhances comprehension.

Violation

begin

  while (temp /= 0) loop
    temp := temp/2;
      end loop;

Fix

begin

  while (temp /= 0) loop
    temp := temp/2;
  end loop;