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.
1 parent e8c6b49 commit c588996Copy full SHA for c588996
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.escape(token.comment) %> */
26
PM_TOKEN_<%= token.name %><%= " = #{token.value}" if token.value %>,
27
28
<%- end -%>
templates/template.rb
@@ -49,6 +49,13 @@ def self.escape(value)
49
end
50
51
52
+ # This module contains methods for escaping characters in Doxygen comments.
53
+ module Doxygen
54
+ def self.escape(value)
55
+ value.gsub(/[\.*%!`#<>_+-]/, '\\\\\0')
56
+ end
57
58
+
59
# A comment attached to a field or node.
60
class ConfigComment
61
attr_reader :value
0 commit comments