Qouted names keep their quotes.

This commit is contained in:
Michael Mathews 2010-07-10 10:08:08 +01:00
parent 44df2ede7e
commit 6a1a46aeba
6 changed files with 41 additions and 13 deletions

View File

@ -271,8 +271,7 @@
}
if (tagAbout.setsDocletDesc) {
tags[tags.length] = parse_tag.fromText('desc '+tags[i].desc);
print('>>> tag desc is '+tags[i].toSource());
tags[tags.length] = parse_tag.fromText('desc '+tags[i].value);
}
if (tags[i].name === 'name') {

View File

@ -86,9 +86,9 @@
var atoms = [],
cursor = 0;
path = path.replace(/(".+?")/g, function($) {
$ = $.slice(1, -1);
//$ = $.slice(1, -1); // trim quotes?
var token = '@' + atoms.length + '@';
var token = '@{' + atoms.length + '}@';
atoms.push($);
return token;
});
@ -98,16 +98,12 @@
splitAt = path.lastIndexOf(splitOn),
prefix = (splitOn && splitAt !== -1)? path.slice(0, splitAt) : '';
if (splitOn === '#' || splitOn === '~') { prefix = prefix + splitOn; }
if ('#~'.indexOf(splitOn) > -1) { prefix = prefix + splitOn; }
// restore quoted strings back again
for (var i = 0, leni = atoms.length; i < leni; i++) {
prefix = prefix.replace('@'+i+'@', atoms[i]);
shortname = shortname.replace('@'+i+'@', atoms[i]);
// remove quotes from shortnames
///^"(.+)"$/.test(shortname);
//if (RegExp.$1) { shortname = RegExp.$1; }
prefix = prefix.replace('@{'+i+'}@', atoms[i]);
shortname = shortname.replace('@{'+i+'}@', atoms[i]);
}
return [prefix, shortname];

View File

@ -344,4 +344,20 @@
new TagDefinition('version', {
isExported: true
});
/** Syntax: @category <text>
@property {TagDefinition} category
@memberOf module:jsdoc/tagdictionary.tagDefinitions
*/
new TagDefinition('category', {
isExported: true
});
/** Syntax: @deprecated <text>
@property {TagDefinition} deprecated
@memberOf module:jsdoc/tagdictionary.tagDefinitions
*/
new TagDefinition('deprecated', {
isExported: true
});
})();

View File

@ -0,0 +1,17 @@
/**
@namespace
@name chat."#channel"
*/
chat["#channel"] = {};
/**
@property
@type {boolean}
@name chat."#channel".open
*/
chat["#channel"].open = true;
/**
@event chat."#channel"."op:announce-motd"
*/

View File

@ -38,7 +38,7 @@ function Shape(){
/**
* This is an inner method, just used here as an example
* @private
* @method Shape-addReference
* @method Shape~addReference
* @since version 0.5
* @author Sue Smart
*/

View File

@ -34,7 +34,7 @@
it('should have an `name` property set to the last entire quoted segment of that string', function() {
var doclet = doclets[2].toObject();
expect(doclet).to(have_property, 'name');
expect(doclet.name).to(eql, 'and.don\'t.forget#Po!');
expect(doclet.name).to(eql, '"and.don\'t.forget#Po!"');
});
});