Prism Ruby parser
|
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. | |
void | pm_static_literals_free (pm_static_literals_t *literals) |
Free the internal memory associated with the given static literals set. | |
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. | |
A set of static literal nodes that can be checked for duplicates.
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. |
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. |
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. |