diff options
Diffstat (limited to 'prism/static_literals.h')
-rw-r--r-- | prism/static_literals.h | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/prism/static_literals.h b/prism/static_literals.h index dd1f2e7f84..bd29761899 100644 --- a/prism/static_literals.h +++ b/prism/static_literals.h @@ -8,8 +8,7 @@ #include "prism/defines.h" #include "prism/ast.h" -#include "prism/node.h" -#include "prism/parser.h" +#include "prism/util/pm_newline_list.h" #include <assert.h> #include <stdbool.h> @@ -92,12 +91,14 @@ typedef struct { /** * Add a node to the set of static literals. * - * @param parser The parser that created the node. + * @param newline_list The list of newline offsets to use to calculate lines. + * @param start_line The line number that the parser starts on. * @param literals The set of static literals to add the node to. * @param node The node to add to the set. + * @param replace Whether to replace the previous node if one already exists. * @return A pointer to the node that is being overwritten, if there is one. */ -pm_node_t * pm_static_literals_add(const pm_parser_t *parser, pm_static_literals_t *literals, pm_node_t *node); +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); /** * Free the internal memory associated with the given static literals set. @@ -110,9 +111,11 @@ void pm_static_literals_free(pm_static_literals_t *literals); * Create a string-based representation of the given static literal. * * @param buffer The buffer to write the string to. - * @param parser The parser that created the node. + * @param newline_list The list of newline offsets to use to calculate lines. + * @param start_line The line number that the parser starts on. + * @param encoding_name The name of the encoding of the source being parsed. * @param node The node to create a string representation of. */ -PRISM_EXPORTED_FUNCTION void pm_static_literal_inspect(pm_buffer_t *buffer, const pm_parser_t *parser, const pm_node_t *node); +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); #endif |