
SWI-Prolog allows writing paths as /-nested terms and This predicate is part of the Prolog source library because path_segments_atom (+Segments, -Atom) is det path_segments_atom (-Segments, +Atom) is det Translate between a path represented as a/b/c and an atom Generated with the longest directory first. file_alias_path (-Alias, ?Dir) is nondet True if file Alias points to Dir. This performs the inverse of absolute_file_name/3. file_name_on_path (+File:atom, -OnPath) is det True if OnPath a description of File based on the file search prolog_canonical_source (+SourceSpec:ground, -Id:atomic) is semidet Given a user-specification of a source, generate a unique and If the hook failsĬlose/2 using the option force(true) is used.

Opened by the hook prolog:xref_open_source/2. prolog: xref_close_source (+SourceID, +Stream) is semidet Called by prolog_close_source/1 to close a source previously The end, we call expand_term(end_of_file, _) to allow expansion prolog_close_source (+In:stream) is det Close a stream opened using prolog_open_source/2. When successful, theĬorresponding prolog:xref_close_source/2 hook is called forĬlosing the source. This is used forĬross-referencing non-files, such as XPCE buffers, files fromĪrchives, git repositories, etc. prolog: xref_open_source (+SourceID, -Stream) Hook to open an xref SourceID. This skeleton, operator and style-check options areĪutomatically restored to the values before opening the source.Ĭall_cleanup(process(Src), prolog_close_source(In)). Streams opened using this predicate must be closed using Prolog_canonical_source/2) and remove the #! line if any. prolog_open_source (+CanonicalId:atomic, -Stream:stream) is det Open source with given canonical id (see This multifile hook is used by library(prolog_source) to load Library must be a valid first argument for prolog: quasi_quotation_syntax (+Syntax, -Library) is semidet True when the quasi quotation syntax Syntax can be loaded from prolog:alternate_syntax/4 for locally scoped operators. See also - Use read_source_term/4 to read a file from the start. Makes read_source_term_at_location/3 deterministic ( det). Offset:Message that indicates the (character) location of error (-Error) If no correct parse can be found, unify Error with a term operators (+List) List of additional operator declarations to enforce while module (+Module) Use syntax from the given module. See seek/4įor limitations of seeking in text-files. offset (+Characters) Use seek/4 to go to the indicated location. line (+Line) If present, start reading at line Line. Note that the line and offset options are The options below are processed in addition to the options of Prolog:alternate_syntax/4 that can be used to temporary redefine This deals with module files that define the used If theįile is loaded, it can be passed the module using the module This predicate has two ways to find the right syntax. This predicate is usedīy e.g., clause_info/4 and by PceEmacs to colour the current

Therefore, this predicate isįundamentally heuristic and may fail. Due to Prolog's dynamic syntax, e.g., due to operatorĭeclarations that may change anywhere inside the file, this is read_source_term_at_location (+Stream, -Term, +Options) is semidet Try to read a Prolog term form an arbitrary location inside aįile. This is also needed forīetter compatibility with systems that provide a To be done - We need a better way to know that an import affects the
PROLOG ADVENTURE GAME SOURCE CODE UPDATE
Tracks directives to update its notion of the currentlyĮffective syntax (e.g., declared operators). This predicate is intended to read the file from the start. Users of the library are: prolog_ The Prolog cross-referencer prolog_ Get details about (compiled) clauses prolog_ Colourise source-code PceEmacs Emacs syntax-colouring PlDoc The documentation framework prolog_read_source_term (+In, -Term, -Expanded, +Options) is det Read a term from a Prolog source-file.

This module concentrates these issues in a single library.
