Skip to content

Commit 64a3dd1

Browse files
author
yavuzkoroglu
committed
on 03.07.23 @ 09:55
1 parent 52154fc commit 64a3dd1

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

src/srcmetrics/metrics/sloc.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,8 @@ void event_startElement_sloc(struct srcsax_context* context, ...) {
124124
) {
125125
switch (sloc_state) {
126126
case 2U:
127-
sloc_currentUnit++;
128127
sloc_overall++;
128+
sloc_currentUnit++;
129129
sloc_currentFunction++;
130130
}
131131
} else if (str_eq_const(localname, "directive")) {
@@ -134,6 +134,12 @@ void event_startElement_sloc(struct srcsax_context* context, ...) {
134134
sloc_currentUnit++;
135135
sloc_overall++;
136136
sloc_state = 7U;
137+
break;
138+
case 2U:
139+
sloc_overall++;
140+
sloc_currentUnit++;
141+
sloc_currentFunction++;
142+
sloc_state = 8U;
137143
}
138144
}
139145
}
@@ -152,6 +158,7 @@ void event_endElement_sloc(struct srcsax_context* context, ...) {
152158
va_end(args);
153159

154160
switch (sloc_state) {
161+
case 8U: if (str_eq_const(localname, "directive")) sloc_state = 2U; break;
155162
case 7U: if (str_eq_const(localname, "directive")) sloc_state = 1U; break;
156163
case 6U: if (str_eq_const(localname, "macro")) sloc_state = 2U; break;
157164
case 5U: if (str_eq_const(localname, "macro")) sloc_state = 1U; break;

0 commit comments

Comments
 (0)