Skip to content

Commit 0f10178

Browse files
committed
Add links to code refs in docs
1 parent acc0b79 commit 0f10178

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

include/prism.h

+12-12
Original file line numberDiff line numberDiff line change
@@ -259,11 +259,11 @@ PRISM_EXPORTED_FUNCTION void pm_dump_json(pm_buffer_t *buffer, const pm_parser_t
259259
* In order to parse Ruby code, the structures and functions that you're going
260260
* to want to use and be aware of are:
261261
*
262-
* * `pm_parser_t` - the main parser structure
263-
* * `pm_parser_init` - initialize a parser
264-
* * `pm_parse` - parse and return the root node
265-
* * `pm_node_destroy` - deallocate the root node returned by `pm_parse`
266-
* * `pm_parser_free` - free the internal memory of the parser
262+
* * <code>#pm_parser_t</code> - the main parser structure
263+
* * `pm_parser_init()` - initialize a parser
264+
* * `pm_parse()` - parse and return the root node
265+
* * `pm_node_destroy()` - deallocate the root node returned by `pm_parse()`
266+
* * `pm_parser_free()` - free the internal memory of the parser
267267
*
268268
* Putting all of this together would look something like:
269269
*
@@ -280,9 +280,9 @@ PRISM_EXPORTED_FUNCTION void pm_dump_json(pm_buffer_t *buffer, const pm_parser_t
280280
* }
281281
* ```
282282
*
283-
* All of the nodes "inherit" from `pm_node_t` by embedding those structures as
283+
* All of the nodes "inherit" from <code>#pm_parser_t</code> by embedding those structures as
284284
* their first member. This means you can downcast and upcast any node in the
285-
* tree to a `pm_node_t`.
285+
* tree to a \ref pm_parser_t "<code>pm_parser_t *</code>".
286286
*
287287
* @section serializing Serializing
288288
*
@@ -292,10 +292,10 @@ PRISM_EXPORTED_FUNCTION void pm_dump_json(pm_buffer_t *buffer, const pm_parser_t
292292
* parse Ruby code. The structures and functions that you're going to want to
293293
* use and be aware of are:
294294
*
295-
* * `pm_buffer_t` - a small buffer object that will hold the serialized AST
296-
* * `pm_buffer_free` - free the memory associated with the buffer
297-
* * `pm_serialize` - serialize the AST into a buffer
298-
* * `pm_serialize_parse` - parse and serialize the AST into a buffer
295+
* * #pm_buffer_t - a small buffer object that will hold the serialized AST
296+
* * #pm_buffer_free() - free the memory associated with the buffer
297+
* * #pm_serialize() - serialize the AST into a buffer
298+
* * #pm_serialize_parse() - parse and serialize the AST into a buffer
299299
*
300300
* Putting all of this together would look something like:
301301
*
@@ -313,7 +313,7 @@ PRISM_EXPORTED_FUNCTION void pm_dump_json(pm_buffer_t *buffer, const pm_parser_t
313313
* @section inspecting Inspecting
314314
*
315315
* Prism provides the ability to inspect the AST by pretty-printing nodes. You
316-
* can do this with the `pm_prettyprint` function, which you would use like:
316+
* can do this with the pm_prettyprint() function, which you would use like:
317317
*
318318
* ```c
319319
* void prettyprint(const uint8_t *source, size_t length) {

include/prism/util/pm_string.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,19 @@ typedef struct {
3434
/** The length of the string in bytes of memory. */
3535
size_t length;
3636

37-
/** The type of the string. This field determines how the string should be freed. */
38-
enum {
37+
/** The type of the string, which determines how the string should be freed. */
38+
enum pm_string_type {
3939
/** This string is a constant string, and should not be freed. */
4040
PM_STRING_CONSTANT,
4141

4242
/** This is a slice of another string, and should not be freed. */
4343
PM_STRING_SHARED,
4444

45-
/** This string owns its memory, and should be freed using `pm_string_free`. */
45+
/** This string owns its memory, and should be freed using \ref pm_string_free "<code>pm_string_free()</code>". */
4646
PM_STRING_OWNED,
4747

4848
#ifdef PRISM_HAS_MMAP
49-
/** This string is a memory-mapped file, and should be freed using `pm_string_free`. */
49+
/** This string is a memory-mapped file, and should be freed using \ref pm_string_free "<code>pm_string_free()</code>". */
5050
PM_STRING_MAPPED
5151
#endif
5252
} type;

0 commit comments

Comments
 (0)