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

Fixes not accepting colon spam with goto labels, adds support for paren-less sleep calls #783

Closed
wants to merge 3 commits into from

Conversation

Altoids1
Copy link
Contributor

@Altoids1 Altoids1 commented Sep 3, 2022

image

Fixes #518.

Summary

In this PR is also a little new tool for the codebase: A defer pattern I found for C#. Here, it is used to consume whitespace regardless of which control flow in ProcStatementFromExpression does the returning. I figure it will be useful in many other places in the codebase later on.

Changelog

  • Goto labels with an exaggerated amount of colons, ::::LIKE_THIS::::, are now parsed correctly.
  • Calling sleep without any parentheses (as in sleep 40) is now properly implemented.
  • Attempting to make a label called sleep now compiletimes, as per parity.

I don't entirely trust this pattern, nor can I really commend its beauty, but we are in desperate need of a method to defer things throughout DMParser. Many functions have clunky syntax or erratic behaviour as a result of not always doing a task on all possible control paths. I've seen a couple TODOs about it as well so, here ya go.
"sleep 40" is now a valid DM statement.

sleep, like del, has a special snowflake behaviour that allows it to be called without parentheses when acting as a lone expression-as-statement.

"sleep" however isn't precisely a keyword, at least not in OD, so this is adds a bit of snowflake flow control to interpret it correctly anyways.
@github-actions
Copy link

github-actions bot commented Nov 2, 2022

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@wixoaGit
Copy link
Member

BYOND labels no longer allow multiple : on either side. This appears to be because of the new v515 : operator.

@wixoaGit
Copy link
Member

Closing in favor of #1461

@wixoaGit wixoaGit closed this Sep 11, 2023
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.

sleep() without parentheses is unsupported
2 participants