jakethedev/beatbattlebot

Tokenize input (ala java's scanner) and refactor commands to expect it

Opened this issue · 0 comments

There's certainly a good NPM repo out there for it, but it might be easy to build too? Only required functions, should be easy to find something open source, in-house would be nice too though

  • from(input) returns a tokenizer using input
  • hasNext() true if more tokens exist
  • getNext() returns the next string token or false
  • concatRemaining(separator = ' ') returns a string concatenated by separator
  • arrayRemaining() returns a copy of the remaining tokens