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)]
|
#[derive(Clone, Debug, PartialEq)]
|
||||||
pub enum OwnedLiteral {
|
pub enum OwnedLiteral {
|
||||||
LPositiveInteger(u64),
|
LPositiveInteger(u64),
|
||||||
LString(String),
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, PartialEq)]
|
#[derive(Clone, Debug, PartialEq)]
|
||||||
pub enum RValue<'a> {
|
pub enum RValue<'a> {
|
||||||
RVPath(Path<'a>),
|
RVPath(Path<'a>),
|
||||||
// RVTemplate(Vec<PartialNameElement>),
|
RVTemplate(Vec<PartialNameElement>),
|
||||||
RVLiteral(OwnedLiteral),
|
RVLiteral(OwnedLiteral),
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -327,9 +326,7 @@ fn template_string_rvalue(i: &str) -> IResult<&str, Vec<PartialNameElement>> {
|
|||||||
fn rvalue(i: &str) -> IResult<&str, RValue> {
|
fn rvalue(i: &str) -> IResult<&str, RValue> {
|
||||||
alt((
|
alt((
|
||||||
map(path, RValue::RVPath),
|
map(path, RValue::RVPath),
|
||||||
map(quoted_string, |s| {
|
map(template_string_rvalue, RValue::RVTemplate),
|
||||||
RValue::RVLiteral(OwnedLiteral::LString(s))
|
|
||||||
}),
|
|
||||||
map(postitive_integer_literal, |num| {
|
map(postitive_integer_literal, |num| {
|
||||||
RValue::RVLiteral(OwnedLiteral::LPositiveInteger(num))
|
RValue::RVLiteral(OwnedLiteral::LPositiveInteger(num))
|
||||||
}),
|
}),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user