internal VariableSymbol(string name, bool isReadOnly, TypeSymbol type, BoundConstant constant) : base(name) { IsReadOnly = isReadOnly; Type = type; Constant = isReadOnly ? constant : null; }
internal GlobalVariableSymbol(string name, bool isReadOnly, TypeSymbol type, BoundConstant constant) : base(name, isReadOnly, type, constant) { }
public virtual void VisitConstant(BoundConstant node) { DefaultVisit(node); }
protected bool TryGetCacheSlot(BoundExpression expression, BoundConstant constant, out int index, out FieldInfo cacheSlot) { cacheSlot = null; index = 0; string name = constant.Value as string; if (name != null) index = Generator._identifierManager.ResolveIdentifier(name); if (name == null && constant.ValueType == BoundValueType.Number) { double number = (double)constant.Value; index = (int)number; if (index != number || index < 0) return false; name = index.ToString(); } cacheSlot = Generator.ResolveCacheSlot(expression, name); return cacheSlot != null; }
private BoundValueType EmitConstant(BoundConstant node) { IL.EmitConstant(node.Value); return node.ValueType; }