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
20 lines
326 B
Text
20 lines
326 B
Text
open nat
|
|
|
|
abbreviation foo : Π (A : Type), nat := λ a, 2 + 3
|
|
|
|
definition tst := foo nat
|
|
|
|
set_option pp.abbreviations false
|
|
|
|
print definition tst
|
|
|
|
set_option pp.abbreviations true
|
|
|
|
print definition tst
|
|
|
|
attribute [parsing_only]
|
|
abbreviation id2 {A : Type} (a : A) := a
|
|
|
|
definition tst1 :nat := id2 10
|
|
|
|
print definition tst1
|