text:
struct Params_Of_State {
    REBARR *arr;
    REBLEN num_visible;
    RELVAL *dest;
    bool just_words;
};

// Reconstitute parameter back into a full value, e.g. REB_P_REFINEMENT
// becomes `/spelling`.
//
// !!! See notes on Is_Param_Hidden() for why caller isn't filtering locals.
//
static bool Params_Of_Hook(
    REBVAL *param,
    REBFLGS flags,
    void *opaque
){
    struct Params_Of_State *s = cast(struct Params_Of_State*, opaque);

    if (not (flags & PHF_SORTED_PASS)) {
        ++s->num_visible;  // first pass we just count unspecialized params
        return true;
    }

    if (not s->arr) {  // if first step on second pass, make the array
        s->arr = Make_Array(s->num_visible);
        s->dest = ARR_HEAD(s->arr);
    }

    Init_Any_Word(s->dest, REB_WORD, VAL_PARAM_SPELLING(param));

    if (not s->just_words) {
        if (
            not (flags & PHF_UNREFINED)
            and TYPE_CHECK(param, REB_TS_REFINEMENT)
        ){
            Refinify(KNOWN(s->dest));
        }

        switch (VAL_PARAM_CLASS(param)) {
          case REB_P_NORMAL:
            break;

          case REB_P_HARD_QUOTE:
            Getify(KNOWN(s->dest));
            break;

          case REB_P_MODAL:
            if (flags & PHF_DEMODALIZED) {
                // associated refinement specialized out
            }
            else
                Symify(KNOWN(s->dest));
            break;

          case REB_P_SOFT_QUOTE:
            Quotify(KNOWN(s->dest), 1);
            break;

          default:
            assert(false);
            DEAD_END;
        }
    }

    ++s->dest;
    return true;
}

//
//  Make_Action_Parameters_Arr: C
//
// Returns array of function words, unbound.
//
REBARR *Make_Action_Parameters_Arr(REBACT *act, bool just_words)
{
    struct Params_Of_State s;
    s.arr = nullptr;
    s.num_visible = 0;
    s.just_words = just_words;

    For_Each_Unspecialized_Param(act, &Params_Of_Hook, &s);

    if (not s.arr)
        return Make_Array(1); // no unspecialized parameters, empty array

    TERM_ARRAY_LEN(s.arr, s.num_visible);
    ASSERT_ARRAY(s.arr);
    return s.arr;
}

static bool Typesets_Of_Hook(
    REBVAL *param,
    REBFLGS flags,
    void *opaque
){
    struct Params_Of_State *s = cast(struct Params_Of_State*, opaque);

    if (not (flags & PHF_SORTED_PASS)) {
        ++s->num_visible;  // first pass we just count unspecialized params
        return true;
    }

    if (not s->arr) {  // if first step on second pass, make the array
        s->arr = Make_Array(s->num_visible);
        s->dest = ARR_HEAD(s->arr);
    }

    // It's already a typeset, but remove the parameter spelling.
    //
    // !!! Typesets must be revisited in a world with user-defined types, as
    // well as to accomodate multiple quoting levels.
    //
    Move_Value(s->dest, param);
    assert(IS_TYPESET(s->dest));
    VAL_TYPESET_STRING_NODE(s->dest) = nullptr;
    ++s->dest;

    return true;
}

//
//  Make_Action_Typesets_Arr: C
//
// Return a block of function arg typesets.
// Note: skips 0th entry.
//
REBARR *Make_Action_Typesets_Arr(REBACT *act)
{
    struct Params_Of_State s;
    s.arr = nullptr;
    s.num_visible = 0;
    s.just_words = false;  // (ignored)

    For_Each_Unspecialized_Param(act, &Typesets_Of_Hook, &s);

    if (not s.arr)
        return Make_Array(1); // no unspecialized parameters, empty array

    TERM_ARRAY_LEN(s.arr, s.num_visible);
    ASSERT_ARRAY(s.arr);
    return s.arr;
}

enum Reb_Spec_Mode {
    SPEC_MODE_NORMAL, // words are arguments
    SPEC_MODE_LOCAL, // words are locals
    SPEC_MODE_WITH // words are "extern"
};

//
//  Push_Paramlist_Triads_May_Fail: C
//
// This is an implementation routine for Make_Paramlist_Managed_May_Fail().
// It was broken out into its own separate routine so that the AUGMENT
// function could reuse the logic for function spec analysis.  It may not
// be broken out in a particularly elegant way, but it's a start.
//
void Push_Paramlist_Triads_May_Fail(
    const REBVAL *spec,
    REBFLGS *flags,
    REBDSP dsp_orig,
    REBDSP *definitional_return_dsp
){
    assert(IS_BLOCK(spec));

    enum Reb_Spec_Mode mode = SPEC_MODE_NORMAL;

    bool refinement_seen = false;

    const RELVAL* value = VAL_ARRAY_AT(spec);

    while (NOT_END(value)) {
        const RELVAL* item = value;  // "faked", e.g. <return> => RETURN:
        ++value;  // go ahead and consume next

    //=//// STRING! FOR FUNCTION DESCRIPTION OR PARAMETER NOTE ////////////=//

        if (IS_TEXT(item)) {
            //
            // Consider `[<with> some-extern "description of that extern"]` to
            // be purely commentary for the implementation, and don't include
            // it in the meta info.
            //
            if (mode == SPEC_MODE_WITH)
                continue;

            if (IS_PARAM(DS_TOP))
                Move_Value(DS_PUSH(), EMPTY_BLOCK);  // need block in position

            if (IS_BLOCK(DS_TOP)) {  // in right spot to push notes/title
                Init_Text(DS_PUSH(), Copy_String_At(item));
            }
            else {  // !!! A string was already pushed.  Should we append?
                assert(IS_TEXT(DS_TOP));
                Init_Text(DS_TOP, Copy_String_At(item));
            }

            if (DS_TOP == DS_AT(dsp_orig + 3))
                *flags |= MKF_HAS_DESCRIPTION;
            else
                *flags |= MKF_HAS_NOTES;

            continue;
        }

    //=//// TOP-LEVEL SPEC TAGS LIKE <local>, <with> etc. /////////////////=//

        if (IS_TAG(item) and (*flags & MKF_KEYWORDS)) {
            if (0 == Compare_String_Vals(item, Root_With_Tag, true)) {
                mode = SPEC_MODE_WITH;
                continue;
            }
            else if (0 == Compare_String_Vals(item, Root_Local_Tag, true)) {
                mode = SPEC_MODE_LOCAL;
                continue;
            }
            else if (0 == Compare_String_Vals(item, Root_Void_Tag, true)) {
                *flags |= MKF_IS_VOIDER;  // use Voider_Dispatcher()

                // Fake as if they said [void!] !!! make more efficient
                //
                item = Get_System(SYS_STANDARD, STD_PROC_RETURN_TYPE);
                goto process_typeset_block;
            }
            else
                fail (Error_Bad_Func_Def_Core(item, VAL_SPECIFIER(spec)));
        }

    //=//// BLOCK! OF TYPES TO MAKE TYPESET FROM (PLUS PARAMETER TAGS) ////=//

        if (IS_BLOCK(item)) {
          process_typeset_block:
            if (IS_BLOCK(DS_TOP)) // two blocks of types!
                fail (Error_Bad_Func_Def_Core(item, VAL_SPECIFIER(spec)));

            // You currently can't say `<local> x [integer!]`, because they
            // are always void when the function runs.  You can't say
            // `<with> x [integer!]` because "externs" don't have param slots
            // to store the type in.
            //
            // !!! A type constraint on a <with> parameter might be useful,
            // though--and could be achieved by adding a type checker into
            // the body of the function.  However, that would be more holistic
            // than this generation of just a paramlist.  Consider for future.
            //
            if (mode != SPEC_MODE_NORMAL)
                fail (Error_Bad_Func_Def_Core(item, VAL_SPECIFIER(spec)));

            // Save the block for parameter types.
            //
            REBVAL* param;
            if (IS_PARAM(DS_TOP)) {
                REBSPC* derived = Derive_Specifier(VAL_SPECIFIER(spec), item);
                Init_Block(
                    DS_PUSH(),
                    Copy_Array_At_Deep_Managed(
                        VAL_ARRAY(item),
                        VAL_INDEX(item),
                        derived
                    )
                );

                param = DS_TOP - 1;  // volatile if you DS_PUSH()!
            }
            else {
                assert(IS_TEXT(DS_TOP));  // !!! are blocks after notes good?

                if (IS_BLANK_RAW(DS_TOP - 2)) {
                    //
                    // No parameters pushed, e.g. func [[integer!] {<-- bad}]
                    //
                    fail (Error_Bad_Func_Def_Core(item, VAL_SPECIFIER(spec)));
                }

                assert(IS_PARAM(DS_TOP - 2));
                param = DS_TOP - 2;

                assert(IS_BLOCK(DS_TOP - 1));
                if (VAL_ARRAY(DS_TOP - 1) != EMPTY_ARRAY)
                    fail (Error_Bad_Func_Def_Core(item, VAL_SPECIFIER(spec)));

                REBSPC* derived = Derive_Specifier(VAL_SPECIFIER(spec), item);
                Init_Block(
                    DS_TOP - 1,
                    Copy_Array_At_Deep_Managed(
                        VAL_ARRAY(item),
                        VAL_INDEX(item),
                        derived
                    )
                );
            }

            // Turn block into typeset for parameter at current index.
            // Leaves VAL_TYPESET_SYM as-is.
            //
            bool was_refinement = TYPE_CHECK(param, REB_TS_REFINEMENT);
            REBSPC* derived = Derive_Specifier(VAL_SPECIFIER(spec), item);
            VAL_TYPESET_LOW_BITS(param) = 0;
            VAL_TYPESET_HIGH_BITS(param) = 0;
            Add_Typeset_Bits_Core(
                param,
                VAL_ARRAY_HEAD(item),
                derived
            );
            if (was_refinement)
                TYPE_SET(param, REB_TS_REFINEMENT);

            *flags |= MKF_HAS_TYPES;
            continue;
        }

    //=//// ANY-WORD! PARAMETERS THEMSELVES (MAKE TYPESETS w/SYMBOL) //////=//

        bool quoted = false;  // single quoting level used as signal in spec
        if (VAL_NUM_QUOTES(item) > 0) {
            if (VAL_NUM_QUOTES(item) > 1)
                fail (Error_Bad_Func_Def_Core(item, VAL_SPECIFIER(spec)));
            quoted = true;
        }

        const REBCEL* cell = VAL_UNESCAPED(item);

        REBSTR* spelling;
        Reb_Param_Class pclass = REB_P_DETECT;

        bool refinement = false;  // paths with blanks at head are refinements
        if (ANY_PATH_KIND(CELL_KIND(cell))) {
            if (
                KIND_BYTE(VAL_ARRAY_AT(cell)) != REB_BLANK
                or KIND_BYTE(VAL_ARRAY_AT(cell) + 1) != REB_WORD
                or KIND_BYTE(VAL_ARRAY_AT(cell) + 2) != REB_0_END
            ){
                fail (Error_Bad_Func_Def_Core(item, VAL_SPECIFIER(spec)));
            }

            refinement = true;
            refinement_seen = true;

            // !!! If you say [<with> x /foo y] the <with> terminates and a
            // refinement is started.  Same w/<local>.  Is this a good idea?
            // Note that historically, help hides any refinements that appear
            // behind a /local, but this feature has no parallel in Ren-C.
            //
            mode = SPEC_MODE_NORMAL;

            spelling = VAL_WORD_SPELLING(VAL_ARRAY_AT(cell) + 1);
            if (STR_SYMBOL(spelling) == SYM_LOCAL)  // /LOCAL
                if (ANY_WORD_KIND(KIND_BYTE(item + 1)))  // END is 0
                    fail (Error_Legacy_Local_Raw(spec));  // -> <local>

            if (CELL_KIND(cell) == REB_GET_PATH) {
                if (not quoted)
                    pclass = REB_P_HARD_QUOTE;
            }
            else if (CELL_KIND(cell) == REB_PATH) {
                if (quoted)
                    pclass = REB_P_SOFT_QUOTE;
                else
                    pclass = REB_P_NORMAL;
            }
        }
        else if (ANY_WORD_KIND(CELL_KIND(cell))) {
            spelling = VAL_WORD_SPELLING(cell);
            if (CELL_KIND(cell) == REB_SET_WORD) {
                if (not quoted)
                    pclass = REB_P_LOCAL;
            }
            else {
                if (refinement_seen and mode == SPEC_MODE_NORMAL)
                    fail (Error_Legacy_Refinement_Raw(spec));

                if (CELL_KIND(cell) == REB_GET_WORD) {
                    if (not quoted)
                        pclass = REB_P_HARD_QUOTE;
                }
                else if (CELL_KIND(cell) == REB_WORD) {
                    if (quoted)
                        pclass = REB_P_SOFT_QUOTE;
                    else
                        pclass = REB_P_NORMAL;
                }
                else if (CELL_KIND(cell) == REB_SYM_WORD) {
                    if (not quoted)
                        pclass = REB_P_MODAL;
                }
            }
        }
        else
            fail (Error_Bad_Func_Def_Core(item, VAL_SPECIFIER(spec)));

        if (pclass == REB_P_DETECT)  // didn't match
            fail (Error_Bad_Func_Def_Core(item, VAL_SPECIFIER(spec)));

        if (mode != SPEC_MODE_NORMAL) {
            if (pclass != REB_P_NORMAL and pclass != REB_P_LOCAL)
                fail (Error_Bad_Func_Def_Core(item, VAL_SPECIFIER(spec)));

            if (mode == SPEC_MODE_LOCAL)
                pclass = REB_P_LOCAL;
        }

        REBSTR* canon = STR_CANON(spelling);
        if (STR_SYMBOL(canon) == SYM_RETURN and pclass != REB_P_LOCAL) {
            //
            // Cancel definitional return if any non-SET-WORD! uses the name
            // RETURN when defining a FUNC.
            //
            *flags &= ~MKF_RETURN;
        }

        // Because FUNC does not do any locals gathering by default, the main
        // purpose of tolerating <with> is for instructing it not to do the
        // definitional returns.  However, it also makes changing between
        // FUNC and FUNCTION more fluid.
        //
        // !!! If you write something like `func [x <with> x] [...]` that
        // should be sanity checked with an error...TBD.
        //
        if (mode == SPEC_MODE_WITH)
            continue;

        // In rhythm of TYPESET! BLOCK! TEXT! we want to be on a string spot
        // at the time of the push of each new typeset.
        //
        if (IS_PARAM(DS_TOP))
            Move_Value(DS_PUSH(), EMPTY_BLOCK);
        if (IS_BLOCK(DS_TOP))
            Move_Value(DS_PUSH(), EMPTY_TEXT);
        assert(IS_TEXT(DS_TOP));

        // Non-annotated arguments disallow ACTION!, VOID! and NULL.  Not
        // having to worry about ACTION! and NULL means by default, code
        // does not have to worry about "disarming" arguments via GET-WORD!.
        // Also, keeping NULL a bit "prickly" helps discourage its use as
        // an input parameter...because it faces problems being used in
        // SPECIALIZE and other scenarios.
        //
        // Note there are currently two ways to get NULL: <opt> and <end>.
        // If the typeset bits contain REB_NULLED, that indicates <opt>.
        // But Is_Param_Endable() indicates <end>.

        if (refinement) {
            Init_Param(
                DS_PUSH(),
                pclass,
                spelling,  // don't canonize, see #2258
                FLAGIT_KIND(REB_TS_REFINEMENT)  // must preserve if type block
            );
        }
        else
            Init_Param(
                DS_PUSH(),
                pclass,
                spelling,  // don't canonize, see #2258
                (*flags & MKF_ANY_VALUE)
                  ? TS_OPT_VALUE
                  : TS_VALUE & ~(
                        FLAGIT_KIND(REB_ACTION)
                        | FLAGIT_KIND(REB_VOID)
                    )
            );

        // All these would cancel a definitional return (leave has same idea):
        //
        //     func [return [integer!]]
        //     func [/refinement return]
        //     func [<local> return]
        //     func [<with> return]
        //
        // ...although `return:` is explicitly tolerated ATM for compatibility
        // (despite violating the "pure locals are NULL" premise)
        //
        if (STR_SYMBOL(canon) == SYM_RETURN) {
            if (*definitional_return_dsp != 0) {
                DECLARE_LOCAL(word);
                Init_Word(word, canon);
                fail (Error_Dup_Vars_Raw(word));  // most dup checks are later
            }
            if (pclass == REB_P_LOCAL)
                *definitional_return_dsp = DSP;  // RETURN: explicit, tolerate
            else
                *flags &= ~MKF_RETURN;
        }
    }
}

//
//  Pop_Paramlist_And_Meta_May_Fail: C
//
// Assuming the stack is formed in a rhythm of the parameter, a type spec
// block, and a description...produce a paramlist in a state suitable to be
// passed to Make_Action().  It may not succeed because there could be
// duplicate parameters on the stack, and the checking via a binder is done
// as part of this popping process.
//
REBARR *Pop_Paramlist_With_Meta_May_Fail(
    REBDSP dsp_orig,
    REBFLGS flags,
    REBDSP definitional_return_dsp
){
    // Go ahead and flesh out the TYPESET! BLOCK! TEXT! triples.
    //
    if (IS_PARAM(DS_TOP))
        Move_Value(DS_PUSH(), EMPTY_BLOCK);
    if (IS_BLOCK(DS_TOP))
        Move_Value(DS_PUSH(), EMPTY_TEXT);
    assert((DSP - dsp_orig) % 3 == 0); // must be a multiple of 3

    // Definitional RETURN slots must have their argument value fulfilled with
    // an ACTION! specific to the action called on *every instantiation*.
    // They are marked with special parameter classes to avoid needing to
    // separately do canon comparison of their symbols to find them.
    //
    // Note: Since RETURN's typeset holds types that need to be checked at
    // the end of the function run, it is moved to a predictable location:
    // first slot of the paramlist.  Initially it was the last slot...but this
    // enables adding more arguments/refinements/locals in derived functions.

    if (flags & MKF_RETURN) {
        if (definitional_return_dsp == 0) { // no explicit RETURN: pure local
            //
            // While default arguments disallow ACTION!, VOID!, and NULL...
            // they are allowed to return anything.  Generally speaking, the
            // checks are on the input side, not the output.
            //
            Init_Param(
                DS_PUSH(),
                REB_P_RETURN,
                Canon(SYM_RETURN),
                TS_OPT_VALUE
            );
            definitional_return_dsp = DSP;

            Move_Value(DS_PUSH(), EMPTY_BLOCK);
            Move_Value(DS_PUSH(), EMPTY_TEXT);
        }
        else {
            REBVAL *param = DS_AT(definitional_return_dsp);

            // Note: AUGMENT may be copying an already REB_P_RETURN'd argument
            // from a pre-existing parameter list.  Else REB_P_LOCAL.
            //
            assert(
                VAL_PARAM_CLASS(param) == REB_P_LOCAL
                or VAL_PARAM_CLASS(param) == REB_P_RETURN
            );
            mutable_KIND_BYTE(param) = REB_P_RETURN;

            assert(MIRROR_BYTE(param) == REB_TYPESET);
        }

        // definitional_return handled specially when paramlist copied
        // off of the stack...moved to head position.

        flags |= MKF_HAS_RETURN;
    }

    // Slots, which is length +1 (includes the rootvar or rootparam)
    //
    REBLEN num_slots = (DSP - dsp_orig) / 3;

    // There should be no more pushes past this point, so a stable pointer
    // into the stack for the definitional return can be found.
    //
    REBVAL *definitional_return =
        definitional_return_dsp == 0
            ? nullptr
            : DS_AT(definitional_return_dsp);

    // Must make the function "paramlist" even if "empty", for identity.
    //
    // !!! In order to facilitate adding to the frame in the copy and
    // relativize step to add LET variables, don't pass SERIES_FLAG_FIXED_SIZE
    // in the creation step.  This formats cells in such a way that the
    // series mechanically cannot be expanded even if the flag is removed.
    // Instead, add it onto a series allocated as resizable.  This is likely
    // temporary--as LET mechanics should use some form of "virtual binding".
    //
    REBARR *paramlist = Make_Array_Core(
        num_slots,
        SERIES_MASK_PARAMLIST & ~(SERIES_FLAG_FIXED_SIZE)
    );
    SET_SERIES_FLAG(paramlist, FIXED_SIZE);

    // Note: not a valid ACTION! paramlist yet, don't use SET_ACTION_FLAG()
    //
    if (flags & MKF_IS_VOIDER)
        SER(paramlist)->info.bits |= ARRAY_INFO_MISC_VOIDER;  // !!! see note
    if (flags & MKF_HAS_RETURN)
        SER(paramlist)->header.bits |= PARAMLIST_FLAG_HAS_RETURN;

  blockscope {
    REBVAL *archetype = RESET_CELL(
        ARR_HEAD(paramlist),
        REB_ACTION,
        CELL_MASK_ACTION
    );
    Sync_Paramlist_Archetype(paramlist);
    INIT_BINDING(archetype, UNBOUND);

    REBVAL *dest = archetype + 1;

    // We want to check for duplicates and a Binder can be used for that
    // purpose--but note that a fail () cannot happen while binders are
    // in effect UNLESS the BUF_COLLECT contains information to undo it!
    // There's no BUF_COLLECT here, so don't fail while binder in effect.
    //
    // (This is why we wait until the parameter list gathering process
    // is over to do the duplicate checks--it can fail.)
    //
    struct Reb_Binder binder;
    INIT_BINDER(&binder);

    REBSTR *duplicate = nullptr;

    REBVAL *src = DS_AT(dsp_orig + 1) + 3;

    if (definitional_return) {
        assert(flags & MKF_RETURN);
        Move_Value(dest, definitional_return);
        ++dest;
    }

    // Weird due to Spectre/MSVC: https://stackoverflow.com/q/50399940
    //
    for (; src != DS_TOP + 1; src += 3) {
        if (not Try_Add_Binder_Index(&binder, VAL_PARAM_CANON(src), 1020))
            duplicate = VAL_PARAM_SPELLING(src);

        if (definitional_return and src == definitional_return)
            continue;

        Move_Value(dest, src);
        ++dest;
    }

    // Must remove binder indexes for all words, even if about to fail
    //
    src = DS_AT(dsp_orig + 1) + 3;

    // Weird due to Spectre/MSVC: https://stackoverflow.com/q/50399940
    //
    for (; src != DS_TOP + 1; src += 3, ++dest) {
        if (
            Remove_Binder_Index_Else_0(&binder, VAL_PARAM_CANON(src))
            == 0
        ){
            assert(duplicate);
        }
    }

    SHUTDOWN_BINDER(&binder);

    if (duplicate) {
        DECLARE_LOCAL (word);
        Init_Word(word, duplicate);
        fail (Error_Dup_Vars_Raw(word));
    }

    TERM_ARRAY_LEN(paramlist, num_slots);
    Manage_Array(paramlist);
  }

    //=///////////////////////////////////////////////////////////////////=//
    //
    // BUILD META INFORMATION OBJECT (IF NEEDED)
    //
    //=///////////////////////////////////////////////////////////////////=//

    // !!! See notes on ACTION-META in %sysobj.r

    REBCTX *meta = nullptr;

    if (flags & (MKF_HAS_DESCRIPTION | MKF_HAS_TYPES | MKF_HAS_NOTES))
        meta = Copy_Context_Shallow_Managed(VAL_CONTEXT(Root_Action_Meta));

    MISC_META_NODE(paramlist) = NOD(meta);

    // If a description string was gathered, it's sitting in the first string
    // slot, the third cell we pushed onto the stack.  Extract it if so.
    //
    if (flags & MKF_HAS_DESCRIPTION) {
        assert(IS_TEXT(DS_AT(dsp_orig + 3)));
        Move_Value(
            CTX_VAR(meta, STD_ACTION_META_DESCRIPTION),
            DS_AT(dsp_orig + 3)
        );
    }

    // Only make `parameter-types` if there were blocks in the spec
    //
    if (flags & MKF_HAS_TYPES) {
        REBARR *types_varlist = Make_Array_Core(
            num_slots,
            SERIES_MASK_VARLIST | NODE_FLAG_MANAGED
        );
        MISC_META_NODE(types_varlist) = nullptr;  // GC sees, must initialize
        INIT_CTX_KEYLIST_SHARED(CTX(types_varlist), paramlist);

        REBVAL *rootvar = RESET_CELL(
            ARR_HEAD(types_varlist),
            REB_FRAME,
            CELL_MASK_CONTEXT
        );
        INIT_VAL_CONTEXT_VARLIST(rootvar, types_varlist);  // "canon FRAME!"
        INIT_VAL_CONTEXT_PHASE(rootvar, ACT(paramlist));
        INIT_BINDING(rootvar, UNBOUND);

        REBVAL *dest = rootvar + 1;

        REBVAL *src = DS_AT(dsp_orig + 2);
        src += 3;

        if (definitional_return) {
            //
            // We put the return note in the top-level meta information, not
            // on the local itself (the "return-ness" is a distinct property
            // of the function from what word is used for RETURN:, and it
            // is possible to use the word RETURN for a local or refinement
            // argument while having nothing to do with the exit value of
            // the function.)
            //
            if (VAL_ARRAY_LEN_AT(definitional_return + 1) != 0) {
                Move_Value(
                    CTX_VAR(meta, STD_ACTION_META_RETURN_TYPE),
                    &definitional_return[1]
                );
            }

            Init_Nulled(dest); // clear the local RETURN: var's description
            ++dest;
        }

        for (; src <= DS_TOP; src += 3) {
            assert(IS_BLOCK(src));
            if (definitional_return and src == definitional_return + 1)
                continue;

            if (VAL_ARRAY_LEN_AT(src) == 0)
                Init_Nulled(dest);
            else
                Move_Value(dest, src);
            ++dest;
        }

        TERM_ARRAY_LEN(types_varlist, num_slots);

        Init_Any_Context(
            CTX_VAR(meta, STD_ACTION_META_PARAMETER_TYPES),
            REB_FRAME,
            CTX(types_varlist)
        );
    }

    // Only make `parameter-notes` if there were strings (besides description)
    //
    if (flags & MKF_HAS_NOTES) {
        REBARR *notes_varlist = Make_Array_Core(
            num_slots,
            SERIES_MASK_VARLIST | NODE_FLAG_MANAGED
        );
        MISC_META_NODE(notes_varlist) = nullptr;  // GC sees, must initialize
        INIT_CTX_KEYLIST_SHARED(CTX(notes_varlist), paramlist);

        REBVAL *rootvar = RESET_CELL(
            ARR_HEAD(notes_varlist),
            REB_FRAME,
            CELL_MASK_CONTEXT
        );
        INIT_VAL_CONTEXT_VARLIST(rootvar, notes_varlist); // canon FRAME!
        INIT_VAL_CONTEXT_PHASE(rootvar, ACT(paramlist));
        INIT_BINDING(rootvar, UNBOUND);

        REBVAL *dest = rootvar + 1;

        REBVAL *src = DS_AT(dsp_orig + 3);
        src += 3;

        if (definitional_return) {
            //
            // See remarks on the return type--the RETURN is documented in
            // the top-level META-OF, not the "incidentally" named RETURN
            // parameter in the list
            //
            if (SER_LEN(VAL_SERIES(definitional_return + 2)) == 0)
                Init_Nulled(CTX_VAR(meta, STD_ACTION_META_RETURN_NOTE));
            else {
                Move_Value(
                    CTX_VAR(meta, STD_ACTION_META_RETURN_NOTE),
                    &definitional_return[2]
                );
            }

            Init_Nulled(dest);
            ++dest;
        }

        for (; src <= DS_TOP; src += 3) {
            assert(IS_TEXT(src));
            if (definitional_return and src == definitional_return + 2)
                continue;

            if (SER_LEN(VAL_SERIES(src)) == 0)
                Init_Nulled(dest);
            else
                Move_Value(dest, src);
            ++dest;
        }

        TERM_ARRAY_LEN(notes_varlist, num_slots);

        Init_Frame(
            CTX_VAR(meta, STD_ACTION_META_PARAMETER_NOTES),
            CTX(notes_varlist)
        );
    }

    // With all the values extracted from stack to array, restore stack pointer
    //
    DS_DROP_TO(dsp_orig);

    return paramlist;
}

//
//  Make_Paramlist_Managed_May_Fail: C
//
// Check function spec of the form:
//
//     ["description" arg "notes" [type! type2! ...] /ref ...]
//
// !!! The spec language was not formalized in R3-Alpha.  Strings were left
// in and it was HELP's job (and any other clients) to make sense of it, e.g.:
//
//     [foo [type!] {doc string :-)}]
//     [foo {doc string :-/} [type!]]
//     [foo {doc string1 :-/} {doc string2 :-(} [type!]]
//
// Ren-C breaks this into two parts: one is the mechanical understanding of
// MAKE ACTION! for parameters in the evaluator.  Then it is the job
// of a generator to tag the resulting function with a "meta object" with any
// descriptions.  As a proxy for the work of a usermode generator, this
// routine tries to fill in FUNCTION-META (see %sysobj.r) as well as to
// produce a paramlist suitable for the function.
//
// Note a "true local" (indicated by a set-word) is considered to be tacit
// approval of wanting a definitional return by the generator.  This helps
// because Red's model for specifying returns uses a SET-WORD!
//
//     func [return: [integer!] {returns an integer}]
//
// In Ren-C's case it just means you want a local called return, but the
// generator will be "initializing it with a definitional return" for you.
// You don't have to use it if you don't want to...and may overwrite the
// variable.  But it won't be a void at the start.
//
// Note: While paramlists should ultimately carry SERIES_FLAG_FIXED_SIZE,
// the product of this routine might need to be added to.  And series that
// are created fixed size have special preparation such that they will trip
// more asserts.  So the fixed size flag is *not* added here, but ensured
// in the Make_Action() step.
//
REBARR *Make_Paramlist_Managed_May_Fail(
    const REBVAL *spec,
    REBFLGS flags
){
    REBDSP dsp_orig = DSP;
    assert(DS_TOP == DS_AT(dsp_orig));

    REBDSP definitional_return_dsp = 0;

    // As we go through the spec block, we push TYPESET! BLOCK! TEXT! triples.
    // These will be split out into separate arrays after the process is done.
    // The first slot of the paramlist needs to be the function canon value,
    // while the other two first slots need to be rootkeys.  Get the process
    // started right after a BLOCK! so it's willing to take a string for
    // the function description--it will be extracted from the slot before
    // it is turned into a rootkey for param_notes.
    //
    Init_Unreadable_Blank(DS_PUSH()); // paramlist[0] becomes ACT_ARCHETYPE()
    Move_Value(DS_PUSH(), EMPTY_BLOCK); // param_types[0] (object canon)
    Move_Value(DS_PUSH(), EMPTY_TEXT); // param_notes[0] (desc, then canon)

    // The process is broken up into phases so that the spec analysis code
    // can be reused in AUGMENT.
    //
    Push_Paramlist_Triads_May_Fail(
        spec,
        &flags,
        dsp_orig,
        &definitional_return_dsp
    );
    return Pop_Paramlist_With_Meta_May_Fail(
        dsp_orig,
        flags,
        definitional_return_dsp
    );
}

//
//  Find_Param_Index: C
//
// Find function param word in function "frame".
//
// !!! This is semi-redundant with similar functions for Find_Word_In_Array
// and key finding for objects, review...
//
REBLEN Find_Param_Index(REBARR *paramlist, REBSTR *spelling)
{
    REBSTR *canon = STR_CANON(spelling); // don't recalculate each time

    RELVAL *param = ARR_AT(paramlist, 1);
    REBLEN len = ARR_LEN(paramlist);

    REBLEN n;
    for (n = 1; n < len; ++n, ++param) {
        if (
            spelling == VAL_PARAM_SPELLING(param)
            or canon == VAL_PARAM_CANON(param)
        ){
            return n;
        }
    }

    return 0;
}

//
//  Make_Action: C
//
// Create an archetypal form of a function, given C code implementing a
// dispatcher that will be called by Eval_Core.  Dispatchers are of the form:
//
//     const REBVAL *Dispatcher(REBFRM *f) {...}
//
// The REBACT returned is "archetypal" because individual REBVALs which hold
// the same REBACT may differ in a per-REBVAL "binding".  (This is how one
// RETURN is distinguished from another--the binding data stored in the REBVAL
// identifies the pointer of the FRAME! to exit).
//
// Actions have an associated REBARR of data, accessible via ACT_DETAILS().
// This is where they can store information that will be available when the
// dispatcher is called.
//
REBACT *Make_Action(
    REBARR *paramlist,
    REBNAT dispatcher, // native C function called by Eval_Core
    REBACT *opt_underlying, // optional underlying function
    REBCTX *opt_exemplar, // if provided, should be consistent w/next level
    REBLEN details_capacity // desired capacity of the ACT_DETAILS() array
){
    ASSERT_ARRAY_MANAGED(paramlist);

    RELVAL *rootparam = ARR_HEAD(paramlist);
    assert(KIND_BYTE(rootparam) == REB_ACTION); // !!! not fully formed...
    assert(VAL_ACT_PARAMLIST(rootparam) == paramlist);
    assert(EXTRA(Binding, rootparam).node == UNBOUND); // archetype

    // "details" for an action is an array of cells which can be anything
    // the dispatcher understands it to be, by contract.  Terminate it
    // at the given length implicitly.

    REBARR *details = Make_Array_Core(
        details_capacity,
        SERIES_MASK_DETAILS | NODE_FLAG_MANAGED
    );
    TERM_ARRAY_LEN(details, details_capacity);

    VAL_ACT_DETAILS_NODE(rootparam) = NOD(details);

    MISC(details).dispatcher = dispatcher; // level of indirection, hijackable

    assert(IS_POINTER_SAFETRASH_DEBUG(LINK(paramlist).trash));

    if (opt_underlying) {
        LINK_UNDERLYING_NODE(paramlist) = NOD(opt_underlying);

        // Note: paramlist still incomplete, don't use SET_ACTION_FLAG....
        //
        if (GET_ACTION_FLAG(opt_underlying, HAS_RETURN))
            SER(paramlist)->header.bits |= PARAMLIST_FLAG_HAS_RETURN;
    }
    else {
        // To avoid NULL checking when a function is called and looking for
        // underlying, just use the action's own paramlist if needed.
        //
        LINK_UNDERLYING_NODE(paramlist) = NOD(paramlist);
    }

    if (not opt_exemplar) {
        //
        // No exemplar is used as a cue to set the "specialty" to paramlist,
        // so that Push_Action() can assign f->special directly from it in
        // dispatch, and be equal to f->param.
        //
        LINK_SPECIALTY_NODE(details) = NOD(paramlist);
    }
    else {
        // The parameters of the paramlist should line up with the slots of
        // the exemplar (though some of these parameters may be hidden due to
        // specialization, see REB_TS_HIDDEN).
        //
        assert(GET_SERIES_FLAG(opt_exemplar, MANAGED));
        assert(CTX_LEN(opt_exemplar) == ARR_LEN(paramlist) - 1);

        LINK_SPECIALTY_NODE(details) = NOD(CTX_VARLIST(opt_exemplar));
    }

    // The meta information may already be initialized, since the native
    // version of paramlist construction sets up the FUNCTION-META information
    // used by HELP.  If so, it must be a valid REBCTX*.  Otherwise NULL.
    //
    assert(
        not MISC_META(paramlist)
        or GET_ARRAY_FLAG(CTX_VARLIST(MISC_META(paramlist)), IS_VARLIST)
    );

    assert(NOT_ARRAY_FLAG(paramlist, HAS_FILE_LINE_UNMASKED));
    assert(NOT_ARRAY_FLAG(details, HAS_FILE_LINE_UNMASKED));

    REBACT *act = ACT(paramlist); // now it's a legitimate REBACT

    // Precalculate cached function flags.  This involves finding the first
    // unspecialized argument which would be taken at a callsite, which can
    // be tricky to figure out with partial refinement specialization.  So
    // the work of doing that is factored into a routine (`PARAMETERS OF`
    // uses it as well).

    if (GET_ACTION_FLAG(act, HAS_RETURN)) {
        REBVAL *param = ACT_PARAMS_HEAD(act);
        assert(VAL_PARAM_SYM(param) == SYM_RETURN);

        if (Is_Typeset_Invisible(param))  // e.g. `return []`
            SET_ACTION_FLAG(act, IS_INVISIBLE);

        if (TYPE_CHECK(param, REB_TS_DEQUOTE_REQUOTE))
            SET_ACTION_FLAG(act, RETURN_REQUOTES);
    }

    REBVAL *first_unspecialized = First_Unspecialized_Param(act);
    if (first_unspecialized) {
        switch (VAL_PARAM_CLASS(first_unspecialized)) {
          case REB_P_NORMAL:
            break;

          case REB_P_HARD_QUOTE:
          case REB_P_MODAL:
          case REB_P_SOFT_QUOTE:
            SET_ACTION_FLAG(act, QUOTES_FIRST);
            break;

          default:
            assert(false);
        }

        if (TYPE_CHECK(first_unspecialized, REB_TS_SKIPPABLE))
            SET_ACTION_FLAG(act, SKIPPABLE_FIRST);
    }

    return act;
}

//
//  Make_Expired_Frame_Ctx_Managed: C
//
// FUNC/PROC bodies contain relative words and relative arrays.  Arrays from
// this relativized body may only be put into a specified REBVAL once they
// have been combined with a frame.
//
// Reflection asks for action body data, when no instance is called.  Hence
// a REBVAL must be produced somehow.  If the body is being copied, then the
// option exists to convert all the references to unbound...but this isn't
// representative of the actual connections in the body.
//
// There could be an additional "archetype" state for the relative binding
// machinery.  But making a one-off expired frame is an inexpensive option.
//
REBCTX *Make_Expired_Frame_Ctx_Managed(REBACT *a)
{
    // Since passing SERIES_MASK_VARLIST includes SERIES_FLAG_ALWAYS_DYNAMIC,
    // don't pass it in to the allocation...it needs to be set, but will be
    // overridden by SERIES_INFO_INACCESSIBLE.
    //
    REBARR *varlist = Alloc_Singular(NODE_FLAG_STACK | NODE_FLAG_MANAGED);
    SER(varlist)->header.bits |= SERIES_MASK_VARLIST;
    SET_SERIES_INFO(varlist, INACCESSIBLE);
    MISC_META_NODE(varlist) = nullptr;

    RELVAL *rootvar = RESET_CELL(
        ARR_SINGLE(varlist),
        REB_FRAME,
        CELL_MASK_CONTEXT
    );
    INIT_VAL_CONTEXT_VARLIST(rootvar, varlist);
    INIT_VAL_CONTEXT_PHASE(rootvar, a);
    INIT_BINDING(rootvar, UNBOUND); // !!! is a binding relevant?

    REBCTX *expired = CTX(varlist);
    INIT_CTX_KEYLIST_SHARED(expired, ACT_PARAMLIST(a));

    return expired;
}

//
//  Get_Maybe_Fake_Action_Body: C
//
// !!! While the interface as far as the evaluator is concerned is satisfied
// with the OneAction ACTION!, the various dispatchers have different ideas
// of what "source" would be like.  There should be some mapping from the
// dispatchers to code to get the BODY OF an ACTION.  For the moment, just
// handle common kinds so the SOURCE command works adquately, revisit later.
//
void Get_Maybe_Fake_Action_Body(REBVAL *out, const REBVAL *action)
{
    REBSPC *binding = VAL_BINDING(action);
    REBACT *a = VAL_ACTION(action);

    // A Hijacker *might* not need to splice itself in with a dispatcher.
    // But if it does, bypass it to get to the "real" action implementation.
    //
    // !!! Should the source inject messages like {This is a hijacking} at
    // the top of the returned body?
    //
    while (ACT_DISPATCHER(a) == &Hijacker_Dispatcher) {
        a = VAL_ACTION(ARR_HEAD(ACT_DETAILS(a)));
        // !!! Review what should happen to binding
    }

    REBARR *details = ACT_DETAILS(a);

    // !!! Should the binding make a difference in the returned body?  It is
    // exposed programmatically via CONTEXT OF.
    //
    UNUSED(binding);

    if (
        ACT_DISPATCHER(a) == &Null_Dispatcher
        or ACT_DISPATCHER(a) == &Void_Dispatcher
        or ACT_DISPATCHER(a) == &Unchecked_Dispatcher
        or ACT_DISPATCHER(a) == &Voider_Dispatcher
        or ACT_DISPATCHER(a) == &Returner_Dispatcher
        or ACT_DISPATCHER(a) == &Block_Dispatcher
    ){
        // Interpreted code, the body is a block with some bindings relative
        // to the action.

        RELVAL *body = ARR_HEAD(details);

        // The PARAMLIST_HAS_RETURN tricks for definitional return make it
        // seem like a generator authored more code in the action's body...but
        // the code isn't *actually* there and an optimized internal trick is
        // used.  Fake the code if needed.

        REBVAL *example;
        REBLEN real_body_index;
        if (ACT_DISPATCHER(a) == &Voider_Dispatcher) {
            example = Get_System(SYS_STANDARD, STD_PROC_BODY);
            real_body_index = 4;
        }
        else if (GET_ACTION_FLAG(a, HAS_RETURN)) {
            example = Get_System(SYS_STANDARD, STD_FUNC_BODY);
            real_body_index = 4;
        }
        else {
            example = NULL;
            real_body_index = 0; // avoid compiler warning
            UNUSED(real_body_index);
        }

        REBARR *real_body = VAL_ARRAY(body);

        REBARR *maybe_fake_body;
        if (example == NULL) {
            maybe_fake_body = real_body;
        }
        else {
            // See %sysobj.r for STANDARD/FUNC-BODY and STANDARD/PROC-BODY
            //
            maybe_fake_body = Copy_Array_Shallow_Flags(
                VAL_ARRAY(example),
                VAL_SPECIFIER(example),
                NODE_FLAG_MANAGED
            );

            // Index 5 (or 4 in zero-based C) should be #BODY, a "real" body.
            // To give it the appearance of executing code in place, we use
            // a GROUP!.

            RELVAL *slot = ARR_AT(maybe_fake_body, real_body_index); // #BODY
            assert(IS_ISSUE(slot));

            // Note: clears VAL_FLAG_LINE
            //
            RESET_VAL_HEADER(slot, REB_GROUP, CELL_FLAG_FIRST_IS_NODE);
            INIT_VAL_NODE(slot, VAL_ARRAY(body));
            VAL_INDEX(slot) = 0;
            INIT_BINDING(slot, a);  // relative binding
        }

        // Cannot give user a relative value back, so make the relative
        // body specific to a fabricated expired frame.  See #2221

        RESET_VAL_HEADER(out, REB_BLOCK, CELL_FLAG_FIRST_IS_NODE);
        INIT_VAL_NODE(out, maybe_fake_body);
        VAL_INDEX(out) = 0;
        INIT_BINDING(out, Make_Expired_Frame_Ctx_Managed(a));
        return;
    }

    if (ACT_DISPATCHER(a) == &Specializer_Dispatcher) {
        //
        // The FRAME! stored in the body for the specialization has a phase
        // which is actually the function to be run.
        //
        REBVAL *frame = KNOWN(ARR_HEAD(details));
        assert(IS_FRAME(frame));
        Move_Value(out, frame);
        return;
    }

    if (ACT_DISPATCHER(a) == &Generic_Dispatcher) {
        REBVAL *verb = KNOWN(ARR_HEAD(details));
        assert(IS_WORD(verb));
        Move_Value(out, verb);
        return;
    }

    Init_Blank(out); // natives, ffi routines, etc.
    return;
}

//
//  Make_Interpreted_Action_May_Fail: C
//
// This is the support routine behind both `MAKE ACTION!` and FUNC.
//
// Ren-C's schematic is *very* different from R3-Alpha, whose definition of
// FUNC was simply:
//
//     make function! copy/deep reduce [spec body]
//
// Ren-C's `make action!` doesn't need to copy the spec (it does not save
// it--parameter descriptions are in a meta object).  The body is copied
// implicitly (as it must be in order to relativize it).
//
// There is also a "definitional return" MKF_RETURN option used by FUNC, so
// the body will introduce a RETURN specific to each action invocation, thus
// acting more like:
//
//     return: make action! [
//         [{Returns a value from a function.} value [<opt> any-value!]]
//         [unwind/with (binding of 'return) :value]
//     ]
//     (body goes here)
//
// This pattern addresses "Definitional Return" in a way that does not need to
// build in RETURN as a language keyword in any specific form (in the sense
// that MAKE ACTION! does not itself require it).
//
// FUNC optimizes by not internally building or executing the equivalent body,
// but giving it back from BODY-OF.  This gives FUNC the edge to pretend to
// add containing code and simulate its effects, while really only holding
// onto the body the caller provided.
//
// While plain MAKE ACTION! has no RETURN, UNWIND can be used to exit frames
// but must be explicit about what frame is being exited.  This can be used
// by usermode generators that want to create something return-like.
//
REBACT *Make_Interpreted_Action_May_Fail(
    const REBVAL *spec,
    const REBVAL *body,
    REBFLGS mkf_flags  // MKF_RETURN, etc.
) {
    assert(IS_BLOCK(spec) and IS_BLOCK(body));

    REBACT *a = Make_Action(
        Make_Paramlist_Managed_May_Fail(spec, mkf_flags),
        &Null_Dispatcher,  // will be overwritten if non-[] body
        nullptr,  // no underlying action (use paramlist)
        nullptr,  // no specialization exemplar (or inherited exemplar)
        1  // details array capacity
    );

    // We look at the *actual* function flags; e.g. the person may have used
    // the FUNC generator (with MKF_RETURN) but then named a parameter RETURN
    // which overrides it, so the value won't have PARAMLIST_HAS_RETURN.

    REBARR *copy;
    if (VAL_ARRAY_LEN_AT(body) == 0) {  // optimize empty body case

        if (GET_ACTION_FLAG(a, IS_INVISIBLE)) {
            ACT_DISPATCHER(a) = &Commenter_Dispatcher;
        }
        else if (SER(a)->info.bits & ARRAY_INFO_MISC_VOIDER) {
            ACT_DISPATCHER(a) = &Voider_Dispatcher;  // !!! ^-- see info note
        }
        else if (GET_ACTION_FLAG(a, HAS_RETURN)) {
            REBVAL *typeset = ACT_PARAMS_HEAD(a);
            assert(VAL_PARAM_SYM(typeset) == SYM_RETURN);
            if (not TYPE_CHECK(typeset, REB_NULLED))  // `do []` returns
                ACT_DISPATCHER(a) = &Returner_Dispatcher;  // error when run
        }
        else {
            // Keep the Null_Dispatcher passed in above
        }

        // Reusing EMPTY_ARRAY won't allow adding ARRAY_HAS_FILE_LINE bits
        //
        copy = Make_Array_Core(1, NODE_FLAG_MANAGED);
    }
    else {  // body not empty, pick dispatcher based on output disposition

        if (GET_ACTION_FLAG(a, IS_INVISIBLE))
            ACT_DISPATCHER(a) = &Elider_Dispatcher; // no f->out mutation
        else if (SER(a)->info.bits & ARRAY_INFO_MISC_VOIDER) // !!! see note
            ACT_DISPATCHER(a) = &Voider_Dispatcher; // forces f->out void
        else if (GET_ACTION_FLAG(a, HAS_RETURN))
            ACT_DISPATCHER(a) = &Returner_Dispatcher; // type checks f->out
        else
            ACT_DISPATCHER(a) = &Unchecked_Dispatcher; // unchecked f->out

        copy = Copy_And_Bind_Relative_Deep_Managed(
            body,  // new copy has locals bound relatively to the new action
            ACT_PARAMLIST(a),
            TS_WORD,
            true  // gather the LETs (transitional method)
        );
    }

    // Favor the spec first, then the body, for file and line information.
    //
    if (GET_ARRAY_FLAG(VAL_ARRAY(spec), HAS_FILE_LINE_UNMASKED)) {
        LINK_FILE_NODE(copy) = LINK_FILE_NODE(VAL_ARRAY(spec));
        MISC(copy).line = MISC(VAL_ARRAY(spec)).line;
        SET_ARRAY_FLAG(copy, HAS_FILE_LINE_UNMASKED);
    }
    else if (GET_ARRAY_FLAG(VAL_ARRAY(body), HAS_FILE_LINE_UNMASKED)) {
        LINK_FILE_NODE(copy) = LINK_FILE_NODE(VAL_ARRAY(body));
        MISC(copy).line = MISC(VAL_ARRAY(body)).line;
        SET_ARRAY_FLAG(copy, HAS_FILE_LINE_UNMASKED);
    }
    else {
        // Ideally all source series should have a file and line numbering
        // At the moment, if a function is created in the body of another
        // function it doesn't work...trying to fix that.
    }

    // Save the relativized body in the action's details block.  Since it is
    // a RELVAL* and not a REBVAL*, the dispatcher must combine it with a
    // running frame instance (the REBFRM* received by the dispatcher) before
    // executing the interpreted code.
    //
    REBARR *details = ACT_DETAILS(a);
    RELVAL *rebound = Init_Relative_Block(
        ARR_AT(details, IDX_NATIVE_BODY),
        a,
        copy
    );

    // Capture the mutability flag that was in effect when this action was
    // created.  This allows the following to work:
    //
    //    >> do mutable [f: function [] [b: [1 2 3] clear b]]
    //    >> f
    //    == []
    //
    // So even though the invocation is outside the mutable section, we have
    // a memory that it was created under those rules.  (It's better to do
    // this based on the frame in effect than by looking at the CONST flag of
    // the incoming body block, because otherwise ordinary Ren-C functions
    // whose bodies were created from dynamic code would have mutable bodies
    // by default--which is not a desirable consequence from merely building
    // the body dynamically.)
    //
    // Note: besides the general concerns about mutability-by-default, when
    // functions are allowed to modify their bodies with words relative to
    // their frame, the words would refer to that specific recursion...and not
    // get picked up by other recursions that see the common structure.  This
    // means compatibility would be with the behavior of R3-Alpha CLOSURE,
    // not with R3-Alpha FUNCTION.
    //
    if (GET_CELL_FLAG(body, CONST))
        SET_CELL_FLAG(rebound, CONST);  // Inherit_Const() would need REBVAL*

    return a;
}

//
//  REBTYPE: C
//
// This handler is used to fail for a type which cannot handle actions.
//
// !!! Currently all types have a REBTYPE() handler for either themselves or
// their class.  But having a handler that could be "swapped in" from a
// default failing case is an idea that could be used as an interim step
// to allow something like REB_GOB to fail by default, but have the failing
// type handler swapped out by an extension.
//
REBTYPE(Fail)
{
    UNUSED(frame_);
    UNUSED(verb);

    fail ("Datatype does not have a dispatcher registered.");
}

//
//  Generic_Dispatcher: C
//
// A "generic" is what R3-Alpha/Rebol2 had called "ACTION!" (until Ren-C took
// that as the umbrella term for all "invokables").  This kind of dispatch is
// based on the first argument's type, with the idea being a single C function
// for the type has a switch() statement in it and can handle many different
// such actions for that type.
//
// (e.g. APPEND copy [a b c] [d] would look at the type of the first argument,
// notice it was a BLOCK!, and call the common C function for arrays with an
// append instruction--where that instruction also handles insert, length,
// etc. for BLOCK!s.)
//
// !!! This mechanism is a very primitive kind of "multiple dispatch".  Rebol
// will certainly need to borrow from other languages to develop a more
// flexible idea for user-defined types, vs. this very limited concept.
//
// https://en.wikipedia.org/wiki/Multiple_dispatch
// https://en.wikipedia.org/wiki/Generic_function
// https://stackoverflow.com/q/53574843/
//
REB_R Generic_Dispatcher(REBFRM *f)
{
    REBACT *phase = FRM_PHASE(f);
    REBARR *details = ACT_DETAILS(phase);
    REBVAL *verb = KNOWN(ARR_HEAD(details));
    assert(IS_WORD(verb));

    // !!! It's technically possible to throw in locals or refinements at
    // any point in the sequence.  So this should really be using something
    // like a First_Unspecialized_Arg() call.  For now, we just handle the
    // case of a RETURN: sitting in the first parameter slot.
    //
    REBVAL *first_arg = GET_ACTION_FLAG(phase, HAS_RETURN)
        ? FRM_ARG(f, 2)
        : FRM_ARG(f, 1);

    return Run_Generic_Dispatch(first_arg, f, verb);
}

//
//  Dummy_Dispatcher: C
//
// Used for frame levels that want a varlist solely for the purposes of tying
// API handle lifetimes to.  These levels should be ignored by stack walks
// that the user sees, and this associated dispatcher should never run.
//
REB_R Dummy_Dispatcher(REBFRM *f)
{
    UNUSED(f);
    panic ("Dummy_Dispatcher() ran, but it never should get called");
}

//
//  Void_Dispatcher: C
//
// If you write `func [return: <void> ...] []` it uses this dispatcher instead
// of running Eval_Core() on an empty block.  This serves more of a point than
// it sounds, because you can make fast stub actions that only cost if they
// are HIJACK'd (e.g. ASSERT is done this way).
//
REB_R Void_Dispatcher(REBFRM *f)
{
    REBARR *details = ACT_DETAILS(FRM_PHASE(f));
    assert(VAL_LEN_AT(ARR_HEAD(details)) == 0);
    UNUSED(details);

    return Init_Void(f->out);
}

//
//  Null_Dispatcher: C
//
// Analogue to Void_Dispatcher() for `func [return: [<opt>] ...] [null]`
// situations.
//
REB_R Null_Dispatcher(REBFRM *f)
{
    REBARR *details = ACT_DETAILS(FRM_PHASE(f));
    assert(VAL_LEN_AT(ARR_HEAD(details)) == 0);
    UNUSED(details);

    return nullptr;
}

//
//  Datatype_Checker_Dispatcher: C
//
// Dispatcher used by TYPECHECKER generator for when argument is a datatype.
//
REB_R Datatype_Checker_Dispatcher(REBFRM *f)
{
    REBARR *details = ACT_DETAILS(FRM_PHASE(f));
    RELVAL *datatype = ARR_HEAD(details);

    if (VAL_TYPE_KIND_OR_CUSTOM(datatype) == REB_CUSTOM) {
        if (VAL_TYPE(FRM_ARG(f, 1)) != REB_CUSTOM)
            return Init_False(f->out);

        REBTYP *typ = VAL_TYPE_CUSTOM(datatype);
        return Init_Logic(
            f->out,
            CELL_CUSTOM_TYPE(FRM_ARG(f, 1)) == typ
        );
    }

    return Init_Logic(  // otherwise won't be equal to any custom type
        f->out,
        VAL_TYPE(FRM_ARG(f, 1)) == VAL_TYPE_KIND_OR_CUSTOM(datatype)
    );
}

//
//  Typeset_Checker_Dispatcher: C
//
// Dispatcher used by TYPECHECKER generator for when argument is a typeset.
//
REB_R Typeset_Checker_Dispatcher(REBFRM *f)
{
    REBARR *details = ACT_DETAILS(FRM_PHASE(f));
    RELVAL *typeset = ARR_HEAD(details);
    assert(IS_TYPESET(typeset));

    return Init_Logic(f->out, TYPE_CHECK(typeset, VAL_TYPE(FRM_ARG(f, 1))));
}

// Common behavior shared by dispatchers which execute on BLOCK!s of code.
//
inline static bool Interpreted_Dispatch_Throws(
    REBVAL *out,  // Note: Elider_Dispatcher() doesn't have `out = f->out`
    REBFRM *f
){
    REBARR *details = ACT_DETAILS(FRM_PHASE(f));
    RELVAL *body = ARR_HEAD(details);  // usually CONST (doesn't have to be)
    assert(IS_BLOCK(body) and IS_RELATIVE(body) and VAL_INDEX(body) == 0);

    // The function body contains relativized words, that point to the
    // paramlist but do not have an instance of an action to line them up
    // with.  We use the frame (identified by varlist) as the "specifier".
    //
    return Do_Any_Array_At_Throws(out, body, SPC(f->varlist));
}

//
//  Unchecked_Dispatcher: C
//
// Runs block, then no typechecking (e.g. had no RETURN: [...] type spec)
//
REB_R Unchecked_Dispatcher(REBFRM *f)
{
    if (Interpreted_Dispatch_Throws(f->out, f))
        return R_THROWN;
    return f->out;
}

//
//  Voider_Dispatcher: C
//
// Runs block, then overwrites result w/void (e.g. RETURN: <void>)
//
REB_R Voider_Dispatcher(REBFRM *f)
{
    if (Interpreted_Dispatch_Throws(f->out, f))  // action body is a BLOCK!
        return R_THROWN;
    return Init_Void(f->out);
}

//
//  Returner_Dispatcher: C
//
// Runs block, ensure type matches RETURN: [...] specification, else fail.
//
// Note: Natives get this check only in the debug build, but not here (their
// dispatcher *is* the native!)  So the extra check is in Eval_Core().
//
REB_R Returner_Dispatcher(REBFRM *f)
{
    if (Interpreted_Dispatch_Throws(f->out, f))
        return R_THROWN;

    FAIL_IF_BAD_RETURN_TYPE(f);
    return f->out;
}

//
//  Elider_Dispatcher: C
//
// Used by "invisible" functions (who in their spec say `RETURN: []`).  Runs
// block but without changing any value already in f->out.
//
REB_R Elider_Dispatcher(REBFRM *f)
{
    REBVAL * const discarded = FRM_SPARE(f);  // spare usable during dispatch

    if (Interpreted_Dispatch_Throws(discarded, f)) {
        //
        // !!! In the implementation of invisibles, it seems reasonable to
        // want to be able to RETURN to its own frame.  But in that case, we
        // don't want to actually overwrite the f->out content or this would
        // be no longer invisible.  Until a better idea comes along, repeat
        // the work of catching here.  (Note this does not handle REDO too,
        // and the hypothetical better idea should do so.)
        //
        const REBVAL *label = VAL_THROWN_LABEL(discarded);
        if (IS_ACTION(label)) {
            if (
                VAL_ACTION(label) == NAT_ACTION(unwind)
                and VAL_BINDING(label) == NOD(f->varlist)
            ){
                CATCH_THROWN(discarded, discarded);
                if (IS_NULLED(discarded)) // !!! catch loses "endish" flag
                    return R_INVISIBLE;

                fail ("Only 0-arity RETURN should be used in invisibles.");
            }
        }

        Move_Value(f->out, discarded);
        return R_THROWN;
    }

    return R_INVISIBLE;
}

//
//  Commenter_Dispatcher: C
//
// This is a specialized version of Elider_Dispatcher() for when the body of
// a function is empty.  This helps COMMENT and functions like it run faster.
//
REB_R Commenter_Dispatcher(REBFRM *f)
{
    REBARR *details = ACT_DETAILS(FRM_PHASE(f));
    RELVAL *body = ARR_HEAD(details);
    assert(VAL_LEN_AT(body) == 0);
    UNUSED(body);
    return R_INVISIBLE;
}

//
//  Hijacker_Dispatcher: C
//
// A hijacker takes over another function's identity, replacing it with its
// own implementation, injecting directly into the paramlist and body_holder
// nodes held onto by all the victim's references.
//
// Sometimes the hijacking function has the same underlying function
// as the victim, in which case there's no need to insert a new dispatcher.
// The hijacker just takes over the identity.  But otherwise it cannot,
// and a "shim" is needed...since something like an ADAPT or SPECIALIZE
// or a MAKE FRAME! might depend on the existing paramlist shape.
//
REB_R Hijacker_Dispatcher(REBFRM *f)
{
    REBACT *phase = FRM_PHASE(f);
    REBARR *details = ACT_DETAILS(phase);
    RELVAL *hijacker = ARR_HEAD(details);

    // We need to build a new frame compatible with the hijacker, and
    // transform the parameters we've gathered to be compatible with it.
    //
    if (Redo_Action_Throws(f->out, f, VAL_ACTION(hijacker)))
        return R_THROWN;

    if (GET_ACTION_FLAG(phase, IS_INVISIBLE))
        return R_INVISIBLE;

    return f->out;
}

//
//  Adapter_Dispatcher: C
//
// Dispatcher used by ADAPT.
//
REB_R Adapter_Dispatcher(REBFRM *f)
{
    REBARR *details = ACT_DETAILS(FRM_PHASE(f));
    assert(ARR_LEN(details) == 2);

    RELVAL* prelude = ARR_AT(details, 0);
    REBVAL* adaptee = KNOWN(ARR_AT(details, 1));

    // The first thing to do is run the prelude code, which may throw.  If it
    // does throw--including a RETURN--that means the adapted function will
    // not be run.

    REBVAL * const discarded = FRM_SPARE(f);

    if (Do_Any_Array_At_Throws(discarded, prelude, SPC(f->varlist))) {
        Move_Value(f->out, discarded);
        return R_THROWN;
    }

    INIT_FRM_PHASE(f, VAL_ACTION(adaptee));
    FRM_BINDING(f) = VAL_BINDING(adaptee);

    return R_REDO_CHECKED;  // the redo will use the updated phase & binding
}

//
//  Encloser_Dispatcher: C
//
// Dispatcher used by ENCLOSE.
//
REB_R Encloser_Dispatcher(REBFRM *f)
{
    REBARR *details = ACT_DETAILS(FRM_PHASE(f));
    assert(ARR_LEN(details) == 2);

    REBVAL *inner = KNOWN(ARR_AT(details, 0));  // same args as f
    assert(IS_ACTION(inner));
    REBVAL *outer = KNOWN(ARR_AT(details, 1));  // takes 1 arg (a FRAME!)
    assert(IS_ACTION(outer));

    assert(GET_SERIES_FLAG(f->varlist, STACK_LIFETIME));

    // We want to call OUTER with a FRAME! value that will dispatch to INNER
    // when (and if) it runs DO on it.  That frame is the one built for this
    // call to the encloser.  If it isn't managed, there's no worries about
    // user handles on it...so just take it.  Otherwise, "steal" its vars.
    //
    REBCTX *c = Steal_Context_Vars(CTX(f->varlist), NOD(FRM_PHASE(f)));
    INIT_LINK_KEYSOURCE(c, NOD(VAL_ACTION(inner)));
    CLEAR_SERIES_FLAG(c, STACK_LIFETIME);

    assert(GET_SERIES_INFO(f->varlist, INACCESSIBLE));  // look dead

    // f->varlist may or may not have wound up being managed.  It was not
    // allocated through the usual mechanisms, so if unmanaged it's not in
    // the tracking list Init_Any_Context() expects.  Just fiddle the bit.
    //
    SET_SERIES_FLAG(c, MANAGED);

    // When the DO of the FRAME! executes, we don't want it to run the
    // encloser again (infinite loop).
    //
    REBVAL *rootvar = CTX_ARCHETYPE(c);
    INIT_VAL_CONTEXT_PHASE(rootvar, VAL_ACTION(inner));
    INIT_BINDING_MAY_MANAGE(rootvar, VAL_BINDING(inner));

    // We don't actually know how long the frame we give back is going to
    // live, or who it might be given to.  And it may contain things like
    // bindings in a RETURN or a VARARGS! which are to the old varlist, which
    // may not be managed...and so when it goes off the stack it might try
    // and think that since nothing managed it then it can be freed.  Go
    // ahead and mark it managed--even though it's dead--so that returning
    // won't free it if there are outstanding references.
    //
    // Note that since varlists aren't added to the manual series list, the
    // bit must be tweaked vs. using Ensure_Array_Managed.
    //
    SET_SERIES_FLAG(f->varlist, MANAGED);

    const bool fully = true;
    if (RunQ_Throws(f->out, fully, rebU1(outer), rootvar, rebEND))
        return R_THROWN;

    return f->out;
}

//
//  Chainer_Dispatcher: C
//
// Dispatcher used by CHAIN.
//
REB_R Chainer_Dispatcher(REBFRM *f)
{
    REBARR *details = ACT_DETAILS(FRM_PHASE(f));
    REBARR *pipeline = VAL_ARRAY(ARR_HEAD(details));

    // The post-processing pipeline has to be "pushed" so it is not forgotten.
    // Go in reverse order, so the function to apply last is at the bottom of
    // the stack.
    //
    REBVAL *chained = KNOWN(ARR_LAST(pipeline));
    for (; chained != ARR_HEAD(pipeline); --chained) {
        assert(IS_ACTION(chained));
        Move_Value(DS_PUSH(), KNOWN(chained));
    }

    // Extract the first function, itself which might be a chain.
    //
    INIT_FRM_PHASE(f, VAL_ACTION(chained));
    FRM_BINDING(f) = VAL_BINDING(chained);

    return R_REDO_UNCHECKED;  // signatures should match
}

//
//  Get_If_Word_Or_Path_Throws: C
//
// Some routines like APPLY and SPECIALIZE are willing to take a WORD! or
// PATH! instead of just the value type they are looking for, and perform
// the GET for you.  By doing the GET inside the function, they are able
// to preserve the symbol:
//
//     >> applique 'append [value: 'c]
//     ** Script error: append is missing its series argument
//
// If push_refinements is used, then it avoids intermediate specializations...
// e.g. `specialize 'append/dup [part: true]` can be done with one FRAME!.
//
bool Get_If_Word_Or_Path_Throws(
    REBVAL *out,
    REBSTR **opt_name_out,
    const RELVAL *v,
    REBSPC *specifier,
    bool push_refinements
) {
    if (IS_WORD(v) or IS_GET_WORD(v) or IS_SYM_WORD(v)) {
        if (opt_name_out)
            *opt_name_out = VAL_WORD_SPELLING(v);
        Get_Word_May_Fail(out, v, specifier);
    }
    else if (IS_PATH(v) or IS_GET_PATH(v) or IS_SYM_PATH(v)) {
        REBSPC *derived = Derive_Specifier(specifier, v);
        if (Eval_Path_Throws_Core(
            out,
            opt_name_out,  // requesting says we run functions (not GET-PATH!)
            VAL_ARRAY(v),
            VAL_INDEX(v),
            derived,
            NULL,  // `setval`: null means don't treat as SET-PATH!
            EVAL_MASK_DEFAULT | (push_refinements
                ? EVAL_FLAG_PUSH_PATH_REFINES  // pushed in reverse order
                : 0)
        )){
            return true;
        }
    }
    else {
        *opt_name_out = NULL;
        Derelativize(out, v, specifier);
    }

    return false;
}


text:
using System;

using Org.BouncyCastle.Asn1;
using Org.BouncyCastle.Asn1.Cms;
using Org.BouncyCastle.Asn1.Kisa;
using Org.BouncyCastle.Asn1.Nist;
using Org.BouncyCastle.Asn1.Ntt;
using Org.BouncyCastle.Asn1.Pkcs;
using Org.BouncyCastle.Asn1.X509;
using Org.BouncyCastle.Crypto;
using Org.BouncyCastle.Crypto.Parameters;
using Org.BouncyCastle.Security;

namespace Org.BouncyCastle.Cms
{
	internal class KekRecipientInfoGenerator : RecipientInfoGenerator
	{
		private static readonly CmsEnvelopedHelper Helper = CmsEnvelopedHelper.Instance;

		private KeyParameter	keyEncryptionKey;
		// TODO Can get this from keyEncryptionKey?
		private string			keyEncryptionKeyOID;
		private KekIdentifier	kekIdentifier;

		// Derived
		private AlgorithmIdentifier keyEncryptionAlgorithm;

		internal KekRecipientInfoGenerator()
		{
		}

		internal KekIdentifier KekIdentifier
		{
			set { this.kekIdentifier = value; }
		}

		internal KeyParameter KeyEncryptionKey
		{
			set
			{
				this.keyEncryptionKey = value;
				this.keyEncryptionAlgorithm = DetermineKeyEncAlg(keyEncryptionKeyOID, keyEncryptionKey);
			}
		}

		internal string KeyEncryptionKeyOID
		{
			set { this.keyEncryptionKeyOID = value; }
		}

		public RecipientInfo Generate(KeyParameter contentEncryptionKey, SecureRandom random)
		{
			byte[] keyBytes = contentEncryptionKey.GetKey();

			IWrapper keyWrapper = Helper.CreateWrapper(keyEncryptionAlgorithm.ObjectID.Id);
			keyWrapper.Init(true, new ParametersWithRandom(keyEncryptionKey, random));
        	Asn1OctetString encryptedKey = new DerOctetString(
				keyWrapper.Wrap(keyBytes, 0, keyBytes.Length));

			return new RecipientInfo(new KekRecipientInfo(kekIdentifier, keyEncryptionAlgorithm, encryptedKey));
		}

		private static AlgorithmIdentifier DetermineKeyEncAlg(
			string algorithm, KeyParameter key)
		{
			if (algorithm.StartsWith("DES"))
			{
				return new AlgorithmIdentifier(
					PkcsObjectIdentifiers.IdAlgCms3DesWrap,
					DerNull.Instance);
			}
			else if (algorithm.StartsWith("RC2"))
			{
				return new AlgorithmIdentifier(
					PkcsObjectIdentifiers.IdAlgCmsRC2Wrap,
					new DerInteger(58));
			}
			else if (algorithm.StartsWith("AES"))
			{
				int length = key.GetKey().Length * 8;
				DerObjectIdentifier wrapOid;

				if (length == 128)
				{
					wrapOid = NistObjectIdentifiers.IdAes128Wrap;
				}
				else if (length == 192)
				{
					wrapOid = NistObjectIdentifiers.IdAes192Wrap;
				}
				else if (length == 256)
				{
					wrapOid = NistObjectIdentifiers.IdAes256Wrap;
				}
				else
				{
					throw new ArgumentException("illegal keysize in AES");
				}

				return new AlgorithmIdentifier(wrapOid);  // parameters absent
			}
			else if (algorithm.StartsWith("SEED"))
			{
				// parameters absent
				return new AlgorithmIdentifier(KisaObjectIdentifiers.IdNpkiAppCmsSeedWrap);
			}
			else if (algorithm.StartsWith("CAMELLIA"))
			{
				int length = key.GetKey().Length * 8;
				DerObjectIdentifier wrapOid;

				if (length == 128)
				{
					wrapOid = NttObjectIdentifiers.IdCamellia128Wrap;
				}
				else if (length == 192)
				{
					wrapOid = NttObjectIdentifiers.IdCamellia192Wrap;
				}
				else if (length == 256)
				{
					wrapOid = NttObjectIdentifiers.IdCamellia256Wrap;
				}
				else
				{
					throw new ArgumentException("illegal keysize in Camellia");
				}

				return new AlgorithmIdentifier(wrapOid); // parameters must be absent
			}
			else
			{
				throw new ArgumentException("unknown algorithm");
			}
		}
	}
}

redpajama_set_name: RedPajamaGithub


text:
/**
 * This argument is empty. This is for consistency so `pluginOptions` is always second argument.
 * @typedef {undefined} emptyArg
 */

/**
 * Object containing options defined in `gatsby-config.js`
 * @typedef {object} pluginOptions
 */

/**
 * Called when the Gatsby browser runtime first starts.
 * @param {emptyArg} _
 * @param {pluginOptions} pluginOptions
 * @example
 * exports.onClientEntry = () => {
 *   console.log("We've started!")
 *   callAnalyticsAPI()
 * }
 */
exports.onClientEntry = true

/**
 * Called when the initial (but not subsequent) render of Gatsby App is done on the client.
 * @param {emptyArg} _
 * @param {pluginOptions} pluginOptions
 * @example
 * exports.onInitialClientRender = () => {
 *   console.log("ReactDOM.render has executed")
 * }
 */
exports.onInitialClientRender = true

/**
 * Called when changing location is started.
 * @param {object} $0
 * @param {object} $0.location A location object
 * @param {object|null} $0.prevLocation The previous location object
 * @param {pluginOptions} pluginOptions
 * @example
 * exports.onPreRouteUpdate = ({ location, prevLocation }) => {
 *   console.log("Gatsby started to change location to", location.pathname)
 *   console.log("Gatsby started to change location from", prevLocation ? prevLocation.pathname : null)
 * }
 */
exports.onPreRouteUpdate = true

/**
 * Called when changing location is longer than 1 second.
 * @param {object} $0
 * @param {object} $0.location A location object
 * @param {object} $0.action The "action" that caused the route change
 * @param {pluginOptions} pluginOptions
 * @example
 * exports.onRouteUpdateDelayed = () => {
 *   console.log("We can show loading indicator now")
 * }
 */
exports.onRouteUpdateDelayed = true

/**
 * Called when the user changes routes
 * @param {object} $0
 * @param {object} $0.location A location object
 * @param {object|null} $0.prevLocation The previous location object
 * @param {pluginOptions} pluginOptions
 * @example
 * exports.onRouteUpdate = ({ location, prevLocation }) => {
 *   console.log('new pathname', location.pathname)
 *   console.log('old pathname', prevLocation ? prevLocation.pathname : null)
 *
 *   // Track pageview with google analytics
 *   window.ga(
 *     `set`,
 *     `page`,
 *     location.pathname + location.search + location.hash,
 *   )
 *   window.ga(`send`, `pageview`)
 * }
 */
exports.onRouteUpdate = true

/**
 * Allow a plugin to decide if the scroll position should update or
 * not on a route change.
 * @param {object} $0
 * @param {object} $0.prevRouterProps The previous state of the router before the route change.
 * @param {object} $0.routerProps The current state of the router.
 * @param {string} $0.pathname The new pathname (for backwards compatibility with v1).
 * @param {function} $0.getSavedScrollPosition Takes a location and returns the
 * coordinates of the last scroll position for that location, or `null`. Gatsby
 * saves scroll positions for each route in `SessionStorage`, so they are
 * available after page reload.
 * @returns {(boolean|string|Array)} Should return either an [x, y] Array of
 * coordinates to scroll to, a string of the `id` or `name` of an element to
 * scroll to, `false` to not update the scroll position, or `true` for the
 * default behavior.
 * @param {pluginOptions} pluginOptions
 * @example
 * exports.shouldUpdateScroll = ({
 *   routerProps: { location },
 *   getSavedScrollPosition
 * }) => {
 *   const currentPosition = getSavedScrollPosition(location)
 *   const queriedPosition = getSavedScrollPosition({ pathname: `/random` })
 *
 *   window.scrollTo(...(currentPosition || [0, 0]))
 *
 *   return false
 * }
 */
exports.shouldUpdateScroll = true

/**
 * Allow a plugin to register a Service Worker. Should be a function that returns true.
 * @param {emptyArg} _
 * @param {pluginOptions} pluginOptions
 * @returns {boolean} Should Gatsby register `/sw.js` service worker
 * @example
 * exports.registerServiceWorker = () => true
 */
exports.registerServiceWorker = true

/**
 * Allow a plugin to replace the page component renderer.
 * @deprecated Use [wrapPageElement](#wrapPageElement) to decorate page element.
 * @param {object} $0
 * @param {object} $0.props The props of the page.
 * @param {object} $0.loader The gatsby loader.
 * @param {pluginOptions} pluginOptions
 * @returns {ReactNode} Replaced default page renderer
 */
exports.replaceComponentRenderer = true

/**
 * Allow a plugin to wrap the page element.
 *
 * This is useful for setting wrapper component around pages that won't get
 * unmounted on page change. For setting Provider components use [wrapRootElement](#wrapRootElement).
 *
 * _Note:_ [There is equivalent hook in SSR API](/docs/ssr-apis/#wrapPageElement)
 * @param {object} $0
 * @param {ReactNode} $0.element The "Page" React Element built by Gatsby.
 * @param {object} $0.props Props object used by page.
 * @param {pluginOptions} pluginOptions
 * @returns {ReactNode} Wrapped element
 * @example
 * const React = require("react")
 * const Layout = require("./src/components/layout").default
 *
 * exports.wrapPageElement = ({ element, props }) => {
 *   // props provide same data to Layout as Page element will get
 *   // including location, data, etc - you don't need to pass it
 *   return <Layout {...props}>{element}</Layout>
 * }
 */
exports.wrapPageElement = true

/**
 * Allow a plugin to wrap the root element.
 *
 * This is useful to setup any Providers component that will wrap your application.
 * For setting persistent UI elements around pages use [wrapPageElement](#wrapPageElement).
 *
 * _Note:_ [There is equivalent hook in SSR API](/docs/ssr-apis/#wrapRootElement)
 * @param {object} $0
 * @param {ReactNode} $0.element The "Root" React Element built by Gatsby.
 * @param {pluginOptions} pluginOptions
 * @returns {ReactNode} Wrapped element
 * @example
 * const React = require("react")
 * const { Provider } = require("react-redux")
 *
 * const createStore = require("./src/state/createStore")
 * const store = createStore()
 *
 * exports.wrapRootElement = ({ element }) => {
 *   return (
 *     <Provider store={store}>
 *       {element}
 *     </Provider>
 *   )
 * }
 */
exports.wrapRootElement = true

/**
 * Called when prefetching for a pathname is triggered. Allows
 * for plugins with custom prefetching logic.
 * @param {object} $0
 * @param {string} $0.pathname The pathname whose resources should now be prefetched
 * @param {function} $0.loadPage Function for fetching resources related to pathname
 * @param {pluginOptions} pluginOptions
 */
exports.onPrefetchPathname = true

/**
 * Called when prefetching for a pathname is successful. Allows
 * for plugins with custom prefetching logic.
 * @param {object} $0
 * @param {string} $0.pathname The pathname whose resources have now been prefetched
 * @param {pluginOptions} pluginOptions
 */
exports.onPostPrefetchPathname = true

/**
 * Plugins can take over prefetching logic. If they do, they should call this
 * to disable the now duplicate core prefetching logic.
 * @param {emptyArg} _
 * @param {pluginOptions} pluginOptions
 * @returns {boolean} Should disable core prefetching
 * @example
 * exports.disableCorePrefetching = () => true
 */
exports.disableCorePrefetching = true

/**
 * Allow a plugin to replace the `ReactDOM.render`/`ReactDOM.hydrate` function call by a custom renderer.
 * @param {emptyArg} _
 * @param {pluginOptions} pluginOptions
 * @returns {Function} This method should return a function with same signature as `ReactDOM.render()`
 *
 * _Note:_ it's very important to call the `callback` after rendering, otherwise Gatsby will not be able to call `onInitialClientRender`
 * @example
 * exports.replaceHydrateFunction = () => {
 *   return (element, container, callback) => {
 *     console.log("rendering!");
 *     ReactDOM.render(element, container, callback);
 *   };
 * };
 */
exports.replaceHydrateFunction = true

/**
 * Inform plugins when a service worker has been installed.
 * @param {object} $0
 * @param {object} $0.serviceWorker The service worker instance.
 * @param {pluginOptions} pluginOptions
 */
exports.onServiceWorkerInstalled = true

/**
 * Inform plugins of when a service worker has an update available.
 * @param {object} $0
 * @param {object} $0.serviceWorker The service worker instance.
 * @param {pluginOptions} pluginOptions
 */
exports.onServiceWorkerUpdateFound = true

/**
 * Inform plugins when a service worker has been updated in the background
 * and the page is ready to reload to apply changes.
 * @param {object} $0
 * @param {object} $0.serviceWorker The service worker instance.
 * @param {pluginOptions} pluginOptions
 */
exports.onServiceWorkerUpdateReady = true

/**
 * Inform plugins when a service worker has become active.
 * @param {object} $0
 * @param {object} $0.serviceWorker The service worker instance.
 * @param {pluginOptions} pluginOptions
 */
exports.onServiceWorkerActive = true

/**
 * Inform plugins when a service worker is redundant.
 * @param {object} $0
 * @param {object} $0.serviceWorker The service worker instance.
 * @param {pluginOptions} pluginOptions
 */
exports.onServiceWorkerRedundant = true


text:
<?php

use PHPAST\Boolean;

class BooleanTest extends NumberTest {

	public function createNode($label = NULL) {
		return new Boolean(TRUE, $label);
	}

	public function testToString() {
		$node = new Boolean(TRUE);
		$this->assertEquals('TRUE', (string)$node);
		$node = new Boolean(FALSE);
		$this->assertEquals('FALSE', (string)$node);
	}

	public function testTrueConstant() {
		$node = Boolean::getTrue();
		$this->assertInstanceOf(Boolean::class, $node);
		$this->assertTrue($node->getValue());
		$this->assertSame($node, Boolean::getTrue());
	}

	public function testFalseConstant() {
		$node = Boolean::getFalse();
		$this->assertInstanceOf(Boolean::class, $node);
		$this->assertFalse($node->getValue());
		$this->assertSame($node, Boolean::getFalse());
	}
}


text:
namespace smash {
	class Sphere {
	  public:

      float positionX;
      float positionY;
      float positionZ;
      float velocityX;
      float velocityY;
      float velocityZ;
      float radius;
      float mass;

      Sphere(void);
      void step(float);
  };
}


text:
function getDomoUser(){
  var data = JSON.parse(localStorage.getItem('domo_user'));
  if(data) {
    return {
      name: data.USER_FULLNAME || "",
      id: data.USER_ID || ""
    };
  }
  else {
    return {
      name: "",
      id: ""
    }
  }
}

function getUserId() { return (getDomoUser().id); }
function getUserName() { return getDomoUser().name; }

function CanvasState(canvas) {
  this.canvas = canvas;
  this.width = canvas.width;
  this.height = canvas.height;
  this.context = canvas.getContext('2d');

  // This complicates things a little but but fixes mouse co-ordinate problems
  // when there's a border or padding. See getMouse for more detail
  var stylePaddingLeft, stylePaddingTop, styleBorderLeft, styleBorderTop;
  if (document.defaultView && document.defaultView.getComputedStyle) {
    this.stylePaddingLeft = parseInt(document.defaultView.getComputedStyle(canvas, null)['paddingLeft'], 10)      || 0;
    this.stylePaddingTop  = parseInt(document.defaultView.getComputedStyle(canvas, null)['paddingTop'], 10)       || 0;
    this.styleBorderLeft  = parseInt(document.defaultView.getComputedStyle(canvas, null)['borderLeftWidth'], 10)  || 0;
    this.styleBorderTop   = parseInt(document.defaultView.getComputedStyle(canvas, null)['borderTopWidth'], 10)   || 0;
  }

  // Some pages have fixed-position bars (like the stumbleupon bar) at the top or left of the page
  // They will mess up mouse coordinates and this fixes that
  var html = document.body.parentNode;
  this.htmlTop = html.offsetTop;
  this.htmlLeft = html.offsetLeft;

  this.valid = false; // when set to false, the canvas will redraw everything
  this.table = new Table();

  var myState = this;
  this.interval = 30;
  setInterval(function() { myState.draw(); }, myState.interval);
}

CanvasState.prototype.clear = function() {
  this.context.clearRect(0, 0, this.width, this.height);
}

CanvasState.prototype.draw = function() {
  if(!this.valid) {
    var context = this.context;
    this.clear();

    this.table.draw(context);

    if(this.game) {
    }

    this.valid = true;
  }
}

CanvasState.prototype.setGame = function(game) {
  this.table.game = game;
  this.valid = false;
}

function Table() {
  this.radius = $('canvas').width() * 0.95 / 2;
}

function toInteger(number) {
  return Math.round(  // round to nearest integer
    Number(number)    // type cast your input
  );
};

Table.prototype.draw = function(ctx) {
  var canvasWidth = $('canvas').attr('width');
  var canvasHeight = $('canvas').attr('height');
  var x = canvasWidth / 2;
  var y = canvasHeight / 2;
  ctx.fillStyle = '#9AC9EE';
  ctx.strokeStyle = '#9AC9EE';
  ctx.beginPath();
  ctx.arc(x, y, this.radius, 0, 2 * Math.PI);
  ctx.stroke();
  ctx.fill();

  if(this.game) {
    var game = this.game;
    var p1 = game.playerOne;
    var p2 = game.playerTwo;
    var p3 = game.playerThree;
    var p4 = game.playerFour;
    var numPlayers = 0;

    ctx.fillStyle = '#BAE9FF';
    var hCenter = x;
    var vCenter = y;
    var rectWidth = toInteger(.13 * canvasWidth);
    var margin = toInteger(.07 * canvasWidth);
    var cardLeft = toInteger(0.338 * canvasWidth);
    var cardRight = toInteger(0.7 * canvasWidth);
    var cardTop = toInteger(0.38 * canvasWidth);
    var cardBottom = toInteger(0.3 * canvasWidth + cardTop);
    var cardWidth = toInteger(0.05 * canvasWidth);
    var cardHeight = toInteger(0.07 * canvasWidth);
    var cardMargin = toInteger(0.016 * canvasWidth);
    if(p1) {
      numPlayers++;
      ctx.fillRect(hCenter - rectWidth / 2, margin, rectWidth, rectWidth);
    }
    if(p2) {
      numPlayers++;
      ctx.fillRect(margin, vCenter - rectWidth / 2, rectWidth, rectWidth);
    }
    if(p3) {
      numPlayers++;
      ctx.fillRect(canvasWidth - (margin + rectWidth), vCenter - rectWidth / 2, rectWidth, rectWidth);
    }
    if(p4) {
      numPlayers++;
      ctx.fillRect(hCenter - rectWidth / 2, canvasHeight - (margin + rectWidth), rectWidth, rectWidth);
    }

    if(numPlayers >= 4) {
      for(var cTop = cardTop; cTop + cardHeight < cardBottom; cTop = cTop + cardHeight + cardMargin) {
        for(var cLeft = cardLeft; cLeft + cardWidth < cardRight; cLeft = cLeft + cardWidth + cardMargin) {
          ctx.fillRect(cLeft, cTop, cardWidth, cardHeight);
        }
      }
    }
  }
}

var started = false;
$(document).ready(function () {
  if(started) return;
  started = true;

  var _this = this;

  var fb = new Firebase("https://lunch-dominion.firebaseio.com/");
  var s = new CanvasState(document.getElementById('canvas'));

  var today = new Date();
  var gameTimeToday = new Date(today.getTime());
  gameTimeToday.setHours(12);
  gameTimeToday.setMinutes(0);
  var gameTimeTomorrow = new Date();
  gameTimeTomorrow.setDate(gameTimeToday.getDate() + 1);
  var nextGameDate = null;
  if(today > gameTimeToday) {
    nextGameTime = new Date(gameTimeTomorrow.getTime());
  }
  else {
    nextGameTime = new Date(gameTimeToday.getTime());
  }

  var dd = nextGameTime.getDate();
  var mm = nextGameTime.getMonth() + 1;
  var yyyy = nextGameTime.getFullYear();

  var weekDay = today.getDay();

  if(dd < 10) {
    dd = '0' + dd;
  }

  if(mm < 10) {
    mm = '0' + mm;
  }

  nextGameDateString = yyyy + '-' + mm + '-' + dd;

  console.log('Right now it is', today);
  console.log('Game time today is', gameTimeToday);
  console.log('Next game time is', nextGameTime);

  fb.on('value', function(snapshot) {
    var data = snapshot.val();
    if(data && data[nextGameDateString]) {

      var game = data[nextGameDateString];
      _this.game = game;

      s.setGame(game);

      var p1 = game.playerOne;
      var p2 = game.playerTwo;
      var p3 = game.playerThree;
      var p4 = game.playerFour;

      $('.playerOne').html(p1 || " ");
      $('.playerTwo').html(p2 || " ");
      $('.playerThree').html(p3 || " ");
      $('.playerFour').html(p4 || " ");

      var playerName = getUserName();
      var currentPlayerIsSignedUp = playerName && (p1 === playerName || p2 === playerName || p3 === playerName || p4 === playerName);
      if(currentPlayerIsSignedUp) {
        $('.submit').hide();
        $('.exit').show();
      }
      else {
        $('.submit').show();
        $('.exit').hide();
      }

      var playerCount = 0;
      if(p1) playerCount++;
      if(p2) playerCount++;
      if(p3) playerCount++;
      if(p4) playerCount++;

      $('.theButton').hide();
      $('.filled-message').hide();
      $('.time-passed').hide();
      $('.weekend').hide();

      if(weekDay === 0 || weekDay === 6) {
        $('.weekend').show();
      }
      else if(playerCount >= 4 && !currentPlayerIsSignedUp) {
        $('.filled-message').show();
      }
      else {
        if(today > gameTimeToday) {
          $('.tomorrow').show();
        }
        $('.theButton').show();
      }
    }
    else {
      console.log('No data for ' + nextGameDateString + ', creating new data.');
      var todayRef = fb.child(nextGameDateString);
      todayRef.set({
        'playerOne': '',
        'playerTwo': '',
        'playerThree': '',
        'playerFour': ''
      });
    }
  }, function(errorObject) {
    console.log('The read failed: ' + errorObject.code);
  });

  $('.submit').bind('click', function() {
    var emptyPlayer = GetNextEmptyPlayer();
    if(emptyPlayer) {
      var todayRef = fb.child(nextGameDateString);
      _this.game[emptyPlayer] = getUserName();
      todayRef.set(_this.game);
    }
  });

  $('.exit').bind('click', function() {
    var position = GetPlayerPosition(getUserName());
    if(position) {
      var todayRef = fb.child(nextGameDateString);
      _this.game[position] = "";
      todayRef.set(_this.game);
    }
  });

  var GetPlayerPosition = function(name) {
    var game = _this.game;

    var p1 = game.playerOne;
    var p2 = game.playerTwo;
    var p3 = game.playerThree;
    var p4 = game.playerFour;

    if(p1 === name) {
      return "playerOne";
    }
    else if(p2 === name) {
      return "playerTwo";
    }
    else if(p3 === name) {
      return "playerThree";
    }
    else if(p4 === name) {
      return "playerFour";
    }
    return "";
  };

  var GetNextEmptyPlayer = function() {
    var game = _this.game

    var p1 = game.playerOne;
    var p2 = game.playerTwo;
    var p3 = game.playerThree;
    var p4 = game.playerFour;

    if(!p1) {
      return "playerOne";
    }
    else if(!p2) {
      return "playerTwo";
    }
    else if(!p3) {
      return "playerThree";
    }
    else if(!p4) {
      return "playerFour";
    }
    else {
      console.log("Sorry, all player slots are filled.");
      return "";
    }
  };

  var ClearPlayer = function(playerName) {
      var todayRef = fb.child(nextGameDateString);
      _this.game[playerName] = "";
      todayRef.set(_this.game);
  }

  var timeoutId = 0;
  $('.playerOne').mousedown(function() {
    timeoutId = setTimeout(ClearPlayer, 2000, 'playerOne');
  }).bind('mouseup mouseleave', function() {
    clearTimeout(timeoutId);
  });
  $('.playerTwo').mousedown(function() {
    timeoutId = setTimeout(ClearPlayer, 2000, 'playerTwo');
  }).bind('mouseup mouseleave', function() {
    clearTimeout(timeoutId);
  });
  $('.playerThree').mousedown(function() {
    timeoutId = setTimeout(ClearPlayer, 2000, 'playerThree');
  }).bind('mouseup mouseleave', function() {
    clearTimeout(timeoutId);
  });
  $('.playerFour').mousedown(function() {
    timeoutId = setTimeout(ClearPlayer, 2000, 'playerFour');
  }).bind('mouseup mouseleave', function() {
    clearTimeout(timeoutId);
  });

});


text:
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using Newtonsoft.Json.Linq;
using NoMoreIIS.Models;

namespace NoMoreIIS.Services
{
    public class FixJsonLaunchSettingsService : IFixJsonLaunchSettingsService
    {
        private readonly IFileSystemService _fileSystemService;

        public FixJsonLaunchSettingsService(IFileSystemService fileSystemService = null)
        {
            _fileSystemService = fileSystemService ?? new FileSystemService();
        }

        public void Fix(IEnumerable<LaunchSettingsMetadata> metadata)
        {
            if (metadata == null || !metadata.Any())
            {
                return;
            }

            foreach (LaunchSettingsMetadata launchSettings in metadata)
            {
                FixSafely(launchSettings);
            }
        }

        private void FixSafely(LaunchSettingsMetadata metadata)
        {
            try
            {
                string rawJson = _fileSystemService.GetFileContent(metadata.Location);
                JToken settings = JToken.Parse(rawJson);

                bool removedIISProfile = RemoveIISProfile(settings);
                bool disabledBrowserLaunch = DisableBrowserLaunch(metadata, settings);
                if (removedIISProfile || disabledBrowserLaunch)
                {
                    _fileSystemService.WriteAllText(metadata.Location, settings.ToString());
                }
            }
            catch (Exception ex) // at this point we do not care about the type of exception
            {
                Debug.WriteLine($"Failed to fix file '{metadata.Location}'.{Environment.NewLine}{ex.ToString()}");
            }
        }

        private bool DisableBrowserLaunch(LaunchSettingsMetadata metadata, JToken root)
        {
            JProperty kestrelProfile = root?[Definitions.LaunchSettingsFile.ProfilesNodeName]?
                                .Children<JProperty>()
                                .FirstOrDefault(p => p.Name == metadata.ProjectName);

            if (kestrelProfile != null)
            {
                var launchBrowser = kestrelProfile.Value[Definitions.LaunchSettingsFile.LaunchBrowserFieldName];
                if (launchBrowser != null && launchBrowser.Type == JTokenType.Boolean && (bool)launchBrowser)
                {
                    kestrelProfile.Value[Definitions.LaunchSettingsFile.LaunchBrowserFieldName] = false;
                    return true;
                }
            }

            return false;
        }

        private bool RemoveIISProfile(JToken root)
        {
            JProperty iisProfile = root?[Definitions.LaunchSettingsFile.ProfilesNodeName]?
                    .Children<JProperty>()
                    .FirstOrDefault(p => string.Equals(Definitions.LaunchSettingsFile.IISProfileNodeName, p.Name, StringComparison.OrdinalIgnoreCase));

            if (iisProfile != null)
            {
                iisProfile.Remove();
                return true;
            }

            return false;
        }
    }
}


text:
import {combineReducers} from 'redux';
import messages from './messages';
import name from './name';
import player from './player';
import playlists from './playlists';

const rootReducer = combineReducers({
  messages,
  name,
  player,
  playlists
});

export default rootReducer;


text:
package org.bedework.util.deployment;

import java.io.File;
import java.nio.file.Path;
import java.nio.file.Paths;

/** Represent a ear for deployment.
 *
 * @author douglm
 */
public class War extends VersionedFile {
  private final ApplicationXml appXml;

  private final JbossWebXml jbwXml;

  private final WebXml wXml;

  public War(final String path,
             final SplitName sn,
             final ApplicationXml appXml,
             final PropertiesChain props) throws Throwable {
    super(path, sn, props, "app." + sn.prefix + ".");
    this.appXml = appXml;

    final File webInf = Utils.subDirectory(theFile, "WEB-INF");

    jbwXml = new JbossWebXml(webInf, this.props);
    wXml = new WebXml(webInf, this.props);
  }

  public void update() throws Throwable {
    appXml.setContext(sn.name, props);

    jbwXml.update();

    if (jbwXml.getUpdated()) {
      jbwXml.output();
    }

    wXml.update();

    if (wXml.getUpdated()) {
      wXml.output();
    }
  }

  @SuppressWarnings("UnusedDeclaration")
  private void copyResources() throws Throwable {
    props.pushFiltered("app.copy.resource.", "copy.");

    try {
      for (final String pname: props.top().stringPropertyNames()) {
        final String toName = pname.substring("copy.".length());
        final String fromName = props.get(pname);

        Utils.info("Copy " + fromName + " to " + toName);

        final Path outPath =
                Paths.get(props.get("org.bedework.server.resource.root.dir"),
                          toName);

        final Path inPath =
                Paths.get(props.get("org.bedework.postdeploy.resource.base"),
                          fromName);

        final File outFile = outPath.toFile();

        if (outFile.exists()) {
          Utils.deleteAll(outPath);
        }

        Utils.copy(inPath, outPath, false);
      }
    } finally {
      props.pop();
    }
  }
}


text:
<?php

function Dwoo_Plugin_include(Dwoo $dwoo, $file, $cache_time = null, $cache_id = null, $compile_id = null, $data = '_root', $assign = null, array $rest = array())
{
	if ($file === '') {
		return;
	}

	if (preg_match('#^([a-z]{2,}):(.*)$#i', $file, $m)) {
		// resource:identifier given, extract them
		$resource = $m[1];
		$identifier = $m[2];
	} else {
		// get the current template's resource
		$resource = $dwoo->getTemplate()->getResourceName();
		$identifier = $file;
	}

	try {
		if (!is_numeric($cache_time)) {
			$cache_time = null;
		}
		$include = $dwoo->templateFactory($resource, $identifier, $cache_time, $cache_id, $compile_id);
	} catch (Dwoo_Security_Exception $e) {
		return $dwoo->triggerError('Include : Security restriction : '.$e->getMessage(), E_USER_WARNING);
	} catch (Dwoo_Exception $e) {
		return $dwoo->triggerError('Include : '.$e->getMessage(), E_USER_WARNING);
	}

	if ($include === null) {
		return $dwoo->triggerError('Include : Resource "'.$resource.':'.$identifier.'" not found.', E_USER_WARNING);
	} elseif ($include === false) {
		return $dwoo->triggerError('Include : Resource "'.$resource.'" does not support includes.', E_USER_WARNING);
	}

	if ($dwoo->isArray($data)) {
		$vars = $data;
	} elseif ($dwoo->isArray($cache_time)) {
		$vars = $cache_time;
	} else {
		$vars = $dwoo->readVar($data);
	}

	if (count($rest)) {
		$vars = $rest + $vars;
	}

	$out = $dwoo->get($include, $vars);

	if ($assign !== null) {
		$dwoo->assignInScope($out, $assign);
	} else {
		return $out;
	}
}


text:
using LottieUWP.Model.Animatable;
using LottieUWP.Model.Content;

namespace LottieUWP.Parser
{
    static class GradientFillParser
    {
        internal static GradientFill Parse(JsonReader reader, LottieComposition composition)
        {
            string name = null;
            AnimatableGradientColorValue color = null;
            AnimatableIntegerValue opacity = null;
            GradientType gradientType = GradientType.Linear;
            AnimatablePointValue startPoint = null;
            AnimatablePointValue endPoint = null;
            PathFillType fillType = PathFillType.EvenOdd;
            bool hidden = false;

            while (reader.HasNext())
            {
                switch (reader.NextName())
                {
                    case "nm":
                        name = reader.NextString();
                        break;
                    case "g":
                        int points = -1;
                        reader.BeginObject();
                        while (reader.HasNext())
                        {
                            switch (reader.NextName())
                            {
                                case "p":
                                    points = reader.NextInt();
                                    break;
                                case "k":
                                    color = AnimatableValueParser.ParseGradientColor(reader, composition, points);
                                    break;
                                default:
                                    reader.SkipValue();
                                    break;
                            }
                        }
                        reader.EndObject();
                        break;
                    case "o":
                        opacity = AnimatableValueParser.ParseInteger(reader, composition);
                        break;
                    case "t":
                        gradientType = reader.NextInt() == 1 ? GradientType.Linear : GradientType.Radial;
                        break;
                    case "s":
                        startPoint = AnimatableValueParser.ParsePoint(reader, composition);
                        break;
                    case "e":
                        endPoint = AnimatableValueParser.ParsePoint(reader, composition);
                        break;
                    case "r":
                        fillType = reader.NextInt() == 1 ? PathFillType.Winding : PathFillType.EvenOdd;
                        break;
                    case "hd":
                        hidden = reader.NextBoolean();
                        break;
                    default:
                        reader.SkipValue();
                        break;
                }
            }

            return new GradientFill(
            name, gradientType, fillType, color, opacity, startPoint, endPoint, null, null, hidden);
        }
    }
}


text:
require 'signal'

N = 200000000

print("Running under " .. signal._VERSION)
print("Running before messing with SIGINT")
for i = 1, N do end
signal.signal("INT", "ignore")
print("Running now with SIGINT ignored...")
for i = 1, N do end
signal.signal("INT", function() print("Got an interrupt!") end)
print("Running now with a custom SIGINT handler...")
for i = 1, N do end
signal.signal("INT", "cdefault")
print("Running now with the default SIGINT handler...")
for i = 1, N do end
signal.signal("INT", "default")
print("Running now with Lua's default SIGINT handler...")
for i = 1, N do end
print("Exiting by raising a fatal error")
signal.raise("TERM")
print("Done!")


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<parent>
		<groupId>fr.opensagres.eclipse.wtp</groupId>
		<artifactId>update-site</artifactId>
		<version>1.1.0-SNAPSHOT</version>
	</parent>
	<groupId>fr.opensagres.eclipse.wtp</groupId>
	<artifactId>org.eclipse.wst.json.feature</artifactId>
	<version>1.1.0-SNAPSHOT</version>
	<packaging>eclipse-feature</packaging>

</project>