Add HAProxy configuration file lexer by gaborbernat · Pull Request #3045 · pygments/pygments

HAProxy is one of the most widely used open-source reverse proxies and load balancers. The new HAProxyLexer (alias haproxy, matching haproxy.cfg) covers the full configuration syntax: section headers (global, frontend, backend, listen, defaults, resolvers, peers, etc.), directive keywords, preprocessor conditionals (.if/.elif/.else/.endif), inline ACL expressions ({ ... }), quoted strings with escape sequences, numeric values with time and size suffixes (30s, 10m, 4k), environment variable expansion (${VAR}), IP address literals, and ACL flags (-i, -m). An analyse_text heuristic is included so configs can be auto-detected without requiring an explicit lexer name.

The lexer was built against the official HAProxy configuration documentation: