cknave/kevedit

#play testing expects a space

Closed this issue · 2 comments

ZZT will allow the use of the #play command without a space afterwards provided the following character is non-alphanumeric

#play abcd <- valid
#playabcd <- invalid
#play+abcd <- valid!

KevEdit's music testing functionality (quite reasonably) expects there to be a space, and will ignore lines like #play+abcd when scanning for music.

This can be observed on the title screen for Nevada Bob:
https://museumofzzt.com/file/n/NVBOB1.ZIP?file=NVBOB1.ZZT#48,10

ZZT works this way because of the routine it uses to read words (and commands are considered words in this regard)

There are two rules:

  • A word cannot start with a number
  • A word can only contain A-Z, 0-9, : and _.

As long as the word that it reads is PLAY, it should work. Therefore, even - in place of the space we would expect should work.

Implementation in Roton (ReadWord):
https://github.com/SaxxonPike/roton/blob/dbf95b3e5d266d6c8e574a12b2adc62ab1f8855b/Source/Roton/Emulation/Core/Impl/Parser.cs#L140

Thanks @DrDos0016 and @SaxxonPike! Fixed in 3a548ef