| 3298 | // |
| 3299 | |
| 3300 | static bool terminator() |
| 3301 | { |
| 3302 | |
| 3303 | // For C, changed keyword (KW_SEMICOLON) to MSC_match (KW_SEMICOLON) to eat a |
| 3304 | // semicolon if it is present so as to allow it to be there or not be there. |
| 3305 | // Bug#833. mao 6/21/89 |
| 3306 | |
| 3307 | // For C, right brace ("}") must also be a terminator. |
| 3308 | |
| 3309 | // Used reference here because MSC_match() can change tok_leyword. |
| 3310 | kwwords_t& key = gpreGlob.token_global.tok_keyword; |
| 3311 | |
| 3312 | switch (gpreGlob.sw_language) |
| 3313 | { |
| 3314 | case lang_c: |
| 3315 | if (MSC_match(KW_SEMI_COLON) || key == KW_ELSE || key == KW_ON_ERROR || key == KW_R_BRACE) |
| 3316 | { |
| 3317 | return true; |
| 3318 | } |
| 3319 | break; |
| 3320 | case lang_ada: |
| 3321 | if (MSC_match(KW_SEMI_COLON) || key == KW_ELSE || key == KW_ON_ERROR) |
| 3322 | { |
| 3323 | return true; |
| 3324 | } |
| 3325 | break; |
| 3326 | default: |
| 3327 | if (key == KW_SEMI_COLON || key == KW_ELSE || key == KW_ON_ERROR || |
| 3328 | (gpreGlob.sw_language == lang_cobol && key == KW_DOT)) |
| 3329 | { |
| 3330 | return true; |
| 3331 | } |
| 3332 | } |
| 3333 | |
| 3334 | return false; |
| 3335 | } |
| 3336 |
no test coverage detected