mirror of
https://github.com/Smaug123/WoofWare.Whippet
synced 2025-10-15 12:48:41 +00:00
Initial import of Fantomas client library (#6)
Some checks failed
.NET / build (Debug) (push) Has been cancelled
.NET / build (Release) (push) Has been cancelled
.NET / analyzers (push) Has been cancelled
.NET / build-nix (push) Has been cancelled
.NET / check-dotnet-format (push) Has been cancelled
.NET / check-nix-format (push) Has been cancelled
.NET / Check links (push) Has been cancelled
.NET / Check flake (push) Has been cancelled
.NET / nuget-pack (push) Has been cancelled
.NET / expected-pack (push) Has been cancelled
.NET / all-required-checks-complete (push) Has been cancelled
Some checks failed
.NET / build (Debug) (push) Has been cancelled
.NET / build (Release) (push) Has been cancelled
.NET / analyzers (push) Has been cancelled
.NET / build-nix (push) Has been cancelled
.NET / check-dotnet-format (push) Has been cancelled
.NET / check-nix-format (push) Has been cancelled
.NET / Check links (push) Has been cancelled
.NET / Check flake (push) Has been cancelled
.NET / nuget-pack (push) Has been cancelled
.NET / expected-pack (push) Has been cancelled
.NET / all-required-checks-complete (push) Has been cancelled
This commit is contained in:
32
WoofWare.Whippet.Fantomas/SynAttribute.fs
Normal file
32
WoofWare.Whippet.Fantomas/SynAttribute.fs
Normal file
@@ -0,0 +1,32 @@
|
||||
namespace WoofWare.Whippet.Fantomas
|
||||
|
||||
open Fantomas.FCS.Syntax
|
||||
open Fantomas.FCS.Text.Range
|
||||
|
||||
/// Methods for manipulating `SynAttribute`, which represents a single attribute such as `[<Foo("bar")>]`.
|
||||
[<RequireQualifiedAccess>]
|
||||
module SynAttribute =
|
||||
/// Create an attribute. If you want no arguments, use `SynExpr.CreateConst ()` as the `arg`.
|
||||
let inline create (typeName : SynLongIdent) (arg : SynExpr) : SynAttribute =
|
||||
{
|
||||
TypeName = typeName
|
||||
ArgExpr = arg
|
||||
Target = None
|
||||
AppliesToGetterAndSetter = false
|
||||
Range = range0
|
||||
}
|
||||
|
||||
/// The `[<CompilationRepresentation(CompilationRepresentationFlags.ModuleSuffix)>]` attribute, for use on modules.
|
||||
let compilationRepresentation : SynAttribute =
|
||||
[ "CompilationRepresentationFlags" ; "ModuleSuffix" ]
|
||||
|> SynExpr.createLongIdent
|
||||
|> SynExpr.paren
|
||||
|> create (SynLongIdent.createS "CompilationRepresentation")
|
||||
|
||||
/// The `[<RequireQualifiedAccess>]` attribute.
|
||||
let requireQualifiedAccess : SynAttribute =
|
||||
create (SynLongIdent.createS "RequireQualifiedAccess") (SynExpr.CreateConst ())
|
||||
|
||||
/// The `[<AutoOpen>]` attribute.
|
||||
let autoOpen : SynAttribute =
|
||||
create (SynLongIdent.createS "AutoOpen") (SynExpr.CreateConst ())
|
Reference in New Issue
Block a user