Ruby  3.4.0dev (2024-11-05 revision e440268d51fe02b303e3817a7a733a0dac1c5091)
static_literals.h
Go to the documentation of this file.
1 
6 #ifndef PRISM_STATIC_LITERALS_H
7 #define PRISM_STATIC_LITERALS_H
8 
9 #include "prism/defines.h"
10 #include "prism/ast.h"
12 
13 #include <assert.h>
14 #include <stdbool.h>
15 
19 typedef struct {
22 
24  uint32_t size;
25 
27  uint32_t capacity;
29 
38 typedef struct {
43 
48 
53 
58 
63 
68 
73 
78 
83 
90 
101 pm_node_t * pm_static_literals_add(const pm_newline_list_t *newline_list, int32_t start_line, pm_static_literals_t *literals, pm_node_t *node, bool replace);
102 
109 
119 void pm_static_literal_inspect(pm_buffer_t *buffer, const pm_newline_list_t *newline_list, int32_t start_line, const char *encoding_name, const pm_node_t *node);
120 
121 #endif
The abstract syntax tree.
A list of byte offsets of newlines in a string.
Macro definitions used throughout the prism library.
void pm_static_literal_inspect(pm_buffer_t *buffer, const pm_newline_list_t *newline_list, int32_t start_line, const char *encoding_name, const pm_node_t *node)
Create a string-based representation of the given static literal.
pm_node_t * pm_static_literals_add(const pm_newline_list_t *newline_list, int32_t start_line, pm_static_literals_t *literals, pm_node_t *node, bool replace)
Add a node to the set of static literals.
void pm_static_literals_free(pm_static_literals_t *literals)
Free the internal memory associated with the given static literals set.
C99 shim for <stdbool.h>
A pm_buffer_t is a simple memory buffer that stores data in a contiguous block of memory.
Definition: pm_buffer.h:22
A list of offsets of newlines in a string.
An internal hash table for a set of nodes.
pm_node_t ** nodes
The array of nodes in the hash table.
uint32_t size
The size of the hash table.
uint32_t capacity
The space that has been allocated in the hash table.
This is the base structure that represents a node in the syntax tree.
Definition: ast.h:1069
Certain sets of nodes (hash keys and when clauses) check for duplicate nodes to alert the user of pot...
pm_node_hash_t string_nodes
This is the set of StringNode and SourceFileNode instances.
pm_node_t * false_node
A pointer to the last FalseNode instance that was inserted, or NULL.
pm_node_hash_t regexp_nodes
This is the set of RegularExpressionNode instances.
pm_node_t * source_encoding_node
A pointer to the last SourceEncodingNode instance that was inserted, or NULL.
pm_node_t * nil_node
A pointer to the last NilNode instance that was inserted, or NULL.
pm_node_hash_t number_nodes
This is the set of RationalNode and ImaginaryNode instances.
pm_node_t * true_node
A pointer to the last TrueNode instance that was inserted, or NULL.
pm_node_hash_t symbol_nodes
This is the set of SymbolNode instances.
pm_node_hash_t float_nodes
This is the set of FloatNode instances.
pm_node_hash_t integer_nodes
This is the set of IntegerNode and SourceLineNode instances.