command_feature.test
1.95 KB
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
FOR /l %%a in (5,-1,1) do (TITLE %title% -- closing in %%as)
SET title=%~n0
echo.Hello World
@ECHO OFF
if not defined ProgressFormat set "ProgressFormat=[PPPP]"
EXIT /b
set /a ProgressCnt+=1
IF "%~1" NEQ "" (SET %~1=%new%) ELSE (echo.%new%)
----------------------------------------------------
[
["command", [
["keyword", "FOR"],
["parameter", ["/l"]],
["variable", "%%a"],
["keyword", "in"],
["punctuation", "("],
["number", "5"], ["punctuation", ","],
["number", "-1"], ["punctuation", ","],
["number", "1"], ["punctuation", ")"],
["keyword", "do"]
]],
["punctuation", "("],
["command", [
["keyword", "TITLE"],
["variable", "%title%"],
" -- closing in ",
["variable", "%%as"]
]],
["punctuation", ")"],
["command", [
["keyword", "SET"],
["variable", "title"],
["operator", "="],
["variable", "%~n0"]
]],
["command", [
["keyword", "echo"],
".Hello World"
]],
["operator", "@"],
["command", [
["keyword", "ECHO"],
" OFF"
]],
["command", [
["keyword", "if"],
["keyword", "not"],
["keyword", "defined"],
" ProgressFormat"
]],
["command", [
["keyword", "set"],
["string", "\"ProgressFormat=[PPPP]\""]
]],
["command", [
["keyword", "EXIT"],
["parameter", ["/b"]]
]],
["command", [
["keyword", "set"],
["parameter", ["/a"]],
["variable", "ProgressCnt"],
["operator", "+="],
["number", "1"]
]],
["command", [
["keyword", "IF"],
["string", "\"%~1\""],
["operator", "NEQ"],
["string", "\"\""]
]],
["punctuation", "("],
["command", [
["keyword", "SET"],
["variable", "%~1"],
["operator", "="],
["variable", "%new%"]
]],
["punctuation", ")"],
["command", [
["keyword", "ELSE"]
]],
["punctuation", "("],
["command", [
["keyword", "echo"],
".",
["variable", "%new%"]
]],
["punctuation", ")"]
]
----------------------------------------------------
Checks for commands.