Skip to content

Commit

Permalink
Fix group assignment. Update tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
rottmann committed Nov 10, 2014
1 parent 9ab9e12 commit fc5b07e
Show file tree
Hide file tree
Showing 5 changed files with 510 additions and 203 deletions.
13 changes: 12 additions & 1 deletion lib/parsers/api_param.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,12 @@ function parse(content, source, defaultGroup)
if(matches[10])
matches[10] = matches[10].replace(/\uffff/g, "\n");

// Set group for getGroup function.
var group = matches[1] || defaultGroup || "Parameter";
setGroup(group);

return {
group : matches[1] || defaultGroup || "Parameter",
group : group,
type : matches[2],
size : matches[3],
allowedValues: allowedValues,
Expand All @@ -125,6 +129,13 @@ function getGroup() {
return group;
}

/**
* @todo omg, OO-Style for beginners - change parsers to simple classes.
*/
function setGroup(newGroup) {
group = newGroup;
}

/**
* Exports.
*/
Expand Down
Loading

0 comments on commit fc5b07e

Please sign in to comment.