diff options
author | Tim Hatch <tim@timhatch.com> | 2015-10-13 11:28:06 -0700 |
---|---|---|
committer | Tim Hatch <tim@timhatch.com> | 2015-10-13 11:28:06 -0700 |
commit | 30ed00b906b25fb04374bc507ba3ca0d627fa753 (patch) | |
tree | 8158c862e201c86907fdb75876896b2da5584200 /doc | |
parent | 4e8e8efbc37a9a3bdfdefa97679b8719395f40af (diff) | |
parent | fdb3c388b1dbc056b3a28698388d1225287191dd (diff) | |
download | pygments-30ed00b906b25fb04374bc507ba3ca0d627fa753.tar.gz |
Merged in jparise/pygments-main/lexer-informations (pull request #468)
"information" is the correct word.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/docs/lexerdevelopment.rst | 5 | ||||
-rw-r--r-- | doc/languages.rst | 1 |
2 files changed, 2 insertions, 4 deletions
diff --git a/doc/docs/lexerdevelopment.rst b/doc/docs/lexerdevelopment.rst index 5b621666..2c868440 100644 --- a/doc/docs/lexerdevelopment.rst +++ b/doc/docs/lexerdevelopment.rst @@ -345,15 +345,14 @@ There are a few more things you can do with states: `PythonLexer`'s string literal processing. - If you want your lexer to start lexing in a different state you can modify the - stack by overloading the `get_tokens_unprocessed()` method:: + stack by overriding the `get_tokens_unprocessed()` method:: from pygments.lexer import RegexLexer class ExampleLexer(RegexLexer): tokens = {...} - def get_tokens_unprocessed(self, text): - stack = ['root', 'otherstate'] + def get_tokens_unprocessed(self, text, stack=('root', 'otherstate')): for item in RegexLexer.get_tokens_unprocessed(text, stack): yield item diff --git a/doc/languages.rst b/doc/languages.rst index 1d5c3155..13555ccf 100644 --- a/doc/languages.rst +++ b/doc/languages.rst @@ -86,7 +86,6 @@ Programming languages * Visual FoxPro * XQuery * Zephir - </ul> Template languages ------------------ |