more lenient param names, more info in function exception

main
Ziyang Hu 1 year ago
parent fc75b9ac22
commit eb4d2643b5

@ -52,7 +52,7 @@ COMMENT = _{(BLOCK_COMMENT | LINE_COMMENT)}
prog_entry = {"?"} prog_entry = {"?"}
var = @{(XID_START | "_") ~ (XID_CONTINUE | "_")*} var = @{(XID_START | "_") ~ (XID_CONTINUE | "_")*}
param = @{"$" ~ (XID_CONTINUE | "_")*} param = @{"$" ~ (XID_CONTINUE | "_" | ".")+}
ident = @{XID_START ~ ("_" | XID_CONTINUE)*} ident = @{XID_START ~ ("_" | XID_CONTINUE)*}
underscore_ident = @{("_" | XID_START) ~ ("_" | XID_CONTINUE)*} underscore_ident = @{("_" | XID_START) ~ ("_" | XID_CONTINUE)*}
definitely_underscore_ident = @{"_" ~ XID_CONTINUE+} definitely_underscore_ident = @{"_" ~ XID_CONTINUE+}

@ -1344,7 +1344,7 @@ define_op!(OP_TRIM_START, 1, false);
pub(crate) fn op_trim_start(args: &[DataValue]) -> Result<DataValue> { pub(crate) fn op_trim_start(args: &[DataValue]) -> Result<DataValue> {
match &args[0] { match &args[0] {
DataValue::Str(s) => Ok(DataValue::from(s.trim_start())), DataValue::Str(s) => Ok(DataValue::from(s.trim_start())),
_ => bail!("'trim_start' requires strings"), v => bail!("'trim_start' requires strings, got {}", v),
} }
} }

Loading…
Cancel
Save