summaryrefslogtreecommitdiff
path: root/prism
diff options
context:
space:
mode:
authorKevin Newton <kddnewton@gmail.com>2023-10-31 11:38:06 -0400
committerKevin Newton <kddnewton@gmail.com>2023-11-01 13:10:29 -0400
commitf791db4433dcad178ee77c58c08f9c38e08a452f (patch)
treee62442d3e5b01213da1d2bedce5109dc85d3eb6e /prism
parent1de05631b50140c8510be0bf4413cc8b10fcd74b (diff)
[ruby/prism] Documentation for defines, version, and prettyprint
https://github.com/ruby/prism/commit/e2e29bef2d
Diffstat (limited to 'prism')
-rw-r--r--prism/defines.h2
-rw-r--r--prism/prettyprint.h8
-rw-r--r--prism/templates/src/prettyprint.c.erb4
-rw-r--r--prism/version.h15
4 files changed, 26 insertions, 3 deletions
diff --git a/prism/defines.h b/prism/defines.h
index f697b9e554..457a8502f8 100644
--- a/prism/defines.h
+++ b/prism/defines.h
@@ -1,7 +1,7 @@
#ifndef PRISM_DEFINES_H
#define PRISM_DEFINES_H
-// This file should be included first by any *.h or *.c in prism
+// This file should be included first by any *.h or *.c in prism.
#include <ctype.h>
#include <stdarg.h>
diff --git a/prism/prettyprint.h b/prism/prettyprint.h
index 04596793d4..9ae2397e63 100644
--- a/prism/prettyprint.h
+++ b/prism/prettyprint.h
@@ -9,7 +9,13 @@
#include "prism/parser.h"
#include "prism/util/pm_buffer.h"
-// Pretty-prints the AST represented by the given node to the given buffer.
+/**
+ * Pretty-prints the AST represented by the given node to the given buffer.
+ *
+ * @param output_buffer The buffer to write the pretty-printed AST to.
+ * @param parser The parser that parsed the AST.
+ * @param node The root node of the AST to pretty-print.
+ */
PRISM_EXPORTED_FUNCTION void pm_prettyprint(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm_node_t *node);
#endif
diff --git a/prism/templates/src/prettyprint.c.erb b/prism/templates/src/prettyprint.c.erb
index 2309a86f1f..d5bf196e0b 100644
--- a/prism/templates/src/prettyprint.c.erb
+++ b/prism/templates/src/prettyprint.c.erb
@@ -177,7 +177,9 @@ prettyprint_node(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm
}
}
-// Pretty-prints the AST represented by the given node to the given buffer.
+/**
+ * Pretty-prints the AST represented by the given node to the given buffer.
+ */
PRISM_EXPORTED_FUNCTION void
pm_prettyprint(pm_buffer_t *output_buffer, const pm_parser_t *parser, const pm_node_t *node) {
pm_buffer_t prefix_buffer = { 0 };
diff --git a/prism/version.h b/prism/version.h
index 9a72a1dbdf..25ee409c74 100644
--- a/prism/version.h
+++ b/prism/version.h
@@ -1,4 +1,19 @@
+/**
+ * The major version of the Prism library as an int.
+ */
#define PRISM_VERSION_MAJOR 0
+
+/**
+ * The minor version of the Prism library as an int.
+ */
#define PRISM_VERSION_MINOR 16
+
+/**
+ * The patch version of the Prism library as an int.
+ */
#define PRISM_VERSION_PATCH 0
+
+/**
+ * The version of the Prism library as a constant string.
+ */
#define PRISM_VERSION "0.16.0"