-
-
Notifications
You must be signed in to change notification settings - Fork 42
/
Types.fs
41 lines (34 loc) · 1.17 KB
/
Types.fs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
namespace Myriad.Core
open System
open System.Collections.Generic
open Fantomas.FCS.Syntax
type MyriadGeneratorAttribute(name: string) =
inherit Attribute()
member _.Name = name
type ProjectContext =
{ project: string
projectPath: string
refs: string array
compileBefore: string array
compile: string array
compileAfter: string array
defineConstants: string array }
type GeneratorContext =
{ ConfigKey: string option
ConfigGetter: string -> (string * obj) seq
InputFilename: string
ProjectContext: ProjectContext option
AdditionalParameters: IDictionary<string, string> }
static member Create(configKey, configHandler, inputFile, projectContext, additionalParams) =
{ ConfigKey = configKey
ConfigGetter = configHandler
InputFilename = inputFile
ProjectContext = projectContext
AdditionalParameters = additionalParams }
[<RequireQualifiedAccess>]
type Output =
| Ast of SynModuleOrNamespace list
| Source of string
type IMyriadGenerator =
abstract member ValidInputExtensions : string seq
abstract member Generate : GeneratorContext -> Output