-
Notifications
You must be signed in to change notification settings - Fork 1
/
manifest.pest
72 lines (64 loc) · 1.94 KB
/
manifest.pest
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
//
// Created by intellij-pest on 2021-04-18
// manifest
// Author: Till Wegmueller
//
action_set = @{"set"}
action_depend = @{"depend"}
action_dir = @{"dir"}
action_file = @{"file"}
action_license = @{"license"}
action_hardlink = @{"hardlink"}
action_link = @{"link"}
action_driver = @{"driver"}
action_group = @{"group"}
action_user = @{"user"}
action_legacy = @{"legacy"}
action_name = @{
action_set |
action_depend |
action_dir |
action_file |
action_license |
action_hardlink |
action_link |
action_driver |
action_group |
action_user |
action_legacy
}
quoted_string = @{
"\""
~ quoted_character*
~ "\""
}
quoted_character = {
!"\"" // if the following text is not three apostrophes
~ ANY // then consume one character
}
COMMENT = _{
"#"
~ comment_character*
~ NEWLINE
}
comment_character = {
!NEWLINE // if the following text is not three apostrophes
~ ANY // then consume one character
}
transform_character = {
!">" // if the following text is not three apostrophes
~ ANY // then consume one character
}
unicode_character = {
!(WHITESPACE | NEWLINE) // if the following text is not three apostrophes
~ ANY // then consume one character
}
WHITESPACE = _{ "\\" ~ NEWLINE | " " | "\t" }
transform_action = @{ transform_character*}
transform = {"<transform " ~ action_name ~ property+ ~ "->" ~ transform_action ~ ">" }
property_name = @{ ( ASCII_ALPHANUMERIC | "." | "_" | "-" | "/" )+ }
property_value = @{ quoted_string | unicode_character+ }
payload = @{ property_value }
property = { property_name ~ "=" ~ property_value }
action = { action_name ~ (property | payload) ~ property* ~ (NEWLINE | EOI) }
manifest = { SOI ~ ( NEWLINE | transform | action )+ ~ EOI }