rafaskb/typing-label

Allow users to change {} token characters

rafaskb opened this issue · 1 comments

We could define these characters in TypingConfig and adapt the regex in the Parser class to use these instead of the hardcoded {}.

Heya! I've actually encountered this before, while participating in a libGDX game jam. VisUI has the same open/closing characters for macro's, and it was easier to change yours.

I've isolated my changes as above. I do believe there's room for improvement, an overview:

  • you have to use the method, Parser#setOpenClose(char char), because it forces the Parser to recompile private static variables
  • i've made the variables it changes non final (2 patterns)
  • i've changed the methods that generates the pattern to use static variables in TypingConfig

I included a test, that you can run by uncommenting 3 lines that are specified