use of org.eclipse.n4js.jsdoc.dom.ContentNode in project n4js by eclipse.
the class DocletParser method parseMainDescription.
private Doclet parseMainDescription(JSDocCharScanner scanner) {
Doclet doclet = DomFactory.eINSTANCE.createDoclet();
doclet.setBegin(scanner.offset());
ContentNode description = descriptionParser.parse(scanner, inlineTagDictionary);
if (description != null) {
doclet.getContents().add(description);
}
return doclet;
}
use of org.eclipse.n4js.jsdoc.dom.ContentNode in project n4js by eclipse.
the class LineTagWithFullMemberReferenceTest method test_fullRef_symbolName.
@SuppressWarnings("javadoc")
@Test
public void test_fullRef_symbolName() {
String in = "/** foo." + "\n * @testee n4/model/collections/DataSet.DataSet.#iterator" + "\n */";
AbstractLineTagDefinition tagDef = new LineTagWithFullMemberReference("testee");
DocletParser docletParser = new DocletParser(new TagDictionary<>(Arrays.asList(tagDef)), new TagDictionary<AbstractInlineTagDefinition>());
Doclet doclet = docletParser.parse(in);
LineTag lineTag = doclet.getLineTags().get(0);
EList<ContentNode> contents = lineTag.getValueByKey(LineTagWithFullElementReference.REF).getContents();
FullMemberReference ref = (FullMemberReference) contents.get(0);
assertEquals("n4/model/collections/DataSet", ref.getModuleName());
assertEquals("DataSet", ref.getTypeName());
assertEquals("#iterator", ref.getMemberName());
}
use of org.eclipse.n4js.jsdoc.dom.ContentNode in project n4js by eclipse.
the class StubLineTagWithRegionDefinition method parse.
@Override
public Tag parse(TagTitle title, JSDocCharScanner scanner, DescriptionParser descriptionParser) {
Tag paramTag = createLineTag(title);
scanner.skipWS();
JSDocToken region = InlineTagTokenizer.INSTANCE.nextToken(scanner);
if (region != null) {
addValue(paramTag, REGION, region);
}
// silent ignore no region
scanner.skipWS();
// expect no tags in descritpion
TagDictionary<AbstractInlineTagDefinition> dictionary = new TagDictionary<>();
ContentNode description = descriptionParser.parse(scanner, dictionary);
if (description != null) {
addValue(paramTag, DESCR, description);
}
return paramTag;
}
use of org.eclipse.n4js.jsdoc.dom.ContentNode in project n4js by eclipse.
the class DocletDescriptionParserTest method testDescriptionWithUnknownInlineTag.
@SuppressWarnings("javadoc")
@Test
public void testDescriptionWithUnknownInlineTag() {
String in = "/** This is the description with {@unkonwnInlineTag parsed as text} ..and finish description. \n */";
AbstractInlineTagDefinition inlineTag = new StubInlineTagDefinition("inline");
DocletParser docletParser = new DocletParser(null, new TagDictionary<>(Arrays.asList(inlineTag)));
Doclet doclet = docletParser.parse(in);
EList<ContentNode> contents = doclet.getContents();
Text descr = (Text) contents.get(0);
assertEquals("This is the description with {@unkonwnInlineTag parsed as text} ..and finish description.", descr.getText());
}
use of org.eclipse.n4js.jsdoc.dom.ContentNode in project n4js by eclipse.
the class DefaultLineTagDefinition method parse.
/**
* Parses section content and set it as {@link #CONTENTS}.
*/
@Override
public Tag parse(TagTitle title, JSDocCharScanner scanner, DescriptionParser descriptionParser) {
ContentNode node = descriptionParser.parse(scanner, inlineTags);
Tag tag = createLineTag(title);
if (node != null) {
addValue(tag, CONTENTS, node);
}
return tag;
}
Aggregations