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">
<meta>
<name>Answer-Set Prolog</name>
<type>script</type>
<preferred-file-extension>lp</preferred-file-extension>
</meta>
<detectors>
<extension priority="1.0">lp</extension>
</detectors>
<comments>
<single>
<expression>%</expression>
</single>
<multiline>
<starts-with>
<expression>%*</expression>
</starts-with>
<ends-with>
<expression>*%</expression>
</ends-with>
</multiline>
</comments>
<brackets>
<pair open="{" close="}" />
<pair open="[" close="]" />
<pair open="(" close=")" />
</brackets>
<surrounding-pairs>
<pair open="{" close="}" />
<pair open="[" close="]" />
<pair open="(" close=")" />
<pair open="'" close="'" />
<pair open=""" close=""" />
</surrounding-pairs>
<scopes>
<include syntax="self" collection="comments" />
<include syntax="self" collection="keywords" />
</scopes>
<collections>
<!-- Comments -->
<collection name="comments">
<scope name="asp.comment.block" spell-check="true">
<starts-with>
<expression>%*</expression>
</starts-with>
<ends-with>
<expression>*%</expression>
</ends-with>
</scope>
<scope name="asp.comment.single" spell-check="true">
<starts-with>
<expression>%</expression>
</starts-with>
</scope>
</collection>
<!-- Keywords -->
<collection name="keywords">
<scope name="asp.keyword">
<symbol type="keyword" />
<strings>
<!-- Default Negation -->
<string>not</string>
<!-- Aggregates -->
<string>#sum</string>
<string>#count</string>
<string>#min</string>
<string>#max</string>
<!-- Optimizations -->
<string>#maximize</string>
<string>#minimize</string>
<!-- Directives -->
<string>#show</string>
<string>#const</string>
</strings>
</scope>
</collection>
</collections>
</syntax>
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.