public override Yarn.Type VisitExpComparison(YarnSpinnerV1Parser.ExpComparisonContext context) { ParserRuleContext[] terms = context.expression(); // <, <=, >, >= all support numbers only CheckOperation(context, terms, context.op.Text, Yarn.Type.Number); // Comparisons always return bool return(Yarn.Type.Bool); }
/// <summary> /// Exit a parse tree produced by the <c>expComparison</c> /// labeled alternative in <see cref="YarnSpinnerV1Parser.expression"/>. /// <para>The default implementation does nothing.</para> /// </summary> /// <param name="context">The parse tree.</param> public virtual void ExitExpComparison([NotNull] YarnSpinnerV1Parser.ExpComparisonContext context) { }
/// <summary> /// Visit a parse tree produced by the <c>expComparison</c> /// labeled alternative in <see cref="YarnSpinnerV1Parser.expression"/>. /// <para> /// The default implementation returns the result of calling <see cref="AbstractParseTreeVisitor{Result}.VisitChildren(IRuleNode)"/> /// on <paramref name="context"/>. /// </para> /// </summary> /// <param name="context">The parse tree.</param> /// <return>The visitor result.</return> public virtual Result VisitExpComparison([NotNull] YarnSpinnerV1Parser.ExpComparisonContext context) { return(VisitChildren(context)); }