
Helps with cases like "\xFFecho" by limiting the number of hex digits that will be parsed to maximum suitable for the char type. This rule differs from the C/C++ standard, but ChaiScript does not offer the same workaround options. Furthermore, without it having hexadecimal sequences longer than can fit into the char type is undefined behavior anyway.
8 lines
149 B
ChaiScript
8 lines
149 B
ChaiScript
|
|
assert_equal("\x39", "9")
|
|
assert_equal("\x39ec", "9ec")
|
|
assert_equal("\x39g", "9g")
|
|
assert_equal("b\x39g", "b9g")
|
|
assert_equal("\x39\x38g", "98g")
|
|
|