Skip to content

Preprocessor Parity Error w/ Slashes in Macros #2649

Description

@ike709

This goonstation code:

/// Radio colours, CSS classes, and frequencies.
CREATE_NAMESPACE(RADIO)


//------------ Colours ------------//
/// Radio colours.
CREATE_NAMESPACE(RADIO, COL)

ADD_TO_NAMESPACE(RADIO, COL)(var/const/BRIG = "#FF5000")

using these cursed macros: https://github.com/goonstation/goonstation/blob/5ad07ab1ca1d05d1c382a27fbb8c91d28c02d4de/_std/namespaces/_namespace.dm#L31

gets preprocessed into:

var/datum/namespace/RADIO/RADIO = /datum/namespace/RADIO
/datum/namespace/RADIO/var//datum/namespace/RADIO__COL/COL = /datum/namespace/RADIO__COL
/datum/namespace/RADIO__COL/var/const/BRIG = "#FF5000"

(note the var//)

which OpenDream then errors on. BYOND does not error.

Goonstation fixed this by removing a slash from the start of the path in one of the macros here: goonstation/goonstation@9da8613

I don't know off the top of my head when BYOND will/won't tolerate var//path/example so this will probably need further testing?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Codebase: GoonstationRelating to the Goonstation codebaseCompilerInvolves the OpenDream compilerParityA difference between OpenDream and BYOND implementationsbugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions