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 chokes on paths containing "operator" #374

Open
Exxion opened this issue Oct 22, 2023 · 1 comment
Open

Parser chokes on paths containing "operator" #374

Exxion opened this issue Oct 22, 2023 · 1 comment
Labels

Comments

@Exxion
Copy link

Exxion commented Oct 22, 2023

It is perhaps unwise to include operator in a path, but BYOND accepts it.

/datum/operator

/datum/operator/proc/test()

This emits a warning that the proc is relatively-pathed, and confuses the language server into thinking the proc is global. If you leave out the first line, it also emits a "bad parent type" error.

/datum/test/proc/test(datum/operator/thing)

This causes a fatal error in the parser.

It would not be unreasonable to just treat operator as a reserved word and disallow its use in paths. OpenDream does this by default. It shouldn't break the parser, though.

@SpaceManiac
Copy link
Owner

Unfortunately it's difficult to adapt the parser to allow both of the following to work:

/datum/operator/()
    // this is the overload for `/` division operator for `/datum`
/datum/operator/unrelated_proc()
    // this is an unrelated proc on `/datum/operator`

So I may leave this as a won't-fix.

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