From 1599c24efb6901fb2df96a174cc6e2e68c82505c Mon Sep 17 00:00:00 2001 From: Don Syme Date: Wed, 22 Jun 2016 14:28:55 +0100 Subject: [PATCH 1/4] unreserve various keywords --- src/fsharp/lexhelp.fs | 13 +++---- .../E_ReservedIdentKeywords.fs | 36 +++++++++---------- 2 files changed, 23 insertions(+), 26 deletions(-) diff --git a/src/fsharp/lexhelp.fs b/src/fsharp/lexhelp.fs index 76e317797bf..bb93921b02b 100644 --- a/src/fsharp/lexhelp.fs +++ b/src/fsharp/lexhelp.fs @@ -281,18 +281,15 @@ module Keywords = ] (*------- reserved keywords which are ml-compatibility ids *) @ List.map (fun s -> (FSHARP,s,RESERVED)) - [ "atomic"; "break"; - "checked"; "component"; "constraint"; "constructor"; "continue"; - "eager"; - "fixed"; "fori"; "functor"; + [ "break"; + "checked"; "component"; "constraint"; "continue"; + "fixed"; "fori"; "include"; - "measure"; "method"; "mixin"; - "object"; + "mixin"; "parallel"; "params"; "process"; "protected"; "pure"; - "recursive"; "sealed"; "trait"; "tailcall"; - "virtual"; "volatile"; ] + "virtual"; ] let private unreserveWords = keywordList |> List.choose (function (mode,keyword,_) -> if mode = FSHARP then Some keyword else None) diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/IdentifiersAndKeywords/E_ReservedIdentKeywords.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/IdentifiersAndKeywords/E_ReservedIdentKeywords.fs index 2c550ad3d3c..ec38124d2be 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/IdentifiersAndKeywords/E_ReservedIdentKeywords.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/IdentifiersAndKeywords/E_ReservedIdentKeywords.fs @@ -1,60 +1,60 @@ // #Regression #Conformance #LexicalAnalysis // Reserved identifiers and keywords // Also cover regression test for FSHARP1.0:5367 (keyword 'virtual') -let atomic = 10 + let break = 10 let checked = 10 let component = 10 let constraint = 10 -let constructor = 10 + let continue = 10 -let eager = 10 + let fixed = 10 let fori = 10 -let functor = 10 + let include = 10 -let method = 10 -let measure = 10 + + let mixin = 10 -let object = 10 + let parallel = 10 let params = 10 let process = 10 let protected = 10 let pure = 10 -let recursive = 10 + let sealed = 10 let tailcall = 10 let trait = 10 let virtual = 10 -let volatile = 10 -//The identifier 'atomic' is reserved for future use by F# + + //The identifier 'break' is reserved for future use by F# //The identifier 'checked' is reserved for future use by F# //The identifier 'component' is reserved for future use by F# //The identifier 'constraint' is reserved for future use by F# -//The identifier 'constructor' is reserved for future use by F# + //The identifier 'continue' is reserved for future use by F# -//The identifier 'eager' is reserved for future use by F# + //The identifier 'fixed' is reserved for future use by F# //The identifier 'fori' is reserved for future use by F# -//The identifier 'functor' is reserved for future use by F# + //The identifier 'include' is reserved for future use by F# -//The identifier 'method' is reserved for future use by F# -//The identifier 'measure' is reserved for future use by F# + + //The identifier 'mixin' is reserved for future use by F# -//The identifier 'object' is reserved for future use by F# + //The identifier 'parallel' is reserved for future use by F# //The identifier 'params' is reserved for future use by F# //The identifier 'process' is reserved for future use by F# //The identifier 'protected' is reserved for future use by F# //The identifier 'pure' is reserved for future use by F# -//The identifier 'recursive' is reserved for future use by F# + //The identifier 'sealed' is reserved for future use by F# //The identifier 'tailcall' is reserved for future use by F# //The identifier 'trait' is reserved for future use by F# //The identifier 'virtual' is reserved for future use by F# -//The identifier 'volatile' is reserved for future use by F# + From 1ed74347c57235050a99d51ddca48e0733e1dc58 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Thu, 23 Jun 2016 12:36:04 +0100 Subject: [PATCH 2/4] update tests --- .../IdentifiersAndKeywords/W_ReservedWord01.fs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/IdentifiersAndKeywords/W_ReservedWord01.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/IdentifiersAndKeywords/W_ReservedWord01.fs index 8b3a8681950..070cfca18ff 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/IdentifiersAndKeywords/W_ReservedWord01.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/IdentifiersAndKeywords/W_ReservedWord01.fs @@ -3,8 +3,8 @@ // Verify warning when using a reserved identifier -//The identifier 'atomic' is reserved for future use by F# -let atomic = 1 + + exit 0 From a400ecf3f81c4bae2bfbe4d78a0921c534bd23c2 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Thu, 23 Jun 2016 13:09:16 +0100 Subject: [PATCH 3/4] fix test --- tests/fsharp/typecheck/sigs/neg02.bsl | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tests/fsharp/typecheck/sigs/neg02.bsl b/tests/fsharp/typecheck/sigs/neg02.bsl index 77a47cc01ce..8648e0076c6 100644 --- a/tests/fsharp/typecheck/sigs/neg02.bsl +++ b/tests/fsharp/typecheck/sigs/neg02.bsl @@ -1,8 +1,4 @@ -neg02.fs(6,8,6,15): parse error FS0046: The identifier 'virtual' is reserved for future use by F# - neg02.fs(6,8,6,15): parse error FS0010: Unexpected identifier in member definition -neg02.fs(11,8,11,14): parse error FS0046: The identifier 'method' is reserved for future use by F# - neg02.fs(17,7,17,13): parse error FS0010: Unexpected keyword 'static' in member definition. Expected 'member', 'override' or other token. From 7cae7f14560bff078ab8d86d8a6a9a62bca6970d Mon Sep 17 00:00:00 2001 From: Don Syme Date: Thu, 23 Jun 2016 14:23:10 +0100 Subject: [PATCH 4/4] fix test --- tests/fsharp/typecheck/sigs/neg02.bsl | 2 ++ .../tests/unittests/Tests.LanguageService.ErrorList.fs | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/fsharp/typecheck/sigs/neg02.bsl b/tests/fsharp/typecheck/sigs/neg02.bsl index 8648e0076c6..b7119f8e1d4 100644 --- a/tests/fsharp/typecheck/sigs/neg02.bsl +++ b/tests/fsharp/typecheck/sigs/neg02.bsl @@ -1,4 +1,6 @@ +neg02.fs(6,8,6,15): parse error FS0046: The identifier 'virtual' is reserved for future use by F# + neg02.fs(6,8,6,15): parse error FS0010: Unexpected identifier in member definition neg02.fs(17,7,17,13): parse error FS0010: Unexpected keyword 'static' in member definition. Expected 'member', 'override' or other token. diff --git a/vsintegration/tests/unittests/Tests.LanguageService.ErrorList.fs b/vsintegration/tests/unittests/Tests.LanguageService.ErrorList.fs index 86be53980a5..e06e5d29f24 100644 --- a/vsintegration/tests/unittests/Tests.LanguageService.ErrorList.fs +++ b/vsintegration/tests/unittests/Tests.LanguageService.ErrorList.fs @@ -876,8 +876,8 @@ but here has type member public this.``Warning.ConsistentWithLanguageService``() = let fileContent = """ open System - atomic atomic atomic atomic atomic atomic atomic atomic atomic atomic - atomic atomic atomic atomic atomic atomic atomic atomic atomic atomic""" + mixin mixin mixin mixin mixin mixin mixin mixin mixin mixin + mixin mixin mixin mixin mixin mixin mixin mixin mixin mixin""" let (_, project, file) = this.CreateSingleFileProject(fileContent, fileKind = SourceFileKind.FSX) TakeCoffeeBreak(this.VS) // Wait for the background compiler to catch up. let warnList = GetWarnings(project) @@ -887,8 +887,8 @@ but here has type member public this.``Warning.ConsistentWithLanguageService.Comment``() = let fileContent = """ open System - //atomic atomic atomic atomic atomic atomic atomic atomic atomic atomic - //atomic atomic atomic atomic atomic atomic atomic atomic atomic atomic""" + //mixin mixin mixin mixin mixin mixin mixin mixin mixin mixin + //mixin mixin mixin mixin mixin mixin mixin mixin mixin mixin""" let (_, project, file) = this.CreateSingleFileProject(fileContent, fileKind = SourceFileKind.FSX) TakeCoffeeBreak(this.VS) // Wait for the background compiler to catch up. let warnList = GetWarnings(project)