File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ This changelog tracks the Rust `svdtools` project. See
6
6
## [ Unreleased]
7
7
8
8
* Interpolate path and name in ` description ` and ` derivedFrom `
9
+ * Allow specs started with ` _ ` (missing part)
9
10
10
11
## [ v0.3.12] 2024-03-23
11
12
@@ -15,6 +16,7 @@ This changelog tracks the Rust `svdtools` project. See
15
16
* Refactor ` RegisterBlockExt ` , use ` BlockPath ` for better errors
16
17
* Allow specs started with ` _ `
17
18
* Allow process, ` _delete ` and ` _modify ` cluster without ` _clusters ` specifier
19
+ * Allow 1 string ` _include `
18
20
19
21
## [ v0.3.11] 2024-03-06
20
22
Original file line number Diff line number Diff line change @@ -162,9 +162,12 @@ pub fn yaml_includes(parent: &mut Hash) -> Result<Vec<PathBuf>> {
162
162
}
163
163
}
164
164
165
- let inc = parent. get_vec ( "_include" ) ?. unwrap_or ( & Vec :: new ( ) ) . clone ( ) ;
165
+ let inc = parent
166
+ . str_vec_iter ( "_include" ) ?
167
+ . map ( |s| s. to_string ( ) )
168
+ . collect :: < Vec < _ > > ( ) ;
166
169
for relpath in inc {
167
- let relpath = relpath. as_str ( ) . unwrap ( ) ;
170
+ let relpath = relpath. as_str ( ) ;
168
171
let path = abspath ( & self_path, Path :: new ( relpath) )
169
172
. with_context ( || anyhow ! ( "Opening file \" {relpath}\" from file {self_path:?}" ) ) ?;
170
173
if included. contains ( & path) {
@@ -259,9 +262,6 @@ fn newglob(spec: &str) -> globset::GlobMatcher {
259
262
260
263
/// If a name matches a specification, return the first sub-specification that it matches
261
264
fn matchsubspec < ' a > ( name : & str , spec : & ' a str ) -> Option < & ' a str > {
262
- if spec. starts_with ( '_' ) {
263
- return None ;
264
- }
265
265
if spec. contains ( '{' ) {
266
266
let glob = newglob ( spec) ;
267
267
if glob. is_match ( name) {
@@ -731,9 +731,7 @@ fn spec_ind(spec: &str) -> Option<(usize, usize)> {
731
731
Regex :: new ( r"^[\w%]*((?:[\?*]|\[\d+(?:-\d+)?\]|\[[a-zA-Z]+(?:-[a-zA-Z]+)?\])+)[\w%]*$" )
732
732
. unwrap ( )
733
733
} ) ;
734
- let Some ( caps) = RE . captures ( spec) else {
735
- return None ;
736
- } ;
734
+ let caps = RE . captures ( spec) ?;
737
735
let spec = caps. get ( 0 ) . unwrap ( ) ;
738
736
let token = caps. get ( 1 ) . unwrap ( ) ;
739
737
let li = token. start ( ) ;
You can’t perform that action at this time.
0 commit comments