jgm/highlighting-kate — Issue #12: Text.ParserCombinators.Parsec.Prim.many: combinator 'many' is applied to a parser that accepts an empty string.
Author: mcmaniac
Created: 2012-01-09 12:17:11+00:00
State: open

Hi,

When trying to highlight this [lua paste on my website](http://npaste.de/zHhV/Plaintext) (here without syntax highlighting) I get the error:

Text.ParserCombinators.Parsec.Prim.many: combinator 'many' is applied to a parser that accepts an empty string.

I can't currently tell where/why this error occurs and how it could be caught, but this is a quite serious issue as it causes the whole server thread working on that page request to die with said error message.

You should be able to reproduce this error with the following procedure:

λ nils@n-sch.de. wget npaste.de/zHhV -o foo.lua
λ nils@n-sch.de. ghci
GHCi, version 7.2.2: http://www.haskell.org/ghc/ :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Loading package ffi-1.0 ... linking ... done.
Prelude> :m + Text.Highlighting.Kate
Prelude Text.Highlighting.Kate> s <- readFile "foo.lua"
Prelude Text.Highlighting.Kate> highlightAs "Lua" s
Loading package array-0.3.0.3 ... linking ... done.
Loading package containers-0.4.1.0 ... linking ... done.
Loading package bytestring-0.9.2.0 ... linking ... done.
Loading package deepseq-1.2.0.1 ... linking ... done.
Loading package text-0.11.1.12 ... linking ... done.
Loading package blaze-builder-0.3.0.2 ... linking ... done.
Loading package blaze-html-0.4.3.1 ... linking ... done.
Loading package filepath-1.2.0.1 ... linking ... done.
Loading package transformers-0.2.2.0 ... linking ... done.
Loading package mtl-2.0.1.0 ... linking ... done.
Loading package parsec-3.1.2 ... linking ... done.
Loading package regex-base-0.93.2 ... linking ... done.
Loading package regex-pcre-builtin-0.94.2.1.7.7 ... linking ... done.
Loading package highlighting-kate-0.4 ... linking ... done.
[*** Exception: Text.ParserCombinators.Parsec.Prim.many: combinator 'many' is applied to a parser that accepts an empty string.