Skip to main content

pm_parser_comments_first

Function pm_parser_comments_first 

Source
pub unsafe extern "C" fn pm_parser_comments_first(
    parser: *const pm_parser_t,
) -> *const pm_comment_t
Expand description

Returns the first comment associated with the given parser. Iterate over the rest with pm_comment_next, as in:

for (const pm_comment_t *comment = pm_parser_comments_first(parser); comment != NULL; comment = pm_comment_next(comment)) {
    pm_location_t location = pm_comment_location(comment);
}

@param parser the parser whose comments we want to iterate over @returns the first comment, or NULL if there are no comments