Skip to content

0.15.3 fails to correctly colorize Haskell source file #1026

@mouse07410

Description

@mouse07410

What version of bat are you using?

$ bat --version
bat 0.15.3
$ 

Describe the bug you encountered:

Screen Shot 2020-05-26 at 09 24 59

Lines in Haskell source file highlighted incorrectly and inconsistently.

Describe what you expected to happen?

Lines 21 and 23 in the given file should be highlighted the same way.

Here's the file itself or your convenience:

data DayOfWeek = Mon | Tues | Wed | Thur | Fri | Sat | Sun deriving Show
data Date = Date DayOfWeek Int deriving Show

instance Eq DayOfWeek where
  (==) Mon  Mon  = True
  (==) Tues Tues = True
  (==) Wed  Wed  = True
  (==) Thur Thur = True
  (==) Fri  Fri  = True
  (==) Sat  Sat  = True
  (==) Sun  Sun  = True
  (==) _    _    = False
  
instance Eq Date where
  (==) (Date weekday dayOfMonth) (Date weekday' dayOfMonth') =
      weekday == weekday' && dayOfMonth == dayOfMonth'
  
main :: IO()
main = do
  putStrLn "Data types test"
  putStr "Wed 14 == Wed 14 ? "
  print (Date Wed 14 == Date Wed 14)
  putStr "Wed 14 == Tue 14 ? " 
  print (Date Wed 14 == Date Tues 14)

How did you install bat?

$ cargo install bat

system
------

**$ uname -srm**
Darwin 19.4.0 x86_64  

**$ sw_vers**
ProductName:	Mac OS X  
ProductVersion:	10.15.4  
BuildVersion:	19E287  

bat
---

**$ bat --version**
bat 0.15.3  

**$ env**

bat_config
----------

bat_wrapper
-----------

No wrapper script for 'bat'.

bat_wrapper_function
--------------------

No wrapper function for 'bat'.

No wrapper function for 'cat'.

tool
----

**$ less --version**
less 487 (POSIX regular expressions)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions