MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / terminator

Function terminator

src/gpre/par.cpp:3300–3335  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3298//
3299
3300static 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

Callers 5

PAR_reservingFunction · 0.85
par_finishFunction · 0.85
par_readyFunction · 0.85
par_start_transactionFunction · 0.85
par_transFunction · 0.85

Calls 1

MSC_matchFunction · 0.85

Tested by

no test coverage detected