diff options
| author | Maxime Dénès | 2017-12-22 10:15:09 +0100 |
|---|---|---|
| committer | Maxime Dénès | 2017-12-22 10:15:09 +0100 |
| commit | 4d83222ee649f7554d0b295d88998048e2cb464e (patch) | |
| tree | 9bdf863f9ad99df984cb3734a0ba73d5839576bb | |
| parent | 483d90887aa53dbb8ae44c35ca77ad802a1d1bd1 (diff) | |
| parent | d941f739dd51f5702bccd8a61ed08027fb0fb264 (diff) | |
Merge PR #6445: [stm] [ide protocol] Allow to include several commands on query.
| -rw-r--r-- | stm/stm.ml | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/stm/stm.ml b/stm/stm.ml index 1d46e08332..3cb6bd9b60 100644 --- a/stm/stm.ml +++ b/stm/stm.ml @@ -2994,16 +2994,25 @@ let query ~doc ~at ~route s = stm_purify (fun s -> if Stateid.equal at Stateid.dummy then ignore(finish ~doc:dummy_doc) else Reach.known_state ~cache:`Yes at; - let loc, ast = parse_sentence ~doc at s in - let indentation, strlen = compute_indentation ?loc at in - CWarnings.set_current_loc loc; - let clas = Vernac_classifier.classify_vernac ast in - let aast = { verbose = true; indentation; strlen; loc; expr = ast } in - match clas with - | VtMeta , _ -> (* TODO: can this still happen ? *) - ignore(process_transaction ~part_of_script:false aast (VtMeta,VtNow)) - | _ -> - ignore(process_transaction aast (VtQuery (false, route), VtNow))) + try + while true do + let loc, ast = parse_sentence ~doc at s in + let indentation, strlen = compute_indentation ?loc at in + CWarnings.set_current_loc loc; + let clas = Vernac_classifier.classify_vernac ast in + let aast = { verbose = true; indentation; strlen; loc; expr = ast } in + match clas with + | VtMeta , _ -> (* TODO: can this still happen ? *) + ignore(process_transaction ~part_of_script:false aast (VtMeta,VtNow)) + | _ -> + ignore(process_transaction aast (VtQuery (false,route), VtNow)) + done; + with + | End_of_input -> () + | exn -> + let iexn = CErrors.push exn in + Exninfo.iraise iexn + ) s let edit_at ~doc id = |
