]> gitweb.factorcode.org Git - factor.git/blob - basis/xmode/modes/roff.xml
xmode.modes: updating with recent xmode files
[factor.git] / basis / xmode / modes / roff.xml
1 <?xml version="1.0"?>
2 <!DOCTYPE MODE SYSTEM "xmode.dtd">
3
4 <!--
5  Mode for the roff family of text processing systems.
6  By Kostas Michalopoulos.
7  
8  Known issues:
9    - In escape sequences with arguments, only single and double quotes are
10      recognized while the roff language allows for any character that doesn't
11      appear in the argument.
12    - Double quotes are not really required for textual macros (like .SH in man
13      pages), but the arguments are still text. However they are shown as
14      keywords and non-textual coloring is done. Not really a problem for most
15      roff documents (ie. manpages) though.
16    - Not sure if the last SPAN_REGEXP in ROFF_ESCAPE is a good idea...
17  
18  Recommended catalog entry:
19  
20    <MODE NAME="roff"
21          FILE="roff.xml"
22          FILE_NAME_GLOB="*.{1,2,3,4,5,6,7,8,9,me,ms,mm,mom,tmac}" />
23 -->
24
25 <MODE>
26     <PROPS>
27         <PROPERTY NAME="noTabs" VALUE="true"/>
28         <PROPERTY NAME="lineComment" VALUE="\\#"/>
29         <PROPERTY NAME="wordBreakChars" VALUE=",+-=&lt;&gt;/?^&amp;*"/>
30     </PROPS>
31     
32     <RULES HIGHLIGHT_DIGITS="FALSE">
33         <EOL_SPAN TYPE="COMMENT1">\#</EOL_SPAN>
34         <EOL_SPAN TYPE="COMMENT1">\"</EOL_SPAN>
35         <EOL_SPAN_REGEXP TYPE="KEYWORD1" AT_LINE_START="TRUE" DELEGATE="ROFF_ESCAPE">\.\s*\w+</EOL_SPAN_REGEXP>
36         <SEQ_REGEXP HASH_CHAR="\" TYPE="KEYWORD3">\\((\p{Graph}\[[^\]]*\])|(\p{Graph}((\'.*\')|(\".*\")))|(\p{Graph}{1,2}))</SEQ_REGEXP>
37     </RULES>
38     
39     <RULES SET="ROFF_ESCAPE">
40         <EOL_SPAN TYPE="COMMENT1">\"</EOL_SPAN>
41         <SPAN TYPE="LITERAL1" NO_LINE_BREAK="TRUE">
42             <BEGIN>"</BEGIN>
43             <END>"</END>
44         </SPAN>
45         <SPAN_REGEXP HASH_CHARS="0123456789" TYPE="DIGIT" NO_LINE_BREAK="TRUE">
46             <BEGIN>(\d|\.)+[icpPszfmnvM]?</BEGIN>
47             <END> </END>
48         </SPAN_REGEXP>
49         <SPAN_REGEXP HASH_CHARS="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstwxyz" TYPE="KEYWORD2" NO_LINE_BREAK="TRUE">
50             <BEGIN>\w+</BEGIN>
51             <END> </END>
52         </SPAN_REGEXP>
53     </RULES>
54 </MODE>
55