lang: add missing includes; misc formatting cleanup
This commit is contained in:
@@ -13,8 +13,8 @@ struct token_parse_result stmt_parse_while(
|
||||
= parser_get_state(ctx, struct expr_parser_state);
|
||||
|
||||
if (state->s_sub_type == EXPR_SUBTYPE_KEYWORD_ARG) {
|
||||
/* keyword messages have a higher precedence than inline conditionals, so
|
||||
* treat this as a statement terminator. */
|
||||
/* keyword messages have a higher precedence than inline
|
||||
* conditionals, so treat this as a statement terminator. */
|
||||
struct token_parse_result result
|
||||
= expr_finalise_and_return(ctx, state);
|
||||
result.r_flags |= PARSE_REPEAT_TOKEN;
|
||||
@@ -30,7 +30,8 @@ struct token_parse_result stmt_parse_while(
|
||||
|
||||
state->s_prev_token = IVY_KW_WHILE;
|
||||
|
||||
if (b_queue_empty(&state->s_operator_stack) && b_queue_empty(&state->s_output_queue)) {
|
||||
if (b_queue_empty(&state->s_operator_stack)
|
||||
&& b_queue_empty(&state->s_output_queue)) {
|
||||
parser_pop_state(ctx, 0);
|
||||
}
|
||||
|
||||
@@ -47,7 +48,8 @@ struct token_parse_result stmt_parse_match(
|
||||
struct expr_parser_state *state
|
||||
= parser_get_state(ctx, struct expr_parser_state);
|
||||
|
||||
if (state->s_prev_component == EXPR_CMP_OPERAND || state->s_prev_component == EXPR_CMP_MSG) {
|
||||
if (state->s_prev_component == EXPR_CMP_OPERAND
|
||||
|| state->s_prev_component == EXPR_CMP_MSG) {
|
||||
/* match statements are operands. */
|
||||
return PARSE_RESULT(IVY_ERR_BAD_SYNTAX, 0);
|
||||
}
|
||||
@@ -61,7 +63,8 @@ struct token_parse_result stmt_parse_match(
|
||||
|
||||
state->s_prev_token = IVY_KW_MATCH;
|
||||
|
||||
if (b_queue_empty(&state->s_operator_stack) && b_queue_empty(&state->s_output_queue)) {
|
||||
if (b_queue_empty(&state->s_operator_stack)
|
||||
&& b_queue_empty(&state->s_output_queue)) {
|
||||
parser_pop_state(ctx, 0);
|
||||
}
|
||||
|
||||
@@ -81,8 +84,8 @@ struct token_parse_result stmt_parse_if(
|
||||
= parser_get_state(ctx, struct expr_parser_state);
|
||||
|
||||
if (state->s_sub_type == EXPR_SUBTYPE_KEYWORD_ARG) {
|
||||
/* keyword messages have a higher precedence than inline conditionals, so
|
||||
* treat this as a statement terminator. */
|
||||
/* keyword messages have a higher precedence than inline
|
||||
* conditionals, so treat this as a statement terminator. */
|
||||
struct token_parse_result result
|
||||
= expr_finalise_and_return(ctx, state);
|
||||
result.r_flags |= PARSE_REPEAT_TOKEN;
|
||||
@@ -98,7 +101,8 @@ struct token_parse_result stmt_parse_if(
|
||||
|
||||
state->s_prev_token = IVY_KW_IF;
|
||||
|
||||
if (b_queue_empty(&state->s_operator_stack) && b_queue_empty(&state->s_output_queue)) {
|
||||
if (b_queue_empty(&state->s_operator_stack)
|
||||
&& b_queue_empty(&state->s_output_queue)) {
|
||||
parser_pop_state(ctx, 0);
|
||||
}
|
||||
|
||||
@@ -142,4 +146,4 @@ struct token_parse_result stmt_parse_end(
|
||||
struct token_parse_result result = expr_finalise_and_return(ctx, state);
|
||||
result.r_flags |= PARSE_REPEAT_TOKEN;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user