/** * Records a marker's description if there is one available and record it in * the current marker. */ private JsDocToken recordDescription(JsDocToken token) { // Find marker's description (if applicable). if (jsdocBuilder.shouldParseDocumentation()) { ExtractionInfo descriptionInfo = extractMultilineTextualBlock(token); token = descriptionInfo.token; } else { token = eatTokensUntilEOL(token); } return token; }
/** * Records a marker's description if there is one available and record it in * the current marker. */ private JsDocToken recordDescription(JsDocToken token) { // Find marker's description (if applicable). if (jsdocBuilder.shouldParseDocumentation()) { ExtractionInfo descriptionInfo = extractMultilineTextualBlock(token); token = descriptionInfo.token; } else { token = eatTokensUntilEOL(token); } return token; }
/** * Parses a {@link JSDocInfo} object. This parsing method reads all tokens * returned by the {@link JsDocTokenStream#getJsDocToken()} method until the * {@link JsDocToken#EOC} is returned. * * @return {@code true} if JSDoc information was correctly parsed, * {@code false} otherwise */ boolean parse() { state = State.SEARCHING_ANNOTATION; skipEOLs(); JsDocToken token = next(); // Always record that we have a comment. if (jsdocBuilder.shouldParseDocumentation()) { ExtractionInfo blockInfo = extractBlockComment(token); token = blockInfo.token; if (!blockInfo.string.isEmpty()) { jsdocBuilder.recordBlockDescription(blockInfo.string); } } else { if (token != JsDocToken.ANNOTATION && token != JsDocToken.EOC) { // Mark that there was a description, but don't bother marking // what it was. jsdocBuilder.recordBlockDescription(""); } } return parseHelperLoop(token, new ArrayList<ExtendedTypeInfo>()); }
/** * Parses a {@link JSDocInfo} object. This parsing method reads all tokens * returned by the {@link JsDocTokenStream#getJsDocToken()} method until the * {@link JsDocToken#EOC} is returned. * * @return {@code true} if JSDoc information was correctly parsed, * {@code false} otherwise */ boolean parse() { state = State.SEARCHING_ANNOTATION; skipEOLs(); JsDocToken token = next(); // Always record that we have a comment. if (jsdocBuilder.shouldParseDocumentation()) { ExtractionInfo blockInfo = extractBlockComment(token); token = blockInfo.token; if (!blockInfo.string.isEmpty()) { jsdocBuilder.recordBlockDescription(blockInfo.string); } } else { if (token != JsDocToken.ANNOTATION && token != JsDocToken.EOC) { // Mark that there was a description, but don't bother marking // what it was. jsdocBuilder.recordBlockDescription(""); } } return parseHelperLoop(token, new ArrayList<ExtendedTypeInfo>()); }
/** * Important comments begin with /*! They are treated as license blocks, but no further JSDoc * parsing is performed */ void parseImportantComment() { state = State.SEARCHING_ANNOTATION; skipEOLs(); JsDocToken token = next(); ExtractionInfo info = extractMultilineComment(token, WhitespaceOption.PRESERVE, false, true); // An extra space is added by the @license annotation // so we need to add one here so they will be identical String license = " " + info.string; if (fileLevelJsDocBuilder != null) { fileLevelJsDocBuilder.addLicense(license); } else if (jsdocBuilder.shouldParseDocumentation()) { jsdocBuilder.recordBlockDescription(license); } else { jsdocBuilder.recordBlockDescription(""); } }
if (jsdocBuilder.shouldParseDocumentation()) { ExtractionInfo authorInfo = extractSingleLineBlock(); String author = authorInfo.string; if (jsdocBuilder.shouldParseDocumentation() && !lookAheadForAnnotation()) { ExtractionInfo fileOverviewInfo = extractMultilineTextualBlock( token, getWhitespaceOption(WhitespaceOption.TRIM), false); if (jsdocBuilder.shouldParseDocumentation() && !isAnnotationNext) { ExtractionInfo descriptionInfo = extractMultilineTextualBlock(token); if (jsdocBuilder.shouldParseDocumentation() && token != JsDocToken.ANNOTATION) { ExtractionInfo paramDescriptionInfo = if (jsdocBuilder.shouldParseDocumentation()) { ExtractionInfo referenceInfo = extractSingleLineBlock(); String reference = referenceInfo.string; if (jsdocBuilder.shouldParseDocumentation() && !isAnnotationNext) { ExtractionInfo returnDescriptionInfo =
if (jsdocBuilder.shouldParseDocumentation()) { ExtractionInfo authorInfo = extractSingleLineBlock(); String author = authorInfo.string; if (jsdocBuilder.shouldParseDocumentation() && !lookAheadForAnnotation()) { ExtractionInfo fileOverviewInfo = extractMultilineTextualBlock( token, getWhitespaceOption(WhitespaceOption.TRIM), false); if (jsdocBuilder.shouldParseDocumentation() && !isAnnotationNext) { ExtractionInfo descriptionInfo = extractMultilineTextualBlock(token); if (jsdocBuilder.shouldParseDocumentation() && token != JsDocToken.ANNOTATION) { ExtractionInfo paramDescriptionInfo = if (jsdocBuilder.shouldParseDocumentation()) { ExtractionInfo referenceInfo = extractSingleLineBlock(); String reference = referenceInfo.string; if (jsdocBuilder.shouldParseDocumentation() && !isAnnotationNext) { ExtractionInfo returnDescriptionInfo =