mirror of
https://github.com/vlang/v.git
synced 2025-09-23 12:28:29 -04:00
This commit is contained in:
parent
5978cbcfbf
commit
cb4d16ff3a
@ -351,7 +351,6 @@ pub:
|
||||
option_pos token.Pos
|
||||
pre_comments []Comment
|
||||
comments []Comment
|
||||
next_comments []Comment
|
||||
i int
|
||||
has_default_expr bool
|
||||
has_prev_newline bool
|
||||
@ -365,6 +364,7 @@ pub:
|
||||
is_deprecated bool
|
||||
is_embed bool
|
||||
pub mut:
|
||||
next_comments []Comment
|
||||
is_recursive bool
|
||||
is_part_of_union bool
|
||||
container_typ Type
|
||||
|
11
vlib/v/fmt/tests/struct_end_comments_keep.vv
Normal file
11
vlib/v/fmt/tests/struct_end_comments_keep.vv
Normal file
@ -0,0 +1,11 @@
|
||||
module main
|
||||
|
||||
pub struct CSDL_GamepadBinding {
|
||||
pub mut:
|
||||
output_type u8
|
||||
// TODO: BELONGS ABOVE // union {
|
||||
// SDL_GamepadButton button; struct {
|
||||
// SDL_GamepadAxis axis; int axis_min; int axis_max; } axis; } output
|
||||
}
|
||||
|
||||
pub type GamepadBinding = CSDL_GamepadBinding
|
@ -212,6 +212,11 @@ fn (mut p Parser) struct_decl(is_anon bool) ast.StructDecl {
|
||||
mut field_pos := token.Pos{}
|
||||
mut option_pos := token.Pos{}
|
||||
|
||||
if p.tok.kind == .rcbr {
|
||||
ast_fields.last().next_comments << pre_field_comments
|
||||
break
|
||||
}
|
||||
|
||||
if is_embed {
|
||||
// struct embedding
|
||||
type_pos = p.tok.pos()
|
||||
|
Loading…
x
Reference in New Issue
Block a user