SpacemanDMM icon indicating copy to clipboard operation
SpacemanDMM copied to clipboard

Parser chokes on paths containing "operator"

Open Exxion opened this issue 8 months ago • 1 comments

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.

Exxion avatar Oct 22 '23 18:10 Exxion

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.

SpaceManiac avatar Oct 25 '23 05:10 SpaceManiac