1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

v: add compile-time enum evaluation with $for item in MyEnum.fields { dump(item.value) dump(item.name) } (#17517)

This commit is contained in:
Felipe Pena
2023-03-12 07:46:54 -03:00
committed by GitHub
parent b2a71ecab2
commit 3197ec1a41
11 changed files with 117 additions and 2 deletions

View File

@ -107,6 +107,12 @@ pub:
typ int
}
pub struct EnumData {
pub:
name string
value i64
}
// FieldData holds information about a field. Fields reside on structs.
pub struct FieldData {
pub: