:py:mod:`myst_parser.parsers.options`
=====================================

.. py:module:: myst_parser.parsers.options

.. autodoc2-docstring:: myst_parser.parsers.options
   :allowtitles:

Module Contents
---------------

Classes
~~~~~~~

.. list-table::
   :class: autosummary longtable
   :align: left

   * - :py:obj:`Position <myst_parser.parsers.options.Position>`
     - .. autodoc2-docstring:: myst_parser.parsers.options.Position
          :summary:
   * - :py:obj:`StreamBuffer <myst_parser.parsers.options.StreamBuffer>`
     - .. autodoc2-docstring:: myst_parser.parsers.options.StreamBuffer
          :summary:
   * - :py:obj:`Token <myst_parser.parsers.options.Token>`
     - .. autodoc2-docstring:: myst_parser.parsers.options.Token
          :summary:
   * - :py:obj:`KeyToken <myst_parser.parsers.options.KeyToken>`
     -
   * - :py:obj:`ValueToken <myst_parser.parsers.options.ValueToken>`
     -
   * - :py:obj:`ColonToken <myst_parser.parsers.options.ColonToken>`
     -
   * - :py:obj:`State <myst_parser.parsers.options.State>`
     - .. autodoc2-docstring:: myst_parser.parsers.options.State
          :summary:

Functions
~~~~~~~~~

.. list-table::
   :class: autosummary longtable
   :align: left

   * - :py:obj:`options_to_items <myst_parser.parsers.options.options_to_items>`
     - .. autodoc2-docstring:: myst_parser.parsers.options.options_to_items
          :summary:

API
~~~

.. py:class:: Position
   :canonical: myst_parser.parsers.options.Position

   .. autodoc2-docstring:: myst_parser.parsers.options.Position

   .. py:attribute:: index
      :canonical: myst_parser.parsers.options.Position.index
      :type: int
      :value: None

      .. autodoc2-docstring:: myst_parser.parsers.options.Position.index

   .. py:attribute:: line
      :canonical: myst_parser.parsers.options.Position.line
      :type: int
      :value: None

      .. autodoc2-docstring:: myst_parser.parsers.options.Position.line

   .. py:attribute:: column
      :canonical: myst_parser.parsers.options.Position.column
      :type: int
      :value: None

      .. autodoc2-docstring:: myst_parser.parsers.options.Position.column

.. py:class:: StreamBuffer(stream: str)
   :canonical: myst_parser.parsers.options.StreamBuffer

   .. autodoc2-docstring:: myst_parser.parsers.options.StreamBuffer

   .. rubric:: Initialization

   .. autodoc2-docstring:: myst_parser.parsers.options.StreamBuffer.__init__

   .. py:property:: index
      :canonical: myst_parser.parsers.options.StreamBuffer.index
      :type: int

      .. autodoc2-docstring:: myst_parser.parsers.options.StreamBuffer.index

   .. py:property:: line
      :canonical: myst_parser.parsers.options.StreamBuffer.line
      :type: int

      .. autodoc2-docstring:: myst_parser.parsers.options.StreamBuffer.line

   .. py:property:: column
      :canonical: myst_parser.parsers.options.StreamBuffer.column
      :type: int

      .. autodoc2-docstring:: myst_parser.parsers.options.StreamBuffer.column

   .. py:method:: peek(index: int = 0) -> str
      :canonical: myst_parser.parsers.options.StreamBuffer.peek

      .. autodoc2-docstring:: myst_parser.parsers.options.StreamBuffer.peek

   .. py:method:: prefix(length: int = 1) -> str
      :canonical: myst_parser.parsers.options.StreamBuffer.prefix

      .. autodoc2-docstring:: myst_parser.parsers.options.StreamBuffer.prefix

   .. py:method:: forward(length: int = 1) -> None
      :canonical: myst_parser.parsers.options.StreamBuffer.forward

      .. autodoc2-docstring:: myst_parser.parsers.options.StreamBuffer.forward

   .. py:method:: get_position() -> myst_parser.parsers.options.Position
      :canonical: myst_parser.parsers.options.StreamBuffer.get_position

      .. autodoc2-docstring:: myst_parser.parsers.options.StreamBuffer.get_position

.. py:class:: Token
   :canonical: myst_parser.parsers.options.Token

   .. autodoc2-docstring:: myst_parser.parsers.options.Token

   .. py:attribute:: id
      :canonical: myst_parser.parsers.options.Token.id
      :type: typing.ClassVar[str]
      :value: '<unknown>'

      .. autodoc2-docstring:: myst_parser.parsers.options.Token.id

   .. py:attribute:: start
      :canonical: myst_parser.parsers.options.Token.start
      :type: myst_parser.parsers.options.Position
      :value: None

      .. autodoc2-docstring:: myst_parser.parsers.options.Token.start

   .. py:attribute:: end
      :canonical: myst_parser.parsers.options.Token.end
      :type: myst_parser.parsers.options.Position
      :value: None

      .. autodoc2-docstring:: myst_parser.parsers.options.Token.end

.. py:class:: KeyToken
   :canonical: myst_parser.parsers.options.KeyToken

   Bases: :py:obj:`myst_parser.parsers.options.Token`

   .. py:attribute:: id
      :canonical: myst_parser.parsers.options.KeyToken.id
      :type: typing.ClassVar[str]
      :value: '<key>'

      .. autodoc2-docstring:: myst_parser.parsers.options.KeyToken.id

   .. py:attribute:: value
      :canonical: myst_parser.parsers.options.KeyToken.value
      :type: str
      :value: None

      .. autodoc2-docstring:: myst_parser.parsers.options.KeyToken.value

   .. py:attribute:: style
      :canonical: myst_parser.parsers.options.KeyToken.style
      :type: typing.Literal[None, ', "]
      :value: None

      .. autodoc2-docstring:: myst_parser.parsers.options.KeyToken.style

.. py:class:: ValueToken
   :canonical: myst_parser.parsers.options.ValueToken

   Bases: :py:obj:`myst_parser.parsers.options.Token`

   .. py:attribute:: id
      :canonical: myst_parser.parsers.options.ValueToken.id
      :type: typing.ClassVar[str]
      :value: '<value>'

      .. autodoc2-docstring:: myst_parser.parsers.options.ValueToken.id

   .. py:attribute:: value
      :canonical: myst_parser.parsers.options.ValueToken.value
      :type: str
      :value: None

      .. autodoc2-docstring:: myst_parser.parsers.options.ValueToken.value

   .. py:attribute:: style
      :canonical: myst_parser.parsers.options.ValueToken.style
      :type: typing.Literal[None, ', ", |, >]
      :value: None

      .. autodoc2-docstring:: myst_parser.parsers.options.ValueToken.style

.. py:class:: ColonToken
   :canonical: myst_parser.parsers.options.ColonToken

   Bases: :py:obj:`myst_parser.parsers.options.Token`

   .. py:attribute:: id
      :canonical: myst_parser.parsers.options.ColonToken.id
      :type: typing.ClassVar[str]
      :value: '<colon>'

      .. autodoc2-docstring:: myst_parser.parsers.options.ColonToken.id

.. py:exception:: TokenizeError(problem: str, problem_mark: myst_parser.parsers.options.Position, context: str | None = None, context_mark: myst_parser.parsers.options.Position | None = None)
   :canonical: myst_parser.parsers.options.TokenizeError

   Bases: :py:obj:`Exception`

   .. py:method:: clone(line_offset: int, column_offset: int) -> myst_parser.parsers.options.TokenizeError
      :canonical: myst_parser.parsers.options.TokenizeError.clone

      .. autodoc2-docstring:: myst_parser.parsers.options.TokenizeError.clone

.. py:class:: State
   :canonical: myst_parser.parsers.options.State

   .. autodoc2-docstring:: myst_parser.parsers.options.State

   .. py:attribute:: has_comments
      :canonical: myst_parser.parsers.options.State.has_comments
      :type: bool
      :value: False

      .. autodoc2-docstring:: myst_parser.parsers.options.State.has_comments

.. py:function:: options_to_items(text: str, line_offset: int = 0, column_offset: int = 0) -> tuple[list[tuple[str, str]], myst_parser.parsers.options.State]
   :canonical: myst_parser.parsers.options.options_to_items

   .. autodoc2-docstring:: myst_parser.parsers.options.options_to_items
