1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

vfmt: change all '$expr' to '${expr}' (#16428)

This commit is contained in:
yuyi
2022-11-15 21:53:13 +08:00
committed by GitHub
parent 56239b4a23
commit 017ace6ea7
859 changed files with 7156 additions and 7135 deletions

View File

@ -30,7 +30,7 @@ pub fn (err IError) str() string {
// TODO: remove once deprecation period for `IError` methods has ended
// old_error_style := unsafe { voidptr(&err.msg) != voidptr(&err.code) } // if fields are not defined (new style) they don't have an offset between
// <<
'$err.type_name(): $err.msg()'
'${err.type_name()}: ${err.msg()}'
}
}
}
@ -56,7 +56,7 @@ pub:
// msg returns the message of MessageError
pub fn (err MessageError) msg() string {
if err.code > 0 {
return '$err.msg; code: $err.code'
return '${err.msg}; code: ${err.code}'
}
return err.msg
}
@ -83,7 +83,7 @@ fn (_ None__) str() string {
[if trace_error ?]
fn trace_error(x string) {
eprintln('> ${@FN} | $x')
eprintln('> ${@FN} | ${x}')
}
// error returns a default error instance containing the error given in `message`.
@ -100,7 +100,7 @@ pub fn error(message string) IError {
// Example: if ouch { return error_with_code('an error occurred', 1) }
[inline]
pub fn error_with_code(message string, code int) IError {
trace_error('$message | code: $code')
trace_error('${message} | code: ${code}')
return &MessageError{
msg: message
code: code