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

Semicolons are being enforced in modified type expressions #403

Open
Zandario opened this issue Jul 28, 2024 · 0 comments
Open

Semicolons are being enforced in modified type expressions #403

Zandario opened this issue Jul 28, 2024 · 0 comments
Labels

Comments

@Zandario
Copy link

image

https://www.byond.com/docs/ref/#/proc/newlist

The semicolon is necessary if you put several variable assignments on the same line. The braces are necessary, even though they are generally optional in DM (since the compiler looks at your indentation). The reason is that the path + initializations must be parsed as a single expression, which is a different context from the usual use of braces in DM when you are defining a true type. Also, indentation inside of an argument list is always ignored anyway.

Don't really know how to explain it other than ;'s aren't necessary within {}'s, unless it's multiple expressions on the same line.

Reproduction Code

/proc/test()
	return newlist(
		/obj{
			name = "bob"
			color = "red"
		},
		/obj{
			name = "joe"
			color = "blue"
		},
	)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants