#diagnostics #error #error-reporting #identifier #version #language #sdml

sdml-errors

Simple Domain Modeling Language (SDML) errors and diagnostics

3 unstable releases

new 0.3.0 Sep 1, 2024
0.1.6 Jun 28, 2024
0.1.5 Jun 28, 2024

#5 in #sdml

Download history 372/week @ 2024-06-26 18/week @ 2024-07-03 9/week @ 2024-07-10 8/week @ 2024-07-17 8/week @ 2024-07-24 5/week @ 2024-07-31 1/week @ 2024-08-07 3/week @ 2024-08-21 213/week @ 2024-08-28

217 downloads per month
Used in 4 crates

Custom license

80KB
2K SLoC

#+TITLE: Package sdml-error #+AUTHOR: Simon Johnston #+EMAIL: johnstonskj@gmail.com #+LANGUAGE: en #+STARTUP: overview hidestars inlineimages entitiespretty #+OPTIONS: author:nil created:nil creator:nil date:nil email:nil num:3 toc:nil

Rust Library containing the error and diagnostic types for the Simple Domain Modeling Language (SDML).

[https://crates.io/crates/sdml_errors] [https://docs.rs/sdml_errors]

This package is part of the Rust SDML project and specifically defines the error and diagnostic types for the project. The project's intent is to provide an idiomatic implementation of the in-memory model, parser, generators, and the CLI tool.

The following figure demonstrates this package in the broader project context.

#+CAPTION: Package Organization #+BEGIN_EXAMPLE ╭───────╮ │ CLI │ ╔══ │ crate │ ══╗ ║ ╰───────╯ ║ ┌╌╌╌╌╌╌╌╌┐ V V ┆ ┆ ╭───────╮ ╭──────────╮ Formatted Source ┆ source ┆ ══> │ parse │ ══> │ generate │ ══> RDF Representation ┆ file ┆ ╭───│ crate │───────│ crate │───╮ Documentation ┆ ┆ │ ╰───────╯ ╰──────────╯ │ Diagrams └╌╌╌╌╌╌╌╌┘ │ core/errors crate │ ╰──────────────────────────────────╯ ┌───────┐ ⋀ │ other │ ║ │ tools │ ════════════════╝ └───────┘ #+END_EXAMPLE

  • Changes

Version 0.3.0

  • Build: align version number with sdml-core supporting the latest grammar.

Version 0.1.6

  • Feature: add a new variant in =Error=, =GeneratorError= for use by the =sdml-generator= crate.

Version 0.1.5

  • Feature: add new diagnostic for =IdentifierNotPreferredCase= where an identifier is not in the preferred case style for its usage.
    • Add new code to =ErrorCode=.
    • Add new function =identifier_not_preferred_case=.
    • Add new enum =IdentifierCaseConvention= used to identify the case style to enforce.

Version 0.1.4

  • Feature: improved a number of diagnostic help messages.
  • Feature: added shared =UseColor= type.

Version 0.1.3

  • Feature: add new diagnostic for =DeprecatedTermUsed= where an identifier includes a term listed in a supplied =TermSet=.
    • Add new code to =ErrorCode=.
    • Add new function =deprecated_term_used=.

Version 0.1.2

  • Feature: add new diagnostic for =DoubleUnderscoredIdentifier= where an identifier include two (or more) consecutive underscore characters.
    • Add new code to =ErrorCode=.
    • Add new function =double_underscored_identifier=.

Version 0.1.1

  • Feature: add new diagnostic for =PropertyReferenceNotProperty= where the property name in a member does not resolve to a property definition.
    • Add new code to =ErrorCode=.
    • Add new function =property_reference_not_property=.

Version 0.1.0

Initial Release.

  • Error Handling:
    • Copy =error= module from =sdml_core=, rename as =errors=.
    • Remove diagnostics from the existing =Error= type.
  • Diagnostics:
    • Copy =diagnostics= module.
    • Create new =diagnostics::codes= module and =ErrorCode= enum.
    • Create new =diagnostics::functions= module and functions for each =ErrorCode=.
  • Diagnostic Reporting:
    • Create new =diagnostics::reporter= module.
    • Create new =Reporter= trait.
    • Create a =StandardStreamReporter= to emit colored and structured errors to the console.
    • Create a =BailoutReporter= that will turn the first diagnostic it is given into an error.

Dependencies

~9–20MB
~256K SLoC