This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open System | |
module Whitespace = | |
type Node = { Text : string; Nodes : Node ResizeArray; Parent : Node option } | |
type private Line = { Text : string; Indentation : int } | |
type private Token = Begin | Text of string | End | |
let parseTree (src : string) = | |
let lines = | |
src.Split ([| "\n"; "\r" |], StringSplitOptions.RemoveEmptyEntries) | |
|> Array.filter (fun s -> s.Trim () = "" |> not) |