git.delta.rocks / jrsonnet / refs/commits / a87f41a9697f

difftreelog

feat digit separators

lmvsnknnYaroslav Bolyukin2026-02-10parent: #b6c7886.patch.diff
in: master

1 file changed

modifiedcrates/jrsonnet-parser/src/lib.rsdiffbeforeafterboth
53 rule digit() -> char = d:$(['0'..='9']) {d.chars().next().unwrap()}53 rule digit() -> char = d:$(['0'..='9']) {d.chars().next().unwrap()}
54 rule end_of_ident() = !['0'..='9' | '_' | 'a'..='z' | 'A'..='Z']54 rule end_of_ident() = !['0'..='9' | '_' | 'a'..='z' | 'A'..='Z']
55 /// Sequence of digits55 /// Sequence of digits
56 rule uint_str() -> &'input str = a:$(digit()+) { a }56 rule uint_str() -> &'input str = a:$(digit()+ ("_" digit()+)*) { a }
57 /// Number in scientific notation format57 /// Number in scientific notation format
58 rule number() -> f64 = quiet!{a:$(uint_str() ("." uint_str())? (['e'|'E'] (s:['+'|'-'])? uint_str())?) {? a.parse().map_err(|_| "<number>") }} / expected!("<number>")58 rule number() -> f64 = quiet!{a:$(uint_str() ("." uint_str())? (['e'|'E'] (s:['+'|'-'])? uint_str())?) {? a.replace("_","").parse().map_err(|_| "<number>") }} / expected!("<number>")
5959
60 /// Reserved word followed by any non-alphanumberic60 /// Reserved word followed by any non-alphanumberic
61 rule reserved() = ("assert" / "else" / "error" / "false" / "for" / "function" / "if" / "import" / "importstr" / "importbin" / "in" / "local" / "null" / "tailstrict" / "then" / "self" / "super" / "true") end_of_ident()61 rule reserved() = ("assert" / "else" / "error" / "false" / "for" / "function" / "if" / "import" / "importstr" / "importbin" / "in" / "local" / "null" / "tailstrict" / "then" / "self" / "super" / "true") end_of_ident()