B.10 Hooks for loading files
AllApplicationManualNameSummaryHelp

  • Documentation
    • Reference manual
      • Hackers corner
        • Hooks for loading files
          • prolog_load_file/2
          • open_source_hook/3
          • comment_hook/3
    • Packages
Sourceprolog:comment_hook(+Comments, +Pos, +Term)
This hook allows for processing comments encountered by the compiler. If this hook is defined, the compiler calls read_term/2 with the option comments(Comments). If the list of comments returned by read_term/2 is not empty it calls this comment hook with the following arguments.

  • Comments is the non-empty list of comments. Each comment is a pair Position-String, where String is a string object (see section 5.2) that contains the comment including delimiters. Consecutive line comments are returned as a single comment.
  • Pos is a stream-position term that describes the starting position of Term
  • Term is the term read.

This hook is exploited by the documentation system. See stream_position_data/3. See also read_term/3.