Skip to content

Commit

Permalink
fix unquote-splicing of symbols #14
Browse files Browse the repository at this point in the history
  • Loading branch information
jcubic committed May 15, 2019
1 parent 11cd1e7 commit 6a36d6d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
4 changes: 3 additions & 1 deletion dist/lips.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* http://javascript.nwbox.com/ContentLoaded/
* http://javascript.nwbox.com/ContentLoaded/MIT-LICENSE
*
* build: Wed, 15 May 2019 09:30:00 +0000
* build: Wed, 15 May 2019 09:52:55 +0000
*/
(function () {
'use strict';
Expand Down Expand Up @@ -4131,6 +4131,8 @@ function _typeof(obj) {
}

eval_pair.append(value);
} else if (eval_pair instanceof _Symbol) {
return eval_pair;
} else {
eval_pair = new Pair(eval_pair, value);
}
Expand Down
4 changes: 2 additions & 2 deletions dist/lips.min.js

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions spec/lips.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,11 @@ describe('parser', function() {
);
});
});
it('should join symbol', function() {
lips.exec("(let ((x 'foo)) `(a ,@x))").then(result => {
expect(result[0].toString()).toEqual('(a . foo)');
});
});
it('should unquote from double quotation', function() {
var code = `(let ((x '(1 2)))
\`(let ((x '(2 3)))
Expand Down
2 changes: 2 additions & 0 deletions src/lips.js
Original file line number Diff line number Diff line change
Expand Up @@ -2665,6 +2665,8 @@
return nil;
}
eval_pair.append(value);
} else if (eval_pair instanceof Symbol) {
return eval_pair;
} else {
eval_pair = new Pair(
eval_pair,
Expand Down

0 comments on commit 6a36d6d

Please sign in to comment.