-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Problem
Now a lot of modifying operations occur at the parsing stage. It's not logical.
Merging parent fields into current object:
deser/src/deser/macroutils/parsing/struct.nim
Lines 138 to 151 in b231af7
| if Some(@parentTypeSym) ?= parentTypeSym: | |
| let parentTypeInfo = TypeInfo.fromTypeSym(parentTypeSym) | |
| if Some(@parentRecList) ?= parentTypeInfo.recList: | |
| if Some(@recListValue) ?= recList: | |
| recList = some mergeRecList(parentRecList, recListValue) | |
| else: | |
| recList = some parentRecList | |
| if Some(@parentPragma) ?= parentTypeInfo.pragma: | |
| if Some(@pragmaValue) ?= pragma: | |
| pragma = some mergePragma(pragmaValue, parentPragma) | |
| else: | |
| pragma = some parentPragma |
Merging other cases to the first case:
deser/src/deser/macroutils/parsing/field.nim
Line 120 in b231af7
| firstCaseField.get().merge(field) |
The operation of "flattening" the fields occurs at the stage of initialization of the structure.
deser/src/deser/macroutils/types.nim
Line 175 in b231af7
| flattenFields: flatten fields, |
Possible solution
Divide the parsing stage into two steps
References
No response
Code example
No response
Additional information
No response
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request