Fix custom syntax with method calls.

This commit is contained in:
Stephen Chung
2021-12-16 22:40:10 +08:00
parent 224aa0ea68
commit 10fa6844c4
4 changed files with 37 additions and 27 deletions

View File

@@ -268,6 +268,7 @@ fn test_custom_syntax_raw2() -> Result<(), Box<EvalAltResult>> {
);
assert_eq!(engine.eval::<INT>("let x = 41; x + #1")?, 42);
assert_eq!(engine.eval::<INT>("#-42.abs()")?, 42);
assert_eq!(engine.eval::<INT>("#42/2")?, 21);
assert_eq!(engine.eval::<INT>("#-1")?, -1);