Update to M2Lexer and Algol styles

Issue #1093 new
trijezdci
created an issue

Hi,

I have an update for the Modula-2 lexer and the two Algol styles.

The styles used a red border to mark errors but this does not show up when rendering to RTF output, I have to assume that RTF cannot display/encode borders, so I changed this to bold red text instead. I also added an entry for a template placeholders, tagged by the lexer with a custom token called Name.Placehoder.

The lexer is now completely parameterised. While the last version checked and tagged various token types hardcoded, this is now all generic, checking all token types against dictionaries. Furthermore, I have added several more dialects, not totalling 11 dialects and a few exotic use cases that were not included before, such as template placeholders.

This is all thoroughly tested on the latest revision of the hg repo, checked out within the last hours before this post. I can confirm that the custom token types are now covered by less specific token type entries in the style, thus your bugfix in the formatter solved the problem I reported via IRC.

The files to be updated are in our repo:

https://bitbucket.org/trijezdci/m2r10/src/tip/_GRAMMAR/pygments.styles.algol.py

https://bitbucket.org/trijezdci/m2r10/src/tip/_GRAMMAR/pygments.styles.algol_nu.py

https://bitbucket.org/trijezdci/m2r10/src/tip/_GRAMMAR/pygments.lexers.modula2.py

https://bitbucket.org/trijezdci/m2r10/src/tip/_GRAMMAR/pygments.tests.examplefiles.modula2_test_cases.def

I also attach one test report (the output from running the test cases) and I have a full set of all the test reports, one for each dialect which I can provide if you want them -- of course you can always produce them yourself by rendering the test cases file once for each dialect.

thanks regards trijezdci

Comments (5)

  1. Log in to comment