Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not write json to stdout #99

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gen_docs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ if [ "$link" -eq "1" ]; then
fi

bash "$source"scripts/mk_all.sh
lean src/entrypoint.lean >export.json
lean src/entrypoint.lean
bash "$source"scripts/rm_all.sh

python3 print_docs.py -r "$source" -w "$site_root" "${args[@]}"
7 changes: 6 additions & 1 deletion src/export_json.lean
Original file line number Diff line number Diff line change
Expand Up @@ -391,9 +391,14 @@ do m ← of_tactic localized_attr.get_cache,
(tok.length = 1 ∧ tok.front.is_alphanum) ∨ tok ∈ ["ε", "φ", "ψ", "W_", "σ", "ζ"]) $
lean.parser.emit_code_here m <|> skip

def write_file (fn : string) (cnts : string) (mode := io.mode.write) : io unit :=
do h ← io.mk_file_handle fn io.mode.write,
io.fs.put_str h cnts,
io.fs.close h

meta def main : io unit := do
json ← run_tactic mk_export_json,
put_str json.unparse
write_file "export.json" json.unparse

-- HACK: print gadgets with less fluff
notation x ` := `:10 y := opt_param x y
Expand Down