From 40880f748e5f0dbe6318b9953d6eae998d9c1458 Mon Sep 17 00:00:00 2001 From: Jan Wielemaker Date: Sun, 28 Feb 2021 17:09:45 +0100 Subject: [PATCH] PORT: Support new style SWI-Prolog neck syntax from the core highlight module and support the --- lib/highlight.pl | 11 ++++++----- web/js/codemirror/mode/prolog/prolog.js | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/highlight.pl b/lib/highlight.pl index c2a69194d..27946b997 100644 --- a/lib/highlight.pl +++ b/lib/highlight.pl @@ -884,11 +884,12 @@ style(table_option(_Mode), table_option, [text]). -neck_text(clause, (:-)). -neck_text(grammar_rule, (-->)). -neck_text(method(send), (:->)). -neck_text(method(get), (:<-)). -neck_text(directive, (:-)). +neck_text(clause, (:-)) :- !. +neck_text(grammar_rule, (-->)) :- !. +neck_text(method(send), (:->)) :- !. +neck_text(method(get), (:<-)) :- !. +neck_text(directive, (:-)) :- !. +neck_text(Text, Text). % new style head_type(exported, head_exported). head_type(public(_), head_public). diff --git a/web/js/codemirror/mode/prolog/prolog.js b/web/js/codemirror/mode/prolog/prolog.js index 41db8c15c..cabcef6a1 100644 --- a/web/js/codemirror/mode/prolog/prolog.js +++ b/web/js/codemirror/mode/prolog/prolog.js @@ -40,7 +40,7 @@ var isSymbolChar = /[-#$&*+./:<=>?@\\^~]/; /* Prolog glueing symbols chars */ var isSoloChar = /[[\]{}(),;|!]/; /* Prolog solo chars */ - var isNeck = /^(:-|-->)$/; + var isNeck = /^(:-|-->|=>)$/; var isControlOp = /^(,|;|->|\*->|\\+|\|)$/;