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 | 09b0f9defadf8078aeafc5082aa1dcdb298b639e (patch) | |
| tree | aef873ac321d5c11cd5ee51c3ab1a2887451dd7d /doc/docs | |
| parent | 916c412361d7d3903ea30bdd103b766d84b70658 (diff) | |
| parent | 510c79045dc384a17476b3c75dc856a86e117d9f (diff) | |
| download | pygments-git-09b0f9defadf8078aeafc5082aa1dcdb298b639e.tar.gz | |
Merged in jparise/pygments-main/lexer-informations (pull request #468)
"information" is the correct word.
Diffstat (limited to 'doc/docs')
| -rw-r--r-- | doc/docs/lexerdevelopment.rst | 5 |
1 files changed, 2 insertions, 3 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 |
