File tree 2 files changed +7
-5
lines changed
2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -10,10 +10,10 @@ multiline_comment = _{ "/*" ~ (!("*/") ~ ANY)* ~ "*/"}
10
10
string_type = _{
11
11
("\"" ~ (!(newline | "\"") ~ ANY)* ~ "\"")
12
12
}
13
- key = _ { string }
13
+ key = @ { string }
14
14
key_assigment = ${ (" ")* ~ "=" ~ (" ")* }
15
- string = $ { string_type }
16
- pair = $ { key ~ key_assigment ~ string }
15
+ string = @ { string_type }
16
+ pair = _ { key ~ key_assigment ~ string }
17
17
18
18
line = _{ pair | comment | space | other | newline }
19
19
item = _{ SOI ~ line* ~ EOI }
Original file line number Diff line number Diff line change @@ -26,7 +26,8 @@ mod tests {
26
26
27
27
"NSCameraUsageDescription" = "开启Wi-Fi后继续使用";
28
28
// 单行comment
29
- "中文key测试" = "开启定位权限";
29
+ "中文key测试" = "开启GPS定位权限";
30
+ "60分" = "60分";
30
31
"### ;
31
32
32
33
let expect = r###"
@@ -40,7 +41,8 @@ mod tests {
40
41
41
42
"NSCameraUsageDescription" = "开启 Wi-Fi 后继续使用";
42
43
// 单行 comment
43
- "中文 key 测试" = "开启定位权限";
44
+ "中文key测试" = "开启 GPS 定位权限";
45
+ "60分" = "60 分";
44
46
"### ;
45
47
46
48
assert_eq ! ( expect, format_strings( example) . to_string( ) ) ;
You can’t perform that action at this time.
0 commit comments