CheeseLord / plaid

PLAtformer In D
MIT License
0 stars 0 forks source link

YAML parser should treat omitted list members or Null node as the empty list #44

Open kronmillerg opened 8 years ago

kronmillerg commented 8 years ago

Our level files contain a lot of platforms with "species: []" (indicating none of the bits are set). It's annoying to have to type this every time we want a platform with none of the bits set. Currently if you omit the species entirely, you get an error; we should change the YAML parser to allow that.

Also, when specifying multiple bits, the convenient way is to use YAML's out-of-line syntax:

species:
    - BOUNCY
    - JUMPTHRU

but there's a pitfall: if you remove all the bits:

species:

then it's not the empty list; it's a Null node, and again you get an error. Since the parser knows it's parsing a list, it should just treat a Null node as the empty list so that this works.