sed -Ei 's/^(\s*)((private |protected )?(noncomputable )?(abbreviation|definition|meta_definition|theorem|lemma|proposition|corollary)\s+\S+\s*)((\s*\[(\S+(\s+[0-9]+)*|priority.*)\])+)\s*/\1attribute \6\n\1\2/' library/**/*.lean tests/**/*.lean sed -Ei 's/\s+$//' library/**/*.lean # remove trailing whitespace
47 lines
754 B
Text
47 lines
754 B
Text
open nat
|
|
|
|
structure foo [class] :=
|
|
(a : nat) (b : nat)
|
|
|
|
attribute [instance] [priority std.priority.default-2]
|
|
definition i1 : foo :=
|
|
foo.mk 1 1
|
|
|
|
example : foo.a = 1 :=
|
|
rfl
|
|
|
|
attribute [instance] [priority std.priority.default-1]
|
|
definition i2 : foo :=
|
|
foo.mk 2 2
|
|
|
|
example : foo.a = 2 :=
|
|
rfl
|
|
|
|
attribute [instance]
|
|
definition i3 : foo :=
|
|
foo.mk 3 3
|
|
|
|
example : foo.a = 3 :=
|
|
rfl
|
|
|
|
attribute [instance] [priority std.priority.default-1]
|
|
definition i4 : foo :=
|
|
foo.mk 4 4
|
|
|
|
example : foo.a = 3 :=
|
|
rfl
|
|
|
|
attribute i4 [instance] [priority std.priority.default+2]
|
|
|
|
example : foo.a = 4 :=
|
|
rfl
|
|
|
|
attribute i1 [instance] [priority std.priority.default+3]
|
|
|
|
example : foo.a = 1 :=
|
|
rfl
|
|
|
|
attribute i2 [instance] [priority std.priority.default+4]
|
|
|
|
example : foo.a = 2 :=
|
|
rfl
|