Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slightly adjust frameenter/exit in generated C #613

Merged
merged 1 commit into from
Jul 9, 2024

Conversation

hugomg
Copy link
Member

@hugomg hugomg commented Jul 9, 2024

  1. Don't add blank lines around FRAMEENTER.

    static void function_03(
    lua_State *L,
    Udata * restrict K,
    TValue * restrict U
    ) {
    PALLENE_C_FRAMEENTER(L, "myfunc");
    StackValue *base = L->top.p;
    ptrdiff_t base_offset = savestack(L, base);

  2. Move the FRAMEEXIT to before the multi-return assignments. The assingments+return are a single thing.

    PALLENE_FRAMEEXIT();
    *ret2 = x3;
    return x2;

1) Don't add blank lines around FRAMEENTER.

    static void function_03(
        lua_State *L,
        Udata * restrict K,
        TValue * restrict U
    ) {
        PALLENE_C_FRAMEENTER(L, "myfunc");
        StackValue *base = L->top.p;
        ptrdiff_t base_offset = savestack(L, base);

2) Move the FRAMEEXIT to before the multi-return assignments. The
assingments+return are a single thing.

    PALLENE_FRAMEEXIT();
    *ret2 = x3;
    return x2;
@hugomg hugomg requested a review from singul4ri7y July 9, 2024 04:14
Copy link
Contributor

@singul4ri7y singul4ri7y left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@singul4ri7y singul4ri7y merged commit eea1836 into master Jul 9, 2024
2 checks passed
@singul4ri7y singul4ri7y deleted the frameenter-spacing branch July 9, 2024 06:14
@hugomg
Copy link
Member Author

hugomg commented Jul 9, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants