anchor.diff:  
       let bitOfBool b = if b then 1 else 0
       let boolOfBit n = (n = 1L)
  -        
  +
  +    let inline colorStateOfLexState (state: FSharpTokenizerLexState) =
  +        enum<FSharpTokenizerColorState> (int32 ((state &&& lexstateMask) >>> lexstateStart))
  +
  +    let inline lexStateOfColorState (state: FSharpTokenizerColorState) =
  +        (int64 state <<< lexstateStart) &&& lexstateMask
  +
       let encodeLexCont (colorState:FSharpTokenizerColorState) ncomments (b:pos) ifdefStack light = 
           let mutable ifdefStackCount = 0
           let mutable ifdefStackBits = 0
  
positive.code:                     ifdefStackBits <- (ifdefStackBits ||| (1 <<< ifdefStackCount))
              ifdefStackCount <- ifdefStackCount + 1
  
          let lexstate = int64 colorState
          ((lexstate <<< lexstateStart)  &&& lexstateMask)
          ||| ((ncomments <<< ncommentsStart) &&& ncommentsMask)
          ||| ((resize32 b.Encoding <<< startPosStart) &&& startPosMask)
          ||| ((resize32 (bitOfBool light) <<< hardwhitePosStart) &&& hardwhitePosMask)
  
negative.code:                 let mask = 1 <<< bit
                  let ifDef = (if ifdefStack &&& mask = 0 then IfDefIf else IfDefElse)
                  ifDefs<-(ifDef,range0)::ifDefs
          colorStateOfLexState state,
          (int32) ((state &&& ncommentsMask) >>> ncommentsStart),
          pos.Decode (int32 ((state &&& startPosMask) >>> startPosStart)),
          ifDefs,
  