| 1 | (************************************************************************) |
| 2 | (* * The Rocq Prover / The Rocq Development Team *) |
| 3 | (* v * Copyright INRIA, CNRS and contributors *) |
| 4 | (* <O___,, * (see version control and CREDITS file for authors & dates) *) |
| 5 | (* \VV/ **************************************************************) |
| 6 | (* // * This file is distributed under the terms of the *) |
| 7 | (* * GNU Lesser General Public License Version 2.1 *) |
| 8 | (* * (see LICENSE file for the text of the license) *) |
| 9 | (************************************************************************) |
| 10 | |
| 11 | |
| 12 | (** Latex to unicode bindings. |
| 13 | See also the documentation in doc/sphinx/practical-tools/coqide.rst. |
| 14 | |
| 15 | Text description of the unicode bindings, in a file with one item per line, |
| 16 | each item consists of: |
| 17 | - a leading backslahs |
| 18 | - a ascii word next to it |
| 19 | - a unicode word (or possibly a full sentence in-between doube-quotes, |
| 20 | the sentence may include spaces and \n tokens), |
| 21 | - optionally, an integer indicating the "priority" (lower is higher priority), |
| 22 | technically the length of the prefix that suffices to obtain this word. |
| 23 | Ex. if "\lambda" has priority 3, then "\lam" always decodes as "\lambda". |
| 24 | |
| 25 | \pi π |
| 26 | \lambda λ 3 |
| 27 | \lambdas λs 4 |
| 28 | \lake Ο 2 |
| 29 | \lemma "Lemma foo : x. Proof. Qed." 1 ---currently not supported by the parser |
| 30 | |
| 31 | - In case of equality between two candidates (same ascii word, or same |
| 32 | priorities for two words with similar prefix), the first binding is considered. |
| 33 | |
| 34 | - Note that if a same token is bound in several bindings file, |
| 35 | the one with the lowest priority number will be considered. |
| 36 | In case of same priority, the binding from the first file loaded |
| 37 | is considered. |
| 38 | *) |
| 39 | |
| 40 | |
| 41 | (** [load_files] takes a list of filenames and load them as binding files. |
| 42 | Filenames may include "default" and "local" as items. *) |
| 43 | |
| 44 | val load_files : string list -> unit |
| 45 | |
| 46 | (** [lookup] takes a prefix and returns the corresponding unicode value *) |
| 47 | |
| 48 | val lookup : string -> string option |