File tree 2 files changed +18
-2
lines changed
2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -97,7 +97,14 @@ def consume_body_statements
97
97
stmts = [ ]
98
98
brace_level = 1
99
99
loop do
100
- strip_non_statement_data
100
+ # Need to include the @! directive tags for them to be processed
101
+ # along with the body statement content.
102
+ # (At least the @!group directive.)
103
+ directive_tags = capture_directive_tags_hack do
104
+ strip_non_statement_data
105
+ end
106
+ stmts . concat ( directive_tags )
107
+
101
108
start = @index
102
109
line = @line
103
110
consume_until ( /[{};]/ )
@@ -115,6 +122,15 @@ def consume_body_statements
115
122
stmts
116
123
end
117
124
125
+ def capture_directive_tags_hack
126
+ temp = @statements . dup
127
+ yield if block_given?
128
+ stmts = ( @statements - temp )
129
+ stmts . select do |stmt |
130
+ stmt . is_a? ( Comment ) && stmt . source . start_with? ( '@!' )
131
+ end
132
+ end
133
+
118
134
def strip_non_statement_data
119
135
start = @index
120
136
loop do
Original file line number Diff line number Diff line change @@ -130,7 +130,7 @@ def parse(contents)
130
130
parse <<-eof
131
131
void Init_Mask(void)
132
132
{
133
- rb_cExample = rb_define_class("Example", rb_cObject);
133
+ rb_cExample = rb_define_class("Example", rb_cObject);
134
134
135
135
// @!group Foos
136
136
You can’t perform that action at this time.
0 commit comments