ainslec / adventuron-issue-tracker

Adventuron Issues Tracker
4 stars 0 forks source link

Request: Allow duplicate top-level keys to make compiling larger projects (from multiple files) easier #494

Open joshgoebel opened 2 years ago

joshgoebel commented 2 years ago

IE, allow:

// the swamp
locations {
  // ...
}
// the castle
locations {
  // ...
}

A pre-compiler might merge these from different files or a user could use them purely for organizing their project in a way that makes more sense to them. We're already venturing into this territory with the newly added on_command_2... with multiple blocks one could just add a second (or third) on_command if that made things easier to organize without needing to explicitly support it with a _2 suffix.

The expected behavior would be that multiple blocks are processed in order and any duplicate IDs would of course raise an error, ie you couldn't have a "foyer" room in both location blocks... IE, all locations are merged into one large location block, in the order they are seen in the input.


Alternatives

A pre-compiler has to learn to lex/parse Rion and do this merging itself.