IniLexer fails to highlight properly empty keys

Issue #391 resolved
Christian Boos
created an issue

Example: {{{ [section] key1 = key2 = key3 = key4 = key5 = }}}

Would highlight as: {{{ <span class="k">[section]</span> <span class="na">key1</span> <span class="o">=</span> <span class="s">key2 =</span> <span class="na">key3</span> <span class="o">=</span> <span class="s">key4 =</span> <span class="na">key5</span> <span class="o">=</span> }}} i.e. key2 and key4 are tokenized as strings.

I could not see the problem in: {{{ 49 (r'(.?)(\s)(=)(\s)(.?)$', 50 bygroups(Name.Attribute, Text, Operator, Text, String) }}} which seems correct at first glance.

However, from the generated markup, it looks like when matching the key1 = line, the end of line is ignored and the next line key2 = is still matched by the same regexp and hence tokenized as String.

This happens whether there are spaces after the '=' or not.

So could it be that in this situation the (\\s*) part "eats" the end-of-line?

(this is with tip of today, i.e. c20574958ca5)

Comments (5)

  1. Log in to comment