Ruby 3.3.6p108 (2024-11-05 revision 75015d4c1f6965b5e85e96fb309f1f2129f933c0)
pm_options_t Struct Reference

The options that can be passed to the parser. More...

#include <options.h>

Data Fields

pm_string_t filepath
 The name of the file that is currently being parsed.
 
int32_t line
 The line within the file that the parse starts on.
 
pm_string_t encoding
 The name of the encoding that the source file is in.
 
size_t scopes_count
 The number of scopes surrounding the code that is being parsed.
 
pm_options_scope_tscopes
 The scopes surrounding the code that is being parsed.
 
bool frozen_string_literal
 Whether or not the frozen string literal option has been set.
 
bool suppress_warnings
 Whether or not we should suppress warnings.
 

Detailed Description

The options that can be passed to the parser.

Definition at line 30 of file options.h.

Field Documentation

◆ encoding

pm_string_t pm_options_t::encoding

The name of the encoding that the source file is in.

Note that this must correspond to a name that can be found with Encoding.find in Ruby.

Definition at line 44 of file options.h.

Referenced by pm_options_encoding_set(), pm_options_free(), pm_options_read(), and pm_parser_init().

◆ filepath

pm_string_t pm_options_t::filepath

The name of the file that is currently being parsed.

Definition at line 32 of file options.h.

Referenced by pm_options_filepath_set(), pm_options_free(), pm_options_read(), and pm_parser_init().

◆ frozen_string_literal

bool pm_options_t::frozen_string_literal

Whether or not the frozen string literal option has been set.

Definition at line 59 of file options.h.

Referenced by pm_options_frozen_string_literal_set(), pm_options_read(), and pm_parser_init().

◆ line

int32_t pm_options_t::line

The line within the file that the parse starts on.

This value is 0-indexed.

Definition at line 38 of file options.h.

Referenced by pm_options_line_set(), pm_options_read(), and pm_parser_init().

◆ scopes

pm_options_scope_t* pm_options_t::scopes

The scopes surrounding the code that is being parsed.

For most parses this will be NULL, but for evals it will be the locals that are in scope surrounding the eval.

Definition at line 56 of file options.h.

Referenced by pm_options_free(), pm_options_read(), pm_options_scope_get(), and pm_options_scopes_init().

◆ scopes_count

size_t pm_options_t::scopes_count

The number of scopes surrounding the code that is being parsed.

Definition at line 49 of file options.h.

Referenced by pm_options_free(), pm_options_scopes_init(), and pm_parser_init().

◆ suppress_warnings

bool pm_options_t::suppress_warnings

Whether or not we should suppress warnings.

This is purposefully negated so that the default is to not suppress warnings, which allows us to still create an options struct with zeroed memory.

Definition at line 66 of file options.h.

Referenced by pm_options_read(), pm_options_suppress_warnings_set(), and pm_parser_init().


The documentation for this struct was generated from the following file: