private static Parser <SyntaxToken, JassFunctionSyntax> GetFunctionParser()
 {
     return(Map(
                (declaration, body) => new JassFunctionSyntax(declaration, body),
                Keyword(SyntaxTokenType.ConstantKeyword).Optional().Then(Keyword(SyntaxTokenType.FunctionKeyword)).Then(FunctionDeclarationParser).Before(Newline),
                StatementListParser.Before(Keyword(SyntaxTokenType.EndfunctionKeyword))));
 }
Exemplo n.º 2
0
 private static Parser <char, JassFunctionSyntax> GetFunctionParser()
 {
     return(Map(
                (declaration, body) => new JassFunctionSyntax(declaration, body),
                Keyword("constant").Optional().Then(Keyword("function")).Then(FunctionDeclarationParser).Before(Newline),
                StatementListParser.Before(Keyword("endfunction"))));
 }