Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
7c0155a
Proposed SyntaxTree for operator changes.
nojaf Apr 13, 2022
235033a
Capture SynOperatorName in opName. Change identOrOp to identOrOpExpr.
nojaf Apr 13, 2022
d250f1f
Refactor nameop.
nojaf Apr 13, 2022
ef9a291
Refactor atomicPatternLongIdent
nojaf Apr 13, 2022
2d2ae2d
Replace identExpr with identOrOpExpr.
nojaf Apr 14, 2022
580ddb2
Update mkSynOperator to return SynExpr.Operator.
nojaf Apr 14, 2022
ee828ca
Remove isOptional from all SynExpr.LongIdent.
nojaf Apr 14, 2022
e4b3f60
Update parser with remaining syntax tree changes.
nojaf Apr 14, 2022
6a5bcd0
Update SyntaxTreeOps with remaining syntax tree changes.
nojaf Apr 14, 2022
e88d57d
Update CheckDeclarations and CheckExpressions with remaining syntax t…
nojaf Apr 14, 2022
97a4be9
Update ServiceParseTreeWalk with remaining syntax tree changes.
nojaf Apr 14, 2022
937c973
Update ServiceNavigation with remaining syntax tree changes.
nojaf Apr 14, 2022
a7afb47
Update FSharpParseFileResults and ServiceParsedInputOps with remainin…
nojaf Apr 14, 2022
ec7c2d5
Update ServiceStructure and ServiceXmlDocParser with remaining syntax…
nojaf Apr 14, 2022
87091f8
Update unit tests with remaining syntax tree changes.
nojaf Apr 14, 2022
e8beafe
Additional attempts to fix compilation.
nojaf Apr 14, 2022
34cf481
Ignore dots when looking for member value pattern.
nojaf Apr 14, 2022
2b6926f
Include operators in AnalyzeRecursiveDecl.
nojaf Apr 14, 2022
1613bb9
Treat upper case SynPat.Named as TcPatLongIdent.
nojaf Apr 14, 2022
f1adaa6
Extract SynPat.Named logic to TcPatNamed.
nojaf Apr 14, 2022
88a0edb
SynPat.Named as UnionCase.
nojaf Apr 15, 2022
0100f71
Add unit tests for new untyped syntax tree changes.
nojaf Apr 15, 2022
330abdc
Add SurfaceArea changes.
nojaf Apr 15, 2022
2e27b7c
Preserve correct SynAccess for SynPat.Named.
nojaf Apr 15, 2022
fd04b57
Object model with get/set.
nojaf Apr 15, 2022
729507e
Capture ranges of parenthesis outside of callback.
nojaf Apr 15, 2022
03749c4
Include SynExpr.DotGetOperator in LongOrSingleIdent.
nojaf Apr 15, 2022
5bffa86
Support matching literal values from SynPat.Named.
nojaf Apr 15, 2022
e1d6f30
Convert SynPat.Operator to SynExpr.Ident.
nojaf Apr 15, 2022
3d888ac
Don't resolve pattern if it isMemberThis for SynPat.Named.
nojaf Apr 19, 2022
02cd517
Add an additional check to see if we are dealing with a member.
nojaf Apr 19, 2022
3b535b5
Determine member by topValInfo.
nojaf Apr 19, 2022
adab557
SynPat.Named Active pattern as lambda arg.
nojaf Apr 19, 2022
0b659ed
Normalize SynPat.Paren (SynPat.Operator _).
nojaf Apr 19, 2022
44363a3
Recursive bindings can contain SynPat.ParametersOwner(SynPat.Named), …
nojaf Apr 20, 2022
cfa27be
Add accessibility to SynPat.DotGetOperator. Normalize SynPat.DotGetOp…
nojaf Apr 20, 2022
8bde835
Update baseline for UnionCase name tests.
nojaf Apr 21, 2022
71e5055
Skip unit test with questionable active patterns.
nojaf Apr 21, 2022
32e155f
Take any SynPat.Named if it is a this identifier.
nojaf Apr 21, 2022
fb7a9c9
Apply the same rule of SynPat.ParametersOwner for uppercase SynPat.Na…
nojaf Apr 22, 2022
a24a2ef
Update SynBinOp to take SynExpr.Operator into account.
nojaf Apr 22, 2022
9ea0b09
Add SynPat.DotGetOperator to LongOrSingleIdentInPat.
nojaf Apr 22, 2022
cf8cc4b
Update AST matches in FSharpParseFileResults.
nojaf Apr 22, 2022
8a82611
As active pattern using SynPat.Named.
nojaf Apr 22, 2022
ca35572
Uppercase SynPat.Named in SynPat.As.
nojaf Apr 22, 2022
6a255d2
Add new SynExpr nodes to digOutIdentFromFuncExpr.
nojaf Apr 24, 2022
29aa16f
Update SynExpr.Ident to SynExpr.Operator for op_ArrayLookup usage.
nojaf Apr 24, 2022
5bc84b7
Update error message in E_type_id_equal_pipe.fsx
nojaf Apr 24, 2022
08ee929
SynPat.Named for ObjExpr member.
nojaf Apr 25, 2022
a4fa954
Add newly introduce syntax nodes to ServiceParsedInputOps.fs.
nojaf Apr 25, 2022
24871ed
Update error message in attrUnionCaseDecl01.fs.
nojaf Apr 25, 2022
974976d
Only perform SynPat.LongIdent checks when the identifier is Uppercase.
nojaf Apr 25, 2022
9b9ae3c
Update error message for attrUnionCaseDecl01b.fs.
nojaf Apr 25, 2022
04b1708
Add SynPat.Named directly to SimplePatsOfPat.
nojaf Apr 25, 2022
1744401
Revert "Add SynPat.Named directly to SimplePatsOfPat."
nojaf Apr 25, 2022
f939de2
Use more explicit SynPat matches to overcome the uppercase hurdle.
nojaf Apr 25, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions src/fsharp/CheckComputationExpressions.fs
Original file line number Diff line number Diff line change
Expand Up @@ -639,10 +639,10 @@ let TcComputationExpression (cenv: cenv) env (overallTy: OverallTy) tpenv (mWhol
match e with
| ForEachThen (isFromSource, firstSourcePat, firstSource, JoinOrGroupJoinOrZipClause(nm, secondSourcePat, secondSource, keySelectorsOpt, pat3opt, mOpCore), innerComp)
when
(let _firstSourceSimplePats, later1 =
use _holder = TemporarilySuspendReportingTypecheckResultsToSink cenv.tcSink
SimplePatsOfPat cenv.synArgNameGenerator firstSourcePat
Option.isNone later1)
(use _holder = TemporarilySuspendReportingTypecheckResultsToSink cenv.tcSink
match firstSourcePat with
| SynPat.Named _ -> true
| _ -> SimplePatsOfPat cenv.synArgNameGenerator firstSourcePat |> snd |> Option.isNone)

-> Some (isFromSource, firstSourcePat, firstSource, nm, secondSourcePat, secondSource, keySelectorsOpt, pat3opt, mOpCore, innerComp)

Expand Down Expand Up @@ -828,7 +828,12 @@ let TcComputationExpression (cenv: cenv) env (overallTy: OverallTy) tpenv (mWhol
vspecs, envinner)
| None -> varSpace

let firstSourceSimplePats, later1 = SimplePatsOfPat cenv.synArgNameGenerator firstSourcePat
let firstSourceSimplePats, later1 =
match firstSourcePat with
| SynPat.Named (v, thisV, _, m) ->
SynSimplePats.SimplePats ([SynSimplePat.Id (v, None, false, thisV, false, m)], m), None
| _ ->
SimplePatsOfPat cenv.synArgNameGenerator firstSourcePat
let secondSourceSimplePats, later2 = SimplePatsOfPat cenv.synArgNameGenerator secondSourcePat

if Option.isSome later1 then errorR (Error (FSComp.SR.tcJoinMustUseSimplePattern(nm.idText), firstSourcePat.Range))
Expand Down
10 changes: 5 additions & 5 deletions src/fsharp/CheckDeclarations.fs
Original file line number Diff line number Diff line change
Expand Up @@ -4830,8 +4830,8 @@ module TcDeclarations =
// Only the keep the field-targeted attributes
let attribs = attribs |> List.filter (fun a -> match a.Target with Some t when t.idText = "field" -> true | _ -> false)
let mLetPortion = synExpr.Range
let fldId = ident (CompilerGeneratedName id.idText, mLetPortion)
let headPat = SynPat.LongIdent (LongIdentWithDots([fldId], []), None, None, Some noInferredTypars, SynArgPats.Pats [], None, mLetPortion)
let fldPat = SynPat.Named(ident (CompilerGeneratedName id.idText, mLetPortion), false, None, mLetPortion)
let headPat = SynPat.ParametersOwner (fldPat, None, None, Some noInferredTypars, SynArgPats.Pats [], None, mLetPortion)
let retInfo = match tyOpt with None -> None | Some ty -> Some (SynReturnInfo((ty, SynInfo.unnamedRetVal), ty.Range))
let isMutable =
match propKind with
Expand All @@ -4858,8 +4858,8 @@ module TcDeclarations =
// Only the keep the non-field-targeted attributes
let attribs = attribs |> List.filter (fun a -> match a.Target with Some t when t.idText = "field" -> false | _ -> true)
let fldId = ident (CompilerGeneratedName id.idText, mMemberPortion)
let headPatIds = if isStatic then [id] else [ident ("__", mMemberPortion);id]
let headPat = SynPat.LongIdent (LongIdentWithDots(headPatIds, []), None, None, Some noInferredTypars, SynArgPats.Pats [], None, mMemberPortion)
let headPatIdPat = if isStatic then SynPat.Named(id, false, None, id.idRange) else SynPat.LongIdent(LongIdentWithDots([ident ("__", mMemberPortion);id], []), None, unionRanges mMemberPortion id.idRange)
let headPat = SynPat.ParametersOwner (headPatIdPat, None, None, Some noInferredTypars, SynArgPats.Pats [], None, mMemberPortion)

match propKind, mGetSetOpt with
| SynMemberKind.PropertySet, Some m -> errorR(Error(FSComp.SR.parsMutableOnAutoPropertyShouldBeGetSetNotJustSet(), m))
Expand All @@ -4884,7 +4884,7 @@ module TcDeclarations =
| SynMemberKind.PropertyGetSet ->
let setter =
let vId = ident("v", mMemberPortion)
let headPat = SynPat.LongIdent (LongIdentWithDots(headPatIds, []), None, None, Some noInferredTypars, SynArgPats.Pats [mkSynPatVar None vId], None, mMemberPortion)
let headPat = SynPat.ParametersOwner (headPatIdPat, None, None, Some noInferredTypars, SynArgPats.Pats [mkSynPatVar None vId], None, mMemberPortion)
let rhsExpr = mkSynAssign (SynExpr.Ident fldId) (SynExpr.Ident vId)
//let retInfo = match tyOpt with None -> None | Some ty -> Some (SynReturnInfo((ty, SynInfo.unnamedRetVal), ty.Range))
let binding = mkSynBinding (xmlDoc, headPat) (access, false, false, mMemberPortion, DebugPointAtBinding.NoneAtInvisible, None, rhsExpr, rhsExpr.Range, [], [], Some (memberFlags SynMemberKind.PropertySet), SynBindingTrivia.Zero)
Expand Down
Loading