Swi-Prolog (a rather popular Prolog implementation) uses special syntax involving the dot (.) operator for their new dict feature: http://swi-prolog.org/pldoc/man?section=dicts Current Kate's Prolog highlighter marks such usages of dot as warnings. This makes it harder to see actual warnings. Reproducible: Always Steps to Reproduce: 1. Enter p:- (a -> X = Y.c ; true) into a new file. 2. Save file as a Prolog file. Actual Results: Observe that dot in X.c is marked as warning (red background). Expected Results: Dot in X.c should not be marked as a warning. I have created a patch that removes dot warning markers in the relevant contexts (nested, curly, nested_expr). Nested context: usually inside if-then-else (->;), curly: inside dicts themself and dcg {} blocks, nested_expr: arithmetic expressions like X is A * (Y.c + 3). I have tested it with some files. Previously I used a workaround by avoiding the dot operator but recent changes in Swi made that impossible: http://swi-prolog.996271.n3.nabble.com/Ann-SWI-Prolog-7-1-13-td14825.html
Created attachment 86164 [details] Pathc to remove dot warning in relevant contexts. Uploading possible patch.
@Raivo: Is there any negative side effect of this patch? Otherwise, we'll commit this.
@Dominik: I hoped to get a comment from the original author (added to CC) but that has not happened. This is my first time to modify an highlight file. Someone with a deeper knowledge of highlight definitions should review my patch that it does exactly what it says: removes 3 warning markers. As far as I see it does not touch any other rules or context transitions and thus can't have negative side effects. I use the patched file on my system and daily work on Prolog projects using Kate, no issues so far.
answer(Patch) :- Patch is ok + well.done; commit(Patch).
Git commit ab1e932a6d9ea88b2219f23f3a5b0628ba7d5fce by Dominik Haumann. Committed on 07/06/2014 at 13:37. Pushed by dhaumann into branch 'master'. fix: Prolog highlighting marks Swi-Prolog 7.x new dict syntax as warning Thanks to Raivo Laanemets for the patch! M +1 -4 part/syntax/data/prolog.xml http://commits.kde.org/kate/ab1e932a6d9ea88b2219f23f3a5b0628ba7d5fce
Git commit babe8751b504200a354029216c1250aaf8fc3d3d by Dominik Haumann. Committed on 07/06/2014 at 13:38. Pushed by dhaumann into branch 'master'. fix: Prolog highlighting marks Swi-Prolog 7.x new dict syntax as warning M +1 -4 src/syntax/data/prolog.xml http://commits.kde.org/ktexteditor/babe8751b504200a354029216c1250aaf8fc3d3d