'use strict'; /*@ Ox.doc Generates documentation for annotated JavaScript (source) -> <[o]> Array of doc objects arguments <[o]|u> Arguments (array of doc objects) Present if the type of the item is "function". description Multi-line description with optional markup See Ox.sanitizeHTML for details events <[o]|u> Events (array of doc objects) Present if the item fires any events file File name line Line number name Name of the item properties <[o]|u> Properties (array of doc objects) Present if the type of the item is "event", "function" or "object". section Section in the file source <[o]> Source code (array of tokens) column Column line Line type Type (see Ox.tokenize for a list of types) value Value summary One-line summary usage <[o]> Usage (array of doc objects) Present if the type of the item is "function". tests <[o]> Tests (array of test objects) type Type of the item (file, callback) -> undefined (files, callback) -> undefined source JavaScript source code file JavaScript file files <[s]> Array of javascript files callback Callback function doc <[o]> Array of doc objects # > Ox.doc("//@ My.FOO Magic constant\nMy.FOO = 23;") # [{"name": "Ox.foo", "summary": "Magic constant", "type": "number"}] @*/ Ox.doc = (function() { // fixme: dont require the trailing '@' var re = { item: /^(.+?) <(.+?)> (.+?)$/, multiline: /^\/\*\@.*?\n([\w\W]+)\n.*?\@\*\/$/, script: /\n(\s*