TriggerReactor

TriggerReactor

24.6k Downloads

Automatic Placeholder conversion in String

wysohn opened this issue ยท 3 comments

commented

For example, "force $playername 5" will be automatically translate into "force "+$playername+" 5" by the lexer.

commented

This is impossible due to the nature of how the string is processed.

in string, it's hard to tell the end of placeholder as there is no indication of what would end character or normal character. If we decide to add the specific end character to denote the end of placeholder, it conflicts with the very first reason why we need this: newcomers put placeholder inside the string, not put it outside and append it to the string.

commented

This might be possible

commented

Rules

  • starts with $ and end when reaches end of string or a white space
    • "my name is $playername" "hey $playername !"
  • starts with ${ and ends with }
    • "hey ${playername}!"
    • Exception if not closed with }