... This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
... If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.

(.require
 [library
  [lux (.except)
   ["$" documentation]
   [data
    [text (.only \n)
     ["%" \\injection]]
    [collection
     ["[0]" list]]]
   [meta
    [macro
     ["[0]" template]]]]]
 ["[0]" \\projection]
 [\\library
  ["[0]" /]])

(`` (the \\projection
      (List $.Documentation)
      (list ($.module \\projection._
                      "")

            ($.definition \\projection.cannot_parse)
            ($.definition \\projection.unconsumed_input)

            ($.definition (\\projection.Projection it)
              "A projection for Lux code analysis nodes.")

            ($.definition \\projection.value
              "Executes a projection and makes sure no inputs go unconsumed."
              ($.example (' (value projection input))))

            ($.definition \\projection.any
              "Matches any value, without discrimination.")

            ($.definition \\projection.end
              "Ensures there are no more inputs.")

            ($.definition \\projection.end?
              "Checks whether there are no more inputs.")

            (,, (template.with [<query> <assertion>]
                  [($.definition <query>
                     (%.message "Queries for a " (template.text [<query>]) " value."))
                   ($.definition <assertion>
                     (%.message "Assert a specific " (template.text [<query>]) " value."))]

                  [\\projection.bit \\projection.this_bit]
                  [\\projection.natural \\projection.this_natural]
                  [\\projection.integer \\projection.this_integer]
                  [\\projection.revolution \\projection.this_revolution]
                  [\\projection.decimal \\projection.this_decimal]
                  [\\projection.text \\projection.this_text]
                  [\\projection.local \\projection.this_local]
                  [\\projection.foreign \\projection.this_foreign]
                  [\\projection.constant \\projection.this_constant]
                  ))

            ($.definition \\projection.tuple
              "Parses only within the context of a tuple's contents."
              ($.example (' (tuple projection))))
            )))

(the .public documentation
  (List $.Documentation)
  (list.partial ($.module /._
                          "")

                ($.definition /.Branch')
                ($.definition /.Match')
                ($.definition /.Environment)
                ($.definition /.Term)
                ($.definition /.Branch)
                ($.definition /.Match)
                ($.definition /.equivalence)
                ($.definition /.when)
                ($.definition /.unit)
                ($.definition /.bit)
                ($.definition /.natural)
                ($.definition /.integer)
                ($.definition /.revolution)
                ($.definition /.decimal)
                ($.definition /.text)
                ($.definition /.no_op)
                ($.definition /.variable)
                ($.definition /.constant)
                ($.definition /.local)
                ($.definition /.foreign)
                ($.definition /.variant)
                ($.definition /.tuple)
                ($.definition /.injection)
                ($.definition /.State)
                ($.definition /.Operation)
                ($.definition /.Phase)
                ($.definition /.Handler)
                ($.definition /.Bundle)
                ($.definition /.with_source_code)
                ($.definition /.with_current_module)
                ($.definition /.with_location)
                ($.definition /.failure)
                ($.definition /.except)
                ($.definition /.assertion)
                ($.definition /.with_exception)
                ($.definition /.set_state)
                ($.definition /.set_source_code)
                ($.definition /.set_current_module)
                ($.definition /.set_location)
                ($.definition /.location)
                ($.definition /.source)
                ($.definition /.info)
                ($.definition /.state)

                ..\\projection
                ))
