-
Notifications
You must be signed in to change notification settings - Fork 98
feat: elaborate block structures as concrete elements #693
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
base: concrete-block
Are you sure you want to change the base?
Conversation
|
|
||
| public abbrev DirectiveExpanderOf α := α → TSyntaxArray `block → DocElabM Term | ||
|
|
||
| public abbrev DirectiveElaborator := Array Arg → TSyntaxArray `block → DocElabM (Array Target.Block) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want this old-school version to be public?
| let n ← mkFreshUserName <| declName ++ `directive | ||
|
|
||
| -- Find the appropriate adapter for both new (`DirectiveElabOf`) and legacy (`DirectiveExpanderOf`) declarations | ||
| let constructor ← match (← getEnv).find? declName |>.map (·.type.getAppFn) with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is probably correct, but I figured I'd flag it up just to be sure. Right now, this will reject user-written abbrevs that expand to one of the allowed forms. The check could be done modulo defeq to allow those. I think this is correct anyway because I think the attributes reject types that don't strictly have this form, but I thought it was worth double-checking.
| let n ← mkFreshUserName <| declName ++ `directive | ||
|
|
||
| -- Find the appropriate adapter for both new (`DirectiveElabOf`) and legacy (`DirectiveExpanderOf`) declarations | ||
| let constructor ← match (← getEnv).find? declName |>.map (·.type.getAppFn) with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
constructor has a specific meaning that I think we should avoid overloading. What about adapter?
| } | ||
|
|
||
| private unsafe def directiveExpandersForUnsafe' (x : Name) : DocElabM (Array (DirectiveExpander × Option String × Option SigDoc)) := do | ||
| private unsafe def directiveExpandersForUnsafe' (x : Name) : DocElabM (Array (DirectiveElaborator × Option String × Option SigDoc)) := do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't the function be renamed too?
| private unsafe def directiveExpandersForUnsafe' (x : Name) : DocElabM (Array (DirectiveElaborator × Option String × Option SigDoc)) := do | |
| private unsafe def directiveElabsForUnsafe' (x : Name) : DocElabM (Array (DirectiveElaborator × Option String × Option SigDoc)) := do |
No description provided.