OpenDreamProject / OpenDream

A project for running games made in the DM programming language
MIT License
186 stars 100 forks source link

weird `}` at end of line causing parse failure #1826

Open ZeWaka opened 3 weeks ago

ZeWaka commented 3 weeks ago

it can't handle this:

/typeinfo/obj/machinery/conveyor_switch {
    mats = list("metal" = 10,
                "conductive" = 10,
                "crystal" = 10)}

/obj/machinery/conveyor_switch

but it can handle this with the extra newline:

/typeinfo/obj/machinery/conveyor_switch {
    mats = list("metal" = 10,
                "conductive" = 10,
                "crystal" = 10)
}

/obj/machinery/conveyor_switch

the original preproc dump:

/obj/machinery/conveyor_switch/typeinfo_type = /typeinfo/obj/machinery/conveyor_switch; /obj/machinery/conveyor_switch/get_typeinfo() { ; return get_singleton(src.typeinfo_type); } /typeinfo/obj/machinery/conveyor_switch; /typeinfo/obj/machinery/conveyor_switch/New(){ . = ..(); admin_procs += list(/obj/machinery/conveyor_switch/proc/trigger); }
/obj/machinery/conveyor_switch/typeinfo_type = /typeinfo/obj/machinery/conveyor_switch; /obj/machinery/conveyor_switch/get_typeinfo() { ; return get_singleton(src.typeinfo_type); } /typeinfo/obj/machinery/conveyor_switch {
    mats = list("metal" = 10,
                "conductive" = 10,
                "crystal" = 10)}
/obj/machinery/conveyor_switch
    name = "conveyor switch"
    desc = "A conveyor control switch."

perhaps related to https://github.com/OpenDreamProject/OpenDream/issues/512

ZeWaka commented 3 weeks ago

fixed on goon since it was uglycode anyways