namespace WoofWare.Whippet.Fantomas open Fantomas.FCS.Syntax open Fantomas.FCS.Text.Range /// Module for manipulating the AST `SynAttributes` type. This represents a collection of `[]` objects: /// if you have `[] [] foo` then the SynAttributes contains two elements, `[A]` and `[B ; C]`, each of which /// is a list of attributes. [] module SynAttributes = /// Build a SynAttributes of the form `[] [] []`, i.e. one `[<>]` for each input attribute. let ofAttrs (attrs : SynAttribute list) : SynAttributes = attrs |> List.map (fun a -> { Attributes = [ a ] Range = range0 } ) /// Get all the attributes out of this SynAttributes, as a list of individual attributes. let toAttrs (attrs : SynAttributes) : SynAttribute list = attrs |> List.collect (fun attr -> attr.Attributes)