pygments / pygments

Pygments is a generic syntax highlighter written in Python
http://pygments.org/
BSD 2-Clause "Simplified" License
1.82k stars 672 forks source link

SystemVerilog/Verlog lexer does not support $info among others #908

Closed Anteru closed 4 years ago

Anteru commented 5 years ago

(Original issue 1201 created by kraigher on 2016-01-26T19:25:49.954371+00:00)

The lexer fails on a SystemVerilog code snippet that contains calls to the $info-function. The $info function is part of the SystemVerilog standard. SystemVerilog has the $ prefix of builtin functions but custom ones can also be added via PLI by the user.

When reviewing the hdl.py code I see that the the $-functions are hardcoded and they do not include $info. Hardcoding the functions will not work well with users who have added custom functions via the PLI. The lexer really needs to support $<anything>.

I am using Pygments through sphinx and the lexer will error out causing sphinx to report that the highlighting could not be used forcing me to revert to no highlighting or removing the $info calls from the SystemVerilog code I wish to highlight.

Anteru commented 5 years ago

(Original comment by birkenfeld on 2016-02-02T10:07:56.482503+00:00)

Verilog: support $customname (closes #1201)

→ <>