Function enum_to_value

Source
pub fn enum_to_value(defn: &EnumDef) -> Value
Expand description

Convert a SDML EnumDef into a context object, in the form shown as JSON below.

{
    "__type": "enum",
    "source_span": {},              // optional
    "name": "Identifier",
    "annotations": [],
    "variants": [                   // optional
        {
            "name": "Identifier",
            "annotations": []       // optional
        }
    ]
}