mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-01 12:18:15 +00:00
Strip even more semicolons if followed by a } or ) on the same line
This commit is contained in:
@@ -202,7 +202,7 @@ shift :: proc(a: ^Decimal, i: int) {
|
||||
}
|
||||
|
||||
can_round_up :: proc(a: ^Decimal, nd: int) -> bool {
|
||||
if nd < 0 || nd >= a.count { return false ; }
|
||||
if nd < 0 || nd >= a.count { return false }
|
||||
if a.digits[nd] == '5' && nd+1 == a.count {
|
||||
if a.trunc {
|
||||
return true
|
||||
@@ -214,7 +214,7 @@ can_round_up :: proc(a: ^Decimal, nd: int) -> bool {
|
||||
}
|
||||
|
||||
round :: proc(a: ^Decimal, nd: int) {
|
||||
if nd < 0 || nd >= a.count { return; }
|
||||
if nd < 0 || nd >= a.count { return }
|
||||
if can_round_up(a, nd) {
|
||||
round_up(a, nd)
|
||||
} else {
|
||||
@@ -223,7 +223,7 @@ round :: proc(a: ^Decimal, nd: int) {
|
||||
}
|
||||
|
||||
round_up :: proc(a: ^Decimal, nd: int) {
|
||||
if nd < 0 || nd >= a.count { return; }
|
||||
if nd < 0 || nd >= a.count { return }
|
||||
|
||||
for i := nd-1; i >= 0; i -= 1 {
|
||||
if c := a.digits[i]; c < '9' {
|
||||
@@ -240,7 +240,7 @@ round_up :: proc(a: ^Decimal, nd: int) {
|
||||
}
|
||||
|
||||
round_down :: proc(a: ^Decimal, nd: int) {
|
||||
if nd < 0 || nd >= a.count { return; }
|
||||
if nd < 0 || nd >= a.count { return }
|
||||
a.count = nd
|
||||
trim(a)
|
||||
}
|
||||
|
||||
@@ -402,11 +402,11 @@ parse_f64 :: proc(str: string) -> (value: f64, ok: bool) {
|
||||
}
|
||||
exp = exp * 10 + d
|
||||
}
|
||||
if exp > 308 { exp = 308; }
|
||||
if exp > 308 { exp = 308 }
|
||||
|
||||
for exp >= 50 { scale *= 1e50; exp -= 50; }
|
||||
for exp >= 8 { scale *= 1e8; exp -= 8; }
|
||||
for exp > 0 { scale *= 10; exp -= 1; }
|
||||
for exp >= 50 { scale *= 1e50; exp -= 50 }
|
||||
for exp >= 8 { scale *= 1e8; exp -= 8 }
|
||||
for exp > 0 { scale *= 10; exp -= 1 }
|
||||
}
|
||||
}
|
||||
s = s[i:]
|
||||
|
||||
Reference in New Issue
Block a user