Ox.doc: fix regular expressions

This commit is contained in:
rolux 2012-06-02 12:36:48 +02:00
parent ba954cfedf
commit 38ba971dab

View file

@ -83,10 +83,10 @@ Ox.doc <f> Generates documentation for annotated JavaScript
@*/
Ox.doc = (function() {
var re = {
item: /^(.+?) <(.+?)> (.+?)$/,
item: /^(.+?)\s+<(.+?)>\s+(.+?)$/,
multiline: /^\/\*\@.*?\n([\w\W]+)\n.*?\@?\*\/$/,
script: /\n(\s*<script>s*\n[\w\W]+\n\s*<\/script>s*)/g,
signature: /(\(.*?\)) \->(.*)/,
signature: /^(\(.*?\))\s+\->(.*)/,
singleline: /^\/\/@\s*(.*?)\s*$/,
test: /\n(\s*> .+\n.+?)/g,
},
@ -228,6 +228,7 @@ Ox.doc = (function() {
item.tests = item.tests || [];
item.tests.push(parseTest(line));
} else if ((subitem = parseItem(line))) {
item.name == 'Ox.getset' && Ox.print(line, subitem)
if (subitem.signature) {
item.returns = item.returns || [];
item.returns.push(parseNode(node));