[prev in list] [next in list] [prev in thread] [next in thread]
List: kwrite-devel
Subject: not addressed by a symbolic name
From: Terry Scheingeld <tscheingeld32 () gmail ! com>
Date: 2020-11-02 22:09:38
Message-ID: CABg1sXrpr_5O0F4kQk+ioMY_AUomsz0RkeupQnjt1N3KhbyfDw () mail ! gmail ! com
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
I'm writing a syntax file for a JSON-like language. I started with a JSON
syntax file and have been modifying it a little bit at a time. The syntax
file is attached.
I'm trying to add line-based comments to the syntax. That is, a # character
starts a comment, and the comment ends at the end of the line. I copied
some of the code from a Ruby syntax file. The problem is triggered by the
following line:
<DetectChar char="#" context="General Comment" attribute="Comment" />
Later in the file is this context:
<context name="General Comment" attribute="Comment"
lineEndContext="#pop">
<IncludeRules context="##Alerts" />-->
</context>
In the <ItemDatas> section is this line:
<itemData name="Comment" defStyleNum="dsComment"/>
When I open a file with that syntax, I get a window that says "There were
warning(s) and/or error(s) while parsing the syntax highlighting
configuration. Clicking the details button gives this detail:
/home/terry/.local/share/org.kde.syntax-highlighting/syntax/axf.xml:Deprecated
syntax. Context General Comment not addressed by a symbolic name
An image of that window is attached.
I'm using Kate Version 17.12.3
Any idea what's wrong with my syntax file?
[Attachment #5 (text/html)]
<div dir="ltr">I'm writing a syntax file for a JSON-like language. I started with \
a JSON syntax file and have been modifying it a little bit at a time. The syntax file \
is attached.<br><br>I'm trying to add line-based comments to the syntax. That is, \
a # character starts a comment, and the comment ends at the end of the line. I copied \
some of the code from a Ruby syntax file. The problem is triggered by the following \
line:<br><br><font face="monospace"> <DetectChar char="#" \
context="General Comment" attribute="Comment" \
/></font><div><br></div><div>Later in the file is this \
context:</div><div><br></div><div><font face="monospace"> <context \
name="General Comment" attribute="Comment" \
lineEndContext="#pop"><br> <IncludeRules \
context="##Alerts" />--><br> \
</context></font><br></div><div><br></div><div>In the <ItemDatas> section \
is this line:</div><div><br></div><div><font face="monospace"> <itemData \
name="Comment" \
defStyleNum="dsComment"/></font><br></div><div><br></div><div>When I \
open a file with that syntax, I get a window that says "There were warning(s) \
and/or error(s) while parsing the syntax highlighting configuration. Clicking the \
details button gives this detail:</div><div><br></div><div> \
/home/terry/.local/share/org.kde.syntax-highlighting/syntax/axf.xml:Deprecated \
syntax. Context General Comment not addressed by a symbolic \
name<br></div><div><br></div><div>An image of that window is \
attached.</div><div><br></div><div>I'm using Kate Version \
17.12.3</div><div><br></div><div>Any idea what's wrong with my syntax \
file?</div></div>
["Screenshot at 2020-11-02 16-53-58.png" (image/png)]
["axf.xml" (text/xml)]
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language SYSTEM "language.dtd">
<!--
***************************************************************************
** Writing a Kate Highlighting XML File
** http://kate-editor.org/article/writing_a_kate_highlighting_xml_file
**
** Introducing JSON
** http://www.json.org/
**
** The application/json Media Type for JavaScript Object Notation (JSON)
** http://tools.ietf.org/html/rfc4627
***************************************************************************
-->
<language name="AXF" section="Markup" version="5" kateversion="2.4" \
extensions="*.axf" mimetype="application/axf" author="Mike O'Sullivan \
(mike@idocs.com)" license="GPL"> <highlighting>
<list name="Constants">
<item>null</item>
<item>true</item>
<item>false</item>
</list>
<contexts>
<context name="Normal" lineEndContext="#stay" attribute="Style_Error">
<DetectChar char="{" context="Pair" beginRegion="Region_Object" \
attribute="Style_Seperator_Pair" />
<DetectChar char="[" context="Array" beginRegion="Region_Array" \
attribute="Style_Seperator_Array" />
<!-- problem line: -->
<DetectChar char="#" context="General Comment" attribute="Comment" />
<DetectSpaces context="#stay" attribute="Style_Normal" />
</context>
<context name="Pair" lineEndContext="#stay" attribute="Style_Error">
<DetectChar char=""" context="String_Key_Double" \
attribute="Style_String_Key" />
<DetectChar char="'" context="String_Key_Single" \
attribute="Style_String_Key" />
<DetectChar char=":" context="Value" attribute="Style_Seperator_Pair" \
/>
<DetectChar char="}" context="#pop" endRegion="Region_Object" \
attribute="Style_Seperator_Pair" />
<DetectChar char="," context="#stay" attribute="Style_Seperator_Pair" \
/>
<!--<DetectChar attribute="Comment" char="#" context="General Comment"/>-->
<DetectSpaces context="#stay" attribute="Style_Normal" />
</context>
<context name="String_Key_Double" lineEndContext="#stay" \
attribute="Style_String_Key">
<DetectChar char=""" context="#pop" attribute="Style_String_Key" />
<RegExpr String="\\(?:["\\/bfnrt]|u[0-9a-fA-f]{4})" context="#stay" \
insensitive="false" minimal="false" attribute="Style_String_Key_Char" /> </context>
<context name="String_Key_Single" lineEndContext="#stay" \
attribute="Style_String_Key">
<DetectChar char="'" context="#pop" attribute="Style_String_Key" />
<RegExpr String="\\(?:['\\/bfnrt]|u[0-9a-fA-f]{4})" context="#stay" \
insensitive="false" minimal="false" attribute="Style_String_Key_Char" /> </context>
<context name="Value" lineEndContext="#stay" attribute="Style_Error" >
<DetectChar char=""" context="String_Value" \
attribute="Style_String_Value" />
<DetectChar char="{" context="Pair" beginRegion="Region_Object" \
attribute="Style_Seperator_Pair" />
<DetectChar char="[" context="Array" beginRegion="Region_Array" \
attribute="Style_Seperator_Array" /> <DetectChar char="}" context="#pop" \
lookAhead="true" /> <DetectChar char="," context="#pop" lookAhead="true" />
<DetectSpaces context="#stay" attribute="Style_Normal" />
<keyword String="Constants" context="#stay" attribute="Style_Keyword" />
<RegExpr String="-?(?:[0-9]|[1-9][0-9]+)\.[0-9]+(?:[eE][+-]?[0-9]+)?" \
context="#stay" insensitive="false" minimal="false" \
attribute="Style_Float" />
<RegExpr String="-?(?:[0-9]|[1-9][0-9]+)(?:[eE][+-]?[0-9]+)?" context="#stay" \
insensitive="false" minimal="false" attribute="Style_Decimal" /> </context>
<context name="String_Value" lineEndContext="#stay" \
attribute="Style_String_Value">
<DetectChar char=""" context="#pop" attribute="Style_String_Value" />
<RegExpr String="\\(?:["\\/bfnrt]|u[0-9a-fA-f]{4})" context="#stay" \
insensitive="false" minimal="false" attribute="Style_String_Value_Char" /> \
</context>
<context name="Array" lineEndContext="#stay" attribute="Style_Error">
<DetectChar char="," context="#stay" attribute="Style_Seperator_Array" \
/>
<DetectChar char="]" context="#pop" endRegion="Region_Array" \
attribute="Style_Seperator_Array" />
<DetectChar char="{" context="Pair" beginRegion="Region_Object" \
attribute="Style_Seperator_Pair" />
<DetectChar char="[" context="Array" beginRegion="Region_Array" \
attribute="Style_Seperator_Array" />
<DetectChar char=""" context="String_Value" \
attribute="Style_String_Value" />
<DetectSpaces context="#stay" attribute="Style_Normal" />
<keyword String="Constants" context="#stay" attribute="Style_Keyword" />
<RegExpr String="-?(?:[0-9]|[1-9][0-9]+)\.[0-9]+(?:[eE][+-]?[0-9]+)?" \
context="#stay" insensitive="false" minimal="false" \
attribute="Style_Float" />
<RegExpr String="-?(?:[0-9]|[1-9][0-9]+)(?:[eE][+-]?[0-9]+)?" context="#stay" \
insensitive="false" minimal="false" attribute="Style_Decimal" /> </context>
</contexts>
<context name="General Comment" attribute="Comment" lineEndContext="#pop">
<IncludeRules context="##Alerts" />-->
</context>
<itemDatas>
<itemData name="Style_Normal" defStyleNum="dsNormal" />
<itemData name="Style_Seperator_Pair" defStyleNum="dsFunction" bold="true" \
/>
<itemData name="Style_Seperator_Array" defStyleNum="dsOthers" bold="true" />
<itemData name="Style_Decimal" defStyleNum="dsDecVal" />
<itemData name="Style_Float" defStyleNum="dsFloat" />
<itemData name="Style_String_Key" defStyleNum="dsDataType" />
<itemData name="Style_String_Value" defStyleNum="dsString" />
<itemData name="Style_String_Key_Char" defStyleNum="dsChar" />
<itemData name="Style_String_Value_Char" defStyleNum="dsChar" />
<itemData name="Style_Keyword" defStyleNum="dsKeyword" />
<itemData name="Style_Error" defStyleNum="dsError" />
<itemData name="Comment" defStyleNum="dsComment"/>
</itemDatas>
</highlighting>
</language>
<!--
// kate: space-indent on; indent-width 2; replace-tabs on;
-->
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic