Issue #601 resolved

New lexer for cfengine3 policy files

Diego Zamboni
created an issue


(I have also sent this by email, but I'm opening an issue just for completeness).

First of all, thank you for all your work in pygments! It's really a useful program, I use it primarily through

I have written a pygments lexer for cfengine3 policy files ( Cfengine is a very popular configuration management engine.

You can find the code at this gist:

I've made it a separate python file for ease of testing, but if it's added to the distribution, I would suggest adding it to

You can see an example output here:

It would be awesome to see cfengine support in pygments! This is my first-ever lexer, so of course I would also welcome any feedback, corrections or suggestions.

Best regards, --Diego Zamboni

Comments (6)

  1. Anonymous

    I submitted this a while ago, and never saw any feedback. Any thoughts?

    Thank you, --Diego

  2. Anonymous

    Thanks for the comment. The cfengine_stdib file is licensed as GPL, see the top of the file at

    In any case, I would advise against including it with Pygments, since it's bound to cause confusion when users find they have two (very likely differing) files: the one that came with cfengine, and the one that came with Pygments.

    BTW, I've made some changes recently to the lexer to fix some erroneous recognition of certain structures, these changes are reflected in the gist at, so if you grab the code from there you should have the latest version.

    Thanks again!

  3. Log in to comment