~pixelherodev/zyg

d7fa82ccddbf7df67ecaec75cffa4969356e23eb — Noam Preil 2 months ago f82bb42
[parser] extern functions
1 files changed, 7 insertions(+), 3 deletions(-)

M parser.c
M parser.c => parser.c +7 -3
@@ 1277,12 1277,13 @@ p_tl_decl(void)
{
	int pub;
	int export;
	int ext;
	uint32_t node;
	pub = parser_is_consume(C3_PUB);
	export = parser_is_consume(C3_EXPORT);
	if(parser_is(0, C3_EXTERN)){
		FATAL("TODO: externs", 0);
	}
	ext = parser_is_consume(C3_EXTERN);
	if(export && ext)
		FATAL("Export and extern are mutually exclusive!", 0);
	if(parser_is(0, C3_THREADLOCAL)){
		FATAL("TODO: thread locals", 0);
	}


@@ 1303,6 1304,8 @@ p_tl_decl(void)
	}
	if(export)
		node = c3append(&ctx.tree, C3_EXPORT, 1, node);
	if(ext)
		node = c3append(&ctx.tree, C3_EXTERN, 1, node);
	if(node == -1)
		OOM();
	return node;


@@ 1359,6 1362,7 @@ p_tl(void)
	case C3_EXPORT:
	case C3_EXTERN:
	case C3_THREADLOCAL:
	case C3_FN:
	case C3_CONST:
	case C3_VAR:
	case C3_USINGNAMESPACE: