Skip to content

Commit 94adf14

Browse files
committed
Renamed KeywordString to SourceIdentifier.
1 parent 756e980 commit 94adf14

File tree

6 files changed

+22
-22
lines changed

6 files changed

+22
-22
lines changed

src/fsharp/CheckExpressions.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -811,7 +811,7 @@ let TcConst cenv ty m env c =
811811
| SynConst.Measure(SynConst.UIntPtr i, _, _) when expandedMeasurablesEnabled -> unifyMeasureArg (i=0UL) cenv.g.punativeint_tcr c; Const.UIntPtr i
812812
| SynConst.Char c -> unif cenv.g.char_ty; Const.Char c
813813
| SynConst.String (s, _, _)
814-
| SynConst.KeywordString(_, s, _) -> unif cenv.g.string_ty; Const.String s
814+
| SynConst.SourceIdentifier (_, s, _) -> unif cenv.g.string_ty; Const.String s
815815
| SynConst.UserNum _ -> error (InternalError(FSComp.SR.tcUnexpectedBigRationalConstant(), m))
816816
| SynConst.Measure _ -> error (Error(FSComp.SR.tcInvalidTypeForUnitsOfMeasure(), m))
817817
| SynConst.UInt16s _ -> error (InternalError(FSComp.SR.tcUnexpectedConstUint16Array(), m))

src/fsharp/SyntaxTree.fs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,13 +117,13 @@ type SynConst =
117117

118118
| Measure of constant: SynConst * constantRange: Range * SynMeasure
119119

120-
| KeywordString of constant: string * value: string * range: Range
120+
| SourceIdentifier of constant: string * value: string * range: Range
121121

122122
member c.Range dflt =
123123
match c with
124124
| SynConst.String (_, _, m0)
125125
| SynConst.Bytes (_, _, m0)
126-
| SynConst.KeywordString(_, _, m0) -> m0
126+
| SynConst.SourceIdentifier(_, _, m0) -> m0
127127
| _ -> dflt
128128

129129
[<NoEquality; NoComparison; RequireQualifiedAccess>]

src/fsharp/SyntaxTree.fsi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ type SynConst =
155155

156156
/// Source Line, File, and Path Identifiers
157157
/// Containing both the original value as the evaluated value.
158-
| KeywordString of constant: string * value: string * range: Range
158+
| SourceIdentifier of constant: string * value: string * range: Range
159159

160160
/// Gets the syntax range of this construct
161161
member Range: dflt: range -> range

src/fsharp/pars.fsy

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2926,9 +2926,9 @@ rawConstant:
29262926
{ let s, synStringKind = $1
29272927
SynConst.String (s, synStringKind, lhs parseState) }
29282928

2929-
| keywordString
2929+
| sourceIdentifier
29302930
{ let c,v = $1
2931-
SynConst.KeywordString (c, v, lhs parseState) }
2931+
SynConst.SourceIdentifier (c, v, lhs parseState) }
29322932

29332933
| BYTEARRAY
29342934
{ let (v, synByteStringKind, _) = $1
@@ -5565,7 +5565,7 @@ string:
55655565
{ let (s, synStringKind, _) = $1
55665566
s, synStringKind }
55675567

5568-
keywordString:
5568+
sourceIdentifier:
55695569
| KEYWORD_STRING { $1 }
55705570

55715571
interpolatedStringFill:

tests/FSharp.Compiler.Service.Tests/SurfaceArea.netstandard.fs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5778,12 +5778,6 @@ FSharp.Compiler.Syntax.SynConst+Int64: Int64 Item
57785778
FSharp.Compiler.Syntax.SynConst+Int64: Int64 get_Item()
57795779
FSharp.Compiler.Syntax.SynConst+IntPtr: Int64 Item
57805780
FSharp.Compiler.Syntax.SynConst+IntPtr: Int64 get_Item()
5781-
FSharp.Compiler.Syntax.SynConst+KeywordString: FSharp.Compiler.Text.Range get_range()
5782-
FSharp.Compiler.Syntax.SynConst+KeywordString: FSharp.Compiler.Text.Range range
5783-
FSharp.Compiler.Syntax.SynConst+KeywordString: System.String constant
5784-
FSharp.Compiler.Syntax.SynConst+KeywordString: System.String get_constant()
5785-
FSharp.Compiler.Syntax.SynConst+KeywordString: System.String get_value()
5786-
FSharp.Compiler.Syntax.SynConst+KeywordString: System.String value
57875781
FSharp.Compiler.Syntax.SynConst+Measure: FSharp.Compiler.Syntax.SynConst constant
57885782
FSharp.Compiler.Syntax.SynConst+Measure: FSharp.Compiler.Syntax.SynConst get_constant()
57895783
FSharp.Compiler.Syntax.SynConst+Measure: FSharp.Compiler.Syntax.SynMeasure Item3
@@ -5794,6 +5788,12 @@ FSharp.Compiler.Syntax.SynConst+SByte: SByte Item
57945788
FSharp.Compiler.Syntax.SynConst+SByte: SByte get_Item()
57955789
FSharp.Compiler.Syntax.SynConst+Single: Single Item
57965790
FSharp.Compiler.Syntax.SynConst+Single: Single get_Item()
5791+
FSharp.Compiler.Syntax.SynConst+SourceIdentifier: FSharp.Compiler.Text.Range get_range()
5792+
FSharp.Compiler.Syntax.SynConst+SourceIdentifier: FSharp.Compiler.Text.Range range
5793+
FSharp.Compiler.Syntax.SynConst+SourceIdentifier: System.String constant
5794+
FSharp.Compiler.Syntax.SynConst+SourceIdentifier: System.String get_constant()
5795+
FSharp.Compiler.Syntax.SynConst+SourceIdentifier: System.String get_value()
5796+
FSharp.Compiler.Syntax.SynConst+SourceIdentifier: System.String value
57975797
FSharp.Compiler.Syntax.SynConst+String: FSharp.Compiler.Syntax.SynStringKind get_synStringKind()
57985798
FSharp.Compiler.Syntax.SynConst+String: FSharp.Compiler.Syntax.SynStringKind synStringKind
57995799
FSharp.Compiler.Syntax.SynConst+String: FSharp.Compiler.Text.Range get_range()
@@ -5810,10 +5810,10 @@ FSharp.Compiler.Syntax.SynConst+Tags: Int32 Int16
58105810
FSharp.Compiler.Syntax.SynConst+Tags: Int32 Int32
58115811
FSharp.Compiler.Syntax.SynConst+Tags: Int32 Int64
58125812
FSharp.Compiler.Syntax.SynConst+Tags: Int32 IntPtr
5813-
FSharp.Compiler.Syntax.SynConst+Tags: Int32 KeywordString
58145813
FSharp.Compiler.Syntax.SynConst+Tags: Int32 Measure
58155814
FSharp.Compiler.Syntax.SynConst+Tags: Int32 SByte
58165815
FSharp.Compiler.Syntax.SynConst+Tags: Int32 Single
5816+
FSharp.Compiler.Syntax.SynConst+Tags: Int32 SourceIdentifier
58175817
FSharp.Compiler.Syntax.SynConst+Tags: Int32 String
58185818
FSharp.Compiler.Syntax.SynConst+Tags: Int32 UInt16
58195819
FSharp.Compiler.Syntax.SynConst+Tags: Int32 UInt16s
@@ -5846,10 +5846,10 @@ FSharp.Compiler.Syntax.SynConst: Boolean IsInt16
58465846
FSharp.Compiler.Syntax.SynConst: Boolean IsInt32
58475847
FSharp.Compiler.Syntax.SynConst: Boolean IsInt64
58485848
FSharp.Compiler.Syntax.SynConst: Boolean IsIntPtr
5849-
FSharp.Compiler.Syntax.SynConst: Boolean IsKeywordString
58505849
FSharp.Compiler.Syntax.SynConst: Boolean IsMeasure
58515850
FSharp.Compiler.Syntax.SynConst: Boolean IsSByte
58525851
FSharp.Compiler.Syntax.SynConst: Boolean IsSingle
5852+
FSharp.Compiler.Syntax.SynConst: Boolean IsSourceIdentifier
58535853
FSharp.Compiler.Syntax.SynConst: Boolean IsString
58545854
FSharp.Compiler.Syntax.SynConst: Boolean IsUInt16
58555855
FSharp.Compiler.Syntax.SynConst: Boolean IsUInt16s
@@ -5868,10 +5868,10 @@ FSharp.Compiler.Syntax.SynConst: Boolean get_IsInt16()
58685868
FSharp.Compiler.Syntax.SynConst: Boolean get_IsInt32()
58695869
FSharp.Compiler.Syntax.SynConst: Boolean get_IsInt64()
58705870
FSharp.Compiler.Syntax.SynConst: Boolean get_IsIntPtr()
5871-
FSharp.Compiler.Syntax.SynConst: Boolean get_IsKeywordString()
58725871
FSharp.Compiler.Syntax.SynConst: Boolean get_IsMeasure()
58735872
FSharp.Compiler.Syntax.SynConst: Boolean get_IsSByte()
58745873
FSharp.Compiler.Syntax.SynConst: Boolean get_IsSingle()
5874+
FSharp.Compiler.Syntax.SynConst: Boolean get_IsSourceIdentifier()
58755875
FSharp.Compiler.Syntax.SynConst: Boolean get_IsString()
58765876
FSharp.Compiler.Syntax.SynConst: Boolean get_IsUInt16()
58775877
FSharp.Compiler.Syntax.SynConst: Boolean get_IsUInt16s()
@@ -5890,10 +5890,10 @@ FSharp.Compiler.Syntax.SynConst: FSharp.Compiler.Syntax.SynConst NewInt16(Int16)
58905890
FSharp.Compiler.Syntax.SynConst: FSharp.Compiler.Syntax.SynConst NewInt32(Int32)
58915891
FSharp.Compiler.Syntax.SynConst: FSharp.Compiler.Syntax.SynConst NewInt64(Int64)
58925892
FSharp.Compiler.Syntax.SynConst: FSharp.Compiler.Syntax.SynConst NewIntPtr(Int64)
5893-
FSharp.Compiler.Syntax.SynConst: FSharp.Compiler.Syntax.SynConst NewKeywordString(System.String, System.String, FSharp.Compiler.Text.Range)
58945893
FSharp.Compiler.Syntax.SynConst: FSharp.Compiler.Syntax.SynConst NewMeasure(FSharp.Compiler.Syntax.SynConst, FSharp.Compiler.Text.Range, FSharp.Compiler.Syntax.SynMeasure)
58955894
FSharp.Compiler.Syntax.SynConst: FSharp.Compiler.Syntax.SynConst NewSByte(SByte)
58965895
FSharp.Compiler.Syntax.SynConst: FSharp.Compiler.Syntax.SynConst NewSingle(Single)
5896+
FSharp.Compiler.Syntax.SynConst: FSharp.Compiler.Syntax.SynConst NewSourceIdentifier(System.String, System.String, FSharp.Compiler.Text.Range)
58975897
FSharp.Compiler.Syntax.SynConst: FSharp.Compiler.Syntax.SynConst NewString(System.String, FSharp.Compiler.Syntax.SynStringKind, FSharp.Compiler.Text.Range)
58985898
FSharp.Compiler.Syntax.SynConst: FSharp.Compiler.Syntax.SynConst NewUInt16(UInt16)
58995899
FSharp.Compiler.Syntax.SynConst: FSharp.Compiler.Syntax.SynConst NewUInt16s(UInt16[])
@@ -5913,10 +5913,10 @@ FSharp.Compiler.Syntax.SynConst: FSharp.Compiler.Syntax.SynConst+Int16
59135913
FSharp.Compiler.Syntax.SynConst: FSharp.Compiler.Syntax.SynConst+Int32
59145914
FSharp.Compiler.Syntax.SynConst: FSharp.Compiler.Syntax.SynConst+Int64
59155915
FSharp.Compiler.Syntax.SynConst: FSharp.Compiler.Syntax.SynConst+IntPtr
5916-
FSharp.Compiler.Syntax.SynConst: FSharp.Compiler.Syntax.SynConst+KeywordString
59175916
FSharp.Compiler.Syntax.SynConst: FSharp.Compiler.Syntax.SynConst+Measure
59185917
FSharp.Compiler.Syntax.SynConst: FSharp.Compiler.Syntax.SynConst+SByte
59195918
FSharp.Compiler.Syntax.SynConst: FSharp.Compiler.Syntax.SynConst+Single
5919+
FSharp.Compiler.Syntax.SynConst: FSharp.Compiler.Syntax.SynConst+SourceIdentifier
59205920
FSharp.Compiler.Syntax.SynConst: FSharp.Compiler.Syntax.SynConst+String
59215921
FSharp.Compiler.Syntax.SynConst: FSharp.Compiler.Syntax.SynConst+Tags
59225922
FSharp.Compiler.Syntax.SynConst: FSharp.Compiler.Syntax.SynConst+UInt16

tests/service/Symbols.fs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -766,7 +766,7 @@ with
766766
assertRange (6, 2) (6, 21) clause.Range
767767
| _ -> Assert.Fail "Could not get valid AST"
768768

769-
module KeywordStrings =
769+
module SourceIdentifiers =
770770
[<Test>]
771771
let ``__LINE__`` () =
772772
let parseResults =
@@ -776,7 +776,7 @@ __LINE__"""
776776

777777
match parseResults with
778778
| ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [
779-
SynModuleDecl.DoExpr(expr = SynExpr.Const(SynConst.KeywordString("__LINE__", "2", range), _))
779+
SynModuleDecl.DoExpr(expr = SynExpr.Const(SynConst.SourceIdentifier("__LINE__", "2", range), _))
780780
]) ])) ->
781781
assertRange (2, 0) (2, 8) range
782782
| _ -> Assert.Fail "Could not get valid AST"
@@ -790,7 +790,7 @@ __SOURCE_DIRECTORY__"""
790790

791791
match parseResults with
792792
| ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [
793-
SynModuleDecl.DoExpr(expr = SynExpr.Const(SynConst.KeywordString("__SOURCE_DIRECTORY__", _, range), _))
793+
SynModuleDecl.DoExpr(expr = SynExpr.Const(SynConst.SourceIdentifier("__SOURCE_DIRECTORY__", _, range), _))
794794
]) ])) ->
795795
assertRange (2, 0) (2, 20) range
796796
| _ -> Assert.Fail "Could not get valid AST"
@@ -804,7 +804,7 @@ __SOURCE_FILE__"""
804804

805805
match parseResults with
806806
| ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [
807-
SynModuleDecl.DoExpr(expr = SynExpr.Const(SynConst.KeywordString("__SOURCE_FILE__", _, range), _))
807+
SynModuleDecl.DoExpr(expr = SynExpr.Const(SynConst.SourceIdentifier("__SOURCE_FILE__", _, range), _))
808808
]) ])) ->
809809
assertRange (2, 0) (2, 15) range
810810
| _ -> Assert.Fail "Could not get valid AST"

0 commit comments

Comments
 (0)