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

Question- Support optional character ?. in lua #280

Open
Gellipapa opened this issue Jul 11, 2023 · 5 comments
Open

Question- Support optional character ?. in lua #280

Gellipapa opened this issue Jul 11, 2023 · 5 comments
Labels
enhancement New feature or request

Comments

@Gellipapa
Copy link

Gellipapa commented Jul 11, 2023

Hi! I have a question:
I'm using the stylua script and the author said to use the full-moon library for parse lua code, so I'm writing here.

My problem would be that we are developing in FiveM which is a framework for GTA 5 online and in FiveM they have included extra characters that are not supported by the base lua. One of these is the optional character ?. and when I start to run the code formatter it exits with an error code because it cannot compile the code. I would like your help on how to make the compiler skip the ?. optional character so that the formatting is successful?

It would be a great help for us FiveM developers because then we would be able to format our code even though it is a bit unique to FiveM.

I'll see how I can implement this if it works out I'll open a pr.

Context thread: Stylua/Question- Support ? and ` characters?

Thanks in advance for your replies.

@Kampfkarren
Copy link
Owner

It would have to be done after the parser rewrite (which will likely not be done soon) and its own feature, off by default. But yes it is probably fine, the parser rewrite will allow us to more easily have whatever funky Lua distributions there are

@Kampfkarren Kampfkarren added the enhancement New feature or request label Jul 12, 2023
@Gellipapa
Copy link
Author

@Kampfkarren Hi! I would like to know if you managed to rewrite the parser or if you are still in the process of rewriting it. You mentioned earlier that after rewriting it it will support what is written in issue. Thanks in advance for your reply.

@Kampfkarren
Copy link
Owner

It's been stalling but I'm going to be looking at it and hopefully merging it today.

@Gellipapa
Copy link
Author

Gellipapa commented Jan 20, 2024

It's been stalling but I'm going to be looking at it and hopefully merging it today.

Ohh cool thanks so much in advance. Currently I solved it by replacing the characters with node-js before formatting and then resetting them, but a stable solution would be better. Thanks again.

@Gellipapa
Copy link
Author

Thank you very much for your work i saw that you merged , can you give me some guidance on where I can find this new feature to add additional characters so that the parser doesn't throw an error? Thank you very much.

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

No branches or pull requests

2 participants