summaryrefslogtreecommitdiff
path: root/manual
diff options
context:
space:
mode:
authorDemi Marie Obenour <demiobenour@gmail.com>2022-11-11 22:40:01 -0500
committerDemi Marie Obenour <demiobenour@gmail.com>2023-02-27 14:32:07 -0500
commitf63491bb6c427ed24501ee9910e9aec1ef8c8238 (patch)
tree8a0b8d6ea3b4174acb8a2bc67624ac0819742609 /manual
parentfd6e6e0c9cf636f69cc90f4590834f77efaa5b95 (diff)
downloadocaml-f63491bb6c427ed24501ee9910e9aec1ef8c8238.tar.gz
ocamlyacc: support OCaml-style comments
This adds support for OCaml-style comments everywhere in ocamlyacc, in addition to the existing support for C-style comments. The syntax is the same as for OCaml comments in actions. It also fixes reporting of an unterminated comment in an action, which was previously reported as “unmatched /*” instead of “unmatched (*” Reviewed by Damien Doligez.
Diffstat (limited to 'manual')
-rw-r--r--manual/src/cmds/lexyacc.etex7
1 files changed, 4 insertions, 3 deletions
diff --git a/manual/src/cmds/lexyacc.etex b/manual/src/cmds/lexyacc.etex
index 0524c37c21..deb0beafef 100644
--- a/manual/src/cmds/lexyacc.etex
+++ b/manual/src/cmds/lexyacc.etex
@@ -416,9 +416,10 @@ Grammar definitions have the following format:
\var{trailer}
\end{alltt}
-Comments are enclosed between \verb|/*| and \verb|*/| (as in C) in the
-``declarations'' and ``rules'' sections, and between \verb|(*| and
-\verb|*)| (as in OCaml) in the ``header'' and ``trailer'' sections.
+Comments are delimited by \verb|(*| and \verb|*)|, as in OCaml.
+Additionally, comments can be delimited by \verb|/*| and \verb|*/|,
+as in C, in the ``declarations'' and ``rules'' sections. C-style
+comments do not nest, but OCaml-style comments do.
\subsection{ss:ocamlyacc-header-trailer}{Header and trailer}