<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/python-packages/pygments-git.git/tests/test_tnt.py, branch raw-alias</title>
<subtitle>github.com: pygments/pygments.git
</subtitle>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-packages/pygments-git.git/'/>
<entry>
<title>TNTLexer: Don't crash on unexpected EOL. (#1570)</title>
<updated>2020-10-14T05:18:39+00:00</updated>
<author>
<name>Ken</name>
<email>kenny2minecraft@gmail.com</email>
</author>
<published>2020-10-14T05:18:39+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-packages/pygments-git.git/commit/?id=3e1b79c82d2df318f63f24984d875fd2a3400808'/>
<id>3e1b79c82d2df318f63f24984d875fd2a3400808</id>
<content type='text'>
* TNTLexer: Don't crash on unexpected EOL

Catch IndexErrors in each line and error the rest of the line,
leaving whatever tokens were found.

* Write and pass tests for Typographic Number Theory

pygments/lexers/tnt.py:
* Fix indentation on import
* Fix: TNTLexer.cur is class-level reference if not initialized
  in get_tokens_unprocessed, so init it in __init__ too
* Fix: Fantasy markers are not allowed as components of other formulas,
  so have a dedicated check for them in the body of get_tokens_unprocessed
  which disables the normal formula handling if present
* Clarify TNTLexer.lineno docstring
* Attempt to discard tokens before an IndexError

+tests/test_tnt.py:
* Test every method, and test both +ve and -ve matches for most
* Lexer fixture is test-level to reinitialize cur clean each time
* Don't test actual get_tokens_unprocessed method (besides for fantasy markers)
  because the text testing is left to examplefiles

AUTHORS:
+ Add myself to credits :)

* Add a TNT test just to make sure no crashes</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* TNTLexer: Don't crash on unexpected EOL

Catch IndexErrors in each line and error the rest of the line,
leaving whatever tokens were found.

* Write and pass tests for Typographic Number Theory

pygments/lexers/tnt.py:
* Fix indentation on import
* Fix: TNTLexer.cur is class-level reference if not initialized
  in get_tokens_unprocessed, so init it in __init__ too
* Fix: Fantasy markers are not allowed as components of other formulas,
  so have a dedicated check for them in the body of get_tokens_unprocessed
  which disables the normal formula handling if present
* Clarify TNTLexer.lineno docstring
* Attempt to discard tokens before an IndexError

+tests/test_tnt.py:
* Test every method, and test both +ve and -ve matches for most
* Lexer fixture is test-level to reinitialize cur clean each time
* Don't test actual get_tokens_unprocessed method (besides for fantasy markers)
  because the text testing is left to examplefiles

AUTHORS:
+ Add myself to credits :)

* Add a TNT test just to make sure no crashes</pre>
</div>
</content>
</entry>
</feed>
