Skip to content
This repository has been archived by the owner on Oct 14, 2023. It is now read-only.

User-defined notation parsers #1617

Closed
wants to merge 15 commits into from
Closed

Conversation

Kha
Copy link
Member

@Kha Kha commented May 30, 2017

Allow user-defined notation that uses lean.parser for parsing its parameters and computes a pre-term in the tactic monad. The notation is activated by a single tk parser, which may optionally be preceded by a qexpr parser for postfix/infix notations.

Examples: the mandatory unquote! macro, a format! macro, and a non-creative infix notation example. More suggestions welcome.

@Kha Kha mentioned this pull request May 31, 2017
@Kha Kha force-pushed the user-notation branch from 55ff5d4 to 3a14e97 Compare June 2, 2017 14:47
@Kha
Copy link
Member Author

Kha commented Jun 2, 2017

I fear I might give @leodemoura a heart attack with this commit, but I hope the results justify the means :) .

@Kha Kha force-pushed the user-notation branch 5 times, most recently from 3d5bf94 to f69fd6a Compare June 6, 2017 15:16
@@ -133,813 +132,3 @@ meta def param_desc : expr → tactic format
then return $ to_fmt "{ tactic }"
else paren <$> pp e
end interactive

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is everyone fine with this refactoring to reduce dependencies? If yes, I'd recommend merging the PR as-is to reduce merge conflicts. I will improve error handling in a later PR.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am fine with reducing dependencies, but a new directory tactic with a single interactive.lean file looks strange. I think interactive_base.lean and interactive.lean in the same directory (i.e., meta) looks better.

BTW, I'm not against mirroring the namespace hierarchy in the directory structure. However, if you do it, we should be consistent. We should also do it in a different PR. What do you think?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could move the *_tactic(s).lean files into the directory. However, your suggestion is probably better for the time being since it avoids conflicts with other open PRs. I will do the change.

@Kha Kha force-pushed the user-notation branch from f69fd6a to a118321 Compare June 7, 2017 15:44
@Kha Kha changed the title [WIP, RFC]: User-defined notation parsers User-defined notation parsers Jun 7, 2017
@Kha Kha force-pushed the user-notation branch from a118321 to 2df6f03 Compare June 7, 2017 16:10
@leodemoura leodemoura closed this Jun 7, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants