use of com.google.javascript.rhino.NonJSDocComment in project closure-compiler by google.
the class ParserTest method testInlineNonJSDocCommentAttachmentToVar.
@Test
public void testInlineNonJSDocCommentAttachmentToVar() {
isIdeMode = true;
parsingMode = JsDocParsing.INCLUDE_ALL_COMMENTS;
Node letNode = parse("let /* blah */ x = 'a';").getFirstChild();
assertNode(letNode).hasType(Token.LET);
NonJSDocComment nonJSDocComment = letNode.getFirstChild().getNonJSDocComment();
assertThat(nonJSDocComment).isNotNull();
assertThat(nonJSDocComment.isInline()).isTrue();
assertThat(nonJSDocComment.isEndingAsLineComment()).isFalse();
assertThat(nonJSDocComment.getCommentString()).contains("/* blah */");
}
use of com.google.javascript.rhino.NonJSDocComment in project closure-compiler by google.
the class IRFactory method transform.
Node transform(ParseTree tree) {
JSDocInfo info = parseJSDocInfoOnTree(tree);
NonJSDocComment comment = parseNonJSDocCommentAt(tree.getStart(), false);
Node node = transformDispatcher.process(tree);
if (info != null) {
node = maybeInjectCastNode(tree, info, node);
node.setJSDocInfo(info);
}
if (comment != null) {
node.setNonJSDocComment(comment);
}
setSourceInfo(node, tree);
return node;
}
Aggregations