-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathsyntax_test.awk
86 lines (76 loc) · 2.94 KB
/
syntax_test.awk
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
# SYNTAX TEST "AWK.sublime-syntax"
# <- punctuation.definition.comment.awk
# <- comment.line.number-sign.awk
#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.line.number-sign.awk
function f(x,y){
# <- storage.type.function.awk
# ^ entity.name.function.awk
# ^ punctuation.definition.parameters.begin.awk
# ^ variable.parameter.function.awk
# ^ variable.parameter.function.awk
# ^ punctuation.definition.parameters.end.awk
}
/^ab#$#/gimy {
# <- punctuation.definition.regex.begin.awk
# ^ punctuation.definition.regex.end.awk
# ^^^^ keyword.other.awk
#^^^^^^^^^^^ string.regexp
}
BEGIN {
# <- constant.language.awk
var = 1/4
# ^ keyword.operator.assignment.awk
# ^ constant.numeric.awk
# ^ keyword.operator.arithmetic.awk
# ^ constant.numeric.awk
var = /1\/4/
# ^ keyword.operator.assignment.awk
# ^ punctuation.definition.regex.begin.awk
# ^^^^ string.regexp
# ^ punctuation.definition.regex.end.awk
var = f(1/4,/1\/4/,1/4,/1\/4/)
# ^ keyword.operator.assignment.awk
# ^ constant.numeric.awk
# ^ keyword.operator.arithmetic.awk
# ^ constant.numeric.awk
# ^ punctuation.separator.parameters.awk
# ^ punctuation.definition.regex.begin.awk
# ^^^^ string.regexp
# ^ punctuation.definition.regex.end.awk
# ^ punctuation.separator.parameters.awk
# ^ constant.numeric.awk
# ^ keyword.operator.arithmetic.awk
# ^ constant.numeric.awk
# ^ punctuation.separator.parameters.awk
# ^ punctuation.definition.regex.begin.awk
# ^^^^ string.regexp
# ^ punctuation.definition.regex.end.awk
var = 1 / 4 + 1 / 4
# ^ constant.numeric.awk
# ^ keyword.operator.arithmetic.awk
# ^ constant.numeric.awk
# ^ keyword.operator.arithmetic.awk
# ^ constant.numeric.awk
# ^ keyword.operator.arithmetic.awk
# ^ constant.numeric.awk
var[2,1+4] = 1
# ^ keyword.operator.index.awk
# ^ constant.numeric.awk
# ^ punctuation.separator.index.awk
# ^ keyword.operator.index.awk
# ^ keyword.operator.assignment.awk
# ^ constant.numeric.awk
}
# <- meta.brace.curly.awk
{ line[NR] = $0 } # remember each input line
# ^ meta.brace.curly.awk
# ^ punctuation.definition.comment.awk
BEGIN {
if (/\{\}/) {
# ^^ keyword.control.awk
# ^ punctuation.definition.regex.begin.awk
# ^ punctuation.definition.regex.end.awk
} else {
# ^^^^ keyword.control.awk
}
}