mirror of
https://github.com/Smaug123/WoofWare.Whippet
synced 2025-10-12 03:08: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:
37
WoofWare.Whippet.Fantomas/SynModuleDecl.fs
Normal file
37
WoofWare.Whippet.Fantomas/SynModuleDecl.fs
Normal file
@@ -0,0 +1,37 @@
|
||||
namespace WoofWare.Whippet.Fantomas
|
||||
|
||||
open Fantomas.FCS.Syntax
|
||||
open Fantomas.FCS.SyntaxTrivia
|
||||
open Fantomas.FCS.Text.Range
|
||||
|
||||
/// Methods for manipulating `SynModuleDecl`, the type representing a single definition within a module.
|
||||
/// For example, an `open` statement, a `let` binding, a type definition, etc.
|
||||
[<RequireQualifiedAccess>]
|
||||
module SynModuleDecl =
|
||||
|
||||
/// Open this target (e.g. `open MyModule` or `open MyNamespace`).
|
||||
let inline openAny (ident : SynOpenDeclTarget) : SynModuleDecl = SynModuleDecl.Open (ident, range0)
|
||||
|
||||
/// Add consecutive `let`-bindings, non-recursive.
|
||||
let inline createLets (bindings : SynBinding list) : SynModuleDecl =
|
||||
SynModuleDecl.Let (false, bindings, range0)
|
||||
|
||||
/// Add a single `let`-binding. (Use `createLets` for *multiple* bindings.)
|
||||
let inline createLet (binding : SynBinding) : SynModuleDecl = createLets [ binding ]
|
||||
|
||||
/// Add type definitions.
|
||||
let inline createTypes (tys : SynTypeDefn list) : SynModuleDecl = SynModuleDecl.Types (tys, range0)
|
||||
|
||||
/// Add a nested module definition.
|
||||
let nestedModule (info : SynComponentInfo) (decls : SynModuleDecl list) : SynModuleDecl =
|
||||
SynModuleDecl.NestedModule (
|
||||
info,
|
||||
false,
|
||||
decls,
|
||||
false,
|
||||
range0,
|
||||
{
|
||||
ModuleKeyword = Some range0
|
||||
EqualsRange = Some range0
|
||||
}
|
||||
)
|
Reference in New Issue
Block a user