Skip to content

4.0.0

Choose a tag to compare

@gares gares released this 23 Oct 13:50
· 41 commits to master since this release
v4.0.0
a840ec2

CHANGES:

  • LSP:
    • New: language server elpi-lsp supporting type information via hovering,
      jump to definition and semantic highlighting. See lsp/README.md
    • New: elpi-webrunner npm package containing the lsp server that runs in a
      web worker, compiled to WebAssembly and to JavaScript. Moreover
      part of the API modules Setup, Parse, Compile and Execute
      exposed JavaScript. See webrunner/README.md
  • Compiler:
    • Change: new field max_errors of Compile.flags
    • Change: the passes can be error resilient: they return their result and
      the list of the errors found. With Compile.flags.max_errors = 0 they do
      stop at the first error, as before.
      See also the flag -max-errors N to elpi.
    • Change: an undeclared global is reported by a warning of its own, located
      at its first occurrence (formerly one warning, without a location, for
      all the undeclared globals).
  • API:
    • New: module LSP, with what the language server needs
    • Change: API.Compile.hover is now API.LSP.hover
    • Change: new module Error: the type of errors Error.t (component,
      location, message), printers, the exception Error.ElpiError (formerly
      Compile.CompileError).
    • Change: Setup.set_error, set_anomaly, set_type_error and
      Utils.error, anomaly, type_error are removed; the errors of the
      builtins can be redirected with Builtin.set_runtime_error,
      set_runtime_anomaly, set_runtime_type_error (they take a
      Builtin.runtime_error_hook, a function that raises).
    • Change: the parser and the passes
      of the compiler return their warnings (Error.warning) with their result
      and their errors; Setup.set_warn is removed. The warnings at run time
      (Builtin.warn, formerly Utils.warn) can be redirected with
      Builtin.set_runtime_warn.
      Setup.warning_id is now Error.warning_id.
    • Change: Parse.goal and Parse.goal_from are now Parse.query and
      Parse.query_from; like Compile.query, they return the query or its
      syntax error (instead of raising Parse.ParseError), and its warnings.
  • Parser:
    • Change: Parse.program and Parse.program_from are error
      resilient when max_errors > 0: a declaration with a syntax error is
      skipped up to the next . and dropped, and they return the program and the
      list of the errors like the passes of the compiler.
    • Change: a syntax error in an accumulated file is located on the
      accumulate directive, its message gives the position in the file.
    • New: the comment block on the line before a declaration (pred, func,
      type, kind...) is its documentation and is used by the LSP server.
  • Builtins:
    • New: reset_new_int N: resets the counter of new_int to N, so the
      next new_int gives N + 1 (its values are increasing only between two
      resets)