Permalink
Browse files

((1))が[1]になってしまうバグ修正

  • Loading branch information...
1 parent 9e4662a commit 915e08fbe47d6e2789a3e98719d63846bec82b10 @hadashiA committed Nov 24, 2012
Showing with 7 additions and 1 deletion.
  1. +3 −1 lib/parse.js
  2. +4 −0 test/parse.test.js
View
@@ -1,5 +1,6 @@
var Symbol = require('./symbol')
- , Cons = require('./cons');
+ , Cons = require('./cons')
+ , util = require('util');
var StringBuffer = (function() {
var StringBuffer = function(string) {
@@ -166,6 +167,7 @@ var parser = {
return null;
} else if (result.length <= 1
&& !(result[0] instanceof Symbol)
+ && !util.isArray(result[0])
&& (typeof result[0] === 'object')) {
return result[0];
} else {
View
@@ -181,5 +181,9 @@ describe('parse()', function() {
it('should be separate \\t', function() {
expect(parse('(1\t2)')).to.eql([1, 2]);
});
+
+ it('should be nested 1 length list', function() {
+ expect(parse('((1))')).to.eql([[1]]);
+ });
});
});

0 comments on commit 915e08f

Please sign in to comment.