core/odin: support field tags on bit_field fields

Fixes #4044
This commit is contained in:
Laytan Laats
2024-08-11 20:59:54 +02:00
parent 26fa3aca44
commit f0840ed24e
3 changed files with 25 additions and 3 deletions
+1
View File
@@ -861,6 +861,7 @@ Bit_Field_Field :: struct {
name: ^Expr,
type: ^Expr,
bit_size: ^Expr,
tag: tokenizer.Token,
comments: ^Comment_Group,
}
+6
View File
@@ -2832,11 +2832,17 @@ parse_operand :: proc(p: ^Parser, lhs: bool) -> ^ast.Expr {
expect_token(p, .Or)
bit_size := parse_expr(p, true)
tag: tokenizer.Token
if p.curr_tok.kind == .String {
tag = expect_token(p, .String)
}
field := ast.new(ast.Bit_Field_Field, name.pos, bit_size)
field.name = name
field.type = type
field.bit_size = bit_size
field.tag = tag
append(&fields, field)