Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Widgets for TypeAugmentation, member methods and patterns #46

Merged
merged 5 commits into from Jun 20, 2023

Conversation

kaashyapan
Copy link
Contributor

#43

kaashyapan and others added 5 commits June 12, 2023 22:30
…into methods

# Conflicts:
#	src/Fabulous.AST.Tests/Fabulous.AST.Tests.fsproj
#	src/Fabulous.AST.Tests/TypeDefinitions/Record.fs
#	src/Fabulous.AST.Tests/TypeDefinitions/Union.fs
#	src/Fabulous.AST/Core/Helpers.fs
#	src/Fabulous.AST/Fabulous.AST.fsproj
#	src/Fabulous.AST/Widgets/TypeDefinitions/Class.fs
@edgarfgp
Copy link
Owner

@kaashyapan I Finally had some time to go over this PR. Thanks for taking the time. I made some changes that I will describe below:

  • The aim of Fabulous. AST is not to add a DSL for all the Oak Nodes, But rather add the ones that make sense based on
    the users and how it can be done using the Fabulous internals
  • I think it makes send to add Widgets for MemberDefn as these can be used in Classes, Records, Unions etc.
[<RequireQualifiedAccess; NoEquality; NoComparison>]
type MemberDefn =
    | ImplicitInherit of InheritConstructor
    | Inherit of MemberDefnInheritNode
    | ValField of FieldNode
    | Member of BindingNode
    | ExternBinding of ExternBindingNode
    | DoExpr of ExprSingleNode
    | LetBinding of BindingListNode
    | ExplicitCtor of MemberDefnExplicitCtorNode
    | Interface of MemberDefnInterfaceNode
    | AutoProperty of MemberDefnAutoPropertyNode
    | AbstractSlot of MemberDefnAbstractSlotNode
    | PropertyGetSet of MemberDefnPropertyGetSetNode
    | SigMember of MemberDefnSigMemberNode
  • I do not think adding Widgets for Pattern is not a good idea for now. We could just add extensions to make it easy to create those. Same for Expr

Regarding naming convention:

  • For Widget constructors, I think I use a more natural language i.e.
    • TypeDefnRegularNode -> Class, GenericClass
    • TypeDefnRegularNode -> Interface, GenericInterface
  • For widgets modifiers, I think it makes sense to match the Oak AST model

@edgarfgp edgarfgp merged commit f0caafe into edgarfgp:main Jun 20, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants