[Pkg-haskell-maintainers] Bug#753299: libghc-highlighting-kate-dev: Highlighting Ocaml fails

John MacFarlane jgm at berkeley.edu
Sun Jul 20 00:16:01 UTC 2014

Upgrading to highlighting-kate
will fix the problem.

+++ John MacFarlane [Jul 19 14 09:19 ]:
>OK, I have the solution!  The \o{377} format for specifying
>octal escapes is only supported starting in PCRE 8.34, and debian
>has an older version.  \377 can still be used.  So I can adjust
>highlighting-kate code to use e.g. \377, as long as we don't have
>characters greater than octal 377.
>+++ John MacFarlane [Jul 19 14 08:17 ]:
>>Another solution would be to modify the highlighting-kate code to
>>avoid using character classes with octal escapes.  (I could simulate
>>them by just listing all the characters.)  Perhaps that is the best
>>short-term solution.
>>+++ John MacFarlane [Jul 19 14 08:14 ]:
>>>Update:  It seems that pcre-light is no longer being actively maintained
>>>upstream.  pcre-regex-builtin is not in Debian.  I thought the solution
>>>might be to add an option to highlighting-kate to use the regex-pcre library
>>>(in debian as libghc-regex-pcre-dev).  However, this seems to have the same
>>>Prelude Text.Regex.PCRE.ByteString Data.ByteString.UTF8> Left e <- compile (compUTF8 + compAnchored) 0 (fromString "[\\o{0370}-\\o{0377}")
>>>Prelude Text.Regex.PCRE.ByteString Data.ByteString.UTF8> e
>>>(11,"range out of order in character class")
>>>Is the problem perhaps that the underlying C library pcre has not been
>>>compiled with UTF8 support?
>>>+++ John MacFarlane [Jul 18 14 16:53 ]:
>>>>I'd tested before with pcre-regex-builtin, which worked.
>>>>I recompiled with pcre-light, and got the failure you report.
>>>>The problem can be exhibited in pcre-light:
>>>>Prelude Text.Regex.PCRE.Light Data.ByteString.UTF8> match (compile
>>>>"[\\o{0370}-\\o{0377}") [utf8,anchored]) (fromString "hi") []
>>>>*** Exception: Text.Regex.PCRE.Light: Error in regex: range out of order
>>>>character class
>>>>The unicode ranges seem to be confusing it, even with 'utf8' set.
>>>>Submitted an issue upstream:
>>>>In the mean time, I suggest that debian packagers use pcre-regex-builtin
>>>>instead (though perhaps there was a reason for using pcre-light?).
>>>>+++ Samuel Hym [Jul 01 14 18:06 ]:
>>>>>Hi John,
>>>>>>Are you certain that the version you are using in GHCI is,
>>>>>>and not an older version (perhaps from your user database)?
>>>>>I rechecked, using the same version of the package but on a 
>>>>>different machine, different arch, just in case. But still 
>>>>>with debian-built packages, and with the same result.
>>>>>Here is what ghci has to say, with the full versions of the modules used:
>>>>>GHCi, version 7.6.3: http://www.haskell.org/ghc/  :? for help
>>>>>Loading package ghc-prim ... linking ... done.
>>>>>Loading package integer-gmp ... linking ... done.
>>>>>Loading package base ... linking ... done.
>>>>>Prelude> :m +Text.Highlighting.Kate
>>>>>Prelude Text.Highlighting.Kate> highlightAs "ocaml" "a"
>>>>>Loading package array- ... linking ... done.
>>>>>Loading package deepseq- ... linking ... done.
>>>>>Loading package containers- ... linking ... done.
>>>>>Loading package bytestring- ... linking ... done.
>>>>>Loading package transformers- ... linking ... done.
>>>>>Loading package mtl-2.1.2 ... linking ... done.
>>>>>Loading package text- ... linking ... done.
>>>>>Loading package parsec-3.1.3 ... linking ... done.
>>>>>Loading package blaze-builder- ... linking ... done.
>>>>>Loading package blaze-markup- ... linking ... done.
>>>>>Loading package blaze-html- ... linking ... done.
>>>>>Loading package pcre-light-0.4 ... linking ... done.
>>>>>Loading package utf8-string-0.3.7 ... linking ... done.
>>>>>Loading package highlighting-kate- ... linking ... done.
>>>>>[*** Exception: Text.Regex.PCRE.Light: Error in regex: range 
>>>>>out of order in character class
>>>>>You think something else might be to blame in the module stack?
>>>>>Do you know if there is a way to ask pcre-light to be somewhat 
>>>>>more informative about the regex producing the issue?
>>>>>By the way, many thanks for pandoc!
>>>>>Best regards

More information about the Pkg-haskell-maintainers mailing list