rubychan / coderay

Fast and easy syntax highlighting for selected languages, written in Ruby.
http://coderay.rubychan.de/
Other
846 stars 115 forks source link

Scanners misinterpret -1 #79

Open nathany opened 12 years ago

nathany commented 12 years ago

Most scanners scans expressions like -1 mistakenly as operator(-)integer(1) where it should be returning integer(-1). It's not easy to avoid expressions like i-1 getting highlighted as ident(i)operator(+)integer(1), but it's possible (see Ruby scanner).

I removed the recognition of -1 tokens in r255. This is only a hotfix; to really fix it, we need to keep track of some value_expected state. The Ruby Scanner can do this, and the Scanners for Java, C, Delphi, and Python will need it, too.

From Redmine: http://odd-eyed-code.org/issues/47

korny commented 11 years ago

Later.

korny commented 11 years ago

But we should look out for this when implementing new scanners ;)