diff options
| author | Alasdair Armstrong | 2018-11-07 18:56:28 +0000 |
|---|---|---|
| committer | Alasdair Armstrong | 2018-11-09 21:24:14 +0000 |
| commit | 953bfdd18c71bcd6c486aac74fe145104c3b2a4d (patch) | |
| tree | d4b88c3458be8f32d9ab01be9091cff5f2d1502d /editors | |
| parent | 61e6bc97a7d5efb58f9b91738f1dd64404091137 (diff) | |
Improvements to latex generation
The main changes so far are:
* Allow markdown formatting in doc comments. We parse the markdown
using Omd, which is a OCaml library for parsing markdown. The nice
thing about this library is it's pure OCaml and has no dependencies
other the the stdlib. Incidentally it was also developed at OCaml
labs. Using markdown keeps our doc-comments from becoming latex
specfic, and having an actual parser is _much_ nicer than trying to
hackily process latex in doc-comments using OCamls somewhat sub-par
regex support.
* More sane conversion latex identifiers the main approach is to
convert Sail identifiers to lowerCamelCase, replacing numbers with
words, and then add a 'category' code based on the type of
identifier, so for a function we'd have fnlowerCamelCase and for
type synonym typelowerCamelCase etc. Because this transformation is
non-injective we keep track of identifiers we've generated so we end
up with identifierA, identifierB, identifierC when there are
collisions.
* Because we parse markdown in doc comments doc comments can use Sail
identifiers directly in hyperlinks, without having to care about how
they are name-mangled down into TeX compatible things.
* Allow directives to be passed through the compiler to
backends. There are various $latex directives that modify the latex
output. Most usefully there's a
$latex newcommand name markdown
directive that uses the markdown parser to generate latex
commands. An example of why this is useful is bellow. We can also use
$latex noref id
To suppress automatically inserting links to an identifier
* Refactor the latex generator to make the overall generation process
cleaner
* Work around the fact that some operating systems consider
case-sensitive file names to be a good thing
* Fix a bug where latex generation wouldn't occur unless the directory
specified by -o didn't exist
This isn't quite all the requested features for good CHERI
documentation, but new features should be much easier to add now.
Diffstat (limited to 'editors')
| -rw-r--r-- | editors/sail2-mode.el | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/editors/sail2-mode.el b/editors/sail2-mode.el index ac3c199c..e7b115ba 100644 --- a/editors/sail2-mode.el +++ b/editors/sail2-mode.el @@ -21,7 +21,8 @@ "uint64_t" "int64_t" "bv_t" "mpz_t")) (defconst sail2-special - '("_prove" "create" "kill" "convert" "undefined" "$define" "$include" "$ifdef" "$ifndef" "$else" "$endif" "$option")) + '("_prove" "create" "kill" "convert" "undefined" + "$define" "$include" "$ifdef" "$ifndef" "$else" "$endif" "$option" "$latex")) (defconst sail2-font-lock-keywords `((,(regexp-opt sail2-keywords 'symbols) . font-lock-keyword-face) |
