feat(frontends/lean): add 'record' as an alias for 'structure' command
This commit is contained in:
parent
e71db7109d
commit
defc2478b5
3 changed files with 9 additions and 3 deletions
|
@ -11,7 +11,7 @@
|
||||||
'("import" "reducible" "irreducible" "tactic_hint" "protected" "private" "opaque" "definition" "renaming"
|
'("import" "reducible" "irreducible" "tactic_hint" "protected" "private" "opaque" "definition" "renaming"
|
||||||
"hiding" "exposing" "parameter" "parameters" "begin" "proof" "qed" "conjecture" "constant" "constants"
|
"hiding" "exposing" "parameter" "parameters" "begin" "proof" "qed" "conjecture" "constant" "constants"
|
||||||
"hypothesis" "lemma" "corollary" "variable" "variables" "print" "theorem" "example"
|
"hypothesis" "lemma" "corollary" "variable" "variables" "print" "theorem" "example"
|
||||||
"context" "open" "as" "export" "axiom" "inductive" "with" "structure" "universe" "universes"
|
"context" "open" "as" "export" "axiom" "inductive" "with" "structure" "record" "universe" "universes"
|
||||||
"alias" "help" "environment" "options" "precedence" "reserve" "postfix" "prefix"
|
"alias" "help" "environment" "options" "precedence" "reserve" "postfix" "prefix"
|
||||||
"calc_trans" "calc_subst" "calc_refl" "calc_symm"
|
"calc_trans" "calc_subst" "calc_refl" "calc_symm"
|
||||||
"infix" "infixl" "infixr" "notation" "eval" "check" "exit" "coercion" "end"
|
"infix" "infixl" "infixr" "notation" "eval" "check" "exit" "coercion" "end"
|
||||||
|
@ -105,7 +105,7 @@
|
||||||
(,(rx (or "λ" "→" "∃" "∀" ":=")) . 'font-lock-constant-face )
|
(,(rx (or "λ" "→" "∃" "∀" ":=")) . 'font-lock-constant-face )
|
||||||
;; universe/inductive/theorem... "names"
|
;; universe/inductive/theorem... "names"
|
||||||
(,(rx word-start
|
(,(rx word-start
|
||||||
(group (or "inductive" "theorem" "axiom" "lemma" "hypothesis" "definition" "constant"))
|
(group (or "inductive" "structure" "record" "theorem" "axiom" "lemma" "hypothesis" "definition" "constant"))
|
||||||
word-end
|
word-end
|
||||||
(zero-or-more (or whitespace "(" "{" "["))
|
(zero-or-more (or whitespace "(" "{" "["))
|
||||||
(group (zero-or-more (not (any " \t\n\r")))))
|
(group (zero-or-more (not (any " \t\n\r")))))
|
||||||
|
|
|
@ -95,7 +95,7 @@ void init_token_table(token_table & t) {
|
||||||
|
|
||||||
pair<char const *, char const *> cmd_aliases[] =
|
pair<char const *, char const *> cmd_aliases[] =
|
||||||
{{"lemma", "theorem"}, {"corollary", "theorem"}, {"hypothesis", "parameter"}, {"conjecture", "parameter"},
|
{{"lemma", "theorem"}, {"corollary", "theorem"}, {"hypothesis", "parameter"}, {"conjecture", "parameter"},
|
||||||
{nullptr, nullptr}};
|
{"record", "structure"}, {nullptr, nullptr}};
|
||||||
|
|
||||||
auto it = builtin;
|
auto it = builtin;
|
||||||
while (it->first) {
|
while (it->first) {
|
||||||
|
|
6
tests/lean/run/record8.lean
Normal file
6
tests/lean/run/record8.lean
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
import data.nat.basic
|
||||||
|
|
||||||
|
record point :=
|
||||||
|
(x y : nat)
|
||||||
|
|
||||||
|
check point.x
|
Loading…
Reference in a new issue