Add a couple more in-string eval unit tests to check for proper escaping

This commit is contained in:
Jonathan Turner
2009-09-13 12:53:12 +00:00
parent 0fbb7c44bd
commit 63de0fd33c
3 changed files with 10 additions and 2 deletions

View File

@@ -337,7 +337,7 @@ namespace chaiscript
if (is_interpolated) {
//If we've seen previous interpolation, add on instead of making a new one
TokenPtr plus(new Token("+", Token_Type::Str, filename, -1, -1, -1, -1));
TokenPtr plus(new Token("+", Token_Type::Str, filename, prev_line, prev_col, line, col));
match_stack.push_back(plus);
TokenPtr t(new Token(match, Token_Type::Quoted_String, filename, prev_line, prev_col, line, col));
@@ -437,7 +437,7 @@ namespace chaiscript
}
}
if (is_interpolated) {
TokenPtr plus(new Token("+", Token_Type::Str, filename, -1, -1, -1, -1));
TokenPtr plus(new Token("+", Token_Type::Str, filename, prev_line, prev_col, line, col));
match_stack.push_back(plus);
TokenPtr t(new Token(match, Token_Type::Quoted_String, filename, prev_line, prev_col, line, col));

View File

@@ -0,0 +1,4 @@
print("$ {4 + 5}")
print("$${4+5}")
print("Value: \${4 + 5}")
print("Value: \$${4 + 5}")

View File

@@ -0,0 +1,4 @@
$ {4 + 5}
$9
Value: ${4 + 5}
Value: $9