Skip to content

Commit

Permalink
PORT: Support new style SWI-Prolog neck syntax from the core highligh…
Browse files Browse the repository at this point in the history
…t module

and support the
  • Loading branch information
JanWielemaker committed Feb 28, 2021
1 parent 29852d4 commit 40880f7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
11 changes: 6 additions & 5 deletions lib/highlight.pl
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
2 changes: 1 addition & 1 deletion web/js/codemirror/mode/prolog/prolog.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

var isSymbolChar = /[-#$&*+./:<=>?@\\^~]/; /* Prolog glueing symbols chars */
var isSoloChar = /[[\]{}(),;|!]/; /* Prolog solo chars */
var isNeck = /^(:-|-->)$/;
var isNeck = /^(:-|-->|=>)$/;
var isControlOp = /^(,|;|->|\*->|\\+|\|)$/;


Expand Down

0 comments on commit 40880f7

Please sign in to comment.