public RuleIfAction(ParseInfo parseInfo, Scope scope, DeltinScriptParser.Rule_ifContext ifContext)
        {
            // Syntax error if there is no expression.
            if (ifContext.expr() == null)
            {
                parseInfo.Script.Diagnostics.Error("Expected expression.", DocRange.GetRange(ifContext.RIGHT_PAREN()));
            }

            // Get the expression.
            else
            {
                Expression = parseInfo.GetExpression(scope, ifContext.expr());
            }
        }
Beispiel #2
0
 public override object VisitRule_if(DeltinScriptParser.Rule_ifContext context)
 {
     if (context.expr() == null)
     {
         _diagnostics.Error("Expected expression.", new Location(_file, Range.GetRange(context)));
     }
     return(base.VisitRule_if(context));
 }