mirror of
https://github.com/Ed94/Odin.git
synced 2026-07-31 03:40:08 +00:00
Deprecate strings.write_quoted_* in favour of io.write_quoted_*; make reflect.write_type a little more robust with io.Error handling
This commit is contained in:
@@ -8,6 +8,7 @@ import "core:path/filepath"
|
||||
import "core:unicode/utf8"
|
||||
import "core:unicode/utf16"
|
||||
import "core:os"
|
||||
import "core:io"
|
||||
|
||||
@(private)
|
||||
Tokenizer :: tokenizer.Tokenizer
|
||||
@@ -518,9 +519,8 @@ join_adjacent_string_literals :: proc(cpp: ^Preprocessor, initial_tok: ^Token) {
|
||||
|
||||
|
||||
quote_string :: proc(s: string) -> []byte {
|
||||
b := &strings.Builder{}
|
||||
strings.init_builder(b, 0, len(s)+2)
|
||||
strings.write_quoted_string(b, s, '"')
|
||||
b := strings.make_builder(0, len(s)+2)
|
||||
io.write_quoted_string(strings.to_writer(&b), s, '"')
|
||||
return b.buf[:]
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user