Skip to content

Commit

Permalink
feat: add propper code-gen and support for implicits
Browse files Browse the repository at this point in the history
  • Loading branch information
William Sørensen committed Aug 14, 2024
1 parent c737ce7 commit 296e410
Show file tree
Hide file tree
Showing 5 changed files with 253 additions and 198 deletions.
16 changes: 1 addition & 15 deletions Qpf/Macro/Data/Ind.lean
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,16 @@ import Qpf.Qpf.Multivariate.Constructions.DeepThunk
import Qpf.Macro.Data.Constructors
import Qpf.Macro.Data.RecForm
import Qpf.Macro.Data.View
import Qpf.Macro.ParserUtils
import Qpf.Macro.Common
import Qpf.Util.Vec

open Lean.Parser (Parser)
open Lean Meta Elab.Command Elab.Term Parser.Term
open Lean.Parser.Tactic (inductionAlt)



def flattenForArg (n : Name) := Name.str .anonymous $ n.toStringWithSep "_" true

/-- Both `bracketedBinder` and `matchAlts` have optional arguments,
which cause them to not by recognized as parsers in quotation syntax
(that is, ``` `(bracketedBinder| ...) ``` does not work).
To work around this, we define aliases that force the optional argument to it's default value,
so that we can write ``` `(bb| ...) ```instead. -/
abbrev bb : Parser := bracketedBinder
abbrev matchAltExprs : Parser := matchAlts

/- Since `bb` and `matchAltExprs` are aliases for `bracketedBinder`, resp. `matchAlts`,
we can safely coerce syntax of these categories -/
instance : Coe (TSyntax ``bb) (TSyntax ``bracketedBinder) where coe x := ⟨x.raw⟩
instance : Coe (TSyntax ``matchAltExprs) (TSyntax ``matchAlts) where coe x := ⟨x.raw⟩

section
variable {m} [Monad m] [MonadQuotation m] [MonadError m] [MonadTrace m] [AddMessageContext m]

Expand Down
Loading

0 comments on commit 296e410

Please sign in to comment.