Repository navigation
Add Doxygen \memberof annotations
#3027
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -53,6 +53,7 @@ PRISM_EXPORTED_FUNCTION const char * pm_version(void); | |
| * @param source The source to parse. | ||
| * @param size The size of the source. | ||
| * @param options The optional options to use when parsing. | ||
| * \public \memberof pm_parser | ||
| */ | ||
| PRISM_EXPORTED_FUNCTION void pm_parser_init(pm_parser_t *parser, const uint8_t *source, size_t size, const pm_options_t *options); | ||
|
|
||
|
|
@@ -62,13 +63,15 @@ PRISM_EXPORTED_FUNCTION void pm_parser_init(pm_parser_t *parser, const uint8_t * | |
| * | ||
| * @param parser The parser to register the callback with. | ||
| * @param callback The callback to register. | ||
| * \public \memberof pm_parser | ||
| */ | ||
| PRISM_EXPORTED_FUNCTION void pm_parser_register_encoding_changed_callback(pm_parser_t *parser, pm_encoding_changed_callback_t callback); | ||
|
|
||
| /** | ||
| * Free any memory associated with the given parser. | ||
| * | ||
| * @param parser The parser to free. | ||
| * \public \memberof pm_parser | ||
| */ | ||
| PRISM_EXPORTED_FUNCTION void pm_parser_free(pm_parser_t *parser); | ||
|
|
||
|
|
@@ -77,13 +80,15 @@ PRISM_EXPORTED_FUNCTION void pm_parser_free(pm_parser_t *parser); | |
| * | ||
| * @param parser The parser to use. | ||
| * @return The AST representing the source. | ||
| * \public \memberof pm_parser | ||
| */ | ||
| PRISM_EXPORTED_FUNCTION pm_node_t * pm_parse(pm_parser_t *parser); | ||
|
|
||
| /** | ||
| * This function is used in pm_parse_stream to retrieve a line of input from a | ||
| * This function is used in pm_parse_stream() to retrieve a line of input from a | ||
| * stream. It closely mirrors that of fgets so that fgets can be used as the | ||
| * default implementation. | ||
| * \public \memberof pm_parser | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This shouldn't be marked as a member of parser, as it's a user-defined callback that does not correspond to a parser.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you use |
||
| */ | ||
| typedef char * (pm_parse_stream_fgets_t)(char *string, int size, void *stream); | ||
|
|
||
|
|
@@ -96,6 +101,7 @@ typedef char * (pm_parse_stream_fgets_t)(char *string, int size, void *stream); | |
| * @param fgets The function to use to read from the stream. | ||
| * @param options The optional options to use when parsing. | ||
| * @return The AST representing the source. | ||
| * \public \memberof pm_parser | ||
| */ | ||
| PRISM_EXPORTED_FUNCTION pm_node_t * pm_parse_stream(pm_parser_t *parser, pm_buffer_t *buffer, void *stream, pm_parse_stream_fgets_t *fgets, const pm_options_t *options); | ||
|
|
||
|
|
@@ -112,6 +118,7 @@ PRISM_EXPORTED_FUNCTION pm_node_t * pm_parse_stream(pm_parser_t *parser, pm_buff | |
| * @param stream The stream to parse. | ||
| * @param fgets The function to use to read from the stream. | ||
| * @param data The optional data to pass to the parser. | ||
| * \public \relatedalso pm_buffer_t | ||
| */ | ||
| PRISM_EXPORTED_FUNCTION void pm_serialize_parse_stream(pm_buffer_t *buffer, void *stream, pm_parse_stream_fgets_t *fgets, const char *data); | ||
|
|
||
|
|
@@ -121,6 +128,7 @@ PRISM_EXPORTED_FUNCTION void pm_serialize_parse_stream(pm_buffer_t *buffer, void | |
| * @param parser The parser to serialize. | ||
| * @param list The list of comments to serialize. | ||
| * @param buffer The buffer to serialize to. | ||
| * \public \memberof pm_buffer_t | ||
| */ | ||
| void pm_serialize_comment_list(pm_parser_t *parser, pm_list_t *list, pm_buffer_t *buffer); | ||
|
|
||
|
|
@@ -129,6 +137,7 @@ void pm_serialize_comment_list(pm_parser_t *parser, pm_list_t *list, pm_buffer_t | |
| * | ||
| * @param encoding The encoding to serialize. | ||
| * @param buffer The buffer to serialize to. | ||
| * \public \memberof pm_buffer_t | ||
| */ | ||
| void pm_serialize_encoding(const pm_encoding_t *encoding, pm_buffer_t *buffer); | ||
|
|
||
|
|
@@ -138,6 +147,7 @@ void pm_serialize_encoding(const pm_encoding_t *encoding, pm_buffer_t *buffer); | |
| * @param parser The parser to serialize. | ||
| * @param node The node to serialize. | ||
| * @param buffer The buffer to serialize to. | ||
| * \public \memberof pm_buffer_t | ||
| */ | ||
| void pm_serialize_content(pm_parser_t *parser, pm_node_t *node, pm_buffer_t *buffer); | ||
|
|
||
|
|
@@ -147,6 +157,7 @@ void pm_serialize_content(pm_parser_t *parser, pm_node_t *node, pm_buffer_t *buf | |
| * @param parser The parser to serialize. | ||
| * @param node The node to serialize. | ||
| * @param buffer The buffer to serialize to. | ||
| * \public \memberof pm_node | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why are we pointing to |
||
| */ | ||
| PRISM_EXPORTED_FUNCTION void pm_serialize(pm_parser_t *parser, pm_node_t *node, pm_buffer_t *buffer); | ||
|
|
||
|
|
@@ -157,6 +168,7 @@ PRISM_EXPORTED_FUNCTION void pm_serialize(pm_parser_t *parser, pm_node_t *node, | |
| * @param source The source to parse. | ||
| * @param size The size of the source. | ||
| * @param data The optional data to pass to the parser. | ||
| * \public \memberof pm_buffer_t | ||
| */ | ||
| PRISM_EXPORTED_FUNCTION void pm_serialize_parse(pm_buffer_t *buffer, const uint8_t *source, size_t size, const char *data); | ||
|
|
||
|
|
@@ -167,6 +179,7 @@ PRISM_EXPORTED_FUNCTION void pm_serialize_parse(pm_buffer_t *buffer, const uint8 | |
| * @param source The source to parse. | ||
| * @param size The size of the source. | ||
| * @param data The optional data to pass to the parser. | ||
| * \public \relatedalso pm_buffer_t | ||
| */ | ||
| PRISM_EXPORTED_FUNCTION void pm_serialize_parse_comments(pm_buffer_t *buffer, const uint8_t *source, size_t size, const char *data); | ||
|
|
||
|
|
@@ -177,6 +190,7 @@ PRISM_EXPORTED_FUNCTION void pm_serialize_parse_comments(pm_buffer_t *buffer, co | |
| * @param size The size of the source. | ||
| * @param buffer The buffer to serialize to. | ||
| * @param data The optional data to pass to the lexer. | ||
| * \public \relatedalso pm_buffer_t | ||
| */ | ||
| PRISM_EXPORTED_FUNCTION void pm_serialize_lex(pm_buffer_t *buffer, const uint8_t *source, size_t size, const char *data); | ||
|
|
||
|
|
@@ -188,6 +202,7 @@ PRISM_EXPORTED_FUNCTION void pm_serialize_lex(pm_buffer_t *buffer, const uint8_t | |
| * @param source The source to parse. | ||
| * @param size The size of the source. | ||
| * @param data The optional data to pass to the parser. | ||
| * \public \relatedalso pm_buffer_t | ||
| */ | ||
| PRISM_EXPORTED_FUNCTION void pm_serialize_parse_lex(pm_buffer_t *buffer, const uint8_t *source, size_t size, const char *data); | ||
|
|
||
|
|
@@ -200,6 +215,7 @@ PRISM_EXPORTED_FUNCTION void pm_serialize_parse_lex(pm_buffer_t *buffer, const u | |
| * @param size The size of the source. | ||
| * @param data The optional data to pass to the parser. | ||
| * @return True if the source parses without errors or warnings. | ||
| * \public \memberof pm_parser | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same question about |
||
| */ | ||
| PRISM_EXPORTED_FUNCTION bool pm_parse_success_p(const uint8_t *source, size_t size, const char *data); | ||
|
|
||
|
|
@@ -229,6 +245,7 @@ const char * pm_token_type_human(pm_token_type_t token_type); | |
| * @param buffer The buffer to serialize to. | ||
| * @param parser The parser that parsed the node. | ||
| * @param node The node to serialize. | ||
| * \public \memberof pm_node | ||
| */ | ||
| PRISM_EXPORTED_FUNCTION void pm_dump_json(pm_buffer_t *buffer, const pm_parser_t *parser, const pm_node_t *node); | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,6 +13,7 @@ | |
| /** | ||
| * Loop through each node in the node list, writing each node to the given | ||
| * pm_node_t pointer. | ||
| * \public \related pm_node_list | ||
| */ | ||
| #define PM_NODE_LIST_FOREACH(list, index, node) \ | ||
| for (size_t index = 0; index < (list)->size && ((node) = (list)->nodes[index]); index++) | ||
|
|
@@ -22,6 +23,7 @@ | |
| * | ||
| * @param list The list to append to. | ||
| * @param node The node to append. | ||
| * \private \memberof pm_node_list | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why are this one and the following ones private? |
||
| */ | ||
| void pm_node_list_append(pm_node_list_t *list, pm_node_t *node); | ||
|
|
||
|
|
@@ -30,6 +32,7 @@ void pm_node_list_append(pm_node_list_t *list, pm_node_t *node); | |
| * | ||
| * @param list The list to prepend to. | ||
| * @param node The node to prepend. | ||
| * \private \memberof pm_node_list | ||
| */ | ||
| void pm_node_list_prepend(pm_node_list_t *list, pm_node_t *node); | ||
|
|
||
|
|
@@ -38,13 +41,15 @@ void pm_node_list_prepend(pm_node_list_t *list, pm_node_t *node); | |
| * | ||
| * @param list The list to concatenate onto. | ||
| * @param other The list to concatenate. | ||
| * \private \memberof pm_node_list | ||
| */ | ||
| void pm_node_list_concat(pm_node_list_t *list, pm_node_list_t *other); | ||
|
|
||
| /** | ||
| * Free the internal memory associated with the given node list. | ||
| * | ||
| * @param list The list to free. | ||
| * \private \memberof pm_node_list | ||
| */ | ||
| void pm_node_list_free(pm_node_list_t *list); | ||
|
|
||
|
|
@@ -53,6 +58,7 @@ void pm_node_list_free(pm_node_list_t *list); | |
| * | ||
| * @param parser The parser that owns the node. | ||
| * @param node The node to deallocate. | ||
| * \public \memberof pm_parser | ||
| */ | ||
| PRISM_EXPORTED_FUNCTION void pm_node_destroy(pm_parser_t *parser, struct pm_node *node); | ||
|
|
||
|
|
@@ -61,6 +67,7 @@ PRISM_EXPORTED_FUNCTION void pm_node_destroy(pm_parser_t *parser, struct pm_node | |
| * | ||
| * @param node_type The node type to convert to a string. | ||
| * @return A string representation of the given node type. | ||
| * \public \memberof pm_node | ||
| */ | ||
| PRISM_EXPORTED_FUNCTION const char * pm_node_type_to_str(pm_node_type_t node_type); | ||
|
|
||
|
|
@@ -112,6 +119,7 @@ PRISM_EXPORTED_FUNCTION const char * pm_node_type_to_str(pm_node_type_t node_typ | |
| * @param node The root node to start visiting from. | ||
| * @param visitor The callback to call for each node in the subtree. | ||
| * @param data An opaque pointer that is passed to the visitor callback. | ||
| * \public \related pm_node | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| */ | ||
| PRISM_EXPORTED_FUNCTION void pm_visit_node(const pm_node_t *node, bool (*visitor)(const pm_node_t *node, void *data), void *data); | ||
|
|
||
|
|
@@ -123,6 +131,7 @@ PRISM_EXPORTED_FUNCTION void pm_visit_node(const pm_node_t *node, bool (*visitor | |
| * @param node The node to visit the children of. | ||
| * @param visitor The callback to call for each child node. | ||
| * @param data An opaque pointer that is passed to the visitor callback. | ||
| * \public \related pm_node | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| */ | ||
| PRISM_EXPORTED_FUNCTION void pm_visit_child_nodes(const pm_node_t *node, bool (*visitor)(const pm_node_t *node, void *data), void *data); | ||
|
|
||
|
|
||

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
()makes this into link to thepm_parse_stream()function that uses this callback.