diff options
| author | Emilio Jesus Gallego Arias | 2020-02-21 12:46:22 -0500 |
|---|---|---|
| committer | Emilio Jesus Gallego Arias | 2020-03-25 23:45:01 -0400 |
| commit | f374c2562b9522bd90330f6f17f0a7e41c723e8b (patch) | |
| tree | 3ad126603fb6a7eccb1ec20b3dc3dd340cf22b90 /printing | |
| parent | af7628468d638c77fb3f55a9eb315b687b76a21d (diff) | |
[parsing] Move `coq_parsable` custom logic to Grammar.
Latest refactorings allow us to make the signature Coq parser a
standard `Grammar.S` one; the only bit needed is to provide the extra
capabilities to the `Lexer` signature w.r.t. to comments state.
The handling of Lexer state is still a bit ad-hoc, in particular it is
global whereas it should be fully attached to the parsable. This may
work ok in batch mode but the current behavior may be buggy in the
interactive context.
This PR doesn't solve that but it is a step towards a more functional
solution.
Diffstat (limited to 'printing')
| -rw-r--r-- | printing/proof_diffs.ml | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/printing/proof_diffs.ml b/printing/proof_diffs.ml index fb91ea7b5c..9d75341795 100644 --- a/printing/proof_diffs.ml +++ b/printing/proof_diffs.ml @@ -98,18 +98,17 @@ let tokenize_string s = else stream_tok ((Tok.extract_string true e) :: acc) str in - let st = CLexer.get_lexer_state () in + let st = CLexer.Lexer.State.get () in try let istr = Stream.of_string s in let lex = CLexer.LexerDiff.tok_func istr in let toks = stream_tok [] (fst lex) in - CLexer.set_lexer_state st; + CLexer.Lexer.State.set st; toks with exn -> - CLexer.set_lexer_state st; + CLexer.Lexer.State.set st; raise (Diff_Failure "Input string is not lexable");; - type hyp_info = { idents: string list; rhs_pp: Pp.t; |
