public override object VisitDataStatement(DataStatementContext context) { var r = (new Result()); if (context.nilExpr() != null) { r.data = Any; r.text = "null"; } else if (context.floatExpr() != null) { r.data = F64; r.text = (string)(Visit(context.floatExpr())); } else if (context.integerExpr() != null) { r.data = I32; r.text = (string)(Visit(context.integerExpr())); } else if (context.rawStringExpr() != null) { r.data = Str; r.text = (string)(Visit(context.rawStringExpr())); } else if (context.stringExpr() != null) { r.data = Str; r.text = (string)(Visit(context.stringExpr())); } else if (context.t.Type == FeelParser.CharLiteral) { r.data = Chr; r.text = context.CharLiteral().GetText(); } else if (context.t.Type == FeelParser.TrueLiteral) { r.data = Bool; r.text = T; } else if (context.t.Type == FeelParser.FalseLiteral) { r.data = Bool; r.text = F; } return(r); }
public override object VisitDataStatement([NotNull] DataStatementContext context) { var r = new Result(); if (context.t.Type == Float) { r.data = f64; r.text = $"{context.Float().GetText()}"; } else if (context.t.Type == Integer) { r.data = i32; r.text = $"{context.Integer().GetText()}"; } else if (context.t.Type == Text) { r.data = str; r.text = context.Text().GetText(); } else if (context.t.Type == XsParser.Char) { r.data = chr; r.text = context.Char().GetText(); } else if (context.t.Type == XsParser.True) { r.data = bl; r.text = $"{context.True().GetText()}"; } else if (context.t.Type == XsParser.False) { r.data = bl; r.text = $"{context.False().GetText()}"; } else if (context.t.Type == Null) { r.data = Any; r.text = "null"; } return(r); }