Update parser to treat all string rvalues as templates.
This commit is contained in:
parent
3352b777ae
commit
581f9f7e97
@ -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))
|
||||
}),
|
||||
|
Loading…
x
Reference in New Issue
Block a user