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

Better format arguments in variant parser #32313

Merged
merged 1 commit into from
Jun 18, 2021

Conversation

YeldhamDev
Copy link
Member

@YeldhamDev YeldhamDev commented Sep 24, 2019

Removed extra spaces from the variant parser, which means that in the docs values will appear as Vector2(0, 0) instead of Vector( 0, 0 ).

@akien-mga
Copy link
Member

akien-mga commented Sep 25, 2019

This will have a big impact on the serialization of Variants in tscn and tres files, it breaks compat a priori.

I'm in favor of it but that's 4.0 material, and we need to ensure that the parser can handle both styles (but saves it without extraneous spaces). The current style is likely @reduz's personal preference when he designed it, so we should also discuss it to reach a consensus before changing it.

@akien-mga akien-mga added this to the 4.0 milestone Sep 25, 2019
@akien-mga
Copy link
Member

Made arguments in the connection dialog be arg: type instead of type arg,

This could still be merged for 3.2 though.

and removed extra spaces.

And this possibly, as long as only the editor is impacted and we don't consider the discrepancy with serialized values an issue.

@Calinou
Copy link
Member

Calinou commented Sep 25, 2019

Removed extra spaces from the variant parser, which means that in the docs values will appear as Vector2(0, 0) instead of Vector( 0, 0 ).

From my testing, it ignores whitespace so even the following can be parsed successfully:

Vector2(
	0,
	0
)

The only thing that's not allowed is having trailing commas. Adding support for trailing commas in constructors would allow for better VCS diffs (see #32124).

@YeldhamDev YeldhamDev changed the title Better format arguments and default values in the editor Better format arguments in variant parser Sep 26, 2019
@YeldhamDev
Copy link
Member Author

The connections dialog changes were moved to the newly created #32357 commit.

@YeldhamDev YeldhamDev force-pushed the format_args_values branch 2 times, most recently from 86debfc to 26f9add Compare February 28, 2020 21:24
@YeldhamDev YeldhamDev force-pushed the format_args_values branch from 26f9add to 64b2bcb Compare May 17, 2020 13:29
@aaronfranke aaronfranke requested a review from akien-mga July 1, 2020 02:42
@YeldhamDev YeldhamDev requested a review from a team March 1, 2021 16:15
@YeldhamDev YeldhamDev force-pushed the format_args_values branch 2 times, most recently from db71c6a to e6b6834 Compare June 17, 2021 22:56
@YeldhamDev YeldhamDev requested a review from a team as a code owner June 17, 2021 22:56
@YeldhamDev YeldhamDev force-pushed the format_args_values branch from e6b6834 to 326bd36 Compare June 18, 2021 02:24
@YeldhamDev YeldhamDev requested a review from a team as a code owner June 18, 2021 02:24
@YeldhamDev YeldhamDev force-pushed the format_args_values branch from 326bd36 to ead8aa1 Compare June 18, 2021 02:45
@YeldhamDev YeldhamDev requested review from a team as code owners June 18, 2021 02:45
@YeldhamDev YeldhamDev requested review from a team as code owners June 18, 2021 02:45
@YeldhamDev YeldhamDev force-pushed the format_args_values branch from ead8aa1 to 0ff4095 Compare June 18, 2021 03:06
Copy link
Member

@akien-mga akien-mga left a comment

Choose a reason for hiding this comment

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

Code and change look good to me.

For the record, we should probably add more tests for VariantParser (there's two strings in tests/test_config_file.h affected by this PR but that's all, which shows that our coverage for Variant serialization isn't top notch ;)).

@akien-mga akien-mga merged commit 86aff37 into godotengine:master Jun 18, 2021
@akien-mga
Copy link
Member

Thanks!

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

Successfully merging this pull request may close these issues.

4 participants