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

Add support for table prealloc syntax #8

Open
wants to merge 1 commit into
base: lua-5.0
Choose a base branch
from

Conversation

Zjonn
Copy link

@Zjonn Zjonn commented Mar 5, 2023

Closes #7

Brief

I've implemented support for table prealocation syntax.
New grammar allows to produce

  • table = {&A &B}
  • table = {&A}

@Zjonn Zjonn changed the title Add support for table prealloc syntax ("{&A &B}") Add support for table prealloc syntax Mar 5, 2023
@Zjonn
Copy link
Author

Zjonn commented Mar 6, 2023

@Askaholic please take a look

@Askaholic
Copy link
Collaborator

Thanks for the ping, for some reason I wasn’t watching this repo so I didn’t see that the PR was opened. I’ll review this properly as soon as I can.

In the mean time do you have any idea if your implementation is similar to that of the GPG one in actual FA? When possible I’ve been trying to keep the implementations close to existing stuff that can be observed in the FA exe. There’s only so much you can do but sometimes it’s possible to tell more or less how the call tree looks and try to mimic that in this codebase.

@Zjonn
Copy link
Author

Zjonn commented Mar 6, 2023

In the mean time do you have any idea if your implementation is similar to that of the GPG one in actual FA? - no, not really, I just saw that the fa repo tests were failing on this new syntax and I decided to fix it.

I've implemented it in simplest possible way, so from a call tree prepective

table1 = {&A &B}
table2 = {}

should be equal. In addition A, B can only be numeric tokens, so I could assign them directly to ConsControl.

@Zjonn
Copy link
Author

Zjonn commented Nov 3, 2023

@Askaholic

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.

Pre-allocation syntax of tables
2 participants