Skip to content

Divide the parsing stage into parsing and processing #23

Open
@gabbhack

Description

@gabbhack

Problem

Now a lot of modifying operations occur at the parsing stage. It's not logical.

Merging parent fields into current object:

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:

firstCaseField.get().merge(field)

The operation of "flattening" the fields occurs at the stage of initialization of the structure.

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

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions