Ruby 4.1.0dev (2026-04-06 revision a371a207f1e2ce536ce6d1e68dba3071387a952c)
Typedefs | Functions
magic_comments.h File Reference

(a371a207f1e2ce536ce6d1e68dba3071387a952c)

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

#include "prism/compiler/exported.h"
#include "prism/compiler/nonnull.h"
#include "prism/ast.h"
#include <stddef.h>
Include dependency graph for magic_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_magic_comment_t pm_magic_comment_t
 An opaque pointer to a magic comment found while parsing.
 

Functions

PRISM_EXPORTED_FUNCTION pm_location_t pm_magic_comment_key (const pm_magic_comment_t *magic_comment) PRISM_NONNULL(1)
 Returns the location of the key associated with the given magic comment.
 
PRISM_EXPORTED_FUNCTION pm_location_t pm_magic_comment_value (const pm_magic_comment_t *magic_comment) PRISM_NONNULL(1)
 Returns the location of the value associated with the given magic comment.
 

Detailed Description

Types and functions related to magic comments found during parsing.

Definition in file magic_comments.h.

Typedef Documentation

◆ pm_magic_comment_t

An opaque pointer to a magic comment found while parsing.

Definition at line 17 of file magic_comments.h.

Function Documentation

◆ pm_magic_comment_key()

PRISM_EXPORTED_FUNCTION pm_location_t pm_magic_comment_key ( const pm_magic_comment_t magic_comment)

Returns the location of the key associated with the given magic comment.

Parameters
magic_commentthe magic comment whose key location we want to get
Returns
the location of the key associated with the given magic comment

Returns the location of the key associated with the given magic comment.

Definition at line 196 of file parser.c.

Referenced by pm_magic_comment_key().

◆ pm_magic_comment_value()

PRISM_EXPORTED_FUNCTION pm_location_t pm_magic_comment_value ( const pm_magic_comment_t magic_comment)

Returns the location of the value associated with the given magic comment.

Parameters
magic_commentthe magic comment whose value location we want to get
Returns
the location of the value associated with the given magic comment

Returns the location of the value associated with the given magic comment.

Definition at line 204 of file parser.c.

Referenced by pm_magic_comment_value().