mirror of
https://github.com/Ed94/Odin.git
synced 2026-07-29 02:40:05 +00:00
Strip even more semicolons if followed by a } or ) on the same line
This commit is contained in:
@@ -207,11 +207,11 @@ cut :: proc(s: string, rune_offset := int(0), rune_length := int(0), allocator :
|
||||
s := s; rune_length := rune_length
|
||||
l := utf8.rune_count_in_string(s)
|
||||
|
||||
if rune_offset >= l { return ""; }
|
||||
if rune_offset >= l { return "" }
|
||||
if rune_offset == 0 && rune_length <= 0 {
|
||||
return clone(s, allocator)
|
||||
}
|
||||
if rune_length == 0 { rune_length = l; }
|
||||
if rune_length == 0 { rune_length = l }
|
||||
|
||||
bytes_needed := min(rune_length * 4, len(s))
|
||||
buf := make([]u8, bytes_needed, allocator)
|
||||
@@ -226,7 +226,7 @@ cut :: proc(s: string, rune_offset := int(0), rune_length := int(0), allocator :
|
||||
byte_offset += w
|
||||
}
|
||||
if rune_length > 0 {
|
||||
if i == rune_offset + rune_length - 1 { break; }
|
||||
if i == rune_offset + rune_length - 1 { break }
|
||||
}
|
||||
s = s[w:]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user