From 6b12776ed921290837bc483ed5ce460493583761 Mon Sep 17 00:00:00 2001 From: rolux Date: Sat, 26 May 2012 13:02:50 +0200 Subject: [PATCH] update docs, add tests --- source/Ox/js/JavaScript.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/source/Ox/js/JavaScript.js b/source/Ox/js/JavaScript.js index 8bddd034..e781f8c7 100644 --- a/source/Ox/js/JavaScript.js +++ b/source/Ox/js/JavaScript.js @@ -18,11 +18,7 @@ Ox.doc Generates documentation for annotated JavaScript "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 + source Source code summary One-line summary usage <[o]> Usage (array of doc objects) Present if the type of the item is @@ -38,7 +34,6 @@ Ox.doc Generates documentation for annotated JavaScript # > 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 = { @@ -585,6 +580,10 @@ Ox.tokenize Tokenizes JavaScript "string" or "whitespace" value Value of the token source JavaScript source code + > Ox.tokenize('// comment\nvar foo = bar / baz;').length + 14 + > Ox.tokenize('return /foo/g;')[2].value.length + 6 @*/ // FIXME: numbers (hex, exp, etc.) Ox.tokenize = (function() {