mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
vfmt: fix raw string support
This commit is contained in:
@ -660,6 +660,9 @@ pub fn (mut f Fmt) expr(node ast.Expr) {
|
|||||||
f.write(')')
|
f.write(')')
|
||||||
}
|
}
|
||||||
ast.StringLiteral {
|
ast.StringLiteral {
|
||||||
|
if it.is_raw {
|
||||||
|
f.write('r')
|
||||||
|
}
|
||||||
if it.val.contains("'") && !it.val.contains('"') {
|
if it.val.contains("'") && !it.val.contains('"') {
|
||||||
f.write('"$it.val"')
|
f.write('"$it.val"')
|
||||||
} else {
|
} else {
|
||||||
|
@ -94,7 +94,7 @@ pub fn githash(should_get_from_filesystem bool) string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
fn set_vroot_folder(vroot_path string) {
|
pub fn set_vroot_folder(vroot_path string) {
|
||||||
// Preparation for the compiler module:
|
// Preparation for the compiler module:
|
||||||
// VEXE env variable is needed so that compiler.vexe_path()
|
// VEXE env variable is needed so that compiler.vexe_path()
|
||||||
// can return it later to whoever needs it:
|
// can return it later to whoever needs it:
|
||||||
@ -205,7 +205,7 @@ pub fn read_file(file_path string) ?string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
[inline]
|
[inline]
|
||||||
fn imin(a, b int) int {
|
pub fn imin(a, b int) int {
|
||||||
return if a < b {
|
return if a < b {
|
||||||
a
|
a
|
||||||
} else {
|
} else {
|
||||||
@ -214,7 +214,7 @@ fn imin(a, b int) int {
|
|||||||
}
|
}
|
||||||
|
|
||||||
[inline]
|
[inline]
|
||||||
fn imax(a, b int) int {
|
pub fn imax(a, b int) int {
|
||||||
return if a > b {
|
return if a > b {
|
||||||
a
|
a
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user