open Lean
declare_syntax_cat stmt
syntax"do'" stmt : term
-- Prevent `if ...` from being parsed as a termsyntax (priority := low) term : stmt
syntax"let" ident "←" stmt:1";" stmt : stmt
macro"{"
s: TSyntax `stmt
s:stmt "}" : stmt =>`($
s: TSyntax `stmt
s)/- Remark: we annotate `macro`s and `macro_rules` with their corresponding translation/abbreviation id from the paper.-/syntax"d!" stmt : term -- corresponds to `D(s)`macro_rules|`(do'$