@@ -695,7 +695,7 @@ moduleSpfn:
695
695
valSpfn:
696
696
| opt_attributes opt_access VAL opt_attributes opt_inline opt_mutable opt_access nameop opt_explicitValTyparDecls COLON topTypeWithTypeConstraints optLiteralValueSpfn
697
697
{ if Option.isSome $2 then errorR(Error(FSComp.SR.parsVisibilityDeclarationsShouldComePriorToIdentifier(), rhs parseState 2))
698
- let attr1, attr2, isInline, isMutable, vis2, id, doc, explicitValTyparDecls, (ty, arity), (mEquals, konst: SynExpr option) = ($1), ($4), ($5), ($6), ($7), ($8), grabXmlDoc(parseState, $1, 1), ($9), ($11), ($12)
698
+ let attr1, attr2, isInline, isMutable, vis2, id, doc, explicitValTyparDecls, (ty, arity), (mEquals, konst: SynExpr option) = ($1), ($4), (Option.isSome $5), ($6), ($7), ($8), grabXmlDoc(parseState, $1, 1), ($9), ($11), ($12)
699
699
if not (isNil attr2) then errorR(Deprecated(FSComp.SR.parsAttributesMustComeBeforeVal(), rhs parseState 4))
700
700
let m =
701
701
rhs2 parseState 1 11
@@ -705,7 +705,7 @@ valSpfn:
705
705
| None -> m
706
706
| Some e -> unionRanges m e.Range
707
707
let mVal = rhs parseState 3
708
- let trivia: SynValSigTrivia = { LeadingKeyword = SynLeadingKeyword.Val mVal; WithKeyword = None; EqualsRange = mEquals }
708
+ let trivia: SynValSigTrivia = { LeadingKeyword = SynLeadingKeyword.Val mVal; InlineKeyword = $5; WithKeyword = None; EqualsRange = mEquals }
709
709
let valSpfn = SynValSig((attr1@attr2), id, explicitValTyparDecls, ty, arity, isInline, isMutable, doc, vis2, konst, m, trivia)
710
710
SynModuleSigDecl.Val(valSpfn, m)
711
711
}
@@ -913,7 +913,7 @@ classSpfnMembersAtLeastOne:
913
913
classMemberSpfn:
914
914
| opt_attributes opt_access memberSpecFlags opt_inline opt_access nameop opt_explicitValTyparDecls COLON topTypeWithTypeConstraints classMemberSpfnGetSet optLiteralValueSpfn
915
915
{ if Option.isSome $2 then errorR(Error(FSComp.SR.parsVisibilityDeclarationsShouldComePriorToIdentifier(), rhs parseState 2))
916
- let isInline, doc, vis2, id, explicitValTyparDecls, (ty, arity), (mEquals, optLiteralValue) = $4 , grabXmlDoc(parseState, $1, 1), $5, $6, $7, $9, $11
916
+ let isInline, doc, vis2, id, explicitValTyparDecls, (ty, arity), (mEquals, optLiteralValue) = (Option.isSome $4) , grabXmlDoc(parseState, $1, 1), $5, $6, $7, $9, $11
917
917
let mWith, (getSet, getSetRangeOpt) = $10
918
918
let getSetAdjuster arity = match arity, getSet with SynValInfo([], _), SynMemberKind.Member -> SynMemberKind.PropertyGet | _ -> getSet
919
919
let mWhole =
@@ -930,7 +930,7 @@ classMemberSpfn:
930
930
931
931
let flags, leadingKeyword = $3
932
932
let flags = flags (getSetAdjuster arity)
933
- let trivia = { LeadingKeyword = leadingKeyword; WithKeyword = mWith; EqualsRange = mEquals }
933
+ let trivia = { LeadingKeyword = leadingKeyword; InlineKeyword = $4; WithKeyword = mWith; EqualsRange = mEquals }
934
934
let valSpfn = SynValSig($1, id, explicitValTyparDecls, ty, arity, isInline, false, doc, vis2, optLiteralValue, mWhole, trivia)
935
935
let trivia: SynMemberSigMemberTrivia = { GetSetKeywords = getSetRangeOpt }
936
936
SynMemberSig.Member(valSpfn, flags, mWhole, trivia) }
@@ -970,7 +970,7 @@ classMemberSpfn:
970
970
let mNew = rhs parseState 3
971
971
let m = unionRanges (rhs parseState 1) ty.Range |> unionRangeWithXmlDoc doc
972
972
let isInline = false
973
- let trivia: SynValSigTrivia = { LeadingKeyword = SynLeadingKeyword.New mNew; WithKeyword = None; EqualsRange = None }
973
+ let trivia: SynValSigTrivia = { LeadingKeyword = SynLeadingKeyword.New mNew; InlineKeyword = None; WithKeyword = None; EqualsRange = None }
974
974
let valSpfn = SynValSig ($1, (SynIdent(mkSynId (rhs parseState 3) "new", None)), noInferredTypars, ty, valSynInfo, isInline, false, doc, vis, None, m, trivia)
975
975
SynMemberSig.Member(valSpfn, CtorMemberFlags, m, SynMemberSigMemberTrivia.Zero) }
976
976
@@ -1740,8 +1740,8 @@ memberCore:
1740
1740
let memFlagsBuilder, leadingKeyword = flagsBuilderAndLeadingKeyword
1741
1741
let memberFlags = memFlagsBuilder SynMemberKind.Member
1742
1742
let mWholeBindLhs = (mBindLhs, attrs) ||> unionRangeWithListBy (fun (a: SynAttributeList) -> a.Range)
1743
- let trivia: SynBindingTrivia = { LeadingKeyword = leadingKeyword; EqualsRange = Some mEquals }
1744
- let binding = mkSynBinding (xmlDoc, bindingPat) (vis, $1 , false, mWholeBindLhs, DebugPointAtBinding.NoneAtInvisible, optReturnType, $5, mRhs, [], attrs, Some memberFlags, trivia)
1743
+ let trivia: SynBindingTrivia = { LeadingKeyword = leadingKeyword; InlineKeyword = $1; EqualsRange = Some mEquals }
1744
+ let binding = mkSynBinding (xmlDoc, bindingPat) (vis, (Option.isSome $1) , false, mWholeBindLhs, DebugPointAtBinding.NoneAtInvisible, optReturnType, $5, mRhs, [], attrs, Some memberFlags, trivia)
1745
1745
let memberRange = unionRanges rangeStart mRhs |> unionRangeWithXmlDoc xmlDoc
1746
1746
[ SynMemberDefn.Member (binding, memberRange) ]) }
1747
1747
@@ -1819,7 +1819,7 @@ classDefnMember:
1819
1819
1820
1820
| opt_attributes opt_access abstractMemberFlags opt_inline nameop opt_explicitValTyparDecls COLON topTypeWithTypeConstraints classMemberSpfnGetSet opt_ODECLEND
1821
1821
{ let ty, arity = $8
1822
- let isInline, doc, id, explicitValTyparDecls = $4 , grabXmlDoc(parseState, $1, 1), $5, $6
1822
+ let isInline, doc, id, explicitValTyparDecls = (Option.isSome $4) , grabXmlDoc(parseState, $1, 1), $5, $6
1823
1823
let mWith, (getSet, getSetRangeOpt) = $9
1824
1824
let getSetAdjuster arity = match arity, getSet with SynValInfo([], _), SynMemberKind.Member -> SynMemberKind.PropertyGet | _ -> getSet
1825
1825
let mWhole =
@@ -1830,7 +1830,7 @@ classDefnMember:
1830
1830
|> unionRangeWithXmlDoc doc
1831
1831
if Option.isSome $2 then errorR(Error(FSComp.SR.parsAccessibilityModsIllegalForAbstract(), mWhole))
1832
1832
let mkFlags, leadingKeyword = $3
1833
- let trivia = { LeadingKeyword = leadingKeyword; WithKeyword = mWith; EqualsRange = None }
1833
+ let trivia = { LeadingKeyword = leadingKeyword; InlineKeyword = $4; WithKeyword = mWith; EqualsRange = None }
1834
1834
let valSpfn = SynValSig($1, id, explicitValTyparDecls, ty, arity, isInline, false, doc, None, None, mWhole, trivia)
1835
1835
let trivia: SynMemberDefnAbstractSlotTrivia = { GetSetKeywords = getSetRangeOpt }
1836
1836
[ SynMemberDefn.AbstractSlot(valSpfn, mkFlags (getSetAdjuster arity), mWhole, trivia) ] }
@@ -1870,7 +1870,7 @@ classDefnMember:
1870
1870
let declPat = SynPat.LongIdent (SynLongIdent([mkSynId (rhs parseState 3) "new"], [], [None]), None, Some noInferredTypars, SynArgPats.Pats [$4], vis, rhs parseState 3)
1871
1871
// Check that 'SynPatForConstructorDecl' matches this correctly
1872
1872
assert (match declPat with SynPatForConstructorDecl _ -> true | _ -> false)
1873
- let synBindingTrivia: SynBindingTrivia = { LeadingKeyword = SynLeadingKeyword.New mNew; EqualsRange = Some mEquals }
1873
+ let synBindingTrivia: SynBindingTrivia = { LeadingKeyword = SynLeadingKeyword.New mNew; InlineKeyword = None; EqualsRange = Some mEquals }
1874
1874
[ SynMemberDefn.Member(SynBinding (None, SynBindingKind.Normal, false, false, $1, xmlDoc, valSynData, declPat, None, expr, mWholeBindLhs, DebugPointAtBinding.NoneAtInvisible, synBindingTrivia), m) ] }
1875
1875
1876
1876
| opt_attributes opt_access STATIC typeKeyword tyconDefn
@@ -2669,7 +2669,7 @@ cPrototype:
2669
2669
let bindingPat = SynPat.LongIdent (SynLongIdent([nm], [], [None]), None, Some noInferredTypars, SynArgPats.Pats [SynPat.Tuple(false, args, argsm)], vis, nmm)
2670
2670
let mWholeBindLhs = (mBindLhs, attrs) ||> unionRangeWithListBy (fun (a: SynAttributeList) -> a.Range)
2671
2671
let xmlDoc = grabXmlDoc(parseState, attrs, 1)
2672
- let trivia = { LeadingKeyword = SynLeadingKeyword.Extern mExtern; EqualsRange = None }
2672
+ let trivia = { LeadingKeyword = SynLeadingKeyword.Extern mExtern; InlineKeyword = None; EqualsRange = None }
2673
2673
let binding =
2674
2674
mkSynBinding
2675
2675
(xmlDoc, bindingPat)
@@ -2792,8 +2792,8 @@ localBinding:
2792
2792
let mWhole = (unionRanges leadingKeyword.Range mRhs, attrs) ||> unionRangeWithListBy (fun (a: SynAttributeList) -> a.Range)
2793
2793
let spBind = if IsDebugPointBinding bindingPat expr then DebugPointAtBinding.Yes mWhole else DebugPointAtBinding.NoneAtLet
2794
2794
let mWholeBindLhs = (mBindLhs, attrs) ||> unionRangeWithListBy (fun (a: SynAttributeList) -> a.Range)
2795
- let trivia: SynBindingTrivia = { LeadingKeyword = leadingKeyword; EqualsRange = Some mEquals }
2796
- mkSynBinding (xmlDoc, bindingPat) (vis, $1, $2, mWholeBindLhs, spBind, optReturnType, expr, mRhs, opts, attrs, None, trivia))
2795
+ let trivia: SynBindingTrivia = { LeadingKeyword = leadingKeyword; InlineKeyword = $1; EqualsRange = Some mEquals }
2796
+ mkSynBinding (xmlDoc, bindingPat) (vis, Option.isSome $1, $2, mWholeBindLhs, spBind, optReturnType, expr, mRhs, opts, attrs, None, trivia))
2797
2797
localBindingRange, localBindingBuilder }
2798
2798
2799
2799
| opt_inline opt_mutable bindingPattern opt_topReturnTypeWithTypeConstraints EQUALS error
@@ -2807,8 +2807,8 @@ localBinding:
2807
2807
let zeroWidthAtEnd = mEquals.EndRange
2808
2808
let rhsExpr = arbExpr("localBinding1", zeroWidthAtEnd)
2809
2809
let spBind = if IsDebugPointBinding bindingPat rhsExpr then DebugPointAtBinding.Yes mWhole else DebugPointAtBinding.NoneAtLet
2810
- let trivia: SynBindingTrivia = { LeadingKeyword = leadingKeyword; EqualsRange = Some mEquals }
2811
- mkSynBinding (xmlDoc, bindingPat) (vis, $1, $2, mBindLhs, spBind, optReturnType, rhsExpr, mRhs, [], attrs, None, trivia))
2810
+ let trivia: SynBindingTrivia = { LeadingKeyword = leadingKeyword; InlineKeyword = $1; EqualsRange = Some mEquals }
2811
+ mkSynBinding (xmlDoc, bindingPat) (vis, Option.isSome $1, $2, mBindLhs, spBind, optReturnType, rhsExpr, mRhs, [], attrs, None, trivia))
2812
2812
mWhole, localBindingBuilder }
2813
2813
2814
2814
| opt_inline opt_mutable bindingPattern opt_topReturnTypeWithTypeConstraints recover
@@ -2820,9 +2820,9 @@ localBinding:
2820
2820
let localBindingBuilder =
2821
2821
(fun xmlDoc attrs vis (leadingKeyword: SynLeadingKeyword) ->
2822
2822
let spBind = DebugPointAtBinding.Yes (unionRanges leadingKeyword.Range mRhs)
2823
- let trivia = { LeadingKeyword = leadingKeyword; EqualsRange = None }
2823
+ let trivia = { LeadingKeyword = leadingKeyword; InlineKeyword = $1; EqualsRange = None }
2824
2824
let rhsExpr = arbExpr("localBinding2", mRhs)
2825
- mkSynBinding (xmlDoc, bindingPat) (vis, $1, $2, mBindLhs, spBind, optReturnType, rhsExpr, mRhs, [], attrs, None, trivia))
2825
+ mkSynBinding (xmlDoc, bindingPat) (vis, Option.isSome $1, $2, mBindLhs, spBind, optReturnType, rhsExpr, mRhs, [], attrs, None, trivia))
2826
2826
mWhole, localBindingBuilder }
2827
2827
2828
2828
/* A single expression with an optional type annotation, and an optional static optimization block */
@@ -5816,8 +5816,8 @@ opt_bar:
5816
5816
| /* EMPTY */ { }
5817
5817
5818
5818
opt_inline:
5819
- | INLINE { true }
5820
- | /* EMPTY */ { false }
5819
+ | INLINE { Some (rhs parseState 1) }
5820
+ | /* EMPTY */ { None }
5821
5821
5822
5822
opt_mutable:
5823
5823
| MUTABLE { true }
0 commit comments