maude syntax updates

- negative rationals
- fix string escapes
- ±Infinity
- strategy modules, decls, etc
- some arrows etc i missed
This commit is contained in:
rhiannon morris 2022-03-16 04:55:30 +01:00
parent dede580ecf
commit c82d5cdb44
2 changed files with 24 additions and 12 deletions

View file

@ -402,3 +402,4 @@ aside {
.maude .cf { color: hsl(276deg, 75%, 35%); font-weight: 500; } .maude .cf { color: hsl(276deg, 75%, 35%); font-weight: 500; }
.maude .op { color: hsl(220deg, 10%, 28%); } .maude .op { color: hsl(220deg, 10%, 28%); }
.maude .co { color: hsl(221deg, 10%, 39%); font-style: italic; } .maude .co { color: hsl(221deg, 10%, 39%); font-style: italic; }
.maude :is(.st, .fl, .dv, .sc) { color: hsl(143deg, 100%, 20%); }

View file

@ -7,8 +7,10 @@
<list name="modules"> <list name="modules">
<item>mod</item> <item>endm</item> <item>is</item> <item>mod</item> <item>endm</item> <item>is</item>
<item>fmod</item> <item>endfm</item> <item>fmod</item> <item>endfm</item>
<item>smod</item> <item>endsm</item>
<item>th</item> <item>endth</item> <item>th</item> <item>endth</item>
<item>fth</item> <item>endfth</item> <item>fth</item> <item>endfth</item>
<item>sth</item> <item>endsth</item>
<item>view</item> <item>endv</item> <item>view</item> <item>endv</item>
<item>from</item> <item>to</item> <item>from</item> <item>to</item>
</list> </list>
@ -24,12 +26,14 @@
<item>subsort</item> <item>subsorts</item> <item>subsort</item> <item>subsorts</item>
</list> </list>
<list name="ops"> <item>op</item> <item>ops</item> </list> <list name="ops"> <item>op</item> <item>ops</item> </list>
<list name="vars"> <item>var</item> <item>vars</item> </list> <list name="vars"> <item>var</item> <item>vars</item> </list>
<list name="eqs"> <item>eq</item> <item>ceq</item> </list> <list name="eqs"> <item>eq</item> <item>ceq</item> </list>
<list name="rules"> <item>rl</item> <item>crl</item> </list> <list name="rules"> <item>rl</item> <item>crl</item> </list>
<list name="members"> <item>mb</item> <item>cmb</item> </list> <list name="members"> <item>mb</item> <item>cmb</item> </list>
<list name="if"> <item>if</item> </list> <list name="strats"> <item>strat</item> <item>strats</item> </list>
<list name="sds"> <item>sd</item> <item>csd</item> </list>
<list name="if"> <item>if</item> </list>
<contexts> <contexts>
<context attribute="default" lineEndContext="#stay" name="Default"> <context attribute="default" lineEndContext="#stay" name="Default">
@ -46,26 +50,31 @@
<RegExpr attribute="if" context="#stay" String="/\\" /> <RegExpr attribute="if" context="#stay" String="/\\" />
<RegExpr attribute="punc" context="#stay" <RegExpr attribute="punc" context="#stay"
String="(?&lt;=^|\s)(?:::?|->|=>|=(?:=|/=)?)(?=\s|$)" /> String="(?&lt;=^|\s)(?::[:=]?|->|&lt;-|=>|=(?:=|/=)?|@)(?=\s|$)" />
<RegExpr attribute="delim" context="#stay" <RegExpr attribute="delim" context="#stay"
String="[{}\[\](),]|(?&lt;=^|\s)\.(?=\s|$)" /> String="[{}\[\](),]|(?&lt;=^|\s)\.(?=\s|$)" />
<DetectChar attribute="string" context="String" char="&quot;" /> <DetectChar attribute="string" context="String" char="&quot;" />
<Int attribute="int" context="#stay" />
<Float attribute="float" context="#stay" /> <Float attribute="float" context="#stay" />
<RegExpr attribute="rat" context="#stay" String="\d+/\d+" /> <RegExpr attribute="float" context="#stay"
String="(?&lt;=^|\s|[(\[{])-?Infinity(?=$|\s|[)\]}])" />
<RegExpr attribute="rat" context="#stay" String="-?\d+(?:/\d+)?" />
<RegExpr attribute="comment" context="comment s" <RegExpr attribute="comment" context="comment s"
String="(?:---|\*\*\*)(?!\()" /> String="(?:---|\*\*\*)(?!\()" />
<RegExpr attribute="comment" context="comment m" <RegExpr attribute="comment" context="comment m"
String="(?:---|\*\*\*)\(" /> String="(?:---|\*\*\*)\(" />
<!-- todo make this more exact? -->
<RegExpr attribute="qid" context="#stay"
String="'(?:\S+|&quot;(?:[^\\&quot;]|\\.)*&quot;)" />
</context> </context>
<context attribute="string" lineEndContext="#stay" name="String"> <context attribute="string" lineEndContext="#stay" name="String">
<RegExpr attribute="string" context="#stay" String="\\." /> <RegExpr attribute="string esc" context="#stay" String="\\." />
<DetectChar attribute="string esc" context="#pop" char="&quot;" /> <DetectChar attribute="string" context="#pop" char="&quot;" />
</context> </context>
<context attribute="comment" lineEndContext="#pop" name="comment s" /> <context attribute="comment" lineEndContext="#pop" name="comment s" />
@ -86,14 +95,16 @@
<itemData name="eqs" defStyleNum="dsFunction" /> <itemData name="eqs" defStyleNum="dsFunction" />
<itemData name="rules" defStyleNum="dsControlFlow" /> <itemData name="rules" defStyleNum="dsControlFlow" />
<itemData name="members" defStyleNum="dsKeyword" /> <itemData name="members" defStyleNum="dsKeyword" />
<itemData name="strats" defStyleNum="dsControlFlow" />
<itemData name="sds" defStyleNum="dsControlFlow" />
<itemData name="if" defStyleNum="dsControlFlow" /> <itemData name="if" defStyleNum="dsControlFlow" />
<itemData name="punc" defStyleNum="dsOperator" /> <itemData name="punc" defStyleNum="dsOperator" />
<itemData name="delim" defStyleNum="dsNormal" /> <itemData name="delim" defStyleNum="dsNormal" />
<itemData name="string" defStyleNum="dsString" /> <itemData name="string" defStyleNum="dsString" />
<itemData name="string esc" defStyleNum="dsSpecialChar" /> <itemData name="string esc" defStyleNum="dsSpecialChar" />
<itemData name="int" defStyleNum="dsDecVal" />
<itemData name="float" defStyleNum="dsFloat" /> <itemData name="float" defStyleNum="dsFloat" />
<itemData name="rat" defStyleNum="dsFloat" /> <itemData name="rat" defStyleNum="dsFloat" />
<itemData name="qid" defStyleNum="dsString" />
<itemData name="comment" defStyleNum="dsComment" /> <itemData name="comment" defStyleNum="dsComment" />
</itemDatas> </itemDatas>
</highlighting> </highlighting>