anchor.diff:          { Pattern = [SCap "var"; SCap "="; SCap "in"];              Func = generateBind }
       ]
   
  -//let doubleUnboundeExpressionTypes =
  -//    [
  -//        { Begin = None;       Delims = [];                          End = None;         Func = (fun exprs -> SubExpression exprs) }
  -//        { Begin = None;       Delims = [RCap ","];                  End = None;         Func = (fun exprs -> Tuple exprs) }
  -//        { Begin = None;       Delims = [SCap "=>"];                 End = None;         Func = generateLambda }
  -//    ]
  -//
  -//let startBoundedExpressionTypes = 
  -//    [
  -//        { Begin = Some "fun"; Delims = [SCap "->"];                 End = None;         Func = generateLambda }
  -//        { Begin = Some "if";  Delims = [SCap "then"; SCap "else"];  End = None;         Func = generateIfThenElse }
  -//    ]
  -//
  -//let boundedExpressionTypes = 
  -//    [
  -//        { Begin = Some "(";   Delims = [];                          End = Some ")";     Func = (function | [] -> Unit | exprs -> SubExpression exprs) }
  -//        { Begin = Some "{";   Delims = [RCap ".."];                 End = Some "}";     Func = generateNumIterator }
  -//        { Begin = Some "[";   Delims = [];                          End = Some "]";     Func = (fun exprs -> IndexArgs <| SubExpression exprs) }
  -//        { Begin = Some "let"; Delims = [SCap "="];                  End = Some "in";    Func = generateBind }
  -//        { Begin = Some "var"; Delims = [SCap "="];                  End = Some "in";    Func = generateBind }
  -//    ]
  -
   let (|NewExpression|_|) (text: StringWindow) =
       let matches, str = 
           [ 
  
positive.code:             | [] -> crem, [SubExpression result], currentCaptures
              | results -> crem, [SubExpression (results |> List.rev)], currentCaptures 
          | _ when str.Length = 0 -> str, result, currentCaptures
  //        | CaptureBegin (cParams, crem) -> 
  //            let subExprs, rem, captures = parseProgramInner crem [] cParams 
  //            let exprConstraint = 
  //                match captures with
  //                | [] -> failwith "Unexpected end of subexpression"
  //                | h :: [] -> h
  //                | list -> list |> List.filter (fun cap -> List.isEmpty cap.Delims) |> (function | h :: [] -> h | _ -> failwith "Ambiguous end of subexpression")
  //            let value = subExprs |> List.rev |> exprConstraint.Func 
  //            parseProgramInner rem (value :: result) currentCaptures
  //        | CaptureDelim currentCaptures (cParams, crem) -> 
  //            let subExprs, rem, captures = parseProgramInner crem [] cParams
  //            SubExpression (result |> List.rev) :: subExprs, rem, captures 
  //        | CaptureEnd currentCaptures (cParams, crem) ->  
  //            match result with
  //            | [] -> result, crem, cParams
  //            | results -> [SubExpression (results |> List.rev)], crem, cParams 
          | OngoingExpression currentCaptures (captures, crem) ->
              match captures with
              | { Pattern = []; Func = _ } :: parents -> crem, [SubExpression (result |> List.rev)], captures
  
negative.code:             | _ -> None
          | _ -> None
  
  let parseProgram (startText: string) = 
      let rec parseProgramInner (str: StringWindow) (result: ExprTypes list) (currentCaptures: SubexpressionType list) =
          match str with
  