vfmt: fix raw string support
parent
3cfdd2a4cd
commit
b02ec8cbf9
|
@ -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 {
|
||||||
|
|
Loading…
Reference in New Issue