summaryrefslogtreecommitdiff
path: root/src/latex.ml
AgeCommit message (Collapse)Author
2019-01-29Merge branch 'sail2' into asl_flow2Thomas Bauereiss
2019-01-21Fix some issues with latex generation so manual builds againAlasdair Armstrong
since riscv is no longer in this repository, and we use the RISC-V duopod as an example, you need to build as: make RISCV=directory manual.pdf if directory is not equal to ../../sail-riscv (which is where it would be if sail and sail-riscv are checked out in the same respository together)
2019-01-16Latex: handle underscores when generating latex names.Prashanth Mundkur
2018-11-15Add simple valspec printing in latex that drops effects and other extraneous ↵Robert Norton
details (TODO make this optional).
2018-11-14Use code style For [id] refs in doc comments.Robert Norton
2018-11-14latex: use callback macro saildocxxx (one per top-level category) to give ↵Robert Norton
usere more flexibility about formatting generated latex.
2018-11-12Add referencing commands to generated latexAlasdair Armstrong
2018-11-12Fix numbers in constructor argumentsAlasdair Armstrong
Also ensure no collisions for function clause constructor categories
2018-11-12Improve latex naming scheme and avoid collisionsAlasdair Armstrong
2018-11-09Improvements to latex generationAlasdair Armstrong
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.
2018-10-31Rename Reporting_basic to ReportingAlasdair Armstrong
There is no Reporting_complex, so it's not clear what the basic is intended to signify anyway. Add a GitHub issue link to any err_unreachable errors (as they are all bugs)
2018-09-12Jenkins: Fix deprecation warningsAlasdair Armstrong
Now that Jenkins is updated to a newer version of OCaml we can finally fix some warning with more recent versions of OCaml than 4.02.3. Also fix a Lem test case that was failing.
2018-08-07Revert "Warnings: deal with all the deprecation warnings"Alasdair Armstrong
One day we will be free from the 4.02.3 menace, but today is not that day. :( This should fix Sail on Jenkins This reverts commit 86e29bcbb1597c4ef1f6cae8edbeed42f9a31414.
2018-07-26Warnings: deal with all the deprecation warningsAlastair Reid
Changes are: - String.capitalize -> String.capitalize_ascii - String.uppercase -> String.uppercase_ascii - String.lowercase -> String.lowercase_ascii Basically just making the change that the warning message suggested.
2018-05-11Remove unneeded _sail suffix from latex files.Robert Norton
2018-05-11Avoid generating latex files that differ only by case because this causes ↵Robert Norton
confusion on case insensitive file systems (e.g. mac).
2018-05-10latex: don't include the prefix in the label. This means we have the option ↵Robert Norton
of omitting valspec in documentation if it is deemed too verbose and still have hyperlinks work. The caveat is that it could result in multiply defined labels.
2018-05-09Add language=sail option in listings command for latex output. This helps ↵Robert Norton
with documents containing listings in multiple languages.
2018-04-25Start working on documentationAlasdair Armstrong
2018-04-23Merge branch 'rmn30_latex' into sail2Robert Norton
2018-04-18add some experimental support for latex output in multiple files.Robert Norton
2018-04-18Updates to latex mode for documentationAlasdair Armstrong
2018-04-05Fix precedence printing and update aarch64 specAlasdair Armstrong
More work on Latex output
2018-04-05More work on latex outputAlasdair Armstrong
Now generate commands for each toplevel definition, such that e.g. the function clause for execute LOAD could be inserted using \sailexecuteLOAD. Tries to generate fairly intuitive names while avoiding clashes where possible.
2018-03-19Fixes to C backend for RISCV-compilationAlasdair Armstrong
Can now compile RISCV. Requires some library tweaks before it'll pass any tests, Also adds hyperlinks to wip latex output
2018-03-14WIP Latex formattingAlasdair Armstrong
Added option -latex that outputs input to a latex document. Added doc comments that can be attached to certain AST nodes - right now just valspecs and function clauses, e.g. /*! Documentation for main */ val main : unit -> unit These comments are kept by the sail pretty printer, and used when generating latex