Exemple #1
0
static bool emit_node(node *each, void *context)
{
    bool result = true;
    switch(node_kind(each))
    {
        case DOCUMENT:
            result = emit_document(each, context);
            break;
        case SCALAR:
            result = emit_scalar(each, context);
            break;
        case SEQUENCE:
            result = emit_sequence(each, context);
            break;
        case MAPPING:
            result = emit_mapping(each, context);
            break;
        case ALIAS:
            result = emit_node(alias_target(each), context);
            break;
    }

    return result;
}
Exemple #2
0
 /*!
  * Build a single lambda function by "folding" the chain.  Folding means
  * that the chain is processed from back to front and each emitter is
  * composed using previous lambda functions.
  *
  * \return Single "folded" lambda function representing the chain.
  */
 auto emit() const {
     const size_t Size = sizeof ... (Lambdas);
     return emit_sequence(common::make_index_sequence<Size>{ });
 }