You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TODO: This project is still work in progress, and need more documents.
Status
NuGet
CI (AppVeyor)
Issue status
Pull req
What is this?
We can apply visitor pattern with minimum coding for FSharp.Compiler.Service's untyped ASTs.
Contains two visitors:
"Functional visitor types. (FP based)"
"Inheritable (Legacy) visitor base class. (OOP based)"
FSharp.Compiler.Service.Visitors is part of fscx-project.
Functional visitor implementation:
"Functional visitor" is using for functional visitor patterns with F#'s AST (FSharp.Compiler.Services untyped AST).
// Functional visitor pattern (Not use custom context):letouterVisitor(defaultVisitor:(NoContext * SynExpr -> SynExpr),context:NoContext,// (Non custom context type)expr:SynExpr):SynExpr option =match expr with| SynExpr.Quote(operator,_,_,_,_)->// DEBUG
printfn "%A" operator
None // (None is default visiting)| SynExpr.App(exprAtomicFlag, isInfix, funcExpr, argExpr, range)->match funcExpr with// ...|_->
None // (None is default visiting)// Declare your own functional visitor.// Type name for free.typeInsertLoggingVisitor()=inherit DeclareAstFunctionalVisitor(outerVisitor)
Inheritable visitor implementation:
"Inheritable visitor" is using for traditional visitor patterns with F#'s AST.
If you are implemented visitor class inherit from "AstInheritableVisitor" class.
"AstInheritableVisitor" are abstract classes, generic version and non-generic version.
Generic argument is "Context type". Context is depending any information holds for your implementations. Implicit applied "NoContext" type for non-generic version.
Pinned version 1.4.2 for System.Reflection.Metadata (non-beta)
0.7.1:
Manage parent nodes using list instead stack.
Remove FSharpCheckFileResults args.
Update readme.
0.6.3:
Reduced context type constraints.
0.6.2:
Moved non generic AstInheritableVisitor.
0.6.1:
Upgraded to FSharp.Compiler Service 6.0.2 (You must be rearrenging for NuGet package installation with -Pre option, because 6.0.2 depends for System.Reflection.Metadata.dll BETA package.)
0.5.1:
Moving implements from FSharp.Expandable.Compiler.Core.