mirror of
https://github.com/uffejakobsen/acme.git
synced 2025-02-14 21:31:45 +00:00
minor cleanup
git-svn-id: https://svn.code.sf.net/p/acme-crossass/code-0/trunk@143 4df02467-bbd4-4a76-a152-e7ce94205b78
This commit is contained in:
parent
38952534f4
commit
4b81e40c63
27
src/flow.c
27
src/flow.c
@ -135,7 +135,7 @@ void flow_store_while_condition(struct condition *condition)
|
||||
|
||||
|
||||
// check a condition expression
|
||||
static int check_condition(struct condition *condition)
|
||||
static boolean check_condition(struct condition *condition)
|
||||
{
|
||||
struct number intresult;
|
||||
|
||||
@ -189,20 +189,17 @@ void flow_do_while(struct do_while *loop)
|
||||
|
||||
// helper functions for "!if", "!ifdef" and "!ifndef"
|
||||
|
||||
// parse or skip a block. Returns whether block's '}' terminator was missing.
|
||||
// afterwards: GotByte = '}'
|
||||
static int skip_or_parse_block(boolean parse)
|
||||
// parse or skip a block. returns with GotByte as '}'.
|
||||
static void skip_or_parse_block(boolean parse)
|
||||
{
|
||||
if (!parse) {
|
||||
if (parse) {
|
||||
Parse_until_eob_or_eof();
|
||||
// if block isn't correctly terminated, complain and exit
|
||||
if (GotByte != CHAR_EOB)
|
||||
Throw_serious_error(exception_no_right_brace);
|
||||
} else {
|
||||
Input_skip_or_store_block(FALSE);
|
||||
return 0;
|
||||
}
|
||||
// if block was correctly terminated, return FALSE
|
||||
Parse_until_eob_or_eof();
|
||||
// if block isn't correctly terminated, complain and exit
|
||||
if (GotByte != CHAR_EOB)
|
||||
Throw_serious_error(exception_no_right_brace);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@ -210,11 +207,7 @@ static int skip_or_parse_block(boolean parse)
|
||||
void flow_parse_block_else_block(boolean parse_first)
|
||||
{
|
||||
// Parse first block.
|
||||
// If it's not correctly terminated, return immediately (because
|
||||
// in that case, there's no use in checking for an "else" part).
|
||||
if (skip_or_parse_block(parse_first))
|
||||
return;
|
||||
|
||||
skip_or_parse_block(parse_first);
|
||||
// now GotByte = '}'. Check for "else" part.
|
||||
// If end of statement, return immediately.
|
||||
NEXTANDSKIPSPACE();
|
||||
|
Loading…
x
Reference in New Issue
Block a user