Add Ldaprc lexer by bersace · Pull Request #2532 · pygments/pygments
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks.
While the lexer isn't very complicated, I do wonder if you can simplify it. It looks like all the lines have the form <keyword> <whitespace> <value>. Is it possible to use just a few rules like
(r'(\w+)(\s+)(\d+)', bygroups(Keyword, Whitespace, Keyword.Constant),
(r'(\w+)(\s+)(\w+)', bygroups(Keyword, Whitespace, Literal),
...
?
Thanks for the review !
While the lexer isn't very complicated, I do wonder if you can simplify it. It looks like all the lines have the form
<keyword> <whitespace> <value>. Is it possible to use just a few rules like(r'(\w+)(\s+)(\d+)', bygroups(Keyword, Whitespace, Keyword.Constant), (r'(\w+)(\s+)(\w+)', bygroups(Keyword, Whitespace, Literal), ...?
That was my first attempt. I updated to match how DockerLexer is done.
(J'ai été longtemps Charentonnais 👋 )
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters