~pmikkelsen/lpa

d82e1615b58bf59f1d8b14dd62c588be6ea1881c — Peter Mikkelsen 2 months ago a062a05
Skip empty lines in parseprog
1 files changed, 12 insertions(+), 4 deletions(-)

M parse.c
M parse.c => parse.c +12 -4
@@ 159,14 159,22 @@ parseprog(TokenList *t)
	prog->tag = AstProg;

	while(peek(t) != TokEnd){
		Ast *child;
		if(peek(t) == TokDel)
		Ast *child = nil;
		switch(peek(t)){
		case TokDiamond:
		case TokNewline:
			break;
		case TokDel:
			child = parsefuncdef(t);
		else
			break;
		default:
			child = parseexpr(t, nil, nil);
			break;
		}
		if(peek(t) != TokEnd)
			parseseps(t, 1);
		addchild(prog, child);
		if(child)
			addchild(prog, child);
	}
	return prog;
}