()
| 175 | } |
| 176 | |
| 177 | fn parse_resource_name() -> impl CharParser<String> { |
| 178 | let identifier = filter(|&c| is_valid_starting_resource_char(c)) |
| 179 | .map(Some) |
| 180 | .chain::<char, Vec<char>, _>(filter(|&c| is_valid_resource_char(c)).repeated()) |
| 181 | .collect::<String>(); |
| 182 | |
| 183 | identifier.map_err_with_span(|error: ParseError, span| { |
| 184 | error.merge(ParseError::expected_input_found_string( |
| 185 | span, |
| 186 | Some(Some("identifier".to_string())), |
| 187 | None, |
| 188 | )) |
| 189 | }) |
| 190 | } |
| 191 | |
| 192 | /// Parses a resource definition, which consists of a name and a resource kind. |
| 193 | /// Example: `mem=list(1,2)`, `disk=sum(10)`, `foo=range(1-2)`. |
no test coverage detected