Support for trailing commas.

This commit is contained in:
Stephen Chung
2020-06-16 22:14:46 +08:00
parent dc540755e7
commit 1adf3cc39a
11 changed files with 173 additions and 128 deletions

View File

@@ -10,6 +10,12 @@ fn test_internal_fn() -> Result<(), Box<EvalAltResult>> {
engine.eval::<INT>("fn add_me(a, b) { a+b } add_me(3, 4)")?,
7
);
assert_eq!(
engine.eval::<INT>("fn add_me(a, b,) { a+b } add_me(3, 4,)")?,
7
);
assert_eq!(engine.eval::<INT>("fn bob() { return 4; 5 } bob()")?, 4);
Ok(())