From e3f83d58dc74a3e1032907f90544b8c07ca830a6 Mon Sep 17 00:00:00 2001 From: Florian Angeletti Date: Wed, 6 Nov 2019 15:41:03 +0100 Subject: [PATCH] manual: fix operator char classes --- Changes | 3 +++ manual/manual/refman/exten.etex | 9 ++++++--- manual/manual/refman/lex.etex | 15 ++++++++------- 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/Changes b/Changes index 1bde232f7c98..234a10300a6e 100644 --- a/Changes +++ b/Changes @@ -340,6 +340,9 @@ OCaml 4.10.0 - #8950: manual, move local opens in pattern out of the extension chapter (Florian Angeletti, review and suggestion by Gabriel Scherer) +- #9088, #9097: manual, fix operator character classes + (Florian Angelettion, review by Gabriel Scherer, + report by Clément Busschaert) ### Compiler user-interface and warnings: diff --git a/manual/manual/refman/exten.etex b/manual/manual/refman/exten.etex index 0907ae7d9076..dcf3be51fbdb 100644 --- a/manual/manual/refman/exten.etex +++ b/manual/manual/refman/exten.etex @@ -2280,7 +2280,10 @@ type t = T of string \begin{syntax} dot-ext: - | ('!'||'$'||'%'||'&'||'*'||'+'||'-'||'/'||':'||'='||'>'||'?'||'@'||'^'||'|'||'~') { operator-char } + | dot-operator-char { operator-char } +; +dot-operator-char: + '!' || '?' || core-operator-char || '%' || ':' ; expr: ... @@ -2600,10 +2603,10 @@ class c = \begin{syntax} let-operator: - | 'let' ('$'||'&'||'*'||'+'||'-'||'/'||'<'||'='||'>'||'@'||'^'||'|') { operator-char } + | 'let' (core-operator-char || '<') { dot-operator-char } ; and-operator: - | 'and' ('$'||'&'||'*'||'+'||'-'||'/'||'<'||'='||'>'||'@'||'^'||'|') { operator-char } + | 'and' (core-operator-char || '<') { dot-operator-char } ; operator-name : ... diff --git a/manual/manual/refman/lex.etex b/manual/manual/refman/lex.etex index 3ae76ee5fd58..e2776c2e017e 100644 --- a/manual/manual/refman/lex.etex +++ b/manual/manual/refman/lex.etex @@ -230,8 +230,7 @@ there are really 3 tokens, with optional blanks between them. \begin{syntax} infix-symbol: - ('=' || '<' || '>' || '@' || '^' || '|' || '&' || - '+' || '-' || '*' || '/' || '$' || '%') { operator-char } + ( core-operator-char || '%' || '<' ) { operator-char } | "#" {{ operator-char }} ; prefix-symbol: @@ -239,13 +238,15 @@ prefix-symbol: | ('?' || '~') {{ operator-char }} ; operator-char: - '!' || '$' || '%' || '&' || '*' || '+' || '-' || '.' || - '/' || ':' || '<' || '=' || '>' || '?' || '@' || - '^' || '|' || '~' + '~' || '!' || '?' || core-operator-char || '%' || '<' || ':' || '.' +; +core-operator-char: + '$' || '&' || '*' || '+' || '-' || '/' || '=' || '>' || '@' || '^' || '|' \end{syntax} See also the following language extensions: -\hyperref[s:ext-ops]{extension operators} and -\hyperref[s:index-operators]{extended indexing operators}. +\hyperref[s:ext-ops]{extension operators}, +\hyperref[s:index-operators]{extended indexing operators}, +and \hyperref[s:binding-operators]{binding operators}. Sequences of ``operator characters'', such as "<=>" or "!!", are read as a single token from the @infix-symbol@ or @prefix-symbol@