package com.cowlark.sake.parser.parsers;

import com.cowlark.sake.parser.core.Location;
import com.cowlark.sake.parser.core.ParseResult;

public class FunctionStatementParser extends Parser
{
	@Override
	protected ParseResult parseImpl(Location location)
	{
		ParseResult pr1 = VarAssignmentParser.parse(location);
		if (pr1.success())
			return pr1;
		
		ParseResult pr2 = VarDeclParser.parse(location);
		if (pr2.success())
			return pr2;
		
		ParseResult pr3 = ReturnStatementParser.parse(location);
		if (pr3.success())
			return pr3;
		
		ParseResult pr4 = IfStatementParser.parse(location);
		if (pr4.success())
			return pr4;
		
		ParseResult pr5 = LabelStatementParser.parse(location);
		if (pr5.success())
			return pr5;
		
		ParseResult pr6 = GotoStatementParser.parse(location);
		if (pr6.success())
			return pr6;
		
		ParseResult pr7 = ExpressionStatementParser.parse(location);
		if (pr7.success())
			return pr7;
		
		return combineParseErrors(pr1, pr2, pr3, pr4, pr5, pr6, pr7);
	}
}

@@ -841,16 +841,104 @@
 lt pr7 =
+ BlockParser.parse(location);%0A%09%09if (pr7.success())%0A%09%09%09return pr7;%0A%09%09%0A%09%09ParseResult pr8 =
  Express
@@ -973,33 +973,33 @@
 ation);%0A%09%09if (pr
-7
+8
 .success())%0A%09%09%09r
@@ -1002,25 +1002,25 @@
 %09%09%09return pr
-7
+8
 ;%0A%09%09%0A%09%09retur

Allow block statements.