Custom whiteSpace using Haskell Parsec

坚强是说给别人听的谎言 提交于 2019-12-05 06:20:58

Sadly, I don't think there is a way. The local definitions used in makeTokenParser refer recursively to themselves, and so, as you've noted, lexeme uses whiteSpace as defined there, rather than the whiteSpace record member you replace in your lexer object.

The code is taunting because it uses the same names as both local functions in makeTokenParser and as record members of the TokenParser constructor. They are in fact totally distinct entities.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!