kyleoneill / chimerascript

0 stars 0 forks source link

String escape characters #49

Open kyleoneill opened 6 months ago

kyleoneill commented 6 months ago

Need to support escape characters for strings. Escapes are needed so a string can include quotation marks (without ending the string) and parenthesis (without being interpreted as a variable). Escaped strings must

  1. Still be interpreted as a string
  2. Not trigger the behavior of the escaped character (start/end a string, interpret as a variable)
  3. Remove the escape char when rendering or comparing. A string like "\"quote\"" must be equal when compared to some "quote" string

Escapes should look like this - "this is some string with an escaped \" \(quotation mark\)".

kyleoneill commented 6 months ago

Can probably add some pattern matcher to the grammar, like "thing cannot be preceeded by CHAR to match"