mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
Remove println2
This commit is contained in:
parent
ee5d6f1e7f
commit
20b5c4b88b
@ -8,7 +8,7 @@ pub fn exit(reason string) {
|
||||
if reason == '' {
|
||||
panic('exit empty reason')
|
||||
}
|
||||
println2('exit(): $reason')
|
||||
println('exit(): $reason')
|
||||
C.exit(0)
|
||||
}
|
||||
|
||||
@ -31,7 +31,7 @@ pub fn print_backtrace() {
|
||||
}
|
||||
|
||||
pub fn panic(s string) {
|
||||
println2('V panic: $s')
|
||||
println('V panic: $s')
|
||||
print_backtrace()
|
||||
C.exit(1)
|
||||
}
|
||||
@ -53,7 +53,7 @@ pub fn eprintln(s string) {
|
||||
}
|
||||
// TODO issues with stderr and cross compiling for Linux
|
||||
$else {
|
||||
println2(s)
|
||||
println(s)
|
||||
}
|
||||
}
|
||||
|
||||
@ -61,10 +61,6 @@ pub fn print(s string) {
|
||||
C.printf('%.*s', s.len, s.str)
|
||||
}
|
||||
|
||||
fn println2(s string) {
|
||||
C.printf('%.*s\n', s.len, s.str)
|
||||
}
|
||||
|
||||
pub fn malloc(n int) byteptr {
|
||||
if n < 0 {
|
||||
panic('malloc(<0)')
|
||||
@ -78,7 +74,7 @@ pub fn malloc(n int) byteptr {
|
||||
total := i64(0)
|
||||
# total_m += n;
|
||||
# total = total_m;
|
||||
println2('\n\n\nmalloc($n) total=$total')
|
||||
println('\n\n\nmalloc($n) total=$total')
|
||||
print_backtrace()
|
||||
#endif
|
||||
ptr := C.malloc(n)
|
||||
|
@ -228,7 +228,7 @@ pub fn (s string) split(delim string) []string {
|
||||
}
|
||||
if delim.len == 1 {
|
||||
return s.split_single(delim[0])
|
||||
// println2('split 1 only')
|
||||
// println('split 1 only')
|
||||
// os.exit()
|
||||
}
|
||||
mut i := 0
|
||||
|
@ -201,7 +201,7 @@ fn (s string) is_utf8() int {
|
||||
return -1
|
||||
}
|
||||
if !ok {
|
||||
println2('utf is bad dalen=$len KEK $s sdf')
|
||||
println('utf is bad dalen=$len KEK $s sdf')
|
||||
// s = s.left(i)
|
||||
}
|
||||
return i
|
||||
@ -215,7 +215,7 @@ fn (s string) runes() []string {
|
||||
res := []string{}
|
||||
if !s.is_utf8() {
|
||||
mys := s
|
||||
println2('string.me runes bad utf $mys HAHA')
|
||||
println('string.me runes bad utf $mys HAHA')
|
||||
return res
|
||||
}
|
||||
for i := 0; i < s.len; i++ {
|
||||
|
@ -91,7 +91,7 @@ fn main() {
|
||||
args := os.args
|
||||
// Print the version and exit.
|
||||
if 'version' in args {
|
||||
println2('V $Version')
|
||||
println('V $Version')
|
||||
return
|
||||
}
|
||||
if '-h' in args || '--help' in args || 'help' in args {
|
||||
@ -120,7 +120,7 @@ fn main() {
|
||||
if !file.ends_with('.v') {
|
||||
os.exit1('v fmt can only be used on .v files')
|
||||
}
|
||||
println2('vfmt is temporarily disabled')
|
||||
println('vfmt is temporarily disabled')
|
||||
return
|
||||
}
|
||||
// V with no args? REPL
|
||||
@ -379,7 +379,7 @@ string _STR_TMP(const char *fmt, ...) {
|
||||
ret := os.system2(cmd)
|
||||
if ret != 0 {
|
||||
s := os.system(cmd)
|
||||
println2(s)
|
||||
println(s)
|
||||
os.exit1('ret not 0, exiting')
|
||||
}
|
||||
}
|
||||
@ -413,7 +413,7 @@ fn (c mut V) cc() {
|
||||
else if c.build_mode == DEFAULT_MODE {
|
||||
libs = '$TmpPath/vlib/builtin.o'
|
||||
if !os.file_exists(libs) {
|
||||
println2('`builtin.o` not found')
|
||||
println('`builtin.o` not found')
|
||||
exit('')
|
||||
}
|
||||
for imp in c.table.imports {
|
||||
@ -485,7 +485,7 @@ mut args := ''
|
||||
res := os.system(cmd)
|
||||
// println('C OUTPUT:')
|
||||
if res.contains('error: ') {
|
||||
println2(res)
|
||||
println(res)
|
||||
panic('clang error')
|
||||
}
|
||||
// Link it if we are cross compiling and need an executable
|
||||
@ -791,9 +791,9 @@ fn new_v(args[]string) *V {
|
||||
}
|
||||
|
||||
fn run_repl() []string {
|
||||
println2('V $Version')
|
||||
println2('Use Ctrl-D to exit')
|
||||
println2('For now you have to use println() to print values, this will be fixed soon\n')
|
||||
println('V $Version')
|
||||
println('Use Ctrl-D to exit')
|
||||
println('For now you have to use println() to print values, this will be fixed soon\n')
|
||||
file := TmpPath + '/vrepl.v'
|
||||
mut lines := []string
|
||||
for {
|
||||
@ -812,7 +812,7 @@ fn run_repl() []string {
|
||||
mut v := new_v( ['v', '-repl', file])
|
||||
v.compile()
|
||||
s := os.system(TmpPath + '/vrepl')
|
||||
println2(s)
|
||||
println(s)
|
||||
}
|
||||
else {
|
||||
lines << line
|
||||
|
@ -450,7 +450,7 @@ fn (s mut Scanner) scan() ScanRes {
|
||||
}
|
||||
return scan_res(DIV, '')
|
||||
}
|
||||
println2('(char code=$c) pos=$s.pos len=$s.text.len')
|
||||
println('(char code=$c) pos=$s.pos len=$s.text.len')
|
||||
s.error('invalid character `${c.str()}`')
|
||||
return scan_res(EOF, '')
|
||||
}
|
||||
@ -458,15 +458,15 @@ fn (s mut Scanner) scan() ScanRes {
|
||||
fn (s &Scanner) error(msg string) {
|
||||
// println('!! SCANNER ERROR: $msg')
|
||||
file := s.file_path.all_after('/')
|
||||
println2('panic: $file:${s.line_nr + 1}')
|
||||
println2(msg)
|
||||
println('panic: $file:${s.line_nr + 1}')
|
||||
println(msg)
|
||||
// os.print_backtrace()
|
||||
// println(file)
|
||||
// println(s.file_path)
|
||||
os.exit1(' ')
|
||||
}
|
||||
|
||||
// println2('array out of bounds $idx len=$a.len')
|
||||
// println('array out of bounds $idx len=$a.len')
|
||||
// This is really bad. It needs a major clean up
|
||||
fn (s mut Scanner) ident_string() string {
|
||||
// println("\nidentString() at char=", string(s.text[s.pos]),
|
||||
|
@ -615,7 +615,7 @@ fn (table mut Table) cgen_name(f &Fn) string {
|
||||
}
|
||||
old := name
|
||||
name = 'f_$idx'
|
||||
println2('$old ==> $name')
|
||||
println('$old ==> $name')
|
||||
}
|
||||
return name
|
||||
}
|
||||
|
2
gg/gg.v
2
gg/gg.v
@ -344,7 +344,7 @@ fn new_context_text(cfg Cfg, scale int) *GG {
|
||||
font_path = '/var/tmp/RobotoMono-Regular.ttf'
|
||||
}
|
||||
if !os.file_exists(font_path) {
|
||||
println2('failed to load RobotoMono-Regular.ttf')
|
||||
println('failed to load RobotoMono-Regular.ttf')
|
||||
exit('')
|
||||
}
|
||||
# FT_Face face;
|
||||
|
@ -30,7 +30,7 @@ pub:
|
||||
// embed 'http'
|
||||
fn get(url string) string {
|
||||
if url == '' {
|
||||
println2('http: empty get url')
|
||||
println('http: empty get url')
|
||||
return ''
|
||||
}
|
||||
mut req := new_request('GET', url, '')
|
||||
|
@ -98,7 +98,7 @@ fn (req &Request) do() Response {
|
||||
// init curl
|
||||
curl := C.curl_easy_init()
|
||||
if isnil(curl) {
|
||||
println2('curl init failed')
|
||||
println('curl init failed')
|
||||
return Response{}
|
||||
}
|
||||
// options
|
||||
|
Loading…
Reference in New Issue
Block a user