File: yaml.jsf

package info (click to toggle)
joe 4.6-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 10,308 kB
  • sloc: ansic: 51,623; sh: 4,358; makefile: 149; csh: 26
file content (152 lines) | stat: -rw-r--r-- 2,666 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
# JOE syntax highlight file for YAML
# by Christian Nicolai (http://mycrobase.de)

# TODO: Could use numbers vs strings for Constant, but it's a bit of work
#       Array elements with colons get misidentified as keys

=Idle
=Comment
=Constant
=String		+Constant
=Number		+Constant
=Escape
=StringEscape	+Escape +String
=Type
=Bad
=Brace

=Key		+Attr +Type +String
=Directive	+Keyword
=Reference	+Label +DefinedIdent
=LocalType	+DefinedType +Type
=BlockDelim	+Operator

=BadTab		+Bad

:line_start Idle
	*		maybe_key	noeat
	"\t"		bad_tab		recolor=-1
	" "		line_start

:idle Constant
	*		idle
	"\n"		line_start
	"%"		directive	recolor=-1
	"#"		line_comment	recolor=-1
	"'"		string_sq_1	recolor=-1
	"\""		string_dq_1	recolor=-1
	"{[]}"		brace		recolor=-1
	"."		maybe_block_end1
	"*&"		maybe_reference
	"!"		maybe_typecast

:maybe_key Idle
	*		maybe_key1	recolor=-1 mark
	"\n%#'\"{[]}*&!"	idle		noeat
	"-"		maybe_block1	mark

:maybe_key1 Constant
	*		idle		noeat
	":"		key
	" a-zA-Z0-9_-"	maybe_key1

# necessary to include the :
:key Key
	*		key_end		noeat recolormark

:key_end Key
	*		idle		noeat

# mark bad tabs until the first non-whitespace
:bad_tab BadTab
	*		line_start	noeat

:line_comment Comment comment
	*		line_comment
	"\n"		line_start
	"BFHNTX"	line_comment	noeat call=comment_todo.comment_todo()

:brace Brace
	*		idle		noeat

:directive Directive
	*		directive
	"\n"		line_start

:string_sq_1 String string
	*		string_sq	noeat

:string_sq String string
	*		string_sq
	"\'"		idle
	"\\"		string_sq_esc	recolor=-1

:string_sq_esc StringEscape string
	*		string_sq
	"\n"		string_sq	recolor=-2

:string_dq_1 String string
	*		string_dq	noeat

:string_dq String string
	*		string_dq
	"\""		idle
	"\\"		string_dq_esc	recolor=-1

:string_dq_esc StringEscape string
	*		string_dq
	"\n"		string_dq	recolor=-2

:maybe_block1 Constant
	*		maybe_key1	noeat
	"-"		maybe_block2

:maybe_block2 Constant
	*		maybe_key1	noeat
	"-"		block		recolor=-3

:block BlockDelim
	*		idle		noeat

:maybe_block_end1 String string
	*		idle		noeat
	"."		maybe_block_end2

:maybe_block_end2 String string
	*		idle		noeat
	"."		block_end	recolor=-3

:block_end BlockDelim
	*		idle		noeat

:maybe_reference Constant
	*		idle
	"a-zA-Z_"	reference	recolor=-2

:reference Reference
	*		idle		noeat
	"a-zA-Z0-9_"	reference

:maybe_typecast Constant
	*		idle		noeat
	"a-zA-Z_"	local_type	recolor=-1
	"!"		builtin_type

:builtin_type Idle
	*		idle		noeat
	"a-zA-Z"	builtin_type2	buffer

:builtin_type2 Idle
	*		idle		noeat strings
	"str"		type
	"float"		type
	"binary"	type
done
	"a-zA-Z_"	builtin_type2

:type Type
	*		idle		noeat

:local_type LocalType
	*		idle		noeat
	"a-zA-Z_"	local_type