From 40af71635fc8ef52a2760f69deedc7575fcb7553 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Mon, 14 Mar 2016 18:25:57 -0700 Subject: [PATCH] Add @interface support --- lib/parse.js | 7 ++++++- test/lib/parse.js | 12 ++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/lib/parse.js b/lib/parse.js index f2c2c48..445ad04 100644 --- a/lib/parse.js +++ b/lib/parse.js @@ -79,7 +79,12 @@ var flatteners = { 'instance': function (result) { result.scope = 'instance'; }, - // 'interface' + 'interface': function (result, tag) { + result.interface = true; + if (tag.description) { + result.name = tag.description; + } + }, 'kind': function (result, tag) { result.kind = tag.kind; }, diff --git a/test/lib/parse.js b/test/lib/parse.js index 24bd32d..e36fd53 100644 --- a/test/lib/parse.js +++ b/test/lib/parse.js @@ -254,6 +254,18 @@ test('parse - @instance', function (t) { t.end(); }); +test('parse - @interface', function (t) { + t.deepEqual(evaluate(function () { + /** @interface */ + })[0].interface, true, 'anonymous'); + + t.deepEqual(evaluate(function () { + /** @interface Foo */ + })[0].name, 'Foo', 'named'); + + t.end(); +}); + test('parse - @kind', function (t) { t.equal(evaluate(function () { /** @kind class */