Ejemplo n.º 1
0
        // solo function statements
        // this is such a weird thing...
        // COMMAND_FUNC expression, expression ) >>
        // COMMAND_FUNC = << ID (
        public override int VisitFunction_statement(YarnSpinnerParser.Function_statementContext context)
        {
            char[] lTrim        = { '<' };
            char[] rTrim        = { '(' };
            string functionName = context.GetChild(0).GetText().TrimStart(lTrim).TrimEnd(rTrim);

            this.HandleFunction(functionName, context.expression());

            return(0);
        }
Ejemplo n.º 2
0
        // solo function statements
        // this is such a weird thing...
        // COMMAND_FUNC expression, expression ) >>
        // COMMAND_FUNC = << ID (
        public override int VisitFunction_statement(YarnSpinnerParser.Function_statementContext context)
        {
            char[] lTrim = { '<' };
            char[] rTrim = { '(' };
            string functionName = context.GetChild(0).GetText().TrimStart(lTrim).TrimEnd(rTrim);

            var output = this.HandleFunction(functionName, context.expression());
            // failed to handle the function
            if (output == false)
            {
                Yarn.ParseException.Make(context, "Invalid number of parameters for " + functionName);
            }

            return 0;
        }