public string Visit(ConstantSyntaxNode node) { if (node.OutputType.Equals(FunnyType.Text)) { var str = node.Value.ToString(); return($"'{(str.Length > 20 ? (str.Substring(17) + "...") : str)}'"); } return($"{node.Value}"); }
public bool Visit(ConstantSyntaxNode node) { #if DEBUG Trace(node, $"Constant {node.Value}:{node.ClrTypeName}"); #endif var type = LangTiHelper.ConvertToTiType(node.OutputType); if (type is StatePrimitive p) { _ticTypeGraph.SetConst(node.OrderNumber, p); } else if (type is StateArray a && a.Element is StatePrimitive primitiveElement) { _ticTypeGraph.SetArrayConst(node.OrderNumber, primitiveElement); }
public IExpressionNode Visit(ConstantSyntaxNode node) { var type = _typesConverter.Convert(_typeInferenceResults.GetSyntaxNodeTypeOrNull(node.OrderNumber)); //All integer values are encoded by ulong (if it is ulong) or long otherwise if (node.Value is long l) { return(ConstantExpressionNode.CreateConcrete(type, l, node.Interval)); } else if (node.Value is ulong u) { return(ConstantExpressionNode.CreateConcrete(type, u, node.Interval)); } else //other types have their own clr-types { return(new ConstantExpressionNode(node.Value, type, node.Interval)); } }
public virtual VisitorEnterResult Visit(ConstantSyntaxNode node) => DefaultVisitEnter(node);
private static (object, FunnyType) ParseConstant(ConstantSyntaxNode constant) =>
public virtual bool Visit(ConstantSyntaxNode node) => true;