~fd/cane-lang

cca62bf69c78d4aa2425c32dfee6945fb550808c — Ersei Saggi 10 months ago 13a514c
Carriage return escapes
2 files changed, 9 insertions(+), 0 deletions(-)

M README.md
M cane-lang/src/lib.rs
M README.md => README.md +2 -0
@@ 154,7 154,9 @@ Strings begin with a `` ` `` and end with a `'`. See also [special action notati

Strings can be escaped. Currently the following escapes are implemented:
- `\n`: newline
- `\r`: carriage return
- `\'`: single quote
- `\\`: single backslash

Strings can be split into a list inplace: the string will be "exploded". More strings will be returned.


M cane-lang/src/lib.rs => cane-lang/src/lib.rs +7 -0
@@ 778,6 778,13 @@ where
                                .get_data()
                                .get_string()
                                .push_str("\n"),
                            b'r' => self
                                .call_stack
                                .last_mut()
                                .unwrap()
                                .get_data()
                                .get_string()
                                .push_str("\r"),
                            b'\'' => self
                                .call_stack
                                .last_mut()