Ruby
3.4.0dev (2024-11-05 revision e440268d51fe02b303e3817a7a733a0dac1c5091)
|
A set of static literal nodes that can be checked for duplicates. More...
#include "prism/defines.h"
#include "prism/ast.h"
#include "prism/util/pm_newline_list.h"
#include <assert.h>
#include <stdbool.h>
Go to the source code of this file.
Data Structures | |
struct | pm_node_hash_t |
An internal hash table for a set of nodes. More... | |
struct | pm_static_literals_t |
Certain sets of nodes (hash keys and when clauses) check for duplicate nodes to alert the user of potential issues. More... | |
Functions | |
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. More... | |
void | pm_static_literals_free (pm_static_literals_t *literals) |
Free the internal memory associated with the given static literals set. More... | |
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. More... | |
A set of static literal nodes that can be checked for duplicates.
Definition in file static_literals.h.
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.
buffer | The buffer to write the string to. |
newline_list | The list of newline offsets to use to calculate lines. |
start_line | The line number that the parser starts on. |
encoding_name | The name of the encoding of the source being parsed. |
node | The node to create a string representation of. |
Definition at line 607 of file static_literals.c.
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.
newline_list | The list of newline offsets to use to calculate lines. |
start_line | The line number that the parser starts on. |
literals | The set of static literals to add the node to. |
node | The node to add to the set. |
replace | Whether to replace the previous node if one already exists. |
Definition at line 356 of file static_literals.c.
void pm_static_literals_free | ( | pm_static_literals_t * | literals | ) |
Free the internal memory associated with the given static literals set.
literals | The set of static literals to free. |
Definition at line 462 of file static_literals.c.