We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 62c7300 + 0b9d516 commit 745355fCopy full SHA for 745355f
2 files changed
templates/include/prism/ast.h.erb
@@ -22,7 +22,7 @@
22
*/
23
typedef enum pm_token_type {
24
<%- tokens.each do |token| -%>
25
- /** <%= token.comment %> */
+ /** <%= Prism::Template::Doxygen.verbatim(token.comment) %> */
26
PM_TOKEN_<%= token.name %><%= " = #{token.value}" if token.value %>,
27
28
<%- end -%>
templates/template.rb
@@ -49,6 +49,14 @@ def self.escape(value)
49
end
50
51
52
+ # This module contains methods for escaping characters in Doxygen comments.
53
+ module Doxygen
54
+ # Similar to /verbatim ... /endverbatim but doesn't wrap the result in a code block.
55
+ def self.verbatim(value)
56
+ value.gsub(/[\.*%!`#<>_+-]/, '\\\\\0')
57
+ end
58
59
+
60
# A comment attached to a field or node.
61
class ConfigComment
62
attr_reader :value
0 commit comments