Remove while loop and readd c-style for loops i.e. all loops are just for

This commit is contained in:
Ginger Bill
2017-01-27 17:43:42 +00:00
parent 832009f33a
commit 92453369c5
11 changed files with 201 additions and 139 deletions
+3 -4
View File
@@ -143,8 +143,7 @@ valid_rune :: proc(r: rune) -> bool {
valid_string :: proc(s: string) -> bool {
n := s.count;
i := 0;
while i < n {
for i := 0; i < n; {
si := s[i];
if si < RUNE_SELF { // ascii
i += 1;
@@ -178,8 +177,8 @@ valid_string :: proc(s: string) -> bool {
rune_count :: proc(s: string) -> int {
count := 0;
n := s.count;
i := 0;
while i < n {
for i := 0; i < n; {
defer count += 1;
si := s[i];
if si < RUNE_SELF { // ascii