Skip to content

Commit 4255e6f

Browse files
author
yavuzkoroglu
committed
on 03.07.23 @ 10:04
1 parent 64a3dd1 commit 4255e6f

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

src/srcmetrics/metrics/sloc.c

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,9 @@ void event_startElement_sloc(struct srcsax_context* context, ...) {
8989
str_eq_const(localname, "decl_stmt") ||
9090
str_eq_const(localname, "return") ||
9191
str_eq_const(localname, "break") ||
92-
str_eq_const(localname, "continue")
92+
str_eq_const(localname, "continue") ||
93+
str_eq_const(localname, "label") ||
94+
str_eq_const(localname, "goto")
9395
) {
9496
switch (sloc_state) {
9597
case 1U:
@@ -120,7 +122,10 @@ void event_startElement_sloc(struct srcsax_context* context, ...) {
120122
str_eq_const(localname, "for") ||
121123
str_eq_const(localname, "while") ||
122124
str_eq_const(localname, "switch") ||
123-
str_eq_const(localname, "if_stmt")
125+
str_eq_const(localname, "if_stmt") ||
126+
str_eq_const(localname, "typedef") ||
127+
str_eq_const(localname, "struct") ||
128+
str_eq_const(localname, "union")
124129
) {
125130
switch (sloc_state) {
126131
case 2U:
@@ -167,13 +172,15 @@ void event_endElement_sloc(struct srcsax_context* context, ...) {
167172
str_eq_const(localname, "decl_stmt") ||
168173
str_eq_const(localname, "return") ||
169174
str_eq_const(localname, "break") ||
170-
str_eq_const(localname, "continue")
175+
str_eq_const(localname, "continue") ||
176+
str_eq_const(localname, "label") ||
177+
str_eq_const(localname, "goto")
171178
) sloc_state = 2U; break;
172179
case 3U: if (
173180
str_eq_const(localname, "expr_stmt") ||
174181
str_eq_const(localname, "decl_stmt") ||
175182
str_eq_const(localname, "return")
176-
) sloc_state = 1U; break;
183+
) sloc_state = 1U;
177184
}
178185

179186
unless (str_eq_const(localname, "function")) return;

0 commit comments

Comments
 (0)