-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 4b94d7f
Showing
70 changed files
with
16,843 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: 794f69d2daab1a72179a29ae4bd05019 | ||
tags: 645f666f9bcd5a90fca523b33c5a78b7 |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import logging | ||
from pathlib import Path | ||
from pprint import pprint | ||
|
||
from textmate_grammar.grammars import matlab | ||
from textmate_grammar.language import LanguageParser | ||
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 = LanguageParser(matlab.GRAMMAR) | ||
|
||
# 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) |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
129
_sources/apidocs/textmate_grammar/textmate_grammar.elements.rst.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.utils.handler.ContentHandler, pattern: textmate_grammar.utils.handler.Pattern, matching: textmate_grammar.utils.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.utils.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 |
39 changes: 39 additions & 0 deletions
39
_sources/apidocs/textmate_grammar/textmate_grammar.grammars.markdown.rst.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
:py:mod:`textmate_grammar.grammars.markdown` | ||
============================================ | ||
|
||
.. py:module:: textmate_grammar.grammars.markdown | ||
.. autodoc2-docstring:: textmate_grammar.grammars.markdown | ||
:allowtitles: | ||
|
||
Package Contents | ||
---------------- | ||
|
||
Data | ||
~~~~ | ||
|
||
.. list-table:: | ||
:class: autosummary longtable | ||
:align: left | ||
|
||
* - :py:obj:`tmLanguageFile <textmate_grammar.grammars.markdown.tmLanguageFile>` | ||
- .. autodoc2-docstring:: textmate_grammar.grammars.markdown.tmLanguageFile | ||
:summary: | ||
* - :py:obj:`tmLanguageYAML <textmate_grammar.grammars.markdown.tmLanguageYAML>` | ||
- .. autodoc2-docstring:: textmate_grammar.grammars.markdown.tmLanguageYAML | ||
:summary: | ||
|
||
API | ||
~~~ | ||
|
||
.. py:data:: tmLanguageFile | ||
:canonical: textmate_grammar.grammars.markdown.tmLanguageFile | ||
:value: None | ||
|
||
.. autodoc2-docstring:: textmate_grammar.grammars.markdown.tmLanguageFile | ||
|
||
.. py:data:: tmLanguageYAML | ||
:canonical: textmate_grammar.grammars.markdown.tmLanguageYAML | ||
:value: None | ||
|
||
.. autodoc2-docstring:: textmate_grammar.grammars.markdown.tmLanguageYAML |
39 changes: 39 additions & 0 deletions
39
_sources/apidocs/textmate_grammar/textmate_grammar.grammars.matlab.rst.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
:py:mod:`textmate_grammar.grammars.matlab` | ||
========================================== | ||
|
||
.. py:module:: textmate_grammar.grammars.matlab | ||
.. autodoc2-docstring:: textmate_grammar.grammars.matlab | ||
:allowtitles: | ||
|
||
Package Contents | ||
---------------- | ||
|
||
Data | ||
~~~~ | ||
|
||
.. list-table:: | ||
:class: autosummary longtable | ||
:align: left | ||
|
||
* - :py:obj:`tmLanguageFile <textmate_grammar.grammars.matlab.tmLanguageFile>` | ||
- .. autodoc2-docstring:: textmate_grammar.grammars.matlab.tmLanguageFile | ||
:summary: | ||
* - :py:obj:`tmLanguageYAML <textmate_grammar.grammars.matlab.tmLanguageYAML>` | ||
- .. autodoc2-docstring:: textmate_grammar.grammars.matlab.tmLanguageYAML | ||
:summary: | ||
|
||
API | ||
~~~ | ||
|
||
.. py:data:: tmLanguageFile | ||
:canonical: textmate_grammar.grammars.matlab.tmLanguageFile | ||
:value: None | ||
|
||
.. autodoc2-docstring:: textmate_grammar.grammars.matlab.tmLanguageFile | ||
|
||
.. py:data:: tmLanguageYAML | ||
:canonical: textmate_grammar.grammars.matlab.tmLanguageYAML | ||
:value: None | ||
|
||
.. autodoc2-docstring:: textmate_grammar.grammars.matlab.tmLanguageYAML |
17 changes: 17 additions & 0 deletions
17
_sources/apidocs/textmate_grammar/textmate_grammar.grammars.rst.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
:py:mod:`textmate_grammar.grammars` | ||
=================================== | ||
|
||
.. py:module:: textmate_grammar.grammars | ||
.. autodoc2-docstring:: textmate_grammar.grammars | ||
:allowtitles: | ||
|
||
Subpackages | ||
----------- | ||
|
||
.. toctree:: | ||
:titlesonly: | ||
:maxdepth: 3 | ||
|
||
textmate_grammar.grammars.markdown | ||
textmate_grammar.grammars.matlab |
76 changes: 76 additions & 0 deletions
76
_sources/apidocs/textmate_grammar/textmate_grammar.language.rst.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
:py:mod:`textmate_grammar.language` | ||
=================================== | ||
|
||
.. py:module:: textmate_grammar.language | ||
.. autodoc2-docstring:: textmate_grammar.language | ||
:allowtitles: | ||
|
||
Module Contents | ||
--------------- | ||
|
||
Classes | ||
~~~~~~~ | ||
|
||
.. list-table:: | ||
:class: autosummary longtable | ||
:align: left | ||
|
||
* - :py:obj:`DummyParser <textmate_grammar.language.DummyParser>` | ||
- .. autodoc2-docstring:: textmate_grammar.language.DummyParser | ||
:summary: | ||
* - :py:obj:`LanguageParser <textmate_grammar.language.LanguageParser>` | ||
- .. autodoc2-docstring:: textmate_grammar.language.LanguageParser | ||
:summary: | ||
|
||
Data | ||
~~~~ | ||
|
||
.. list-table:: | ||
:class: autosummary longtable | ||
:align: left | ||
|
||
* - :py:obj:`LANGUAGE_PARSERS <textmate_grammar.language.LANGUAGE_PARSERS>` | ||
- .. autodoc2-docstring:: textmate_grammar.language.LANGUAGE_PARSERS | ||
:summary: | ||
|
||
API | ||
~~~ | ||
|
||
.. py:data:: LANGUAGE_PARSERS | ||
:canonical: textmate_grammar.language.LANGUAGE_PARSERS | ||
:value: None | ||
|
||
.. autodoc2-docstring:: textmate_grammar.language.LANGUAGE_PARSERS | ||
|
||
.. py:class:: DummyParser() | ||
:canonical: textmate_grammar.language.DummyParser | ||
|
||
Bases: :py:obj:`textmate_grammar.parser.GrammarParser` | ||
|
||
.. autodoc2-docstring:: textmate_grammar.language.DummyParser | ||
|
||
.. rubric:: Initialization | ||
|
||
.. autodoc2-docstring:: textmate_grammar.language.DummyParser.__init__ | ||
|
||
.. py:class:: LanguageParser(grammar: dict, **kwargs) | ||
:canonical: textmate_grammar.language.LanguageParser | ||
|
||
Bases: :py:obj:`textmate_grammar.parser.PatternsParser` | ||
|
||
.. autodoc2-docstring:: textmate_grammar.language.LanguageParser | ||
|
||
.. rubric:: Initialization | ||
|
||
.. autodoc2-docstring:: textmate_grammar.language.LanguageParser.__init__ | ||
|
||
.. py:method:: parse_file(filePath: str | pathlib.Path, **kwargs) -> textmate_grammar.elements.ContentElement | None | ||
:canonical: textmate_grammar.language.LanguageParser.parse_file | ||
|
||
.. autodoc2-docstring:: textmate_grammar.language.LanguageParser.parse_file | ||
|
||
.. py:method:: parse_string(input: str, **kwargs) -> textmate_grammar.elements.ContentElement | None | ||
:canonical: textmate_grammar.language.LanguageParser.parse_string | ||
|
||
.. autodoc2-docstring:: textmate_grammar.language.LanguageParser.parse_string |
Oops, something went wrong.