Files
ivy/lang/ast/block.h

27 lines
713 B
C
Raw Permalink Normal View History

#ifndef _AST_BLOCK_H_
#define _AST_BLOCK_H_
#include "ctx.h"
#define BLOCK_TERMINATOR_MAX 8
struct block_parser_state {
struct parser_state s_base;
bool s_single_expr;
/* the block will be terminated when any token in this list
* is encountered. the token that terminated the block will
* not be consumed. */
unsigned short s_terminators[BLOCK_TERMINATOR_MAX];
unsigned short s_nr_terminators;
};
extern void block_add_terminator(
struct block_parser_state *state, unsigned short tok);
extern void block_copy_terminators(
const struct block_parser_state *src, struct block_parser_state *dest);
extern bool block_terminates_at_token(
struct block_parser_state *state, unsigned short tok);
#endif