Skip to content

Lexer is confused by suzhou numeral

main :: IO ()
main =
  let  = 5 in print 

fails to compile with


suzhou.hs:3:7: error: lexical error at character ' '
  |
3 |   let 〥 = 5 in print 〥
  |       ^

suzhou.hs

#4373 (closed) might be related.

The below doesn't work either:

main :: IO ()
main =
  let  = 2 in print  
main :: IO ()
main =
  let x =  in print x

Haskell2010 defines

digit → ascDigit | uniDigit

decimal → digit{digit} (Numeric literals)

This says that last example let x = ₂ in print x should be acccepted, yet the text says

Integer literals may be given in decimal (the default), ...

It feels that the grammar should be decimal → ascDigit{ascDigit} as uniDigit doesn't make sense in literals, yet non ascDigit digits could be IMO treated as "small letters".

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information