Skip to content

Commit

Permalink
Merge pull request ocaml#9098 from Octachron/manual_operator_chars
Browse files Browse the repository at this point in the history
manual: operator char classes description
  • Loading branch information
gasche authored Nov 7, 2019
2 parents e5ebec7 + e3f83d5 commit 65e6874
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
3 changes: 3 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,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:

Expand Down
9 changes: 6 additions & 3 deletions manual/manual/refman/exten.etex
Original file line number Diff line number Diff line change
Expand Up @@ -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:
...
Expand Down Expand Up @@ -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 :
...
Expand Down
15 changes: 8 additions & 7 deletions manual/manual/refman/lex.etex
Original file line number Diff line number Diff line change
Expand Up @@ -230,22 +230,23 @@ 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:
'!' { operator-char }
| ('?' || '~') {{ 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@
Expand Down

0 comments on commit 65e6874

Please sign in to comment.