editors

changeset 52:6df4cdf10d75

* simplified kate code folding
* fixed switch / case folding
author Matt Lewis
date Wed Jan 04 07:10:07 2012 -0500 (2012-01-04)
parents cf90a38e8ebc
children 324cde3eee0c
files kate/euphoria.xml
line diff
     1.1 --- a/kate/euphoria.xml	Tue Jan 03 19:58:27 2012 -0500
     1.2 +++ b/kate/euphoria.xml	Wed Jan 04 07:10:07 2012 -0500
     1.3 @@ -229,56 +229,53 @@
     1.4  	<list name="include_directive">
     1.5  		<item> include </item>
     1.6  	</list>
     1.7 +	<list name="end_block">
     1.8 +		<item> end </item>
     1.9 +	</list>
    1.10 +	<list name="blocks">
    1.11 +		<item> enum type </item>
    1.12 +		<item> for </item>
    1.13 +		<item> function </item>
    1.14 +		<item> ifdef </item>
    1.15 +		<item> if </item>
    1.16 +		<item> loop </item>
    1.17 +		<item> procedure </item>
    1.18 +		<item> type </item>
    1.19 +		<item> while </item>
    1.20 +	</list>
    1.21 +	<list name="start_block">
    1.22 +		<item> enum type </item>
    1.23 +		<item> for </item>
    1.24 +		<item> function </item>
    1.25 +		<item> ifdef </item>
    1.26 +		<item> if </item>
    1.27 +		<item> loop </item>
    1.28 +		<item> procedure </item>
    1.29 +		<item> type </item>
    1.30 +		<item> while </item>
    1.31 +	</list>
    1.32  	
    1.33 +	<list name="stop_start_block">
    1.34 +		<item> case </item>
    1.35 +		<item> elsedef </item>
    1.36 +		<item> else </item>
    1.37 +		<item> elsifdef </item>
    1.38 +		<item> elsif </item>
    1.39 +	</list>
    1.40 +	
    1.41 +	<list name="switch_block">
    1.42 +		<item> switch </item>
    1.43 +	</list>
    1.44  	<contexts>
    1.45 -			
    1.46 +		
    1.47  		<context attribute="Normal Text" lineEndContext="#stay" name="Normal">
    1.48  			<DetectSpaces/>
    1.49 -			<!--
    1.50 -				NB: case else should start a new region, but currently, Kate crashes when we use a lookAhead read
    1.51 -				below to end the regCase region with "end switch", so we'll just not start a region at "case else".
    1.52 -				Of course, this might mess up folding for code without a "case else".
    1.53 -			-->
    1.54 -			<RegExpr attribute="Keyword" context="#stay" String="\bcase\s+else\b" endRegion="regCase" />
    1.55 -			<RegExpr attribute="Keyword" context="#stay" String="\bcase\b" endRegion="regCase" beginRegion="regCase"/>
    1.56  			
    1.57 -			<!--<RegExpr attribute="Keyword" context="#stay" lookAhead="true" String="\bend\s+switch\b" endRegion="regCase"/>-->
    1.58 -			<RegExpr attribute="Keyword" context="#stay" String="\bend\s+switch\b" endRegion="regSwitch"/>
    1.59 -			<RegExpr attribute="Keyword" context="#stay" String="\bswitch\b" beginRegion="regSwitch"/>
    1.60 -			
    1.61 -			<RegExpr attribute="Keyword" context="#stay" String="\bend\s+for\b" endRegion="regFor"/>
    1.62 -			<RegExpr attribute="Keyword" context="#stay" String="\bfor\b" beginRegion="regFor"/>
    1.63 -
    1.64 -			<RegExpr attribute="Keyword" context="#stay" String="\belsif\b" endRegion="regIf" beginRegion="regIf"/>
    1.65 -			<RegExpr attribute="Keyword" context="#stay" String="\belse\b" endRegion="regIf" beginRegion="regIf"/>
    1.66 -			<RegExpr attribute="Keyword" context="#stay" String="\bend\s+if\b" endRegion="regIf"/>
    1.67 -			<RegExpr attribute="Keyword" context="#stay" String="\bif\b" beginRegion="regIf"/>
    1.68 -			
    1.69 -			<keyword attribute="Keyword" context="IfDef" String="ifdefs" endRegion="regIfDef" beginRegion="regIfDef"/>
    1.70 -			
    1.71 -			<RegExpr attribute="Keyword" context="#stay" String="\bend\s+ifdef\b" endRegion="regIfDef"/>
    1.72 -			<RegExpr attribute="Keyword" context="#stay" String="\belsifdef\b" endRegion="regIfDef" beginRegion="regIfDef"/>
    1.73 -			<RegExpr attribute="Keyword" context="#stay" String="\belsedef\b" endRegion="regIfDef" beginRegion="regIfDef"/>
    1.74 -			<RegExpr attribute="Keyword" context="#stay" String="\bifdef\b" beginRegion="regIfDef"/>
    1.75 -
    1.76 -			<RegExpr attribute="Keyword" context="#stay" String="\bend\s+function\b" endRegion="regFunction"/>
    1.77 -			<RegExpr attribute="Keyword" context="#stay" String="\bfunction\b" beginRegion="regFunction"/>
    1.78 -
    1.79 -			<RegExpr attribute="Keyword" context="#stay" String="\bend\s+procedure\b" endRegion="regProcedure"/>
    1.80 -			<RegExpr attribute="Keyword" context="#stay" String="\bprocedure\b" beginRegion="regProcedure"/>
    1.81 -
    1.82 -			<RegExpr attribute="Keyword" context="#stay" String="\bend\s+while\b" endRegion="regWhile"/>
    1.83 -			<RegExpr attribute="Keyword" context="#stay" String="\bwhile\b" beginRegion="regWhile"/>
    1.84 -
    1.85 -			<RegExpr attribute="Keyword" context="#stay" String="\bend\s+type\b" endRegion="regType"/>
    1.86 -			<RegExpr attribute="Keyword" context="#stay" String="\btype\b" beginRegion="regType"/>
    1.87 -			
    1.88 -			<RegExpr attribute="Keyword" context="#stay" String="\bend\s+enum\s+type\b" endRegion="regType"/>
    1.89 -			<RegExpr attribute="Keyword" context="#stay" String="\benum\s+type\b" beginRegion="regType"/>
    1.90 -			
    1.91 -			<RegExpr attribute="Keyword" context="#stay" String="\bend\s+loop\b" endRegion="regLoop"/>
    1.92 -			<RegExpr attribute="Keyword" context="#stay" String="\bend\sloop\b" endRegion="regLoop"/>
    1.93 -
    1.94 +			<keyword String="end_block" endRegion="regBlock" context="End Block" attribute="Keyword"/>
    1.95 +			<keyword String="start_block" beginRegion="regBlock" attribute="Keyword" context="#stay"/>
    1.96 +			<keyword String="stop_start_block" endRegion="regBlock" beginRegion="regBlock" attribute="Keyword" context="#stay"/>
    1.97 +			<keyword String="start_block" beginRegion="regBlock" attribute="Keyword" context="#stay"/>
    1.98 +			<keyword String="switch_block" beginRegion="regSwitch" attribute="Keyword" context="#stay"/>
    1.99  			<keyword attribute="Keyword" String="with_without" context="With Directive" firstNonSpace="true"/>
   1.100  			
   1.101  			<keyword attribute="Keyword" context="#stay" String="keywords"/>
   1.102 @@ -307,8 +304,17 @@
   1.103  			<AnyChar String=",./+=-*!&amp;:|[]&lt;&gt;" attribute="Symbol" context="#stay"/>
   1.104  			<DetectChar attribute="Symbol" char="{" context="#stay" beginRegion="regSequence"/>
   1.105  			<DetectChar attribute="Symbol" char="}" context="#stay" endRegion="regSequence"/>
   1.106 +			
   1.107 +			
   1.108  		</context>
   1.109 -
   1.110 +		
   1.111 +		<context name="End Block" attribute="Normal Text" lineEndContext="#stay">
   1.112 +			<DetectSpaces/>
   1.113 +			<keyword String="blocks" attribute="Keyword" context="#pop"/>
   1.114 +			<RegExpr String="\bswitch\b" attribute="Keyword" context="#pop" endRegion="regSwitch"/>
   1.115 +			<RegExpr String="." attribute="Error"/>
   1.116 +		</context>
   1.117 +		
   1.118  		<context attribute="String" lineEndContext="#stay" name="String">
   1.119  		  <HlCStringChar attribute="String Char" context="#stay"/>
   1.120  		  <DetectChar attribute="String" context="#pop" char="&quot;"/>
   1.121 @@ -404,8 +410,9 @@
   1.122  			<keyword String="memstruct_primitives" attribute="Type" context="#stay"/>
   1.123  			<DetectChar context="#pop" char=")"/>
   1.124  		</context>
   1.125 +		
   1.126  	</contexts>
   1.127 -
   1.128 +	
   1.129  	<itemDatas>
   1.130  		<itemData name="Normal Text"     defStyleNum="dsNormal" />
   1.131  		<itemData name="Keyword"         defStyleNum="dsKeyword" />

SCM Home | OpenEuphoria.org Home