1" Vim syntax file
2" Language:	fdcc or locale files
3" Maintainer:	Dwayne Bailey <dwayne@translate.org.za>
4" Last Change:	2004 May 16
5" Remarks:      FDCC (Formal Definitions of Cultural Conventions) see ISO TR 14652
6
7" For version 5.x: Clear all syntax items
8" For version 6.x: Quit when a syntax file was already loaded
9if version < 600
10  syntax clear
11elseif exists("b:current_syntax")
12  finish
13endif
14
15syn sync minlines=150
16setlocal iskeyword+=-
17
18" Numbers
19syn match fdccNumber /[0-9]*/ contained
20
21" Unicode codings and strings
22syn match fdccUnicodeInValid /<[^<]*>/ contained
23syn match fdccUnicodeValid /<U[0-9A-F][0-9A-F][0-9A-F][0-9A-F]>/ contained
24syn region fdccString start=/"/ end=/"/ contains=fdccUnicodeInValid,fdccUnicodeValid
25
26" Valid LC_ Keywords
27syn keyword fdccKeyword escape_char comment_char
28syn keyword fdccKeywordIdentification title source address contact email tel fax language territory revision date category
29syn keyword fdccKeywordCtype copy space translit_start include translit_end outdigit class
30syn keyword fdccKeywordCollate copy script order_start order_end collating-symbol reorder-after reorder-end collating-element symbol-equivalence
31syn keyword fdccKeywordMonetary copy int_curr_symbol currency_symbol mon_decimal_point mon_thousands_sep mon_grouping positive_sign negative_sign int_frac_digits frac_digits p_cs_precedes p_sep_by_space n_cs_precedes n_sep_by_space p_sign_posn n_sign_posn int_p_cs_precedes int_p_sep_by_space int_n_cs_precedes int_n_sep_by_space  int_p_sign_posn int_n_sign_posn
32syn keyword fdccKeywordNumeric copy decimal_point thousands_sep grouping
33syn keyword fdccKeywordTime copy abday day abmon mon d_t_fmt d_fmt t_fmt am_pm t_fmt_ampm date_fmt era_d_fmt first_weekday first_workday week cal_direction time_zone era alt_digits era_d_t_fmt
34syn keyword fdccKeywordMessages copy yesexpr noexpr yesstr nostr
35syn keyword fdccKeywordPaper copy height width
36syn keyword fdccKeywordTelephone copy tel_int_fmt int_prefix tel_dom_fmt int_select
37syn keyword fdccKeywordMeasurement copy measurement
38syn keyword fdccKeywordName copy name_fmt name_gen name_mr name_mrs name_miss name_ms
39syn keyword fdccKeywordAddress copy postal_fmt country_name country_post country_ab2 country_ab3  country_num country_car  country_isbn lang_name lang_ab lang_term lang_lib
40
41" Comments
42syn keyword fdccTodo TODO FIXME contained
43syn match fdccVariable /%[a-zA-Z]/ contained
44syn match fdccComment /[#%].*/ contains=fdccTodo,fdccVariable
45
46" LC_ Groups
47syn region fdccBlank matchgroup=fdccLCIdentification start=/^LC_IDENTIFICATION$/ end=/^END LC_IDENTIFICATION$/ contains=fdccKeywordIdentification,fdccString,fdccComment
48syn region fdccBlank matchgroup=fdccLCCtype start=/^LC_CTYPE$/ end=/^END LC_CTYPE$/ contains=fdccKeywordCtype,fdccString,fdccComment,fdccUnicodeInValid,fdccUnicodeValid
49syn region fdccBlank matchgroup=fdccLCCollate start=/^LC_COLLATE$/ end=/^END LC_COLLATE$/ contains=fdccKeywordCollate,fdccString,fdccComment,fdccUnicodeInValid,fdccUnicodeValid
50syn region fdccBlank matchgroup=fdccLCMonetary start=/^LC_MONETARY$/ end=/^END LC_MONETARY$/ contains=fdccKeywordMonetary,fdccString,fdccComment,fdccNumber
51syn region fdccBlank matchgroup=fdccLCNumeric start=/^LC_NUMERIC$/ end=/^END LC_NUMERIC$/ contains=fdccKeywordNumeric,fdccString,fdccComment,fdccNumber
52syn region fdccBlank matchgroup=fdccLCTime start=/^LC_TIME$/ end=/^END LC_TIME$/ contains=fdccKeywordTime,fdccString,fdccComment,fdccNumber
53syn region fdccBlank matchgroup=fdccLCMessages start=/^LC_MESSAGES$/ end=/^END LC_MESSAGES$/ contains=fdccKeywordMessages,fdccString,fdccComment
54syn region fdccBlank matchgroup=fdccLCPaper start=/^LC_PAPER$/ end=/^END LC_PAPER$/ contains=fdccKeywordPaper,fdccString,fdccComment,fdccNumber
55syn region fdccBlank matchgroup=fdccLCTelephone start=/^LC_TELEPHONE$/ end=/^END LC_TELEPHONE$/ contains=fdccKeywordTelephone,fdccString,fdccComment
56syn region fdccBlank matchgroup=fdccLCMeasurement start=/^LC_MEASUREMENT$/ end=/^END LC_MEASUREMENT$/ contains=fdccKeywordMeasurement,fdccString,fdccComment,fdccNumber
57syn region fdccBlank matchgroup=fdccLCName start=/^LC_NAME$/ end=/^END LC_NAME$/ contains=fdccKeywordName,fdccString,fdccComment
58syn region fdccBlank matchgroup=fdccLCAddress start=/^LC_ADDRESS$/ end=/^END LC_ADDRESS$/ contains=fdccKeywordAddress,fdccString,fdccComment,fdccNumber
59
60
61" For version 5.7 and earlier: only when not done already
62" For version 5.8 and later: only when an item doesn't have highlighting yet
63if version >= 508 || !exists("did_fdcc_syn_inits")
64  if version < 508
65    let did_fdcc_syn_inits = 1
66    command -nargs=+ HiLink hi link <args>
67  else
68    command -nargs=+ HiLink hi def link <args>
69  endif
70
71  HiLink fdccBlank		 Blank
72
73  HiLink fdccTodo		 Todo
74  HiLink fdccComment		 Comment
75  HiLink fdccVariable		 Type
76
77  HiLink fdccLCIdentification	 Statement
78  HiLink fdccLCCtype		 Statement
79  HiLink fdccLCCollate		 Statement
80  HiLink fdccLCMonetary		 Statement
81  HiLink fdccLCNumeric		 Statement
82  HiLink fdccLCTime		 Statement
83  HiLink fdccLCMessages		 Statement
84  HiLink fdccLCPaper		 Statement
85  HiLink fdccLCTelephone	 Statement
86  HiLink fdccLCMeasurement	 Statement
87  HiLink fdccLCName		 Statement
88  HiLink fdccLCAddress		 Statement
89
90  HiLink fdccUnicodeInValid	 Error
91  HiLink fdccUnicodeValid	 String
92  HiLink fdccString		 String
93  HiLink fdccNumber		 Blank
94
95  HiLink fdccKeywordIdentification fdccKeyword
96  HiLink fdccKeywordCtype	   fdccKeyword
97  HiLink fdccKeywordCollate	   fdccKeyword
98  HiLink fdccKeywordMonetary	   fdccKeyword
99  HiLink fdccKeywordNumeric	   fdccKeyword
100  HiLink fdccKeywordTime	   fdccKeyword
101  HiLink fdccKeywordMessages	   fdccKeyword
102  HiLink fdccKeywordPaper	   fdccKeyword
103  HiLink fdccKeywordTelephone	   fdccKeyword
104  HiLink fdccKeywordMeasurement    fdccKeyword
105  HiLink fdccKeywordName	   fdccKeyword
106  HiLink fdccKeywordAddress	   fdccKeyword
107  HiLink fdccKeyword		   Identifier
108
109  delcommand HiLink
110endif
111
112let b:current_syntax = "fdcc"
113
114" vim: ts=8
115