-
Notifications
You must be signed in to change notification settings - Fork 802
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add extern keyword to SynBindingTrivia. (#14030)
- Loading branch information
Showing
7 changed files
with
44 additions
and
8 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
module FSharp.Compiler.Service.Tests.SyntaxTreeTests.ExternTests | ||
|
||
open FSharp.Compiler.Service.Tests.Common | ||
open FSharp.Compiler.Syntax | ||
open FSharp.Compiler.SyntaxTrivia | ||
open NUnit.Framework | ||
|
||
[<Test>] | ||
let ``extern keyword is present in trivia`` () = | ||
let parseResults = getParseResults "extern void GetProcessHeap()" | ||
|
||
match parseResults with | ||
| ParsedInput.ImplFile(ParsedImplFileInput(contents = [ | ||
SynModuleOrNamespace.SynModuleOrNamespace(decls = [ | ||
SynModuleDecl.Let(bindings = [ | ||
SynBinding(trivia = { ExternKeyword = Some mExtern }) | ||
]) | ||
]) | ||
])) -> | ||
assertRange (1, 0) (1, 6) mExtern | ||
| _ -> Assert.Fail $"Could not get valid AST, got {parseResults}" |