Merge branch 'main' of github.com:turchinc/yaak into turchinc/main

This commit is contained in:
Gregory Schier
2025-12-28 15:21:14 -08:00
2 changed files with 18 additions and 2 deletions

View File

@@ -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 ]}");

View File

@@ -74,7 +74,7 @@ export function EnvironmentEditor({ environment, hideName, className, setRef }:
const validateName = useCallback((name: string) => {
// Empty just means the variable doesn't have a name yet and is unusable
if (name === '') return true;
return name.match(/^[a-z_][a-z0-9_-]*$/i) != null;
return name.match(/^[a-z_][a-z0-9_.-]*$/i) != null;
}, []);
const valueType = !isEncryptionEnabled && valueVisibility.value ? 'text' : 'password';