atomdoc
Advanced tools
Comparing version 0.3.0 to 0.3.1
(function() { | ||
var ArgumentListItemRegex, Doc, ReturnsRegex, SpecialHeadingDepth, SpecialHeadings, VisibilityRegex, generateBlockquote, generateCode, generateDescription, generateHeading, generateList, generateParagraph, getLinkMatch, isReturnValue, marked, multiplyString, parse, parseArgumentList, parseArgumentsSection, parseEventsSection, parseExamplesSection, parseListItem, parseReturnValues, parseSummaryAndDescription, stopOnSectionBoundaries, _, _ref, | ||
var ArgumentListItemRegex, Doc, ReturnsRegex, SpecialHeadingDepth, SpecialHeadings, VisibilityRegex, generateBlockquote, generateCode, generateDescription, generateHeading, generateList, generateParagraph, getLinkMatch, isArgumentListItem, isReturnValue, marked, multiplyString, parse, parseArgumentList, parseArgumentsSection, parseEventsSection, parseExamplesSection, parseListItem, parseReturnValues, parseSummaryAndDescription, stopOnSectionBoundaries, _, _ref, | ||
__indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; | ||
@@ -221,3 +221,3 @@ | ||
parseArgumentList = function(tokens) { | ||
var args, argument, argumentStack, argumentsList, argumentsListStack, depth, token; | ||
var args, argument, argumentStack, argumentsList, argumentsListStack, depth, foundListStart, parseAsArgumentList, token, _i, _len, _ref1; | ||
depth = 0; | ||
@@ -233,8 +233,28 @@ args = []; | ||
case 'list_start': | ||
depth++; | ||
if (argumentsList != null) { | ||
argumentsListStack.push(argumentsList); | ||
foundListStart = false; | ||
parseAsArgumentList = false; | ||
for (_i = 0, _len = tokens.length; _i < _len; _i++) { | ||
token = tokens[_i]; | ||
if ((_ref1 = token.type) === 'list_item_start' || _ref1 === 'loose_item_start') { | ||
foundListStart = true; | ||
} else if (token.type === 'text' && foundListStart) { | ||
parseAsArgumentList = isArgumentListItem(token.text); | ||
break; | ||
} | ||
} | ||
argumentsList = []; | ||
tokens.shift(); | ||
if (parseAsArgumentList) { | ||
depth++; | ||
if (argumentsList != null) { | ||
argumentsListStack.push(argumentsList); | ||
} | ||
argumentsList = []; | ||
tokens.shift(); | ||
} else if (argument != null) { | ||
if (argument != null) { | ||
if (argument.text == null) { | ||
argument.text = []; | ||
} | ||
} | ||
argument.text.push('\n' + generateList(tokens)); | ||
} | ||
break; | ||
@@ -265,3 +285,3 @@ case 'list_item_start': | ||
if (argument != null) { | ||
_.extend(argument, parseListItem(argument.text.join(' '))); | ||
_.extend(argument, parseListItem(argument.text.join(' ').replace(new RegExp(' \n', 'g'), '\n'))); | ||
argumentsList.push(argument); | ||
@@ -325,2 +345,6 @@ delete argument.text; | ||
isArgumentListItem = function(string) { | ||
return new RegExp(ArgumentListItemRegex).test(string); | ||
}; | ||
stopOnSectionBoundaries = function(token, tokens) { | ||
@@ -327,0 +351,0 @@ var listToken, _i, _len, _ref1, _ref2; |
{ | ||
"name": "atomdoc", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"description": "A atomdoc parser", | ||
@@ -5,0 +5,0 @@ "main": "./lib/atomdoc.js", |
22419
515