示例#1
0
        // handles emiting the correct instructions for the function
        public override int VisitFunction_call(YarnSpinnerParser.Function_callContext context)
        {
            string functionName = context.FUNC_ID().GetText();

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

            return(0);
        }
        public override string VisitFunction_call([NotNull] YarnSpinnerParser.Function_callContext context)
        {
            var functionName = context.FUNC_ID().GetText();

            if (functionName.Equals("visited") || functionName.Equals("visited_count"))
            {
                // we aren't bothering to test anything about the value itself
                // if it isn't a static string we'll get back null so can ignore it
                // if the func has more than one parameter later on it will cause an error so again can ignore
                var result = Visit(context.expression()[0]);

                if (result != null)
                {
                    TrackingNode.Add(result);
                }
            }

            return(null);
        }