Skip to content

Semicolons are being enforced in modified type expressions #403

Description

@Zandario

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"
		},
	)

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions