Open piccolbo opened 2 years ago
I don't know much Prolog. Is the "Fact"
just supposed to be a string?
Looking at prolog.xml, I'm baffled. It seems that the dq
context just emits a syntax error whenever it sees something that looks like an identifier. Why?
Well, it's two of us then. But yes, from what I understand it is perfectly fine. To test this assumption, I created a file containing afact("Fact").
. Opened it with swipl (SWI prolog) and performed a query afact(X)
and the reply was X = "Fact".
. You may have seen Prolog used with bare atoms, without quotes. skylighting works with those. The quotes are always permissible and mandatory when the atom contains a space or starts with an uppercase letter (which would qualify it as a variable).
So you are looking at this
<context name="dq" lineEndContext="#stay" attribute=""double-quoted"" noIndentationBasedFolding="true" >
<!-- <context name="double-quoted" lineEndContext="#stay" attribute=""double-quoted"" > -->
<IncludeRules context="quoted_1st"/>
<RegExpr String="(""|&esc_oct_iso;|&esc_hex_iso;|\\&any;|[^"\\]+)$"
context="syntax_error_dq" attribute="Syntax Error" />
<Detect2Chars char=""" char1=""" context="#stay" attribute="escaped (!use background)" />
<DetectChar char=""" context="#pop#pop" endRegion="quoted" attribute=""double-quoted"" />
<IncludeRules context="quoted_last"/>
</context>
I don't fully understand, but it seems to emit a syntax error for everything that's double quoted. "Fact" is actually a type of atom, not an identifier. There is a context name atomic but not one for atom. It would be nice to see the original in Kate.
This is the xml syntax definition that is being used in Kate. It's possible that there is some error in our implementation, but I'm not sure what it would be.
Thanks, I don't think an intelligent person should go through 1000 lines of xml to try and fix this, I just switched it off for now. For a grammar that may be 10 lines of BNF.
I emailed the author - if we're lucky we may get some help understanding what it is supposed to do.
Hi, reporting here per suggestion on pandoc user list. I was told this is the upstream dep and replicated the error in skylighting (as far as I understand it, first time user, brew install)
You can see the \ErrorTok command in there. Similar story with html output (span class="er")
I am told that skylighting relies on data shared or derived from the kate editor. I could not reproduce the problem in Kate on Mac OS, or at least I can say the quote atoms appear in green and not bold red. Not sure which style Kate is using by default. I am a complete Prolog noob, but that looks fine to me and SWI Prolog accepts it. Thanks
Antonio