protected override int GetHashCode(ISymbolTableProvider symbolTableProvider) { var result = HashSignature; if (IsNullValue()) { return(HashTypeAnnotations(result, symbolTableProvider)); } if (_bigInteger == null) { var lv = LongValue; // Throw away top 32 bits if they're not interesting. // Otherwise n and -(n+1) get the same hash code. result ^= (int)lv; var hiWord = (int)(lv >> 32); if (hiWord != 0 && hiWord != -1) { result ^= hiWord; } } else { result = _bigInteger.Value.GetHashCode(); } return(HashTypeAnnotations(result, symbolTableProvider)); }
public static UnboundReferences ParseBimlFiles(IEnumerable<BimlFile> bimlFiles, ISymbolTableProvider astRootNode, LanguageSettings languageSettings) { var unboundReferences = new UnboundReferences(); foreach (BimlFile bimlFile in bimlFiles) { var xdocument = bimlFile.XDocument; if (xdocument != null && xdocument.Root != null) { try { SideEffectManager.SideEffectMode = AstSideEffectMode.NoSideEffects; ParseDocument(bimlFile, astRootNode, unboundReferences, languageSettings); SideEffectManager.SideEffectMode = AstSideEffectMode.ConsistencySideEffects; bimlFile.IsParseable = true; } catch (Exception) { bimlFile.IsParseable = false; } } } unboundReferences.ResolveAll(astRootNode.SymbolTable); return unboundReferences; }
protected override int GetHashCode(ISymbolTableProvider symbolTableProvider) { if (!IsNull) { return(BooleanValue ? TrueHash : FalseHash); } return(HashTypeAnnotations(HashSignature, symbolTableProvider)); }
protected override void WriteBodyTo(IIonWriter writer, ISymbolTableProvider symbolTableProvider) { if (IsNullValue()) { writer.WriteNull(IonType.Bool); return; } writer.WriteBool(IsBoolTrue()); }
protected override int GetHashCode(ISymbolTableProvider symbolTableProvider) { var result = HashSignature; if (!IsNullValue()) { result ^= TextValue.GetHashCode(); } return(HashTypeAnnotations(result, symbolTableProvider)); }
protected override void WriteBodyTo(IIonWriter writer, ISymbolTableProvider symbolTableProvider) { if (IsNullValue()) { writer.WriteNull(IonType.Int); } else if (_bigInteger != null) { writer.WriteInt(_bigInteger.Value); } else { writer.WriteInt(_longValue); } }
protected override void WriteBodyTo(IIonWriter writer, ISymbolTableProvider symbolTableProvider) { throw new System.NotImplementedException(); }
protected override int GetHashCode(ISymbolTableProvider symbolTableProvider) { throw new System.NotImplementedException(); }
protected override void WriteBodyTo(IIonWriter writer, ISymbolTableProvider symbolTableProvider) => writer.WriteNull();
protected override int GetHashCode(ISymbolTableProvider symbolTableProvider) => HashTypeAnnotations(HashSignature, symbolTableProvider);
public static UnboundReferences ParseBimlFiles(IEnumerable <BimlFile> bimlFiles, ISymbolTableProvider astRootNode, LanguageSettings languageSettings) { var unboundReferences = new UnboundReferences(); foreach (BimlFile bimlFile in bimlFiles) { var xdocument = bimlFile.XDocument; if (xdocument != null && xdocument.Root != null) { try { SideEffectManager.SideEffectMode = AstSideEffectMode.NoSideEffects; ParseDocument(bimlFile, astRootNode, unboundReferences, languageSettings); SideEffectManager.SideEffectMode = AstSideEffectMode.ConsistencySideEffects; bimlFile.IsParseable = true; } catch (Exception) { bimlFile.IsParseable = false; } } } unboundReferences.ResolveAll(astRootNode.SymbolTable); return(unboundReferences); }
protected override void WriteBodyTo(IIonWriter writer, ISymbolTableProvider symbolTableProvider) => writer.WriteString(TextValue);