Skip to content

Commit

Permalink
chore: newline after responses, for easier parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
kim-em committed Oct 13, 2023
1 parent 3a6182b commit 93b074d
Show file tree
Hide file tree
Showing 16 changed files with 37 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"files.encoding": "utf8",
"files.eol": "\n",
"files.insertFinalNewline": true,
"files.trimFinalNewlines": true,
// We don't use this: it messes up our test files!
// "files.trimFinalNewlines": true,
"files.trimTrailingWhitespace": true,
}
1 change: 1 addition & 0 deletions REPL/Main.lean
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ where loop : M IO Unit := do
| .unpickleEnvironment r => return toJson (← unpickleEnvironment r)
| .pickleProofState r => return toJson (← pickleProofState r)
| .unpickleProofState r => return toJson (← unpickleProofState r)
IO.println "" -- easier to parse the output if there are blank lines
loop

/-- Main executable function, run as `lake exe repl`. -/
Expand Down
2 changes: 2 additions & 0 deletions test/def_eval.expected.out
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
{"sorries": [], "messages": [], "env": 0}

{"sorries": [],
"messages":
[{"severity": "info",
"pos": {"line": 1, "column": 0},
"endPos": {"line": 1, "column": 6},
"data": "rfl : f = f"}],
"env": 1}

1 change: 1 addition & 0 deletions test/enableInitializersExecution.expected.out
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
{"sorries": [], "messages": [], "env": 0}

4 changes: 4 additions & 0 deletions test/pickle_environment.expected.out
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{"sorries": [], "messages": [], "env": 0}

{"sorries": [], "messages": [], "env": 0}

{"sorries": [], "messages": [], "env": 1}

{"sorries": [], "messages": [], "env": 2}

5 changes: 5 additions & 0 deletions test/pickle_environment_with_imports.expected.out
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{"sorries": [], "messages": [], "env": 0}

{"sorries": [], "messages": [], "env": 1}

{"sorries": [], "messages": [], "env": 1}

{"sorries": [], "messages": [], "env": 2}

{"sorries": [], "messages": [], "env": 3}

8 changes: 8 additions & 0 deletions test/pickle_proof_state_1.expected.out
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{"sorries": [], "messages": [], "env": 0}

{"sorries":
[{"proofState": 0,
"pos": {"line": 1, "column": 18},
Expand All @@ -10,9 +11,16 @@
"endPos": {"line": 1, "column": 5},
"data": "declaration uses 'sorry'"}],
"env": 1}

{"proofState": 1, "goals": ["⊢ Nat"]}

{"proofState": 2, "goals": ["⊢ Nat"]}

{"proofState": 3, "goals": ["t : Nat\n⊢ Nat"]}

{"proofState": 4, "goals": ["t : Nat\n⊢ Nat"]}

{"proofState": 5, "goals": ["t : Nat\n⊢ Nat"]}

{"proofState": 6, "goals": []}

2 changes: 2 additions & 0 deletions test/pickle_proof_state_2.expected.out
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
{"proofState": 0, "goals": ["t : Nat\n⊢ Nat"]}

{"proofState": 1, "goals": []}

4 changes: 4 additions & 0 deletions test/proof_step.expected.out
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
"endPos": {"line": 1, "column": 5},
"data": "declaration uses 'sorry'"}],
"env": 0}

{"proofState": 1, "goals": ["⊢ Int"]}

{"proofState": 2, "goals": ["t : Nat\n⊢ Nat"]}

{"proofState": 3, "goals": []}

1 change: 1 addition & 0 deletions test/synthesize_placeholder.expected.out
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
"endPos": {"line": 1, "column": 16},
"data": "don't know how to synthesize placeholder\ncontext:\n⊢ Nat"}],
"env": 0}

1 change: 1 addition & 0 deletions test/tactic_sorry.expected.out
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@
"endPos": {"line": 1, "column": 5},
"data": "declaration uses 'sorry'"}],
"env": 0}

1 change: 1 addition & 0 deletions test/term_sorry.expected.out
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@
"endPos": {"line": 1, "column": 5},
"data": "declaration uses 'sorry'"}],
"env": 0}

1 change: 1 addition & 0 deletions test/unfinished_tactic_block.expected.out
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@
"endPos": {"line": 1, "column": 17},
"data": "unsolved goals\n⊢ Nat"}],
"env": 0}

1 change: 1 addition & 0 deletions test/unknown_environment.expected.out
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
{"message": "Unknown environment."}

2 changes: 2 additions & 0 deletions test/unknown_proof_state.expected.out
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@
"endPos": {"line": 1, "column": 5},
"data": "declaration uses 'sorry'"}],
"env": 0}

{"message": "Unknown proof state."}

1 change: 1 addition & 0 deletions test/unknown_tactic.expected.out
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@
"endPos": {"line": 1, "column": 5},
"data": "declaration uses 'sorry'"}],
"env": 0}

uncaught exception: <input>:1:1: unknown tactic

0 comments on commit 93b074d

Please sign in to comment.