Mercurial > hgrepos > Python > libs > pygments-lexer-pseudocode2
comparison tests/test_algpseudo.py @ 117:d84f1fd10e64
Allow to customize the symbol for a remark
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Wed, 06 May 2026 13:35:12 +0200 |
| parents | 9bfd87544902 |
| children | 4d96ace53ba1 |
comparison
equal
deleted
inserted
replaced
| 116:9bfd87544902 | 117:d84f1fd10e64 |
|---|---|
| 338 ], | 338 ], |
| 339 pygments.lex( | 339 pygments.lex( |
| 340 """\\remArk the remark 1 | 340 """\\remArk the remark 1 |
| 341 \\Rem the remark 2 | 341 \\Rem the remark 2 |
| 342 """, self.lexer)) | 342 """, self.lexer)) |
| 343 | |
| 344 def test_remark_custom(self): | |
| 345 # With the APL comment symbol | |
| 346 lexer = pygments.lexers.load_lexer_from_file( | |
| 347 ALGLEXERFILENAME, ALGLEXERCLASS, remark=u"⍝") | |
| 348 self.assertTokenStreamEqualComplete( | |
| 349 [("Comment.Single", "⍝"), # U+235D ⍝ APL FUNC. SYMBOL UP SHOE JOT | |
| 350 ("Comment.Single", " another remark"), | |
| 351 ("Text.Whitespace", "\n"), | |
| 352 ], | |
| 353 pygments.lex("\\REMARK another remark\n", lexer)) | |
| 343 | 354 |
| 344 def test_remark_in_text(self): | 355 def test_remark_in_text(self): |
| 345 self.assertTokenStreamEqualComplete( | 356 self.assertTokenStreamEqualComplete( |
| 346 [("Text", "the text "), | 357 [("Text", "the text "), |
| 347 ("Comment.Single", "▷"), | 358 ("Comment.Single", "▷"), |
