mirror of
https://github.com/ChaiScript/ChaiScript.git
synced 2025-12-06 08:46:53 +08:00
fix handling of $ in strings ChaiScript#553
This commit is contained in:
parent
55ec76fd39
commit
a4fd5371bd
@ -1369,6 +1369,10 @@ namespace chaiscript
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (cparser.saw_interpolation_marker) {
|
||||||
|
match.push_back('$');
|
||||||
|
}
|
||||||
|
|
||||||
return cparser.is_interpolated;
|
return cparser.is_interpolated;
|
||||||
}();
|
}();
|
||||||
|
|
||||||
|
|||||||
@ -2,3 +2,7 @@ assert_equal("\$ {4 + 5}", "$ {4 + 5}")
|
|||||||
assert_equal("\$9", "$${4+5}")
|
assert_equal("\$9", "$${4+5}")
|
||||||
assert_equal("Value: \${4 + 5}", "Value: \${4 + 5}")
|
assert_equal("Value: \${4 + 5}", "Value: \${4 + 5}")
|
||||||
assert_equal("Value: \$9", "Value: \$${4 + 5}")
|
assert_equal("Value: \$9", "Value: \$${4 + 5}")
|
||||||
|
assert_equal("\$code\$", "$code$")
|
||||||
|
assert_equal("\$\$", "$$")
|
||||||
|
assert_equal("\$", "$")
|
||||||
|
assert_equal("\${", "\${") // ensure this doesn't fail
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user