mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
fmt: keep volatile
qualifier in global declarations (#15947)
This commit is contained in:
parent
a7ad64033e
commit
8a38bc2324
@ -1103,6 +1103,9 @@ pub fn (mut f Fmt) global_decl(node ast.GlobalDecl) {
|
|||||||
}
|
}
|
||||||
for field in node.fields {
|
for field in node.fields {
|
||||||
f.comments(field.comments, inline: true)
|
f.comments(field.comments, inline: true)
|
||||||
|
if field.is_volatile {
|
||||||
|
f.write('volatile ')
|
||||||
|
}
|
||||||
f.write('$field.name ')
|
f.write('$field.name ')
|
||||||
f.write(strings.repeat(` `, max - field.name.len))
|
f.write(strings.repeat(` `, max - field.name.len))
|
||||||
if field.has_expr {
|
if field.has_expr {
|
||||||
|
@ -1,3 +1,7 @@
|
|||||||
|
struct TestInt {
|
||||||
|
i int
|
||||||
|
}
|
||||||
|
|
||||||
__global x = bool(true)
|
__global x = bool(true)
|
||||||
__global y f32
|
__global y f32
|
||||||
__global ()
|
__global ()
|
||||||
@ -7,4 +11,7 @@ __global (
|
|||||||
)
|
)
|
||||||
__global (
|
__global (
|
||||||
a int
|
a int
|
||||||
|
volatile test_int = TestInt{
|
||||||
|
i: 0
|
||||||
|
}
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user