'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.parseHTML 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) length Length of the token offset Offset of the token type Type of the token See Ox.tokenize for list of types summary One-line summary usage <[o]> Usage (array of doc objects) Present if the type of the item is "function". 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": "just some string", "type": "string"}] @*/ Ox.doc = (function() { // fixme: dont require the trailing '@' var re = { item: /^(.+?) <(.+?)> (.+?)$/, multiline: /^\/\*\@.*?\n([\w\W]+)\n.*?\@\*\/$/, script: /\n(\s*