This commit is contained in:
PoiScript 2019-01-10 20:58:13 +08:00
parent a85efe2056
commit 6f7fa9c920
16 changed files with 622 additions and 229 deletions

View file

@ -12,25 +12,13 @@ impl<'a> Keyword<'a> {
let end = eol!(src);
if end == key + 1 {
Some((
Keyword {
key: &src[2..key],
value: "",
},
end,
))
} else {
let space = position!(src, key + 1, |c| !c.is_ascii_whitespace());
Some((
Keyword {
key: &src[2..key],
value: &src[space..end],
},
end,
))
}
Some((
Keyword {
key: &src[2..key],
value: &src[key + 1..end].trim(),
},
end,
))
}
}