Unable to get basic language syntax to load

I’m trying to write a very simple syntax definition for a dialect of prolog and I’m using the auto-generated template as a starting point. Here’s what I have so far:

<?xml version="1.0" encoding="UTF-8"?>
<syntax name="asp">
        <name>Answer-Set Prolog</name>

        <extension priority="1.0">lp</extension>


        <pair open="{" close="}" />
        <pair open="[" close="]" />
        <pair open="(" close=")" />

        <pair open="{" close="}" />
        <pair open="[" close="]" />
        <pair open="(" close=")" />
        <pair open="&apos;" close="&apos;" />
        <pair open="&quot;" close="&quot;" />

        <include syntax="self" collection="comments" />
        <include syntax="self" collection="keywords" />

        <!-- Comments -->
        <collection name="comments">
            <scope name="asp.comment.block" spell-check="true">
            <scope name="asp.comment.single" spell-check="true">

        <!-- Keywords -->
        <collection name="keywords">
            <scope name="asp.keyword">
                <symbol type="keyword" />
                    <!-- Default Negation -->

                    <!-- Aggregates -->

                    <!-- Optimizations -->

                    <!-- Directives -->

If I attempt to load the extension for testing I get the following error:

Answer-Set Prolog[11:40:06.533000] Error loading syntax “Answer-Set Prolog.xml”

The operation couldn’t be completed. (SKXMLDocumentErrorDomain error 111.)

Are there any suggestions for how to proceed? Is there a basic guide for syntax definition writing anywhere? All I really want is some basic highlighting of comments and keywords.

It sounds like you maybe already have seen the docs for syntaxes:


Most of what it sounds like you’ll want to know are in the Syntaxes and Scopes sections.

As for what you already have, I would try escaping the hash mark (#) in your keyword strings with a backslash. When my syntax failed, unescaped special characters were often the issue. (Note that even <string> elements are converted to regular expressions)

It would appear that your use of entities like &percnt; are not valid; Unlike HTML, XML itself does not define more than the five basic entities for quotes, apostrophes, ampersand, and the greater than / less than symbols.