{ "cells": [ { "cell_type": "markdown", "id": "0b753ea3", "metadata": {}, "source": [ "# MWE\n", "\n", "This notebook illustrates a lexing warning on certain OCaml error outputs." ] }, { "cell_type": "code", "execution_count": 1, "id": "94d54811", "metadata": { "tags": [ "raises-exception" ] }, "outputs": [ { "ename": "error", "evalue": "compile_error", "output_type": "error", "traceback": [ "File \"[1]\", line 2, characters 0-1:\n2 | x\n ^\nError: Unbound value x\n" ] } ], "source": [ "(* this cell renders fine *)\n", "x" ] }, { "cell_type": "code", "execution_count": 2, "id": "a633df10", "metadata": { "tags": [ "raises-exception" ] }, "outputs": [ { "ename": "error", "evalue": "compile_error", "output_type": "error", "traceback": [ "File \"[2]\", line 2, characters 33-43:\n2 | module M : sig val x : int end = struct end\n ^^^^^^^^^^\nError: Signature mismatch:\n Modules do not match: sig end is not included in sig val x : int end\n The value `x' is required but not provided\n File \"[2]\", line 2, characters 15-26: Expected declaration\n" ] } ], "source": [ "(* this cell triggers a lexing warning when producing the HTML book *)\n", "module M : sig val x : int end = struct end" ] }, { "cell_type": "code", "execution_count": null, "id": "8fcde13e", "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "celltoolbar": "Edit Metadata", "kernelspec": { "display_name": "OCaml", "language": "OCaml", "name": "ocaml-jupyter" }, "language_info": { "codemirror_mode": "text/x-ocaml", "file_extension": ".ml", "mimetype": "text/x-ocaml", "name": "OCaml", "nbconverter_exporter": null, "pygments_lexer": "OCaml", "version": "4.11.1" } }, "nbformat": 4, "nbformat_minor": 5 }