diff --git a/docs/fcs/compiler.fsx b/docs/fcs/compiler.fsx index 330d54ebb33..e880ed57f1a 100644 --- a/docs/fcs/compiler.fsx +++ b/docs/fcs/compiler.fsx @@ -30,7 +30,6 @@ First, we need to reference the libraries that contain F# interactive service: #r "FSharp.Compiler.Service.dll" open System.IO open FSharp.Compiler.CodeAnalysis -open FSharp.Compiler.Text // Create an interactive checker instance let checker = FSharpChecker.Create() diff --git a/docs/fcs/editor.fsx b/docs/fcs/editor.fsx index b9f49c557a7..b707663c01b 100644 --- a/docs/fcs/editor.fsx +++ b/docs/fcs/editor.fsx @@ -29,6 +29,7 @@ open System open FSharp.Compiler.CodeAnalysis open FSharp.Compiler.EditorServices open FSharp.Compiler.Text +open FSharp.Compiler.Tokenization // Create an interactive checker instance let checker = FSharpChecker.Create() @@ -119,7 +120,7 @@ this is the type that lets you implement most of the interesting F# source code ### Getting a tool tip -To get a tool tip, you can use `GetToolTipTextAlternate` method. The method takes a line number and character +To get a tool tip, you can use `GetToolTip` method. The method takes a line number and character offset. Both of the numbers are zero-based. In the sample code, we want to get tooltip for the `foo` function that is defined on line 3 (line 0 is blank) and the letter `f` starts at index 7 (the tooltip would work anywhere inside the identifier). @@ -132,13 +133,11 @@ identifier (the other option lets you get tooltip with full assembly location wh let identToken = FSharpTokenTag.Identifier // Get tool tip at the specified location -let tip = checkFileResults.GetToolTipText(4, 7, inputLines.[1], ["foo"], identToken) +let tip = checkFileResults.GetToolTip(4, 7, inputLines.[1], ["foo"], identToken) printfn "%A" tip (** -> **NOTE:** `GetToolTipTextAlternate` is an alternative name for the old `GetToolTipText`. The old `GetToolTipText` was -deprecated because it accepted zero-based line numbers. At some point it will be removed, and `GetToolTipTextAlternate` will be renamed back to `GetToolTipText`. *) (** @@ -201,8 +200,7 @@ let methods = // Print concatenated parameter lists for mi in methods.Methods do - [ for p in mi.Parameters -> p.Display ] - |> List.collect (Array.map (fun tt -> tt.Text) >> Array.toList) + [ for p in mi.Parameters do for tt in p.Display do yield tt.Text ] |> String.concat ", " |> printfn "%s(%s)" methods.MethodName (** diff --git a/docs/fcs/filesystem.fsx b/docs/fcs/filesystem.fsx index 3d471e996ff..503a18ea9f1 100644 --- a/docs/fcs/filesystem.fsx +++ b/docs/fcs/filesystem.fsx @@ -144,7 +144,6 @@ let projectOptions = ProjectId = None SourceFiles = [| fileName1; fileName2 |] OriginalLoadReferences = [] - ExtraProjectInfo=None Stamp = None OtherOptions = allFlags ReferencedProjects = [| |] diff --git a/docs/fcs/interactive.fsx b/docs/fcs/interactive.fsx index 155dcbada5f..e455e7283c4 100644 --- a/docs/fcs/interactive.fsx +++ b/docs/fcs/interactive.fsx @@ -32,7 +32,7 @@ First, we need to reference the libraries that contain F# interactive service: #r "FSharp.Compiler.Service.dll" open FSharp.Compiler.Interactive.Shell -open FSharp.Compiler.EditorServices +open FSharp.Compiler.Tokenization (** To communicate with F# interactive, we need to create streams that represent input and @@ -142,7 +142,7 @@ Gives: // show the errors and warnings for w in warnings do - printfn "Warning %s at %d,%d" w.Message w.StartLineAlternate w.StartColumn + printfn "Warning %s at %d,%d" w.Message w.StartLine w.StartColumn (** Gives: @@ -157,7 +157,7 @@ For expressions: let evalExpressionTyped2<'T> text = let res, warnings = fsiSession.EvalExpressionNonThrowing(text) for w in warnings do - printfn "Warning %s at %d,%d" w.Message w.StartLineAlternate w.StartColumn + printfn "Warning %s at %d,%d" w.Message w.StartLine w.StartColumn match res with | Choice1Of2 (Some value) -> value.ReflectionValue |> unbox<'T> | Choice1Of2 None -> failwith "null or no result" @@ -229,7 +229,7 @@ You can also request declaration list information, tooltip text and symbol resol *) // get a tooltip -checkResults.GetToolTipText(1, 2, "xxx + xx", ["xxx"], FSharpTokenTag.IDENT) +checkResults.GetToolTip(1, 2, "xxx + xx", ["xxx"], FSharpTokenTag.IDENT) checkResults.GetSymbolUseAtLocation(1, 2, "xxx + xx", ["xxx"]) // symbol xxx diff --git a/docs/fcs/ja/editor.fsx b/docs/fcs/ja/editor.fsx index f9452dc02b7..d5543eefdee 100644 --- a/docs/fcs/ja/editor.fsx +++ b/docs/fcs/ja/editor.fsx @@ -31,6 +31,7 @@ open System open FSharp.Compiler.CodeAnalysis open FSharp.Compiler.EditorServices open FSharp.Compiler.Text +open FSharp.Compiler.Tokenization // インタラクティブチェッカーのインスタンスを作成 let checker = FSharpChecker.Create() @@ -141,14 +142,11 @@ let checkFileResults = // 最後の引数に指定する、IDENTトークンのタグを取得 // 特定の位置におけるツールチップを取得 -let tip = checkFileResults.GetToolTipText(4, 7, inputLines.[1], ["foo"], FSharpTokenTag.Identifier) +let tip = checkFileResults.GetToolTip(4, 7, inputLines.[1], ["foo"], FSharpTokenTag.Identifier) printfn "%A" tip (** -> **注意:** `GetToolTipTextAlternate` は古い関数 `GetToolTipText` に代わるものです。 -`GetToolTipText` は0から始まる行番号を受け取るようになっていたため、非推奨になりました。 - この関数には位置とトークンの種類の他にも、 (ソースコードの変更時に役立つように)特定行の現在の内容と、 現時点における完全修飾された `名前` を表す文字列のリストを指定する必要があります。 @@ -217,7 +215,7 @@ let methods = // 連結された引数リストを表示 for mi in methods.Methods do - [ for p in mi.Parameters -> p.Display ] + [ for p in mi.Parameters do for tt in p.Display do yield tt.Text ] |> String.concat ", " |> printfn "%s(%s)" methods.MethodName (** diff --git a/docs/fcs/ja/filesystem.fsx b/docs/fcs/ja/filesystem.fsx index ffbeadd6d93..c012596a73b 100644 --- a/docs/fcs/ja/filesystem.fsx +++ b/docs/fcs/ja/filesystem.fsx @@ -21,7 +21,6 @@ open System.IO open System.Text open FSharp.Compiler.CodeAnalysis open FSharp.Compiler.IO -open FSharp.Compiler.Text let defaultFileSystem = FileSystem @@ -126,7 +125,6 @@ let projectOptions = ProjectId = None SourceFiles = [| fileName1; fileName2 |] OriginalLoadReferences = [] - ExtraProjectInfo=None Stamp = None OtherOptions = allFlags ReferencedProjects=[| |] diff --git a/docs/fcs/ja/interactive.fsx b/docs/fcs/ja/interactive.fsx index 92cbef01120..9f7fb2109f4 100644 --- a/docs/fcs/ja/interactive.fsx +++ b/docs/fcs/ja/interactive.fsx @@ -42,9 +42,7 @@ F# Interactiveの開始 *) #r "FSharp.Compiler.Service.dll" -open FSharp.Compiler.CodeAnalysis -open FSharp.Compiler.EditorServices -open FSharp.Compiler.Text +open FSharp.Compiler.Tokenization open FSharp.Compiler.Interactive.Shell (** @@ -158,7 +156,7 @@ match result with // エラーと警告を表示する for w in warnings do - printfn "警告 %s 場所 %d,%d" w.Message w.StartLineAlternate w.StartColumn + printfn "警告 %s 場所 %d,%d" w.Message w.StartLine w.StartColumn (** は次のようになります: @@ -173,7 +171,7 @@ for w in warnings do let evalExpressionTyped2<'T> text = let res, warnings = fsiSession.EvalExpressionNonThrowing(text) for w in warnings do - printfn "警告 %s 場所 %d,%d" w.Message w.StartLineAlternate w.StartColumn + printfn "警告 %s 場所 %d,%d" w.Message w.StartLine w.StartColumn match res with | Choice1Of2 (Some value) -> value.ReflectionValue |> unbox<'T> | Choice1Of2 None -> failwith "null または結果がありません" @@ -248,7 +246,7 @@ checkResults.Diagnostics.Length // 1 *) // ツールチップを取得する -checkResults.GetToolTipText(1, 2, "xxx + xx", ["xxx"], FSharpTokenTag.IDENT) +checkResults.GetToolTip(1, 2, "xxx + xx", ["xxx"], FSharpTokenTag.IDENT) checkResults.GetSymbolUseAtLocation(1, 2, "xxx + xx", ["xxx"]) // シンボル xxx diff --git a/docs/fcs/ja/project.fsx b/docs/fcs/ja/project.fsx index 8da6e249fa0..bdb658a0452 100644 --- a/docs/fcs/ja/project.fsx +++ b/docs/fcs/ja/project.fsx @@ -22,9 +22,9 @@ // F#コンパイラAPIへの参照 #r "FSharp.Compiler.Service.dll" -open System open System.Collections.Generic open FSharp.Compiler.CodeAnalysis +open FSharp.Compiler.Symbols open FSharp.Compiler.Text // インタラクティブチェッカーのインスタンスを作成 @@ -113,8 +113,8 @@ let wholeProjectResults = checker.ParseAndCheckProject(projectOptions) |> Async. wholeProjectResults.Diagnostics.Length // 1 wholeProjectResults.Diagnostics.[0].Message.Contains("Incomplete pattern matches on this expression") // true -wholeProjectResults.Diagnostics.[0].StartLineAlternate // 13 -wholeProjectResults.Diagnostics.[0].EndLineAlternate // 13 +wholeProjectResults.Diagnostics.[0].StartLine // 13 +wholeProjectResults.Diagnostics.[0].EndLine // 13 wholeProjectResults.Diagnostics.[0].StartColumn // 15 wholeProjectResults.Diagnostics.[0].EndColumn // 16 diff --git a/docs/fcs/ja/symbols.fsx b/docs/fcs/ja/symbols.fsx index 2e7dd7bd275..02e2ee48602 100644 --- a/docs/fcs/ja/symbols.fsx +++ b/docs/fcs/ja/symbols.fsx @@ -19,7 +19,6 @@ // F#コンパイラAPIへの参照 #r "FSharp.Compiler.Service.dll" -open System open System.IO open FSharp.Compiler.CodeAnalysis open FSharp.Compiler.Text diff --git a/docs/fcs/ja/tokenizer.fsx b/docs/fcs/ja/tokenizer.fsx index d4e24187916..46548bbd74e 100644 --- a/docs/fcs/ja/tokenizer.fsx +++ b/docs/fcs/ja/tokenizer.fsx @@ -18,12 +18,10 @@ F#のソースコードに対して、トークナイザは ------------------ トークナイザを使用するには、 `FSharp.Compiler.Service.dll` への参照を追加した後に -`SourceCodeServices` 名前空間をオープンします: +`Tokenization` 名前空間をオープンします: *) #r "FSharp.Compiler.Service.dll" -open FSharp.Compiler.CodeAnalysis -open FSharp.Compiler.EditorServices -open FSharp.Compiler.Text +open FSharp.Compiler.Tokenization (** すると `FSharpSourceTokenizer` のインスタンスを作成できるようになります。 このクラスには2つの引数を指定します。 diff --git a/docs/fcs/ja/untypedtree.fsx b/docs/fcs/ja/untypedtree.fsx index 2b89fef0aad..6504431959f 100644 --- a/docs/fcs/ja/untypedtree.fsx +++ b/docs/fcs/ja/untypedtree.fsx @@ -37,7 +37,7 @@ インタラクティブチェッカーを使用するには、 `FSharp.Compiler.Service.dll` への参照を追加した後、 -`SourceCodeServices` 名前空間をオープンします: +`CodeAnalysis` 名前空間をオープンします: *) #r "FSharp.Compiler.Service.dll" open System @@ -164,8 +164,8 @@ let rec visitExpression = function // ('let .. = .. and .. = .. in ...' に対しては複数回走査されることがある) printfn "以下のバインディングを含むLetOrUse:" for binding in bindings do - let (Binding(access, kind, inlin, mutabl, attrs, xmlDoc, - data, pat, retInfo, init, m, sp)) = binding + let (SynBinding(access, kind, inlin, mutabl, attrs, xmlDoc, + data, pat, retInfo, init, m, sp)) = binding visitPattern pat visitExpression init // 本体の式を走査 @@ -199,8 +199,8 @@ let visitDeclarations decls = // (visitExpressionで処理したような)式としてのletバインディングと // 似ているが、本体を持たない for binding in bindings do - let (Binding(access, kind, inlin, mutabl, attrs, xmlDoc, - data, pat, retInfo, body, m, sp)) = binding + let (SynBinding(access, kind, inlin, mutabl, attrs, xmlDoc, + data, pat, retInfo, body, m, sp)) = binding visitPattern pat visitExpression body | _ -> printfn " - サポート対象外の宣言: %A" declaration diff --git a/docs/fcs/project.fsx b/docs/fcs/project.fsx index faf3f572308..2c01f7f3379 100644 --- a/docs/fcs/project.fsx +++ b/docs/fcs/project.fsx @@ -27,6 +27,7 @@ of `InteractiveChecker`: open System open System.Collections.Generic open FSharp.Compiler.CodeAnalysis +open FSharp.Compiler.Symbols open FSharp.Compiler.Text // Create an interactive checker instance @@ -131,8 +132,8 @@ Now look at the errors and warnings: wholeProjectResults.Diagnostics.Length // 1 wholeProjectResults.Diagnostics.[0].Message.Contains("Incomplete pattern matches on this expression") // yes it does -wholeProjectResults.Diagnostics.[0].StartLineAlternate // 13 -wholeProjectResults.Diagnostics.[0].EndLineAlternate // 13 +wholeProjectResults.Diagnostics.[0].StartLine // 13 +wholeProjectResults.Diagnostics.[0].EndLine // 13 wholeProjectResults.Diagnostics.[0].StartColumn // 15 wholeProjectResults.Diagnostics.[0].EndColumn // 16 diff --git a/docs/fcs/symbols.fsx b/docs/fcs/symbols.fsx index 9061d3fa107..c38e23b9943 100644 --- a/docs/fcs/symbols.fsx +++ b/docs/fcs/symbols.fsx @@ -19,6 +19,7 @@ of `FSharpChecker`: open System open System.IO open FSharp.Compiler.CodeAnalysis +open FSharp.Compiler.Symbols open FSharp.Compiler.Text // Create an interactive checker instance diff --git a/docs/fcs/tokenizer.fsx b/docs/fcs/tokenizer.fsx index aa4b8eb9122..ba584446170 100644 --- a/docs/fcs/tokenizer.fsx +++ b/docs/fcs/tokenizer.fsx @@ -17,12 +17,10 @@ Creating the tokenizer --------------------- To use the tokenizer, reference `FSharp.Compiler.Service.dll` and open the -`SourceCodeServices` namespace: +`FSharp.Compiler.Tokenization` namespace: *) #r "FSharp.Compiler.Service.dll" -open FSharp.Compiler.CodeAnalysis -open FSharp.Compiler.EditorServices -open FSharp.Compiler.Text +open FSharp.Compiler.Tokenization (** Now you can create an instance of `FSharpSourceTokenizer`. The class takes two arguments - the first is the list of defined symbols and the second is the diff --git a/docs/fcs/typedtree.fsx b/docs/fcs/typedtree.fsx index 11cd3342946..ad392d38776 100644 --- a/docs/fcs/typedtree.fsx +++ b/docs/fcs/typedtree.fsx @@ -20,13 +20,14 @@ Getting checked expressions To access the type-checked, resolved expressions, you need to create an instance of `InteractiveChecker`. To use the interactive checker, reference `FSharp.Compiler.Service.dll` and open the -`SourceCodeServices` namespace: +relevant namespaces: *) #r "FSharp.Compiler.Service.dll" open System open System.IO open FSharp.Compiler.CodeAnalysis open FSharp.Compiler.EditorServices +open FSharp.Compiler.Symbols open FSharp.Compiler.Text (** @@ -170,93 +171,93 @@ Here is a generic expression visitor: let rec visitExpr f (e:FSharpExpr) = f e match e with - | BasicPatterns.AddressOf(lvalueExpr) -> + | FSharpExprPatterns.AddressOf(lvalueExpr) -> visitExpr f lvalueExpr - | BasicPatterns.AddressSet(lvalueExpr, rvalueExpr) -> + | FSharpExprPatterns.AddressSet(lvalueExpr, rvalueExpr) -> visitExpr f lvalueExpr; visitExpr f rvalueExpr - | BasicPatterns.Application(funcExpr, typeArgs, argExprs) -> + | FSharpExprPatterns.Application(funcExpr, typeArgs, argExprs) -> visitExpr f funcExpr; visitExprs f argExprs - | BasicPatterns.Call(objExprOpt, memberOrFunc, typeArgs1, typeArgs2, argExprs) -> + | FSharpExprPatterns.Call(objExprOpt, memberOrFunc, typeArgs1, typeArgs2, argExprs) -> visitObjArg f objExprOpt; visitExprs f argExprs - | BasicPatterns.Coerce(targetType, inpExpr) -> + | FSharpExprPatterns.Coerce(targetType, inpExpr) -> visitExpr f inpExpr - | BasicPatterns.FastIntegerForLoop(startExpr, limitExpr, consumeExpr, isUp) -> + | FSharpExprPatterns.FastIntegerForLoop(startExpr, limitExpr, consumeExpr, isUp) -> visitExpr f startExpr; visitExpr f limitExpr; visitExpr f consumeExpr - | BasicPatterns.ILAsm(asmCode, typeArgs, argExprs) -> + | FSharpExprPatterns.ILAsm(asmCode, typeArgs, argExprs) -> visitExprs f argExprs - | BasicPatterns.ILFieldGet (objExprOpt, fieldType, fieldName) -> + | FSharpExprPatterns.ILFieldGet (objExprOpt, fieldType, fieldName) -> visitObjArg f objExprOpt - | BasicPatterns.ILFieldSet (objExprOpt, fieldType, fieldName, valueExpr) -> + | FSharpExprPatterns.ILFieldSet (objExprOpt, fieldType, fieldName, valueExpr) -> visitObjArg f objExprOpt - | BasicPatterns.IfThenElse (guardExpr, thenExpr, elseExpr) -> + | FSharpExprPatterns.IfThenElse (guardExpr, thenExpr, elseExpr) -> visitExpr f guardExpr; visitExpr f thenExpr; visitExpr f elseExpr - | BasicPatterns.Lambda(lambdaVar, bodyExpr) -> + | FSharpExprPatterns.Lambda(lambdaVar, bodyExpr) -> visitExpr f bodyExpr - | BasicPatterns.Let((bindingVar, bindingExpr), bodyExpr) -> + | FSharpExprPatterns.Let((bindingVar, bindingExpr), bodyExpr) -> visitExpr f bindingExpr; visitExpr f bodyExpr - | BasicPatterns.LetRec(recursiveBindings, bodyExpr) -> + | FSharpExprPatterns.LetRec(recursiveBindings, bodyExpr) -> List.iter (snd >> visitExpr f) recursiveBindings; visitExpr f bodyExpr - | BasicPatterns.NewArray(arrayType, argExprs) -> + | FSharpExprPatterns.NewArray(arrayType, argExprs) -> visitExprs f argExprs - | BasicPatterns.NewDelegate(delegateType, delegateBodyExpr) -> + | FSharpExprPatterns.NewDelegate(delegateType, delegateBodyExpr) -> visitExpr f delegateBodyExpr - | BasicPatterns.NewObject(objType, typeArgs, argExprs) -> + | FSharpExprPatterns.NewObject(objType, typeArgs, argExprs) -> visitExprs f argExprs - | BasicPatterns.NewRecord(recordType, argExprs) -> + | FSharpExprPatterns.NewRecord(recordType, argExprs) -> visitExprs f argExprs - | BasicPatterns.NewAnonRecord(recordType, argExprs) -> + | FSharpExprPatterns.NewAnonRecord(recordType, argExprs) -> visitExprs f argExprs - | BasicPatterns.NewTuple(tupleType, argExprs) -> + | FSharpExprPatterns.NewTuple(tupleType, argExprs) -> visitExprs f argExprs - | BasicPatterns.NewUnionCase(unionType, unionCase, argExprs) -> + | FSharpExprPatterns.NewUnionCase(unionType, unionCase, argExprs) -> visitExprs f argExprs - | BasicPatterns.Quote(quotedExpr) -> + | FSharpExprPatterns.Quote(quotedExpr) -> visitExpr f quotedExpr - | BasicPatterns.FSharpFieldGet(objExprOpt, recordOrClassType, fieldInfo) -> + | FSharpExprPatterns.FSharpFieldGet(objExprOpt, recordOrClassType, fieldInfo) -> visitObjArg f objExprOpt - | BasicPatterns.AnonRecordGet(objExpr, recordOrClassType, fieldInfo) -> + | FSharpExprPatterns.AnonRecordGet(objExpr, recordOrClassType, fieldInfo) -> visitExpr f objExpr - | BasicPatterns.FSharpFieldSet(objExprOpt, recordOrClassType, fieldInfo, argExpr) -> + | FSharpExprPatterns.FSharpFieldSet(objExprOpt, recordOrClassType, fieldInfo, argExpr) -> visitObjArg f objExprOpt; visitExpr f argExpr - | BasicPatterns.Sequential(firstExpr, secondExpr) -> + | FSharpExprPatterns.Sequential(firstExpr, secondExpr) -> visitExpr f firstExpr; visitExpr f secondExpr - | BasicPatterns.TryFinally(bodyExpr, finalizeExpr) -> + | FSharpExprPatterns.TryFinally(bodyExpr, finalizeExpr) -> visitExpr f bodyExpr; visitExpr f finalizeExpr - | BasicPatterns.TryWith(bodyExpr, _, _, catchVar, catchExpr) -> + | FSharpExprPatterns.TryWith(bodyExpr, _, _, catchVar, catchExpr) -> visitExpr f bodyExpr; visitExpr f catchExpr - | BasicPatterns.TupleGet(tupleType, tupleElemIndex, tupleExpr) -> + | FSharpExprPatterns.TupleGet(tupleType, tupleElemIndex, tupleExpr) -> visitExpr f tupleExpr - | BasicPatterns.DecisionTree(decisionExpr, decisionTargets) -> + | FSharpExprPatterns.DecisionTree(decisionExpr, decisionTargets) -> visitExpr f decisionExpr; List.iter (snd >> visitExpr f) decisionTargets - | BasicPatterns.DecisionTreeSuccess (decisionTargetIdx, decisionTargetExprs) -> + | FSharpExprPatterns.DecisionTreeSuccess (decisionTargetIdx, decisionTargetExprs) -> visitExprs f decisionTargetExprs - | BasicPatterns.TypeLambda(genericParam, bodyExpr) -> + | FSharpExprPatterns.TypeLambda(genericParam, bodyExpr) -> visitExpr f bodyExpr - | BasicPatterns.TypeTest(ty, inpExpr) -> + | FSharpExprPatterns.TypeTest(ty, inpExpr) -> visitExpr f inpExpr - | BasicPatterns.UnionCaseSet(unionExpr, unionType, unionCase, unionCaseField, valueExpr) -> + | FSharpExprPatterns.UnionCaseSet(unionExpr, unionType, unionCase, unionCaseField, valueExpr) -> visitExpr f unionExpr; visitExpr f valueExpr - | BasicPatterns.UnionCaseGet(unionExpr, unionType, unionCase, unionCaseField) -> + | FSharpExprPatterns.UnionCaseGet(unionExpr, unionType, unionCase, unionCaseField) -> visitExpr f unionExpr - | BasicPatterns.UnionCaseTest(unionExpr, unionType, unionCase) -> + | FSharpExprPatterns.UnionCaseTest(unionExpr, unionType, unionCase) -> visitExpr f unionExpr - | BasicPatterns.UnionCaseTag(unionExpr, unionType) -> + | FSharpExprPatterns.UnionCaseTag(unionExpr, unionType) -> visitExpr f unionExpr - | BasicPatterns.ObjectExpr(objType, baseCallExpr, overrides, interfaceImplementations) -> + | FSharpExprPatterns.ObjectExpr(objType, baseCallExpr, overrides, interfaceImplementations) -> visitExpr f baseCallExpr List.iter (visitObjMember f) overrides List.iter (snd >> List.iter (visitObjMember f)) interfaceImplementations - | BasicPatterns.TraitCall(sourceTypes, traitName, typeArgs, typeInstantiation, argTypes, argExprs) -> + | FSharpExprPatterns.TraitCall(sourceTypes, traitName, typeArgs, typeInstantiation, argTypes, argExprs) -> visitExprs f argExprs - | BasicPatterns.ValueSet(valToSet, valueExpr) -> + | FSharpExprPatterns.ValueSet(valToSet, valueExpr) -> visitExpr f valueExpr - | BasicPatterns.WhileLoop(guardExpr, bodyExpr) -> + | FSharpExprPatterns.WhileLoop(guardExpr, bodyExpr) -> visitExpr f guardExpr; visitExpr f bodyExpr - | BasicPatterns.BaseValue baseType -> () - | BasicPatterns.DefaultValue defaultType -> () - | BasicPatterns.ThisValue thisType -> () - | BasicPatterns.Const(constValueObj, constType) -> () - | BasicPatterns.Value(valueToGet) -> () + | FSharpExprPatterns.BaseValue baseType -> () + | FSharpExprPatterns.DefaultValue defaultType -> () + | FSharpExprPatterns.ThisValue thisType -> () + | FSharpExprPatterns.Const(constValueObj, constType) -> () + | FSharpExprPatterns.Value(valueToGet) -> () | _ -> failwith (sprintf "unrecognized %+A" e) and visitExprs f exprs = diff --git a/docs/fcs/untypedtree.fsx b/docs/fcs/untypedtree.fsx index 35b8304b30c..4dd5c369a57 100644 --- a/docs/fcs/untypedtree.fsx +++ b/docs/fcs/untypedtree.fsx @@ -140,8 +140,8 @@ let rec visitExpression e = // for 'let .. = .. and .. = .. in ...' printfn "LetOrUse with the following bindings:" for binding in bindings do - let (Binding(access, kind, inlin, mutabl, attrs, xmlDoc, - data, pat, retInfo, init, m, sp)) = binding + let (SynBinding(access, kind, inlin, mutabl, attrs, xmlDoc, + data, pat, retInfo, init, m, sp)) = binding visitPattern pat visitExpression init // Visit the body expression @@ -171,8 +171,8 @@ let visitDeclarations decls = // Let binding as a declaration is similar to let binding // as an expression (in visitExpression), but has no body for binding in bindings do - let (Binding(access, kind, inlin, mutabl, attrs, xmlDoc, - data, pat, retInfo, body, m, sp)) = binding + let (SynBinding(access, kind, inlin, mutabl, attrs, xmlDoc, + data, pat, retInfo, body, m, sp)) = binding visitPattern pat visitExpression body | _ -> printfn " - not supported declaration: %A" declaration