-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #58 from edgarfgp/attributes-widgets
Attribute Widgets
- Loading branch information
Showing
39 changed files
with
691 additions
and
394 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
namespace Fabulous.AST.Tests.Attributes | ||
|
||
open NUnit.Framework | ||
open Fabulous.AST.Tests | ||
|
||
open Fabulous.AST | ||
|
||
open type Ast | ||
|
||
module AttributesNodes = | ||
|
||
[<Test>] | ||
let ``Simple AttributeNode`` () = | ||
AnonymousModule() { Value("x", "12").attributes(AttributeNode("Obsolete")) } | ||
|> produces | ||
""" | ||
[<Obsolete>] | ||
let x = 12 | ||
""" | ||
|
||
[<Test>] | ||
let ``Simple AttributeNode with expr`` () = | ||
AnonymousModule() { | ||
Value("x", "12") | ||
.attributes(AttributeNode("Obsolete", ParenExpr(ConstantExpr(ConstantString("\"This is obsolete\""))))) | ||
} | ||
|> produces | ||
""" | ||
[<Obsolete("This is obsolete")>] | ||
let x = 12 | ||
""" | ||
|
||
[<Test>] | ||
let ``Multiple attributes`` () = | ||
AnonymousModule() { | ||
Value("x", "12") | ||
.attributes( | ||
AttributeNodes() { | ||
AttributeNode("Obsolete", ParenExpr(ConstantExpr(ConstantString("\"This is obsolete\"")))) | ||
} | ||
) | ||
} | ||
|> produces | ||
""" | ||
[<Obsolete("This is obsolete")>] | ||
let x = 12 | ||
""" | ||
|
||
|
||
[<Test>] | ||
let ``Simple AttributeNode type name and target`` () = | ||
AnonymousModule() { | ||
Value("x", "12") | ||
.attributes(AttributeNode("Struct", "return")) | ||
} | ||
|> produces | ||
""" | ||
[<return: Struct>] | ||
let x = 12 | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.