1. Georg Brandl
  2. pygments-main
  3. Issues
Issue #930 new

new lexer request: antlr4 (with example)

Anonymous created an issue

I think this is as easy as adding the '.g4' extension that is normally used [1] by these files to the file extension lists in pygments-main/pygments/lexers/parsers.py.

[1] '.g4' is referenced all over the Antlr4 wiki, but here is an example: http://www.antlr.org/wiki/display/ANTLR4/ANTLR+Tool+Command+Line+Options

Comments (3)

  1. Thomas Beale

    Antlr4 does not appear to be entirely supported. See here (https://rawgit.com/openEHR/specifications-AM/master/docs/ADL2/ADL2.html#_adl_outer_syntax) for example of Antlr4 grammar that was highlighted by Asciidoctor calling Pygment. Source Antlr4 file here : https://raw.githubusercontent.com/openEHR/specifications-AM/master/docs/ADL2/adl.g4

    There are errors in the regex highlighting and also lexer mode() instructions. I am using the 2.1 version of Pygments.

  2. Log in to comment