Ruby 4.1.0dev (2026-03-30 revision 3379c7efbdc34b7936f322a6bc2de4834c8c65fc)
Typedefs | Enumerations | Functions
comments.h File Reference

(3379c7efbdc34b7936f322a6bc2de4834c8c65fc)

Types and functions related to comments found during parsing. More...

#include "prism/compiler/exported.h"
#include "prism/compiler/nodiscard.h"
#include "prism/compiler/nonnull.h"
#include "prism/ast.h"
#include <stddef.h>
Include dependency graph for comments.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef struct pm_comment_t pm_comment_t
 An opaque pointer to a comment found while parsing.
 

Enumerations

enum  pm_comment_type_t { PM_COMMENT_INLINE , PM_COMMENT_EMBDOC }
 This is the type of a comment that we've found while parsing. More...
 

Functions

PRISM_EXPORTED_FUNCTION pm_location_t pm_comment_location (const pm_comment_t *comment) PRISM_NONNULL(1)
 Returns the location associated with the given comment.
 
PRISM_EXPORTED_FUNCTION pm_comment_type_t pm_comment_type (const pm_comment_t *comment) PRISM_NONNULL(1)
 Returns the type associated with the given comment.
 

Detailed Description

Types and functions related to comments found during parsing.

Definition in file comments.h.

Typedef Documentation

◆ pm_comment_t

typedef struct pm_comment_t pm_comment_t

An opaque pointer to a comment found while parsing.

Definition at line 24 of file comments.h.

Enumeration Type Documentation

◆ pm_comment_type_t

This is the type of a comment that we've found while parsing.

Definition at line 18 of file comments.h.

Function Documentation

◆ pm_comment_location()

PRISM_EXPORTED_FUNCTION pm_location_t pm_comment_location ( const pm_comment_t comment)

Returns the location associated with the given comment.

Parameters
commentthe comment whose location we want to get
Returns
the location associated with the given comment

Definition at line 158 of file parser.c.

Referenced by pm_comment_location().

◆ pm_comment_type()

PRISM_EXPORTED_FUNCTION pm_comment_type_t pm_comment_type ( const pm_comment_t comment)

Returns the type associated with the given comment.

Parameters
commentthe comment whose type we want to get
Returns
the type associated with the given comment. This can either be PM_COMMENT_INLINE or PM_COMMENT_EMBDOC.

Definition at line 166 of file parser.c.

Referenced by pm_comment_type().