In SPARQL, comments starts with a #
and follows to the end of the line. The problem is that URI's, which is a big part of SPARQL, can also contain #
, but then they are not the start of a comment. Like so <http://example.com/foo#bar>
. URI's are always surrounded by <>
and never have any spaces in them.
Normally, we would write a syntax-table like this
(defvar sparql-mode-syntax-table
(modify-syntax-entry ?# "<" syntax-table)
(modify-syntax-entry ?\n ">" syntax-table))
but this would include the #
of a URI. Now when the buffer is font-locked, or we try to move using the defined syntax, from the part from the URI that contains a #
is now considered a comment.
How can I make syntax-propertize
skip marking #
in URI's as beginning of comments?
syntax-propertize
as a tag, but I don't have the reputation yet.