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

parser: fix formatting comptime if expr after inc expr (fix #20927) #20931

Merged
merged 1 commit into from
Mar 1, 2024

Conversation

yuyi98
Copy link
Member

@yuyi98 yuyi98 commented Mar 1, 2024

This PR fix formatting comptime if expr after inc expr (fix #20927).

  • Fix formatting comptime if expr after inc expr.
  • Add test.

vlib\v\fmt\tests\comptime_if_after_inc_expr_keep.vv

fn main() {
	mut i := 0
	i++
	$if abc ? {
		println(i)
	}
	println('done')
}

Copy link
Member

@spytheman spytheman left a comment

Choose a reason for hiding this comment

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

Thank you 🙇🏻‍♂️.

@spytheman spytheman merged commit a2d2330 into vlang:master Mar 1, 2024
54 checks passed
@yuyi98 yuyi98 deleted the fix_inc_with_ct_if branch March 1, 2024 13:40
raw-bin pushed a commit to raw-bin/v that referenced this pull request Mar 9, 2024
raw-bin pushed a commit to raw-bin/v that referenced this pull request Mar 9, 2024
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.

fmt: i++ $if abc ? { gets formatted, as i++$ if abc ? {, and fails to parse.
2 participants