Availability:built-in
read_clause(+Stream,
-Term, +Options)Equivalent to read_term/3,
but sets options according to the current compilation context and
optionally processes comments. Defined options:
- syntax_errors(+Atom)
- See read_term/3,
but the default is
dec10
(report and restart).
- term_position(-TermPos)
- Same as for read_term/3.
- subterm_positions(-TermPos)
- Same as for read_term/3.
- variable_names(-Bindings)
- Same as for read_term/3.
- process_comment(+Boolean)
- If
true
(default), call
prolog:comment_hook(Comments, TermPos, Term)
if this
multifile hook is defined (see prolog:comment_hook/3).
This is used to drive PlDoc.
- comments(-Comments)
- If provided, unify Comments with the comments encountered
while reading Term. This option implies
process_comment(false)
.
The singletons
option of read_term/3
is initialised from the active style-checking mode. The module
option is initialised to the current compilation module (see prolog_load_context/2).