Update parser to treat all string rvalues as templates.

This commit is contained in:
Tom Alexander 2020-05-30 15:49:13 -04:00
parent 3352b777ae
commit 581f9f7e97
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE

View File

@ -111,13 +111,12 @@ pub struct Partial<'a> {
#[derive(Clone, Debug, PartialEq)]
pub enum OwnedLiteral {
LPositiveInteger(u64),
LString(String),
}
#[derive(Clone, Debug, PartialEq)]
pub enum RValue<'a> {
RVPath(Path<'a>),
// RVTemplate(Vec<PartialNameElement>),
RVTemplate(Vec<PartialNameElement>),
RVLiteral(OwnedLiteral),
}
@ -327,9 +326,7 @@ fn template_string_rvalue(i: &str) -> IResult<&str, Vec<PartialNameElement>> {
fn rvalue(i: &str) -> IResult<&str, RValue> {
alt((
map(path, RValue::RVPath),
map(quoted_string, |s| {
RValue::RVLiteral(OwnedLiteral::LString(s))
}),
map(template_string_rvalue, RValue::RVTemplate),
map(postitive_integer_literal, |num| {
RValue::RVLiteral(OwnedLiteral::LPositiveInteger(num))
}),