Documentation

Strata.DL.Imperative.MetaData

MetaData #

The Imperative dialect has a mechanism to store metadata in each of its constructs. Metadata can be used to track both syntactic facts obtained during translation from the source program to this dialect (e.g., line and column numbers), or semantic facts derived during analyses (e.g., global variables implicitly modified by a language construct).

A metadata field, which can be either a variable or an arbitrary string label.

For now, we only track the variables modified by a construct, but we will expand this in the future.

Instances For
    Equations
    • One or more equations did not get rendered due to their size.
    Equations
    • One or more equations did not get rendered due to their size.

    A metadata value, which can be either an expression, a message, or a fileRange

    Instances For
      Equations
      • One or more equations did not get rendered due to their size.
      Equations
      • One or more equations did not get rendered due to their size.

      A metadata element

      • fld : Field P

        The field or key used to identify the metadata.

      • value : Value P

        The value of the metadata.

      Instances For
        @[reducible, inline]

        Metadata is an array of tagged elements.

        Equations
        Instances For

          Push a new metadata element.

          Equations
          Instances For

            Remove the first metadata element with tag fld.

            Equations
            Instances For

              Retrieve the first metadata element with tag fld.

              Equations
              Instances For
                Equations
                Instances For
                  Equations
                  • One or more equations did not get rendered due to their size.
                  Equations
                  • One or more equations did not get rendered due to their size.

                  Common metadata fields #

                  Equations
                  • One or more equations did not get rendered due to their size.
                  Instances For

                    Create a DiagnosticModel from metadata and a message. Uses the file range from metadata if available, otherwise uses a default location.

                    Equations
                    Instances For

                      Create a DiagnosticModel from metadata and a Format message.

                      Equations
                      Instances For
                        def Imperative.MetaData.formatFileRangeD {P : PureExpr} [BEq P.Ident] (md : MetaData P) (fileMap : Option Lean.FileMap := none) (includeEnd? : Bool := false) :

                        Get the file range from metadata as a DiagnosticModel (for formatting). This is a compatibility function that formats the file range using byte offsets. For proper line/column display, use toDiagnostic and format with a FileMap at the top level.

                        Equations
                        Instances For