In python floats are sometimes written as fractions where decimal part is not written for example: ```python a = .3 # instead of 0.3 ``` But seems like pygments does not consider them as float, considers a dot (operator) and a number. Code to reproduce: ```python from pygments import lex from pygments.lexers.python import PythonLexer from pygments.token import Number as Number content = "a = .5" lineno = 0 for token in lex(content, PythonLexer()): print(token) ``` Results: ``` (Token.Name, 'a') (Token.Text, ' ') (Token.Operator, '=') (Token.Text, ' ') (Token.Operator, '.') (Token.Literal.Number.Integer, '5') (Token.Text, '\n') ``` Interestingly does consider 5. as float.
Activity
Liam-Stevens commentedon Mar 24, 2021
We are a team of students from the University of Adelaide, we are currently working on this issue. Expect a pull request within the next month.