Skip to content

Commit

Permalink
Updates to the parsing engine
Browse files Browse the repository at this point in the history
  • Loading branch information
wycats committed Oct 27, 2006
1 parent 3980dc9 commit 440d512
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions build/js/parse.js
Expand Up @@ -5,7 +5,7 @@ function parse( f ) {

while ( bm = blockMatch.exec(f) ) {
block = bm[1].replace(/^\s*\* ?/mg,"") + "!!!";
var ret = { params: [], examples: [], tests: [] };
var ret = { params: [], examples: [], tests: [], options: [] };

while ( m = paramMatch.exec( block ) ) {
block = block.replace( paramMatch, "" );
Expand All @@ -25,12 +25,11 @@ function parse( f ) {
return ret;
})*/ || 1;

if ( n == 'param' || n == 'any' ) {
if ( n == 'param' || n == 'option' ) {
var args = v.split(/\s+/);
v = args.slice( 2, args.length );
v = { type: args[0], name: args[1], desc: v.join(' ') };
if ( n == 'any' ) v.any = 1;
n = "params";
n = n + "s";
} else if ( n == 'example' ) {
v = { code: v };
n = "examples";
Expand Down

0 comments on commit 440d512

Please sign in to comment.