cortav  Check-in [6c198bdce0]

Overview
Comment:many fixes and updates to kate syntax
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 6c198bdce03741956d8d4b461a1fbf084a385b0b589adce91a0590fda9dc4a56
User & Date: lexi on 2022-09-09 01:12:24
Other Links: manifest | tags
Context
2022-09-09
01:39
update docs check-in: 7b6c406de4 user: lexi tags: trunk
01:12
many fixes and updates to kate syntax check-in: 6c198bdce0 user: lexi tags: trunk
2022-09-08
23:37
progress on resources + block macros; fix toc bug; add uri, fetch scaffolding, and b64e to sirsem check-in: 3ee2195d4f user: lexi tags: trunk
Changes

Modified cortav.lua from [cd83b5f5a6] to [3b9ae546e1].

  1282   1282   				kind = 'inline-rsrc';
  1283   1283   				rsrc = rsrc;
  1284   1284   				indent = nil;
  1285   1285   				depth = 0;
  1286   1286   			}
  1287   1287   		end
  1288   1288   	end};
  1289         -	{seq='&$', fn=blockwrap(function(s,c)
  1290         -		local id, args = s:match('^&$([^%s]+)%s?(.-)$')
         1289  +	{seq='$', fn=blockwrap(function(s,c)
         1290  +		local id, args = s:match('^%$([^%s]+)%s?(.-)$')
  1291   1291   		if id == nil or id == '' then
  1292   1292   			c:fail 'malformed macro block'
  1293   1293   		end
  1294   1294   		local argv = ss.str.split(c.doc.enc, args, c.doc.enc.encodeUCS'|', {esc=true})
  1295   1295   		return {
  1296   1296   			kind = 'macro';
  1297   1297   			macro = id;

Modified desk/cortav.xml from [bda20d41cd] to [bf85cd3996].

    40     40   				<RegExpr String='\\.' attribute='Escaped Char'/>
    41     41   				<RegExpr attribute='Section Cue' context='sec-ident' String='(#|ยง)+' firstNonSpace='true' />
    42     42   				<StringDetect String='~~~' attribute='Literal Block Cue' firstNonSpace='true' context='literal-block-cue'/>
    43     43   				<RegExpr attribute='List' String='[\*:]+' firstNonSpace='true' context='text' />
    44     44   				<Detect2Chars char='%' char1='%' attribute='Comment' context='comment'/>
    45     45   				<Detect2Chars char='%' char1='!' attribute='Critical Directive Cue' context='directive'/>
    46     46   				<DetectChar char='%' attribute='Directive Cue' context='directive'/>
    47         -				<DetectChar char='@' attribute='Resource Cue' context='resource'/>
    48         -				<DetectChar char='&#9;' attribute='Normal Text' context='refdef-id'/>
           47  +				<DetectChar char='@' attribute='Resource Cue' context='resource-ident'/>
           48  +				<DetectChar char='$' attribute='Deref Cue' context='block-macro-ident'/>
           49  +				<DetectChar char='&amp;' attribute='Deref Cue' context='block-deref-ident'/>
           50  +				<Detect2Chars char='&#9;' char1='&#9;' context='refdef'/>
           51  +				<DetectChar char='&#9;' context='refdef-id'/>
           52  +
           53  +				<Detect2Chars char='|' char1=':' attribute="Section Cue" context='#pop!table' />
           54  +				<Detect2Chars char='+' char1=':' attribute="Section Cue" context='#pop!table' />
           55  +				<AnyChar String='|+' attribute="Section Cue" context='#pop!table' />
           56  +				<DetectSpaces context="#pop!init"/>
    49     57   			</context>
    50     58   
    51     59   			<context name='comment' attribute='Comment' lineEndContext='#pop'>
    52     60   			</context>
    53     61   			<context name='error' attribute='Error' lineEndContext='#pop'>
    54     62   			</context>
    55     63   
    56         -			<context name='resource' attribute='Resource Identifier' lineEndContext='#pop'>
    57         -				<DetectSpaces context='#pop!error' attribute='Error'/>
           64  +			<context name='resource-ident' attribute='Resource Identifier' lineEndContext='#pop'>
           65  +				<DetectSpaces context='#pop!resource-line'/>
           66  +			</context>
           67  +			<context name='resource-line' attribute='Identifier' lineEndContext='#pop'>
           68  +				<RegExpr String='\{$' attribute="Span Cue" context='#pop!resource-inline'/>
           69  +			</context>
           70  +			<context name='resource-inline' attribute='Literal Block' lineEndContext='#pop!resource-inline'>
           71  +				<RegExpr String='^}$' attribute="Span Cue" context='#pop'/>
    58     72   			</context>
    59     73   
    60     74   			<context name='sec-ident' attribute='Identifier' lineEndContext='#pop'>
    61     75   				<DetectSpaces context='#pop!sec' attribute='Normal Text'/>
    62     76   			</context>
    63     77   
    64     78   			<context name='sec' attribute='Header' lineEndContext='#pop'>
................................................................................
    82     96   				<DetectChar attribute='Macro Delimiter' context='macro' char='{'/>
    83     97   			</context>
    84     98   
    85     99   			<context name='span' attribute='Styled Text' lineEndContext='#pop'>
    86    100   				<IncludeRules context='text'/>
    87    101   				<DetectChar attribute='Span Delimiter' context='#pop' char=']'/>
    88    102   			</context>
          103  +
          104  +			<context name='table' attribute='Normal Text' lineEndContext='#pop'>
          105  +				<IncludeRules context='text'/>
          106  +				<StringDetect attribute='Section Cue' String=':|:'/>
          107  +				<StringDetect attribute='Section Cue' String=':+:'/>
          108  +				<Detect2Chars attribute='Section Cue' char=':' char1='|'/>
          109  +				<Detect2Chars attribute='Section Cue' char=':' char1='+'/>
          110  +				<Detect2Chars attribute='Section Cue' char='|' char1=':'/>
          111  +				<Detect2Chars attribute='Section Cue' char='+' char1=':'/>
          112  +				<AnyChar attribute='Section Cue' String='|+'/>
          113  +			</context>
    89    114   
    90    115   			<context name='macro' attribute='Macro' lineEndContext='#pop'>
    91    116   				<DetectSpaces context='#pop!macro-body'/>
    92    117   				<DetectChar attribute='Macro Delimiter' char='}' context='#pop'/>
    93    118   			</context>
    94    119   
    95    120   			<context name='macro-body' attribute='Styled Text' lineEndContext='#pop'>
    96         -				<RegExpr String='\\.' attribute='Escaped Char'/>
          121  +				<IncludeRules context='text'/>
    97    122   				<DetectChar attribute='Field Delimiter' char='|'/>
    98    123   				<DetectChar attribute='Macro Delimiter' char='}' context='#pop'/>
    99         -				<IncludeRules context='span'/>
          124  +			</context>
          125  +
          126  +			<context name='block-macro-ident' attribute='Macro' lineEndContext='#pop'>
          127  +				<DetectSpaces context='#pop!block-macro'/>
          128  +				<IncludeRules context='text'/>
          129  +			</context>
          130  +
          131  +			<context name='block-macro' attribute='Styled Text' lineEndContext='#pop'>
          132  +				<RegExpr String='\\.' attribute='Escaped Char'/>
          133  +				<DetectChar attribute='Field Delimiter' char='|'/>
          134  +				<IncludeRules context='text'/>
          135  +			</context>
          136  +
          137  +			<context name='block-deref-ident' attribute='Identifier' lineEndContext='#pop'>
          138  +				<DetectSpaces context='#pop!block-deref'/>
          139  +			</context>
          140  +
          141  +			<context name='block-deref' attribute='Styled Text' lineEndContext='#pop'>
          142  +				<IncludeRules context='text'/>
   100    143   			</context>
   101    144   
   102    145   			<context name='span-emph' attribute='Emphatic Text' lineEndContext='#pop'>
   103    146   				<IncludeRules context='span'/>
   104    147   			</context>
   105    148   
   106    149   			<context name='span-strong' attribute='Strong Text' lineEndContext='#pop'>
................................................................................
   109    152   
   110    153   			<context name='span-del' attribute='Deleted Text' lineEndContext='#pop'>
   111    154   				<IncludeRules context='span'/>
   112    155   			</context>
   113    156   
   114    157   			<context name='span-cue' attribute='Span Cue' lineEndContext='#pop' fallthroughContext="error">
   115    158   				<StringDetect attribute='Span Cue' String='`\' context='#pop!flat-span' />
   116         -				<StringDetect attribute='Span Cue' String='\\' context='#pop!flat-span' />
          159  +				<StringDetect attribute='Span Cue' String='"' context='#pop!flat-span' />
   117    160   
   118    161   				<DetectChar   attribute='Span Cue' char='!' context='#pop!span-emph' />
   119    162   				<DetectChar   attribute='Span Cue' char='*' context='#pop!span-strong' />
   120    163   				<DetectChar   attribute='Span Cue' char='~' context='#pop!span-del' />
   121    164   
   122    165   				<AnyChar      attribute='Span Cue' String='`$+๐Ÿ”’' context='#pop!span' />
   123    166   				<StringDetect attribute='Span Cue' String='โ†’' context='#pop!ref' />
   124    167   				<StringDetect attribute='Span Cue' String='๐Ÿ”—' context='#pop!ref' />
   125    168   				<DetectChar   attribute='Span Cue' char='>' context='#pop!ref' />
   126    169   				<DetectChar   attribute='Span Cue' char='^' context='#pop!ref' />
   127         -				<DetectChar   attribute='Span Cue' char='"' context='#pop!ref' />
   128    170   				<DetectChar   attribute='Span Cue' char='&amp;' context='#pop!ref' />
   129    171   				<DetectChar   attribute='Span Cue' char='#' context='#pop!var-ref' />
   130    172   				<DetectChar   attribute='Span Cue' char='\' context='#pop!flat-span' />
          173  +				<DetectChar   attribute='Span Cue' char='=' context='#pop!inline-math' />
   131    174   				<Detect2Chars attribute='Comment' char='%' char1='%' context='#pop!inline-comment' />
   132    175   				<Detect2Chars attribute='Critical Directive Cue' char='%' char1='!' context='#pop!inline-directive' />
   133    176   				<DetectChar   attribute='Directive Cue' char='%' context='#pop!inline-directive' />
   134    177   			</context>
   135    178   
   136    179   			<context name='flat-span' attribute='Unstyled Text' lineEndContext='#pop'>
   137    180   				<DetectChar attribute='Unstyled Text' context='flat-span' char='['/>
................................................................................
   144    187   			</context>
   145    188   
   146    189   			<context name='inline-directive' attribute='Directive' lineEndContext='#pop'>
   147    190   				<IncludeRules context='flat-span'/>
   148    191   				<AnyChar String=".:!#$%@~'&quot;" attribute='Directive Cue'/>
   149    192   				<DetectSpaces context='#pop!span'/>
   150    193   			</context>
          194  +
          195  +			<context name='inline-math' attribute='Emphatic Text' lineEndContext='#pop'>
          196  +				<RegExpr String="\b[\d.,]+" attribute="Literal Block"/>
          197  +				<RegExpr String="\b0x[a-fA-F\d.,]+" attribute="Literal Block"/>
          198  +				<RegExpr String="\b0o[0-7]+" attribute="Literal Block"/>
          199  +				<RegExpr String="\b\w+\(" attribute="Resource Identifier"/>
          200  +				<DetectChar char=')' attribute="Resource Identifier"/>
          201  +				<AnyChar String="+-/รท*ร—=!%^&amp;|&#172;?" attribute="Strong Text"/>
          202  +				<IncludeRules context='span'/>
          203  +			</context>
   151    204   
   152    205   			<context name='ref' attribute='Reference' lineEndContext='#pop'>
   153    206   				<IncludeRules context='flat-span'/>
   154    207   				<DetectSpaces context='#pop!span'/>
   155    208   			</context>
   156    209   
   157    210   			<context name='var-ref' attribute='Reference' lineEndContext='#pop'>
................................................................................
   174    227   			<itemData name='Normal Text' defStyleNum='dsNormal'/>
   175    228   			<itemData name='Styled Text' defStyleNum='dsNormal'/>
   176    229   			<itemData name='Emphatic Text' defStyleNum='dsNormal' italic='true'/>
   177    230   			<itemData name='Strong Text' defStyleNum='dsNormal' bold='true'/>
   178    231   			<itemData name='Deleted Text' defStyleNum='dsNormal' strikeOut='true'/>
   179    232   				
   180    233   			<itemData name='Section Cue' defStyleNum='dsKeyword' bold='true'/>
          234  +			<itemData name='Deref Cue' defStyleNum='dsKeyword' bold='true'/>
   181    235   			<itemData name='Header' defStyleNum='dsControlFlow' underline='true'/>
   182    236   			<itemData name='Identifier' defStyleNum='dsVariable'/>
   183    237   
   184    238   			<itemData name='Unstyled Text' defStyleNum='dsVerbatimString'/>
   185    239   			<itemData name='Escaped Char' defStyleNum='dsSpecialChar'/>
   186    240   			<itemData name='Reference' defStyleNum='dsControlFlow' underline='true'/>
   187    241   			<itemData name='Span Cue' defStyleNum='dsKeyword' bold='true'/>

Modified ext/toc.lua from [214c9479d0] to [38c6bac1b2].

   205    205   				end
   206    206   
   207    207               local function scandoc(doc, depth)
   208    208   	            for i, sec in ipairs(doc.secorder) do
   209    209   						table.insert(all, {ref = sec, depth = sec.depth + depth})
   210    210   						for j, block in ipairs(sec.blocks) do
   211    211   							if blockHasSubdoc(block) then
   212         -								scandoc(block.doc, depth + sec.depth-1)
          212  +								scandoc(block.doc, depth + sec.depth-10)
   213    213   							end
   214    214   						end
   215    215   	            end
   216    216               end
   217    217   
   218    218   				scandoc(job.doc,0)
   219    219