Repository: eslint/doctrine (js)

Issue:
`@param {string} employees[].name` is parsed incorrectly
This example comes from http://usejsdoc.org/tags-param.html#parameters-with-properties

Expected result:

```
{
  title: "param",
  name: "employees[].name",
  description: undefined,
  type: ...
}
```

Actual result:

```
{
  title: "param",
  name: "employees",
  description: "[].bar",
  type: ...
}
```

Pull request:
Fix: Parsing fix for param with arrays and properties (fixes #111)
@nzakas I am not fully convinced with my approach. Need more set of eyes to evaluate this change.
Still in learning phase when it comes to code for this project.

Patch:
diff --git a/lib/doctrine.js b/lib/doctrine.js
index 5ef5967..01187c2 100644
--- a/lib/doctrine.js
+++ b/lib/doctrine.js
@@ -324,6 +324,10 @@
                     name += scanIdentifier(last);
 
                 }
+                if(source.charCodeAt(index) === 0x5B  /* '[' */ && source.charCodeAt(index + 1) === 0x5D  /* ']' */){
+                    name += advance();
+                    name += advance();
+                }
                 while (source.charCodeAt(index) === 0x2E  /* '.' */ ||
                         source.charCodeAt(index) === 0x23  /* '#' */ ||
                         source.charCodeAt(index) === 0x7E  /* '~' */) {


Test patch:
diff --git a/test/parse.js b/test/parse.js
index 96f8b13..c2311e7 100644
--- a/test/parse.js
+++ b/test/parse.js
@@ -423,6 +423,60 @@ describe('parse', function () {
         });
     });
 
+    it('param with properties with description', function () {
+        var res = doctrine.parse(
+            [
+                "/**",
+                " * @param {String} user.name - hi",
+                "*/"
+            ].join('\n'), { unwrap: true });
+        res.tags.should.have.length(1);
+        res.tags[0].should.have.property('title', 'param');
+        res.tags[0].should.have.property('name', 'user.name');
+        res.tags[0].should.have.property('description', 'hi');
+        res.tags[0].should.have.property('type');
+        res.tags[0].type.should.eql({
+            type: 'NameExpression',
+            name: 'String'
+        });
+    });
+
+    it('param with array properties with description', function () {
+        var res = doctrine.parse(
+            [
+                "/**",
+                " * @param {string} employee[].name - hi",
+                " */"
+            ].join('\n'), { unwrap: true });
+        res.tags.should.have.length(1);
+        res.tags[0].should.have.property('title', 'param');
+        res.tags[0].should.have.property('name', 'employee[].name');
+        res.tags[0].should.have.property('description', 'hi');
+        res.tags[0].should.have.property('type');
+        res.tags[0].type.should.eql({
+            type: 'NameExpression',
+            name: 'string'
+        });
+    });
+
+    it('param with array properties without description', function () {
+        var res = doctrine.parse(
+            [
+                "/**",
+                " * @param {string} employee[].name",
+                " */"
+            ].join('\n'), { unwrap: true });
+        res.tags.should.have.length(1);
+        res.tags[0].should.have.property('title', 'param');
+        res.tags[0].should.have.property('name', 'employee[].name');
+        res.tags[0].should.have.property('description', null);
+        res.tags[0].should.have.property('type');
+        res.tags[0].type.should.eql({
+            type: 'NameExpression',
+            name: 'string'
+        });
+    });
+
     it('arg with properties', function () {
         var res = doctrine.parse(
             [