From 756e980bfd25da5f65f191ece08ebd4c8d8b8169 Mon Sep 17 00:00:00 2001 From: nojaf Date: Sat, 24 Apr 2021 21:12:55 +0200 Subject: [PATCH 1/2] Add KeywordString to SynConst. --- src/fsharp/CheckExpressions.fs | 3 +- src/fsharp/SyntaxTree.fs | 6 ++- src/fsharp/SyntaxTree.fsi | 4 ++ src/fsharp/lexhelp.fs | 6 +-- src/fsharp/pars.fsy | 20 ++++++--- .../SurfaceArea.netstandard.fs | 11 +++++ tests/service/Symbols.fs | 43 +++++++++++++++++++ 7 files changed, 81 insertions(+), 12 deletions(-) diff --git a/src/fsharp/CheckExpressions.fs b/src/fsharp/CheckExpressions.fs index 352aa63278a..5e530e32082 100644 --- a/src/fsharp/CheckExpressions.fs +++ b/src/fsharp/CheckExpressions.fs @@ -810,7 +810,8 @@ let TcConst cenv ty m env c = | SynConst.Measure(SynConst.UInt64 i, _, _) when expandedMeasurablesEnabled -> unifyMeasureArg (i=0UL) cenv.g.puint64_tcr c; Const.UInt64 i | SynConst.Measure(SynConst.UIntPtr i, _, _) when expandedMeasurablesEnabled -> unifyMeasureArg (i=0UL) cenv.g.punativeint_tcr c; Const.UIntPtr i | SynConst.Char c -> unif cenv.g.char_ty; Const.Char c - | SynConst.String (s, _, _) -> unif cenv.g.string_ty; Const.String s + | SynConst.String (s, _, _) + | SynConst.KeywordString(_, s, _) -> unif cenv.g.string_ty; Const.String s | SynConst.UserNum _ -> error (InternalError(FSComp.SR.tcUnexpectedBigRationalConstant(), m)) | SynConst.Measure _ -> error (Error(FSComp.SR.tcInvalidTypeForUnitsOfMeasure(), m)) | SynConst.UInt16s _ -> error (InternalError(FSComp.SR.tcUnexpectedConstUint16Array(), m)) diff --git a/src/fsharp/SyntaxTree.fs b/src/fsharp/SyntaxTree.fs index 415055ac092..046402828e8 100644 --- a/src/fsharp/SyntaxTree.fs +++ b/src/fsharp/SyntaxTree.fs @@ -116,10 +116,14 @@ type SynConst = | UInt16s of uint16[] | Measure of constant: SynConst * constantRange: Range * SynMeasure + + | KeywordString of constant: string * value: string * range: Range member c.Range dflt = match c with - | SynConst.String (_, _, m0) | SynConst.Bytes (_, _, m0) -> m0 + | SynConst.String (_, _, m0) + | SynConst.Bytes (_, _, m0) + | SynConst.KeywordString(_, _, m0) -> m0 | _ -> dflt [] diff --git a/src/fsharp/SyntaxTree.fsi b/src/fsharp/SyntaxTree.fsi index 4e94d6d86ed..662deb0dbf6 100644 --- a/src/fsharp/SyntaxTree.fsi +++ b/src/fsharp/SyntaxTree.fsi @@ -152,6 +152,10 @@ type SynConst = /// Old comment: "we never iterate, so the const here is not another SynConst.Measure" | Measure of constant: SynConst * constantRange: range * SynMeasure + + /// Source Line, File, and Path Identifiers + /// Containing both the original value as the evaluated value. + | KeywordString of constant: string * value: string * range: Range /// Gets the syntax range of this construct member Range: dflt: range -> range diff --git a/src/fsharp/lexhelp.fs b/src/fsharp/lexhelp.fs index 94c4be068d4..8fa659de6ee 100644 --- a/src/fsharp/lexhelp.fs +++ b/src/fsharp/lexhelp.fs @@ -396,11 +396,11 @@ module Keywords = if String.IsNullOrEmpty dirname then dirname else PathMap.applyDir args.pathMap dirname - |> KEYWORD_STRING + |> fun dir -> KEYWORD_STRING(s, dir) | "__SOURCE_FILE__" -> - KEYWORD_STRING (System.IO.Path.GetFileName((FileIndex.fileOfFileIndex lexbuf.StartPos.FileIndex))) + KEYWORD_STRING (s, System.IO.Path.GetFileName((FileIndex.fileOfFileIndex lexbuf.StartPos.FileIndex))) | "__LINE__" -> - KEYWORD_STRING (string lexbuf.StartPos.Line) + KEYWORD_STRING (s, string lexbuf.StartPos.Line) | _ -> IdentifierToken args lexbuf s diff --git a/src/fsharp/pars.fsy b/src/fsharp/pars.fsy index a287f3ad149..cddc74d892c 100644 --- a/src/fsharp/pars.fsy +++ b/src/fsharp/pars.fsy @@ -202,7 +202,7 @@ let rangeOfLongIdent(lid:LongIdent) = %token INTERP_STRING_END %token LBRACE RBRACE -%token KEYWORD_STRING // Like __SOURCE_DIRECTORY__ +%token KEYWORD_STRING // Like __SOURCE_DIRECTORY__ %token IDENT %token HASH_IDENT %token INFIX_STAR_STAR_OP @@ -646,7 +646,7 @@ hashDirectiveArgs: /* One argument to a #directive */ hashDirectiveArg: - | stringOrKeywordString + | string { let s, _ = $1 s } @@ -2214,7 +2214,7 @@ tyconDefnOrSpfnSimpleRepr: SynTypeDefnSimpleRepr.Record ($2, $3, lhs parseState) } /* An inline-assembly type definition, for FSharp.Core library only */ - | opt_attributes opt_declVisibility LPAREN HASH stringOrKeywordString HASH rparen + | opt_attributes opt_declVisibility LPAREN HASH string HASH rparen { if not (isNil $1) then errorR(Error(FSComp.SR.parsAttributesIllegalHere(), rhs parseState 1)) let lhsm = lhs parseState libraryOnlyError lhsm @@ -2922,10 +2922,14 @@ rawConstant: | BIGNUM { SynConst.UserNum $1 } - | stringOrKeywordString + | string { let s, synStringKind = $1 SynConst.String (s, synStringKind, lhs parseState) } + | keywordString + { let c,v = $1 + SynConst.KeywordString (c, v, lhs parseState) } + | BYTEARRAY { let (v, synByteStringKind, _) = $1 SynConst.Bytes (v, synByteStringKind, lhs parseState) } @@ -4518,7 +4522,7 @@ forLoopDirection: | DOWNTO { false } inlineAssemblyExpr: - | HASH stringOrKeywordString opt_inlineAssemblyTypeArg optCurriedArgExprs optInlineAssemblyReturnTypes HASH + | HASH string opt_inlineAssemblyTypeArg optCurriedArgExprs optInlineAssemblyReturnTypes HASH { libraryOnlyWarning (lhs parseState) let (s, _), sm = $2, rhs parseState 2 (fun m -> @@ -5556,11 +5560,13 @@ colonOrEquals: | EQUALS { } /* A literal string or a string from a keyword like __SOURCE_FILE__ */ -stringOrKeywordString: +string: | STRING { let (s, synStringKind, _) = $1 s, synStringKind } - | KEYWORD_STRING { $1, SynStringKind.Regular } + +keywordString: + | KEYWORD_STRING { $1 } interpolatedStringFill: | declExpr diff --git a/tests/FSharp.Compiler.Service.Tests/SurfaceArea.netstandard.fs b/tests/FSharp.Compiler.Service.Tests/SurfaceArea.netstandard.fs index ab20cf8f211..e1c21159688 100644 --- a/tests/FSharp.Compiler.Service.Tests/SurfaceArea.netstandard.fs +++ b/tests/FSharp.Compiler.Service.Tests/SurfaceArea.netstandard.fs @@ -5778,6 +5778,12 @@ FSharp.Compiler.Syntax.SynConst+Int64: Int64 Item FSharp.Compiler.Syntax.SynConst+Int64: Int64 get_Item() FSharp.Compiler.Syntax.SynConst+IntPtr: Int64 Item FSharp.Compiler.Syntax.SynConst+IntPtr: Int64 get_Item() +FSharp.Compiler.Syntax.SynConst+KeywordString: FSharp.Compiler.Text.Range get_range() +FSharp.Compiler.Syntax.SynConst+KeywordString: FSharp.Compiler.Text.Range range +FSharp.Compiler.Syntax.SynConst+KeywordString: System.String constant +FSharp.Compiler.Syntax.SynConst+KeywordString: System.String get_constant() +FSharp.Compiler.Syntax.SynConst+KeywordString: System.String get_value() +FSharp.Compiler.Syntax.SynConst+KeywordString: System.String value FSharp.Compiler.Syntax.SynConst+Measure: FSharp.Compiler.Syntax.SynConst constant FSharp.Compiler.Syntax.SynConst+Measure: FSharp.Compiler.Syntax.SynConst get_constant() FSharp.Compiler.Syntax.SynConst+Measure: FSharp.Compiler.Syntax.SynMeasure Item3 @@ -5804,6 +5810,7 @@ FSharp.Compiler.Syntax.SynConst+Tags: Int32 Int16 FSharp.Compiler.Syntax.SynConst+Tags: Int32 Int32 FSharp.Compiler.Syntax.SynConst+Tags: Int32 Int64 FSharp.Compiler.Syntax.SynConst+Tags: Int32 IntPtr +FSharp.Compiler.Syntax.SynConst+Tags: Int32 KeywordString FSharp.Compiler.Syntax.SynConst+Tags: Int32 Measure FSharp.Compiler.Syntax.SynConst+Tags: Int32 SByte FSharp.Compiler.Syntax.SynConst+Tags: Int32 Single @@ -5839,6 +5846,7 @@ FSharp.Compiler.Syntax.SynConst: Boolean IsInt16 FSharp.Compiler.Syntax.SynConst: Boolean IsInt32 FSharp.Compiler.Syntax.SynConst: Boolean IsInt64 FSharp.Compiler.Syntax.SynConst: Boolean IsIntPtr +FSharp.Compiler.Syntax.SynConst: Boolean IsKeywordString FSharp.Compiler.Syntax.SynConst: Boolean IsMeasure FSharp.Compiler.Syntax.SynConst: Boolean IsSByte FSharp.Compiler.Syntax.SynConst: Boolean IsSingle @@ -5860,6 +5868,7 @@ FSharp.Compiler.Syntax.SynConst: Boolean get_IsInt16() FSharp.Compiler.Syntax.SynConst: Boolean get_IsInt32() FSharp.Compiler.Syntax.SynConst: Boolean get_IsInt64() FSharp.Compiler.Syntax.SynConst: Boolean get_IsIntPtr() +FSharp.Compiler.Syntax.SynConst: Boolean get_IsKeywordString() FSharp.Compiler.Syntax.SynConst: Boolean get_IsMeasure() FSharp.Compiler.Syntax.SynConst: Boolean get_IsSByte() FSharp.Compiler.Syntax.SynConst: Boolean get_IsSingle() @@ -5881,6 +5890,7 @@ FSharp.Compiler.Syntax.SynConst: FSharp.Compiler.Syntax.SynConst NewInt16(Int16) FSharp.Compiler.Syntax.SynConst: FSharp.Compiler.Syntax.SynConst NewInt32(Int32) FSharp.Compiler.Syntax.SynConst: FSharp.Compiler.Syntax.SynConst NewInt64(Int64) FSharp.Compiler.Syntax.SynConst: FSharp.Compiler.Syntax.SynConst NewIntPtr(Int64) +FSharp.Compiler.Syntax.SynConst: FSharp.Compiler.Syntax.SynConst NewKeywordString(System.String, System.String, FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynConst: FSharp.Compiler.Syntax.SynConst NewMeasure(FSharp.Compiler.Syntax.SynConst, FSharp.Compiler.Text.Range, FSharp.Compiler.Syntax.SynMeasure) FSharp.Compiler.Syntax.SynConst: FSharp.Compiler.Syntax.SynConst NewSByte(SByte) FSharp.Compiler.Syntax.SynConst: FSharp.Compiler.Syntax.SynConst NewSingle(Single) @@ -5903,6 +5913,7 @@ FSharp.Compiler.Syntax.SynConst: FSharp.Compiler.Syntax.SynConst+Int16 FSharp.Compiler.Syntax.SynConst: FSharp.Compiler.Syntax.SynConst+Int32 FSharp.Compiler.Syntax.SynConst: FSharp.Compiler.Syntax.SynConst+Int64 FSharp.Compiler.Syntax.SynConst: FSharp.Compiler.Syntax.SynConst+IntPtr +FSharp.Compiler.Syntax.SynConst: FSharp.Compiler.Syntax.SynConst+KeywordString FSharp.Compiler.Syntax.SynConst: FSharp.Compiler.Syntax.SynConst+Measure FSharp.Compiler.Syntax.SynConst: FSharp.Compiler.Syntax.SynConst+SByte FSharp.Compiler.Syntax.SynConst: FSharp.Compiler.Syntax.SynConst+Single diff --git a/tests/service/Symbols.fs b/tests/service/Symbols.fs index d62e57c930a..9ac29eba2da 100644 --- a/tests/service/Symbols.fs +++ b/tests/service/Symbols.fs @@ -764,4 +764,47 @@ with ]) ])) -> assertRange (6, 2) (6, 21) range assertRange (6, 2) (6, 21) clause.Range + | _ -> Assert.Fail "Could not get valid AST" + +module KeywordStrings = + [] + let ``__LINE__`` () = + let parseResults = + getParseResults + """ +__LINE__""" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.DoExpr(expr = SynExpr.Const(SynConst.KeywordString("__LINE__", "2", range), _)) + ]) ])) -> + assertRange (2, 0) (2, 8) range + | _ -> Assert.Fail "Could not get valid AST" + + [] + let ``__SOURCE_DIRECTORY__`` () = + let parseResults = + getParseResults + """ +__SOURCE_DIRECTORY__""" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.DoExpr(expr = SynExpr.Const(SynConst.KeywordString("__SOURCE_DIRECTORY__", _, range), _)) + ]) ])) -> + assertRange (2, 0) (2, 20) range + | _ -> Assert.Fail "Could not get valid AST" + + [] + let ``__SOURCE_FILE__`` () = + let parseResults = + getParseResults + """ +__SOURCE_FILE__""" + + match parseResults with + | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ + SynModuleDecl.DoExpr(expr = SynExpr.Const(SynConst.KeywordString("__SOURCE_FILE__", _, range), _)) + ]) ])) -> + assertRange (2, 0) (2, 15) range | _ -> Assert.Fail "Could not get valid AST" \ No newline at end of file From 94adf14c55f8bccf3bb46b636573930ffe1bfda3 Mon Sep 17 00:00:00 2001 From: nojaf Date: Wed, 28 Apr 2021 21:08:26 +0200 Subject: [PATCH 2/2] Renamed KeywordString to SourceIdentifier. --- src/fsharp/CheckExpressions.fs | 2 +- src/fsharp/SyntaxTree.fs | 4 ++-- src/fsharp/SyntaxTree.fsi | 2 +- src/fsharp/pars.fsy | 6 ++--- .../SurfaceArea.netstandard.fs | 22 +++++++++---------- tests/service/Symbols.fs | 8 +++---- 6 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/fsharp/CheckExpressions.fs b/src/fsharp/CheckExpressions.fs index 5e530e32082..6bb4f426722 100644 --- a/src/fsharp/CheckExpressions.fs +++ b/src/fsharp/CheckExpressions.fs @@ -811,7 +811,7 @@ let TcConst cenv ty m env c = | SynConst.Measure(SynConst.UIntPtr i, _, _) when expandedMeasurablesEnabled -> unifyMeasureArg (i=0UL) cenv.g.punativeint_tcr c; Const.UIntPtr i | SynConst.Char c -> unif cenv.g.char_ty; Const.Char c | SynConst.String (s, _, _) - | SynConst.KeywordString(_, s, _) -> unif cenv.g.string_ty; Const.String s + | SynConst.SourceIdentifier (_, s, _) -> unif cenv.g.string_ty; Const.String s | SynConst.UserNum _ -> error (InternalError(FSComp.SR.tcUnexpectedBigRationalConstant(), m)) | SynConst.Measure _ -> error (Error(FSComp.SR.tcInvalidTypeForUnitsOfMeasure(), m)) | SynConst.UInt16s _ -> error (InternalError(FSComp.SR.tcUnexpectedConstUint16Array(), m)) diff --git a/src/fsharp/SyntaxTree.fs b/src/fsharp/SyntaxTree.fs index 046402828e8..703fe29e5a6 100644 --- a/src/fsharp/SyntaxTree.fs +++ b/src/fsharp/SyntaxTree.fs @@ -117,13 +117,13 @@ type SynConst = | Measure of constant: SynConst * constantRange: Range * SynMeasure - | KeywordString of constant: string * value: string * range: Range + | SourceIdentifier of constant: string * value: string * range: Range member c.Range dflt = match c with | SynConst.String (_, _, m0) | SynConst.Bytes (_, _, m0) - | SynConst.KeywordString(_, _, m0) -> m0 + | SynConst.SourceIdentifier(_, _, m0) -> m0 | _ -> dflt [] diff --git a/src/fsharp/SyntaxTree.fsi b/src/fsharp/SyntaxTree.fsi index 662deb0dbf6..8d2d4414912 100644 --- a/src/fsharp/SyntaxTree.fsi +++ b/src/fsharp/SyntaxTree.fsi @@ -155,7 +155,7 @@ type SynConst = /// Source Line, File, and Path Identifiers /// Containing both the original value as the evaluated value. - | KeywordString of constant: string * value: string * range: Range + | SourceIdentifier of constant: string * value: string * range: Range /// Gets the syntax range of this construct member Range: dflt: range -> range diff --git a/src/fsharp/pars.fsy b/src/fsharp/pars.fsy index cddc74d892c..97b866b7695 100644 --- a/src/fsharp/pars.fsy +++ b/src/fsharp/pars.fsy @@ -2926,9 +2926,9 @@ rawConstant: { let s, synStringKind = $1 SynConst.String (s, synStringKind, lhs parseState) } - | keywordString + | sourceIdentifier { let c,v = $1 - SynConst.KeywordString (c, v, lhs parseState) } + SynConst.SourceIdentifier (c, v, lhs parseState) } | BYTEARRAY { let (v, synByteStringKind, _) = $1 @@ -5565,7 +5565,7 @@ string: { let (s, synStringKind, _) = $1 s, synStringKind } -keywordString: +sourceIdentifier: | KEYWORD_STRING { $1 } interpolatedStringFill: diff --git a/tests/FSharp.Compiler.Service.Tests/SurfaceArea.netstandard.fs b/tests/FSharp.Compiler.Service.Tests/SurfaceArea.netstandard.fs index e1c21159688..00665a2e22c 100644 --- a/tests/FSharp.Compiler.Service.Tests/SurfaceArea.netstandard.fs +++ b/tests/FSharp.Compiler.Service.Tests/SurfaceArea.netstandard.fs @@ -5778,12 +5778,6 @@ FSharp.Compiler.Syntax.SynConst+Int64: Int64 Item FSharp.Compiler.Syntax.SynConst+Int64: Int64 get_Item() FSharp.Compiler.Syntax.SynConst+IntPtr: Int64 Item FSharp.Compiler.Syntax.SynConst+IntPtr: Int64 get_Item() -FSharp.Compiler.Syntax.SynConst+KeywordString: FSharp.Compiler.Text.Range get_range() -FSharp.Compiler.Syntax.SynConst+KeywordString: FSharp.Compiler.Text.Range range -FSharp.Compiler.Syntax.SynConst+KeywordString: System.String constant -FSharp.Compiler.Syntax.SynConst+KeywordString: System.String get_constant() -FSharp.Compiler.Syntax.SynConst+KeywordString: System.String get_value() -FSharp.Compiler.Syntax.SynConst+KeywordString: System.String value FSharp.Compiler.Syntax.SynConst+Measure: FSharp.Compiler.Syntax.SynConst constant FSharp.Compiler.Syntax.SynConst+Measure: FSharp.Compiler.Syntax.SynConst get_constant() FSharp.Compiler.Syntax.SynConst+Measure: FSharp.Compiler.Syntax.SynMeasure Item3 @@ -5794,6 +5788,12 @@ FSharp.Compiler.Syntax.SynConst+SByte: SByte Item FSharp.Compiler.Syntax.SynConst+SByte: SByte get_Item() FSharp.Compiler.Syntax.SynConst+Single: Single Item FSharp.Compiler.Syntax.SynConst+Single: Single get_Item() +FSharp.Compiler.Syntax.SynConst+SourceIdentifier: FSharp.Compiler.Text.Range get_range() +FSharp.Compiler.Syntax.SynConst+SourceIdentifier: FSharp.Compiler.Text.Range range +FSharp.Compiler.Syntax.SynConst+SourceIdentifier: System.String constant +FSharp.Compiler.Syntax.SynConst+SourceIdentifier: System.String get_constant() +FSharp.Compiler.Syntax.SynConst+SourceIdentifier: System.String get_value() +FSharp.Compiler.Syntax.SynConst+SourceIdentifier: System.String value FSharp.Compiler.Syntax.SynConst+String: FSharp.Compiler.Syntax.SynStringKind get_synStringKind() FSharp.Compiler.Syntax.SynConst+String: FSharp.Compiler.Syntax.SynStringKind synStringKind FSharp.Compiler.Syntax.SynConst+String: FSharp.Compiler.Text.Range get_range() @@ -5810,10 +5810,10 @@ FSharp.Compiler.Syntax.SynConst+Tags: Int32 Int16 FSharp.Compiler.Syntax.SynConst+Tags: Int32 Int32 FSharp.Compiler.Syntax.SynConst+Tags: Int32 Int64 FSharp.Compiler.Syntax.SynConst+Tags: Int32 IntPtr -FSharp.Compiler.Syntax.SynConst+Tags: Int32 KeywordString FSharp.Compiler.Syntax.SynConst+Tags: Int32 Measure FSharp.Compiler.Syntax.SynConst+Tags: Int32 SByte FSharp.Compiler.Syntax.SynConst+Tags: Int32 Single +FSharp.Compiler.Syntax.SynConst+Tags: Int32 SourceIdentifier FSharp.Compiler.Syntax.SynConst+Tags: Int32 String FSharp.Compiler.Syntax.SynConst+Tags: Int32 UInt16 FSharp.Compiler.Syntax.SynConst+Tags: Int32 UInt16s @@ -5846,10 +5846,10 @@ FSharp.Compiler.Syntax.SynConst: Boolean IsInt16 FSharp.Compiler.Syntax.SynConst: Boolean IsInt32 FSharp.Compiler.Syntax.SynConst: Boolean IsInt64 FSharp.Compiler.Syntax.SynConst: Boolean IsIntPtr -FSharp.Compiler.Syntax.SynConst: Boolean IsKeywordString FSharp.Compiler.Syntax.SynConst: Boolean IsMeasure FSharp.Compiler.Syntax.SynConst: Boolean IsSByte FSharp.Compiler.Syntax.SynConst: Boolean IsSingle +FSharp.Compiler.Syntax.SynConst: Boolean IsSourceIdentifier FSharp.Compiler.Syntax.SynConst: Boolean IsString FSharp.Compiler.Syntax.SynConst: Boolean IsUInt16 FSharp.Compiler.Syntax.SynConst: Boolean IsUInt16s @@ -5868,10 +5868,10 @@ FSharp.Compiler.Syntax.SynConst: Boolean get_IsInt16() FSharp.Compiler.Syntax.SynConst: Boolean get_IsInt32() FSharp.Compiler.Syntax.SynConst: Boolean get_IsInt64() FSharp.Compiler.Syntax.SynConst: Boolean get_IsIntPtr() -FSharp.Compiler.Syntax.SynConst: Boolean get_IsKeywordString() FSharp.Compiler.Syntax.SynConst: Boolean get_IsMeasure() FSharp.Compiler.Syntax.SynConst: Boolean get_IsSByte() FSharp.Compiler.Syntax.SynConst: Boolean get_IsSingle() +FSharp.Compiler.Syntax.SynConst: Boolean get_IsSourceIdentifier() FSharp.Compiler.Syntax.SynConst: Boolean get_IsString() FSharp.Compiler.Syntax.SynConst: Boolean get_IsUInt16() FSharp.Compiler.Syntax.SynConst: Boolean get_IsUInt16s() @@ -5890,10 +5890,10 @@ FSharp.Compiler.Syntax.SynConst: FSharp.Compiler.Syntax.SynConst NewInt16(Int16) FSharp.Compiler.Syntax.SynConst: FSharp.Compiler.Syntax.SynConst NewInt32(Int32) FSharp.Compiler.Syntax.SynConst: FSharp.Compiler.Syntax.SynConst NewInt64(Int64) FSharp.Compiler.Syntax.SynConst: FSharp.Compiler.Syntax.SynConst NewIntPtr(Int64) -FSharp.Compiler.Syntax.SynConst: FSharp.Compiler.Syntax.SynConst NewKeywordString(System.String, System.String, FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynConst: FSharp.Compiler.Syntax.SynConst NewMeasure(FSharp.Compiler.Syntax.SynConst, FSharp.Compiler.Text.Range, FSharp.Compiler.Syntax.SynMeasure) FSharp.Compiler.Syntax.SynConst: FSharp.Compiler.Syntax.SynConst NewSByte(SByte) FSharp.Compiler.Syntax.SynConst: FSharp.Compiler.Syntax.SynConst NewSingle(Single) +FSharp.Compiler.Syntax.SynConst: FSharp.Compiler.Syntax.SynConst NewSourceIdentifier(System.String, System.String, FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynConst: FSharp.Compiler.Syntax.SynConst NewString(System.String, FSharp.Compiler.Syntax.SynStringKind, FSharp.Compiler.Text.Range) FSharp.Compiler.Syntax.SynConst: FSharp.Compiler.Syntax.SynConst NewUInt16(UInt16) FSharp.Compiler.Syntax.SynConst: FSharp.Compiler.Syntax.SynConst NewUInt16s(UInt16[]) @@ -5913,10 +5913,10 @@ FSharp.Compiler.Syntax.SynConst: FSharp.Compiler.Syntax.SynConst+Int16 FSharp.Compiler.Syntax.SynConst: FSharp.Compiler.Syntax.SynConst+Int32 FSharp.Compiler.Syntax.SynConst: FSharp.Compiler.Syntax.SynConst+Int64 FSharp.Compiler.Syntax.SynConst: FSharp.Compiler.Syntax.SynConst+IntPtr -FSharp.Compiler.Syntax.SynConst: FSharp.Compiler.Syntax.SynConst+KeywordString FSharp.Compiler.Syntax.SynConst: FSharp.Compiler.Syntax.SynConst+Measure FSharp.Compiler.Syntax.SynConst: FSharp.Compiler.Syntax.SynConst+SByte FSharp.Compiler.Syntax.SynConst: FSharp.Compiler.Syntax.SynConst+Single +FSharp.Compiler.Syntax.SynConst: FSharp.Compiler.Syntax.SynConst+SourceIdentifier FSharp.Compiler.Syntax.SynConst: FSharp.Compiler.Syntax.SynConst+String FSharp.Compiler.Syntax.SynConst: FSharp.Compiler.Syntax.SynConst+Tags FSharp.Compiler.Syntax.SynConst: FSharp.Compiler.Syntax.SynConst+UInt16 diff --git a/tests/service/Symbols.fs b/tests/service/Symbols.fs index 9ac29eba2da..03e32098547 100644 --- a/tests/service/Symbols.fs +++ b/tests/service/Symbols.fs @@ -766,7 +766,7 @@ with assertRange (6, 2) (6, 21) clause.Range | _ -> Assert.Fail "Could not get valid AST" -module KeywordStrings = +module SourceIdentifiers = [] let ``__LINE__`` () = let parseResults = @@ -776,7 +776,7 @@ __LINE__""" match parseResults with | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.DoExpr(expr = SynExpr.Const(SynConst.KeywordString("__LINE__", "2", range), _)) + SynModuleDecl.DoExpr(expr = SynExpr.Const(SynConst.SourceIdentifier("__LINE__", "2", range), _)) ]) ])) -> assertRange (2, 0) (2, 8) range | _ -> Assert.Fail "Could not get valid AST" @@ -790,7 +790,7 @@ __SOURCE_DIRECTORY__""" match parseResults with | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.DoExpr(expr = SynExpr.Const(SynConst.KeywordString("__SOURCE_DIRECTORY__", _, range), _)) + SynModuleDecl.DoExpr(expr = SynExpr.Const(SynConst.SourceIdentifier("__SOURCE_DIRECTORY__", _, range), _)) ]) ])) -> assertRange (2, 0) (2, 20) range | _ -> Assert.Fail "Could not get valid AST" @@ -804,7 +804,7 @@ __SOURCE_FILE__""" match parseResults with | ParsedInput.ImplFile (ParsedImplFileInput (modules = [ SynModuleOrNamespace.SynModuleOrNamespace(decls = [ - SynModuleDecl.DoExpr(expr = SynExpr.Const(SynConst.KeywordString("__SOURCE_FILE__", _, range), _)) + SynModuleDecl.DoExpr(expr = SynExpr.Const(SynConst.SourceIdentifier("__SOURCE_FILE__", _, range), _)) ]) ])) -> assertRange (2, 0) (2, 15) range | _ -> Assert.Fail "Could not get valid AST" \ No newline at end of file