StanzaOrg / lbstanza-old

L.B. Stanza Programming Language
Other
216 stars 23 forks source link

Add additional escapes in string literals #165

Closed m-hilgendorf closed 2 years ago

m-hilgendorf commented 2 years ago

This PR adds support for ANSI escape chars and the null character in string literals, and updates the writer implementation for strings.

Example :

defpackage program : 
  import core
  import collections

val string = "\a\b\e\f\n\r\t\v\"\'\0\\"
println("%@" % [string])

Running this code prints :

stanza> reload
'\a' '\b' '\e' '\f' '\n' '\r' '\t' '\v' '\"' '\'' '\0' '\\'