adapap / OWScript

Python-like scripting language which transpiles into Overwatch Workshop script rulesets.
MIT License
37 stars 2 forks source link

Add Custom String (Patch 1.42.0.0.63568) #50

Closed MatthewSH closed 4 years ago

MatthewSH commented 4 years ago

This is just a modification to the normal string type.

Currently you can define a string (not string function) with either " or ' and it will be checked against the allowed strings. With the addition of custom strings, I didn't want to remove that all together, but build on top.

So I added a custom string definition across the transpiler and parser to allow for it to be picked up as a valid token.

To skip the normal string check process and define a custom string you just have to add ~ before the string.

The following are valid strings.

~"This is a custom string"
~'This is another custom string'

However, the same strings without the ~ would register as invalid.