jgm / skylighting

A Haskell syntax highlighting library with tokenizers derived from KDE syntax highlighting descriptions
194 stars 62 forks source link

Split skylighting (GPL) into skylighting-core (BSD3) and skylighting (GPL) #37

Closed jtdaugherty closed 6 years ago

jgm commented 6 years ago

What's the conflict involving bin/main.hs?

jtdaugherty commented 6 years ago

I guess there was a small change to your master that wasn't merged into my repo. That's done now.

jtdaugherty commented 6 years ago

Thank you!

jgm commented 6 years ago

OK, the merge should make things easier going forward, but we're not done. I bumped versions to 0.7. Next problem is that the tests fail to compile. I fixed an import, but that isn't enough -- the problem is that the tests (currently in skylighting-core) require defaultSyntaxMap, which only gets defined in Skylighting.

Possible solutions:

jtdaugherty commented 6 years ago

Since the XML files are included in core, it seems to me that leaving the tests behind in core is better since then the tests are closer to the code they're testing, and we can load the XML files dynamically. I can work on that today.

jgm commented 6 years ago

Sounds good.

jtdaugherty commented 6 years ago

I've filed #38. This compiles, but on my system, all of the XML files fail to load with an "illegal URI" error that I don't understand. Can you shed any light on that?

Also, these failures cause a great deal of output to stderr due to the HXT parsing being in IO. The application that I'm working on that motivated all of this work is a curses-style application that controls the terminal, so error output from the parser will corrupt the terminal. Is there any other way to parse XML documents with HXT that doesn't entail getting such output?

jtdaugherty commented 6 years ago

(On second thought, we can easily just load all syntaxes before we take over the terminal, so it isn't a show-stopping issue.)

jgm commented 6 years ago

The argument is for a file path, not the xml contents - that was the problem. I've pushed a fix and now I'm working on travis.

jtdaugherty commented 6 years ago

Oh!

jtdaugherty commented 6 years ago

That explains why the XML was in the error message, which I found strange. I modified the parsing function to omit that from the error, thinking it odd, but now I realize that was a mistake. I'll revert it.