mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-18 23:43:55 +01:00
Merge branch 'main' of github.com:turchinc/yaak into turchinc/main
This commit is contained in:
@@ -323,7 +323,7 @@ impl Parser {
|
||||
let is_valid = if start_pos == self.pos {
|
||||
ch.is_alphanumeric() || ch == '_' // The first char is more restrictive
|
||||
} else {
|
||||
ch.is_alphanumeric() || ch == '_' || ch == '-'
|
||||
ch.is_alphanumeric() || ch == '_' || ch == '-' || ch == '.'
|
||||
};
|
||||
if is_valid {
|
||||
text.push(ch);
|
||||
@@ -545,6 +545,22 @@ mod tests {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn var_dots() -> Result<()> {
|
||||
let mut p = Parser::new("${[ a.b ]}");
|
||||
assert_eq!(
|
||||
p.parse()?.tokens,
|
||||
vec![
|
||||
Token::Tag {
|
||||
val: Val::Var { name: "a.b".into() }
|
||||
},
|
||||
Token::Eof
|
||||
]
|
||||
);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn var_prefixes() -> Result<()> {
|
||||
let mut p = Parser::new("${[ -a ]}${[ $a ]}");
|
||||
|
||||
Reference in New Issue
Block a user