Skip to content

Commit

Permalink
deploy: 1683a2d
Browse files Browse the repository at this point in the history
  • Loading branch information
watermarkhu committed May 11, 2024
0 parents commit 430e519
Show file tree
Hide file tree
Showing 72 changed files with 19,397 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .buildinfo
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: f6fc66a4f2af11239b79a43e98413442
tags: 645f666f9bcd5a90fca523b33c5a78b7
Empty file added .nojekyll
Empty file.
27 changes: 27 additions & 0 deletions _downloads/1a4f80c19cefb4f346c42c68da6fff8e/example.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import logging
from pathlib import Path
from pprint import pprint

from textmate_grammar.parsers.matlab import MatlabParser
from textmate_grammar.utils.cache import init_cache

# Initialize shelved cache
init_cache("shelve")

# Enable debug logging
logging.getLogger().setLevel(logging.DEBUG)
logging.getLogger("textmate_grammar").setLevel(logging.INFO)

# Initialize language parser
parser = MatlabParser()

# Parse file
filePath = Path(__file__).parent / "syntaxes" / "matlab" / "AnEnum.m"
element = parser.parse_file(filePath)

# Print element
element.print()

# Find all enum members
enum_members = element.findall('variable.other.enummember.matlab')
pprint(enum_members)
330 changes: 330 additions & 0 deletions _modules/index.html

Large diffs are not rendered by default.

902 changes: 902 additions & 0 deletions _modules/textmate_grammar/elements.html

Large diffs are not rendered by default.

650 changes: 650 additions & 0 deletions _modules/textmate_grammar/handler.html

Large diffs are not rendered by default.

1,254 changes: 1,254 additions & 0 deletions _modules/textmate_grammar/parser.html

Large diffs are not rendered by default.

527 changes: 527 additions & 0 deletions _modules/textmate_grammar/parsers/base.html

Large diffs are not rendered by default.

350 changes: 350 additions & 0 deletions _modules/textmate_grammar/parsers/markdown.html

Large diffs are not rendered by default.

398 changes: 398 additions & 0 deletions _modules/textmate_grammar/parsers/matlab.html

Large diffs are not rendered by default.

522 changes: 522 additions & 0 deletions _modules/textmate_grammar/utils/cache.html

Large diffs are not rendered by default.

407 changes: 407 additions & 0 deletions _modules/textmate_grammar/utils/exceptions.html

Large diffs are not rendered by default.

523 changes: 523 additions & 0 deletions _modules/textmate_grammar/utils/logger.html

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions _sources/apidocs/index.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
API Reference
=============

This page contains auto-generated API reference documentation [#f1]_.

.. toctree::
:titlesonly:

textmate_grammar/textmate_grammar

.. [#f1] Created with `sphinx-autodoc2 <https://github.com/chrisjsewell/sphinx-autodoc2>`_
129 changes: 129 additions & 0 deletions _sources/apidocs/textmate_grammar/textmate_grammar.elements.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
:py:mod:`textmate_grammar.elements`
===================================

.. py:module:: textmate_grammar.elements
.. autodoc2-docstring:: textmate_grammar.elements
:allowtitles:

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

Classes
~~~~~~~

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

* - :py:obj:`Capture <textmate_grammar.elements.Capture>`
- .. autodoc2-docstring:: textmate_grammar.elements.Capture
:summary:
* - :py:obj:`ContentElement <textmate_grammar.elements.ContentElement>`
- .. autodoc2-docstring:: textmate_grammar.elements.ContentElement
:summary:
* - :py:obj:`ContentBlockElement <textmate_grammar.elements.ContentBlockElement>`
- .. autodoc2-docstring:: textmate_grammar.elements.ContentBlockElement
:summary:

Data
~~~~

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

* - :py:obj:`TOKEN_DICT <textmate_grammar.elements.TOKEN_DICT>`
- .. autodoc2-docstring:: textmate_grammar.elements.TOKEN_DICT
:summary:

API
~~~

.. py:data:: TOKEN_DICT
:canonical: textmate_grammar.elements.TOKEN_DICT
:value: None

.. autodoc2-docstring:: textmate_grammar.elements.TOKEN_DICT

.. py:class:: Capture(handler: textmate_grammar.handler.ContentHandler, pattern: textmate_grammar.handler.Pattern, matching: textmate_grammar.handler.Match, parsers: dict[int, textmate_grammar.parser.GrammarParser], starting: tuple[int, int], boundary: tuple[int, int], key: str = '', **kwargs)
:canonical: textmate_grammar.elements.Capture

.. autodoc2-docstring:: textmate_grammar.elements.Capture

.. rubric:: Initialization

.. autodoc2-docstring:: textmate_grammar.elements.Capture.__init__

.. py:method:: dispatch() -> list[textmate_grammar.elements.Capture | textmate_grammar.elements.ContentElement]
:canonical: textmate_grammar.elements.Capture.dispatch

.. autodoc2-docstring:: textmate_grammar.elements.Capture.dispatch

.. py:class:: ContentElement(token: str, grammar: dict, content: str, characters: dict[textmate_grammar.handler.POS, str], children: list[textmate_grammar.elements.Capture | textmate_grammar.elements.ContentElement] | None = None)
:canonical: textmate_grammar.elements.ContentElement

.. autodoc2-docstring:: textmate_grammar.elements.ContentElement

.. rubric:: Initialization

.. autodoc2-docstring:: textmate_grammar.elements.ContentElement.__init__

.. py:property:: children
:canonical: textmate_grammar.elements.ContentElement.children
:type: list[textmate_grammar.elements.ContentElement]

.. autodoc2-docstring:: textmate_grammar.elements.ContentElement.children

.. py:method:: find(tokens: str | list[str], start_tokens: str | list[str] = '', hide_tokens: str | list[str] = '', stop_tokens: str | list[str] = '', depth: int = -1, attribute: str = '_subelements') -> typing.Generator[tuple[textmate_grammar.elements.ContentElement, list[str]], None, None]
:canonical: textmate_grammar.elements.ContentElement.find

.. autodoc2-docstring:: textmate_grammar.elements.ContentElement.find

.. py:method:: findall(tokens: str | list[str], start_tokens: str | list[str] = '', hide_tokens: str | list[str] = '', stop_tokens: str | list[str] = '', depth: int = -1, attribute: str = '_subelements') -> list[tuple[textmate_grammar.elements.ContentElement, list[str]]]
:canonical: textmate_grammar.elements.ContentElement.findall

.. autodoc2-docstring:: textmate_grammar.elements.ContentElement.findall

.. py:method:: to_dict(depth: int = -1, all_content: bool = False, **kwargs) -> dict
:canonical: textmate_grammar.elements.ContentElement.to_dict

.. autodoc2-docstring:: textmate_grammar.elements.ContentElement.to_dict

.. py:method:: flatten() -> list[tuple[tuple[int, int], str, list[str]]]
:canonical: textmate_grammar.elements.ContentElement.flatten

.. autodoc2-docstring:: textmate_grammar.elements.ContentElement.flatten

.. py:method:: print(flatten: bool = False, depth: int = -1, all_content: bool = False, **kwargs) -> None
:canonical: textmate_grammar.elements.ContentElement.print

.. autodoc2-docstring:: textmate_grammar.elements.ContentElement.print

.. py:class:: ContentBlockElement(*args, begin: list[textmate_grammar.elements.Capture | textmate_grammar.elements.ContentElement] | None = None, end: list[textmate_grammar.elements.Capture | textmate_grammar.elements.ContentElement] | None = None, **kwargs)
:canonical: textmate_grammar.elements.ContentBlockElement

Bases: :py:obj:`textmate_grammar.elements.ContentElement`

.. autodoc2-docstring:: textmate_grammar.elements.ContentBlockElement

.. rubric:: Initialization

.. autodoc2-docstring:: textmate_grammar.elements.ContentBlockElement.__init__

.. py:property:: begin
:canonical: textmate_grammar.elements.ContentBlockElement.begin
:type: list[textmate_grammar.elements.ContentElement]

.. autodoc2-docstring:: textmate_grammar.elements.ContentBlockElement.begin

.. py:property:: end
:canonical: textmate_grammar.elements.ContentBlockElement.end
:type: list[textmate_grammar.elements.ContentElement]

.. autodoc2-docstring:: textmate_grammar.elements.ContentBlockElement.end

.. py:method:: to_dict(depth: int = -1, all_content: bool = False, **kwargs) -> dict
:canonical: textmate_grammar.elements.ContentBlockElement.to_dict

.. autodoc2-docstring:: textmate_grammar.elements.ContentBlockElement.to_dict
102 changes: 102 additions & 0 deletions _sources/apidocs/textmate_grammar/textmate_grammar.handler.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
:py:mod:`textmate_grammar.handler`
==================================

.. py:module:: textmate_grammar.handler
.. autodoc2-docstring:: textmate_grammar.handler
:allowtitles:

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

Classes
~~~~~~~

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

* - :py:obj:`ContentHandler <textmate_grammar.handler.ContentHandler>`
- .. autodoc2-docstring:: textmate_grammar.handler.ContentHandler
:summary:

Data
~~~~

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

* - :py:obj:`POS <textmate_grammar.handler.POS>`
- .. autodoc2-docstring:: textmate_grammar.handler.POS
:summary:

API
~~~

.. py:data:: POS
:canonical: textmate_grammar.handler.POS
:value: None

.. autodoc2-docstring:: textmate_grammar.handler.POS

.. py:class:: ContentHandler(content: str, pre_processor: typing.Callable[[str], str] = _dummy_pre_processor)
:canonical: textmate_grammar.handler.ContentHandler

.. autodoc2-docstring:: textmate_grammar.handler.ContentHandler

.. rubric:: Initialization

.. autodoc2-docstring:: textmate_grammar.handler.ContentHandler.__init__

.. py:attribute:: notLookForwardEOL
:canonical: textmate_grammar.handler.ContentHandler.notLookForwardEOL
:value: 'compile(...)'

.. autodoc2-docstring:: textmate_grammar.handler.ContentHandler.notLookForwardEOL

.. py:method:: from_path(file_path: pathlib.Path, **kwargs) -> textmate_grammar.handler.ContentHandler
:canonical: textmate_grammar.handler.ContentHandler.from_path
:classmethod:

.. autodoc2-docstring:: textmate_grammar.handler.ContentHandler.from_path

.. py:method:: next(pos: textmate_grammar.handler.POS, step: int = 1) -> textmate_grammar.handler.POS
:canonical: textmate_grammar.handler.ContentHandler.next

.. autodoc2-docstring:: textmate_grammar.handler.ContentHandler.next

.. py:method:: prev(pos: textmate_grammar.handler.POS, step: int = 1) -> textmate_grammar.handler.POS
:canonical: textmate_grammar.handler.ContentHandler.prev

.. autodoc2-docstring:: textmate_grammar.handler.ContentHandler.prev

.. py:method:: range(start: textmate_grammar.handler.POS, close: textmate_grammar.handler.POS) -> list[textmate_grammar.handler.POS]
:canonical: textmate_grammar.handler.ContentHandler.range

.. autodoc2-docstring:: textmate_grammar.handler.ContentHandler.range

.. py:method:: chars(start: textmate_grammar.handler.POS, close: textmate_grammar.handler.POS) -> dict[textmate_grammar.handler.POS, str]
:canonical: textmate_grammar.handler.ContentHandler.chars

.. autodoc2-docstring:: textmate_grammar.handler.ContentHandler.chars

.. py:method:: read_pos(start_pos: textmate_grammar.handler.POS, close_pos: textmate_grammar.handler.POS, skip_newline: bool = True) -> str
:canonical: textmate_grammar.handler.ContentHandler.read_pos

.. autodoc2-docstring:: textmate_grammar.handler.ContentHandler.read_pos

.. py:method:: read_line(pos: textmate_grammar.handler.POS) -> str
:canonical: textmate_grammar.handler.ContentHandler.read_line

.. autodoc2-docstring:: textmate_grammar.handler.ContentHandler.read_line

.. py:method:: read(start_pos: textmate_grammar.handler.POS, length: int = 1, skip_newline: bool = True) -> str
:canonical: textmate_grammar.handler.ContentHandler.read

.. autodoc2-docstring:: textmate_grammar.handler.ContentHandler.read

.. py:method:: search(pattern: onigurumacffi._Pattern, starting: textmate_grammar.handler.POS, boundary: textmate_grammar.handler.POS | None = None, greedy: bool = False, **kwargs) -> tuple[onigurumacffi._Match | None, tuple[textmate_grammar.handler.POS, textmate_grammar.handler.POS] | None]
:canonical: textmate_grammar.handler.ContentHandler.search

.. autodoc2-docstring:: textmate_grammar.handler.ContentHandler.search
Loading

0 comments on commit 430e519

Please sign in to comment.