diff --git a/src/Fable.Compiler/Globbing.fs b/src/Fable.Compiler/Globbing.fs index fa56a040e2..569cc2ad72 100644 --- a/src/Fable.Compiler/Globbing.fs +++ b/src/Fable.Compiler/Globbing.fs @@ -18,11 +18,12 @@ module Glob = let inline normalizePath (path: string) = path.Replace('\\', Path.DirectorySeparatorChar).Replace('/', Path.DirectorySeparatorChar) + [] type private SearchOption = - | Directory of string - | Drive of string + | Directory of dir: string + | Drive of drive: string | Recursive - | FilePattern of string + | FilePattern of pattern: string let private checkSubDirs absolute (dir: string) root = if dir.Contains "*" then diff --git a/src/Fable.Compiler/Globbing.fsi b/src/Fable.Compiler/Globbing.fsi index 8a399a9b8b..2f013fccf8 100644 --- a/src/Fable.Compiler/Globbing.fsi +++ b/src/Fable.Compiler/Globbing.fsi @@ -15,11 +15,12 @@ module Glob = val inline normalizePath: path: string -> string + [] type private SearchOption = - | Directory of string - | Drive of string + | Directory of dir: string + | Drive of drive: string | Recursive - | FilePattern of string + | FilePattern of pattern: string val internal getRoot: baseDirectory: string -> pattern: string -> string val internal search: baseDir: string -> originalInput: string -> string list diff --git a/src/Fable.Compiler/Util.fs b/src/Fable.Compiler/Util.fs index 47c22595e0..fb2de98baa 100644 --- a/src/Fable.Compiler/Util.fs +++ b/src/Fable.Compiler/Util.fs @@ -705,11 +705,12 @@ module Json = open Fable.AST // TODO: Check which other parameters are accepted by attributes (arrays?) + [] type AttParam = - | Int of int - | Float of float - | Bool of bool - | String of string + | Int of intValue: int + | Float of floatValue: float + | Bool of boolValue: bool + | String of stringValue: string static member From(values: obj list) = (Ok [], values) diff --git a/src/Fable.Transforms/Dart/Dart.fs b/src/Fable.Transforms/Dart/Dart.fs index 263ef7b82a..7745b0d405 100644 --- a/src/Fable.Transforms/Dart/Dart.fs +++ b/src/Fable.Transforms/Dart/Dart.fs @@ -1,10 +1,12 @@ // Loosely based on https://pub.dev/documentation/analyzer/latest/dart_ast_ast/dart_ast_ast-library.html module rec Fable.AST.Dart +[] type UpdateOperator = | UpdateMinus | UpdatePlus +[] type AssignmentOperator = | AssignEqual | AssignMinus @@ -259,6 +261,7 @@ type Expression = static member throwExpression(value, typ) = ThrowExpression(value, typ) static member rethrowExpression(typ) = RethrowExpression typ +[] type VariableDeclarationKind = | Final | Const @@ -378,6 +381,7 @@ type InstanceVariable(ident, ?value, ?kind, ?isOverride, ?isLate) = member _.IsOverride = defaultArg isOverride false member _.IsLate = defaultArg isLate false +[] type MethodKind = | IsMethod | IsGetter diff --git a/src/Fable.Transforms/Dart/DartPrinter.fs b/src/Fable.Transforms/Dart/DartPrinter.fs index a75075ba4e..7d0f1c83fa 100644 --- a/src/Fable.Transforms/Dart/DartPrinter.fs +++ b/src/Fable.Transforms/Dart/DartPrinter.fs @@ -6,6 +6,7 @@ open Fable.AST open Fable.AST.Dart open Fable.Transforms.Printer +[] type ListPos = | IsFirst | IsMiddle diff --git a/src/Fable.Transforms/Dart/Fable2Dart.fs b/src/Fable.Transforms/Dart/Fable2Dart.fs index 088a9f729b..788a68ad0b 100644 --- a/src/Fable.Transforms/Dart/Fable2Dart.fs +++ b/src/Fable.Transforms/Dart/Fable2Dart.fs @@ -62,6 +62,7 @@ type Context = { this with EntityAndMemberGenericParams = this.EntityAndMemberGenericParams @ genParams } +[] type MemberKind = | ClassConstructor | NonAttached of funcName: string diff --git a/src/Fable.Transforms/FSharp2Fable.Util.fs b/src/Fable.Transforms/FSharp2Fable.Util.fs index b867d379f7..d84fc6fab9 100644 --- a/src/Fable.Transforms/FSharp2Fable.Util.fs +++ b/src/Fable.Transforms/FSharp2Fable.Util.fs @@ -105,10 +105,11 @@ type FsField(fi: FSharpField) = | n -> name + "_" + (string n) [] +[] type CompiledValue = - | Integer of int - | Float of float - | Boolean of bool + | Integer of intValue: int + | Float of floatValue: float + | Boolean of boolValue: bool type FsUnionCase(uci: FSharpUnionCase) = /// FSharpUnionCase.CompiledName doesn't give the value of CompiledNameAttribute diff --git a/src/Fable.Transforms/Fable2Babel.fs b/src/Fable.Transforms/Fable2Babel.fs index bc68c312ae..11c940759a 100644 --- a/src/Fable.Transforms/Fable2Babel.fs +++ b/src/Fable.Transforms/Fable2Babel.fs @@ -13,6 +13,7 @@ type ReturnStrategy = | Assign of Expression | Target of Identifier +[] type ConstructorRef = | Annotation | ActualConsRef @@ -1329,6 +1330,7 @@ module Util = scopedTypeParams, typeParams + [] type MemberKind = | ClassConstructor | NonAttached of funcName: string diff --git a/src/Fable.Transforms/Global/Babel.fs b/src/Fable.Transforms/Global/Babel.fs index fa54308339..e0428756d7 100644 --- a/src/Fable.Transforms/Global/Babel.fs +++ b/src/Fable.Transforms/Global/Babel.fs @@ -3,10 +3,12 @@ namespace rec Fable.AST.Babel open Fable.AST +[] type UpdateOperator = | UpdateMinus | UpdatePlus +[] type AssignmentOperator = | AssignEqual | AssignMinus @@ -204,6 +206,7 @@ type Declaration = /// A directive prologue as defined in ECMA specification /// https://tc39.es/ecma262/#sec-directive-prologues-and-the-use-strict-directive +[] type DirectivePrologue = | DirectivePrologue of text: string /// A module import or export declaration. @@ -300,6 +303,7 @@ type VariableDeclarator = init: Expression option * loc: SourceLocation option +[] type VariableDeclarationKind = | Var | Let @@ -412,6 +416,7 @@ type ObjectMember = // let shorthand = defaultArg shorthand_ false // member _.Shorthand: bool = shorthand +[] type ObjectMethodKind = | ObjectGetter | ObjectSetter @@ -440,6 +445,7 @@ type ObjectMethodKind = // Classes +[] type AccessModifier = | Public | Private diff --git a/src/Fable.Transforms/Global/Compiler.fs b/src/Fable.Transforms/Global/Compiler.fs index c5a26eaf84..58030bac9a 100644 --- a/src/Fable.Transforms/Global/Compiler.fs +++ b/src/Fable.Transforms/Global/Compiler.fs @@ -35,12 +35,14 @@ type CompilerOptionsHelper = } [] +[] type Severity = | Warning | Error | Info [] +[] type OutputType = | Library | Exe diff --git a/src/Fable.Transforms/Php/Fable2Php.fs b/src/Fable.Transforms/Php/Fable2Php.fs index 9f89ed14ae..4afbb5ee5b 100644 --- a/src/Fable.Transforms/Php/Fable2Php.fs +++ b/src/Fable.Transforms/Php/Fable2Php.fs @@ -756,15 +756,16 @@ let convertRecord (com: IPhpCompiler) (decl: Fable.ClassDecl) (info: Fable.Entit /// F# is expression based, but some constructs have to be transpiled as /// statements in other languages. This types indicates how the result /// should be passed to the resto of the code. +[] type ReturnStrategy = /// The statement should return the value | Return /// The statement should define a new variable and assign it - | Let of string + | Let of varName: string /// No return value | Do /// used in decision tree when multiple cases result in the same code - | Target of string + | Target of targetName: string let nsreplacement (ns: string) = match ns.Replace(".", @"\") with diff --git a/src/Fable.Transforms/Php/Php.fs b/src/Fable.Transforms/Php/Php.fs index 1f5f6e25e8..a3d95ba373 100644 --- a/src/Fable.Transforms/Php/Php.fs +++ b/src/Fable.Transforms/Php/Php.fs @@ -1,15 +1,17 @@ namespace rec Fable.AST.Php +[] type PhpConst = - | PhpConstNumber of float - | PhpConstString of string - | PhpConstBool of bool + | PhpConstNumber of number: float + | PhpConstString of str: string + | PhpConstBool of flag: bool | PhpConstNull +[] type PhpArrayIndex = | PhpArrayNoIndex - | PhpArrayInt of int - | PhpArrayString of string + | PhpArrayInt of index: int + | PhpArrayString of key: string type PhpField = { @@ -17,9 +19,10 @@ type PhpField = Type: string } +[] type Capture = - | ByValue of string - | ByRef of string + | ByValue of valueName: string + | ByRef of refName: string type Prop = | Field of PhpField @@ -70,9 +73,9 @@ and PhpStatement = | PhpFor of ident: string * start: PhpExpr * limit: PhpExpr * isUp: bool * body: PhpStatement list | PhpDo of PhpExpr -and PhpCase = - | IntCase of int - | StringCase of string +and [] PhpCase = + | IntCase of intValue: int + | StringCase of strValue: string | DefaultCase and PhpTypeRef = diff --git a/src/Fable.Transforms/Python/Fable2Python.Types.fs b/src/Fable.Transforms/Python/Fable2Python.Types.fs index db2addc808..ce259097f9 100644 --- a/src/Fable.Transforms/Python/Fable2Python.Types.fs +++ b/src/Fable.Transforms/Python/Fable2Python.Types.fs @@ -25,6 +25,7 @@ type ITailCallOpportunity = abstract Args: Arg list abstract IsRecursiveRef: Fable.Expr -> bool +[] type MemberKind = | ClassConstructor | NonAttached of funcName: string diff --git a/src/Fable.Transforms/Python/Python.AST.fs b/src/Fable.Transforms/Python/Python.AST.fs index f8dd40c477..7b89675155 100644 --- a/src/Fable.Transforms/Python/Python.AST.fs +++ b/src/Fable.Transforms/Python/Python.AST.fs @@ -133,6 +133,7 @@ type Literal = | TupleLiteral of Literal list | FrozensetLiteral of Literal list +[] type Operator = | Add | Sub @@ -148,10 +149,12 @@ type Operator = | BitAnd | MatMult +[] type BoolOperator = | And | Or +[] type ComparisonOperator = | Eq | NotEq @@ -164,17 +167,20 @@ type ComparisonOperator = | In | NotIn +[] type UnaryOperator = | Invert | Not | UAdd | USub +[] type ExpressionContext = | Load | Del | Store +[] type Identifier = | Identifier of name: string diff --git a/src/Fable.Transforms/Rust/AST/Rust.AST.Parser.fs b/src/Fable.Transforms/Rust/AST/Rust.AST.Parser.fs index de668ca899..293a73d302 100644 --- a/src/Fable.Transforms/Rust/AST/Rust.AST.Parser.fs +++ b/src/Fable.Transforms/Rust/AST/Rust.AST.Parser.fs @@ -66,6 +66,7 @@ type AssocOp = //#[derive(PartialEq, Debug)] [] +[] type Fixity = /// The operator is left-associative | Left diff --git a/src/Fable.Transforms/Rust/AST/Rust.AST.Pretty.fs b/src/Fable.Transforms/Rust/AST/Rust.AST.Pretty.fs index 22f0b071c1..a07e989131 100644 --- a/src/Fable.Transforms/Rust/AST/Rust.AST.Pretty.fs +++ b/src/Fable.Transforms/Rust/AST/Rust.AST.Pretty.fs @@ -141,6 +141,7 @@ open type Macros /// How to break. Described in more detail in the module docs. [] +[] type Breaks = | Consistent | Inconsistent diff --git a/src/Fable.Transforms/Rust/AST/Rust.AST.State.fs b/src/Fable.Transforms/Rust/AST/Rust.AST.State.fs index 086d21cae0..f4c59f6dae 100644 --- a/src/Fable.Transforms/Rust/AST/Rust.AST.State.fs +++ b/src/Fable.Transforms/Rust/AST/Rust.AST.State.fs @@ -52,6 +52,7 @@ type AsmArg = type SourceMap() = class end [] +[] type CommentStyle = /// No code on either side of each line of the comment | Isolated @@ -117,6 +118,7 @@ type State = } [] +[] type Edition = /// The 2015 edition | Edition2015 diff --git a/src/Fable.Transforms/Rust/AST/Rust.AST.Types.fs b/src/Fable.Transforms/Rust/AST/Rust.AST.Types.fs index a08d3723e0..ba3fb02230 100644 --- a/src/Fable.Transforms/Rust/AST/Rust.AST.Types.fs +++ b/src/Fable.Transforms/Rust/AST/Rust.AST.Types.fs @@ -30,11 +30,13 @@ open Fable.Transforms.Rust.AST.Spans module token = [] + [] type CommentKind = | Line | Block [] + [] type BinOpToken = | Plus | Minus @@ -49,6 +51,7 @@ module token = /// A delimiter token. [] + [] type DelimToken = /// A round parenthesis (i.e., `(` or `)`). | Paren @@ -187,6 +190,7 @@ module token = type TreeAndSpacing = (TokenTree * Spacing) [] + [] type Spacing = | Alone | Joint @@ -319,6 +323,7 @@ type ParenthesizedArgs = /// /// Negative bounds should also be handled here. [] +[] type TraitBoundModifier = /// No modifiers | None @@ -349,6 +354,7 @@ type GenericBounds = Vec /// if we wanted to relax this order, we could override `PartialEq` and /// `PartialOrd`, to allow the kinds to be unordered. [] +[] type ParamKindOrd = | Lifetime | Type @@ -553,6 +559,7 @@ type RangeEnd = | Excluded [] +[] type RangeSyntax = /// `...` | DotDotDot @@ -626,6 +633,7 @@ type PatKind = | MacCall of MacCall [] +[] type Mutability = | Mut | Not @@ -633,6 +641,7 @@ type Mutability = /// The kind of borrow in an `AddrOf` expression, /// e.g., `&place` or `&raw const place`. [] +[] type BorrowKind = /// A normal borrow, `&$expr` or `&mut $expr`. /// The resulting type is either `&'a T` or `&'a mut T` @@ -644,6 +653,7 @@ type BorrowKind = | Raw [] +[] type BinOpKind = /// The `+` operator (addition) | Add @@ -688,6 +698,7 @@ type BinOp = Spanned /// /// Note that `&data` is not an operator, it's an `AddrOf` expression. [] +[] type UnOp = /// The `*` operator for dereferencing | Deref @@ -728,6 +739,7 @@ type MacCallStmt = } [] +[] type MacStmtStyle = /// The macro statement had a trailing semicolon (e.g., `foo! { ... };` /// `foo!(...);`, `foo![...];`). @@ -794,6 +806,7 @@ type BlockCheckMode = | Unsafe of UnsafeSource [] +[] type UnsafeSource = | CompilerGenerated | UserProvided @@ -821,6 +834,7 @@ type Expr = /// Limit types of a range (inclusive or exclusive) [] +[] type RangeLimits = /// Inclusive at the beginning, exclusive at the end | HalfOpen @@ -1018,6 +1032,7 @@ type QSelf = /// A capture clause used in closures and `async` blocks. [] +[] type CaptureBy = /// `move |x| y + x`. | Value @@ -1027,6 +1042,7 @@ type CaptureBy = /// The movability of a generator / closure literal: /// whether a generator contains self-references, causing it to be `!Unpin`. [] +[] type Movability = /// May contain self-references, `!Unpin`. | Static @@ -1057,6 +1073,7 @@ type MacArgs = token.Token [] +[] type MacDelimiter = | Parenthesis | Bracket @@ -1162,11 +1179,13 @@ type FnSig = } [] +[] type FloatTy = | F32 | F64 [] +[] type IntTy = | Isize | I8 @@ -1176,6 +1195,7 @@ type IntTy = | I128 [] +[] type UintTy = | Usize | U8 @@ -1272,6 +1292,7 @@ type TyKind = /// Syntax used to declare a trait object. [] +[] type TraitObjectSyntax = | Dyn | None @@ -1327,6 +1348,7 @@ type InlineAsm = /// /// E.g., `"intel"` as in `llvm_asm!("mov eax, 2" : "={eax}"(result) : : : "intel")`. [] +[] type LlvmAsmDialect = | Att | Intel @@ -1398,6 +1420,7 @@ type FnDecl = /// Is the trait definition an auto trait? [] +[] type IsAuto = | Yes | No @@ -1442,6 +1465,7 @@ type FnRetTy = | Ty of P [] +[] type Inline = | Yes | No @@ -1524,6 +1548,7 @@ type UseTree = /// are contained as statements within items. These two cases need to be /// distinguished for pretty-printing. [] +[] type AttrStyle = | Outer | Inner @@ -1590,6 +1615,7 @@ type PolyTraitRef = } [] +[] type CrateSugar = /// Source is `pub(crate)`. | PubCrate diff --git a/src/Fable.Transforms/Rust/Fable2Rust.fs b/src/Fable.Transforms/Rust/Fable2Rust.fs index 67f32d99fc..58aeba6934 100644 --- a/src/Fable.Transforms/Rust/Fable2Rust.fs +++ b/src/Fable.Transforms/Rust/Fable2Rust.fs @@ -965,6 +965,7 @@ module TypeInfo = ) |> Option.toValueOption + [] type PointerType = | Lrc | Rc