Commit 440d512e authored by Yehuda Katz's avatar Yehuda Katz

Updates to the parsing engine

parent 3980dc92
...@@ -5,7 +5,7 @@ function parse( f ) { ...@@ -5,7 +5,7 @@ function parse( f ) {
while ( bm = blockMatch.exec(f) ) { while ( bm = blockMatch.exec(f) ) {
block = bm[1].replace(/^\s*\* ?/mg,"") + "!!!"; block = bm[1].replace(/^\s*\* ?/mg,"") + "!!!";
var ret = { params: [], examples: [], tests: [] }; var ret = { params: [], examples: [], tests: [], options: [] };
while ( m = paramMatch.exec( block ) ) { while ( m = paramMatch.exec( block ) ) {
block = block.replace( paramMatch, "" ); block = block.replace( paramMatch, "" );
...@@ -25,12 +25,11 @@ function parse( f ) { ...@@ -25,12 +25,11 @@ function parse( f ) {
return ret; return ret;
})*/ || 1; })*/ || 1;
if ( n == 'param' || n == 'any' ) { if ( n == 'param' || n == 'option' ) {
var args = v.split(/\s+/); var args = v.split(/\s+/);
v = args.slice( 2, args.length ); v = args.slice( 2, args.length );
v = { type: args[0], name: args[1], desc: v.join(' ') }; v = { type: args[0], name: args[1], desc: v.join(' ') };
if ( n == 'any' ) v.any = 1; n = n + "s";
n = "params";
} else if ( n == 'example' ) { } else if ( n == 'example' ) {
v = { code: v }; v = { code: v };
n = "examples"; n = "examples";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment