Skip to content

Use Operator token for NonNull operator

The exclamation mark changes the type and behaviour of entities. I think it's worth it to have it distinguished from a simple (optional!) comma often following it.

When first thinking about making this change I first thought about the "!important" token in CSS, which Pygments uses the Comment.Preproc type for, but I think Operator is more suitable.

Even though the exclamation mark is listed under Punctuators in the spec[1], it is more like an operator. The spec also refers to what we would commonly understand as "operator" as "the punctuation often used to describe mathematical expressions". Therefore I think it's fair to say that symbols listed as Punctuator in the spec can also be operators.


Thank you for this lexer. It's the best I've found!

Merge request reports