allow alphanumeric instead of alphabetic in option() parsing

This change allows option names to contain digits, like in `aws-sigv4`.
This commit is contained in:
apparentorder 2023-08-13 09:19:29 +02:00
parent 591e129469
commit 58c4e0534f
No known key found for this signature in database

View File

@ -358,7 +358,7 @@ fn option(reader: &mut Reader) -> ParseResult<'static, EntryOption> {
let line_terminators = optional_line_terminators(reader)?; let line_terminators = optional_line_terminators(reader)?;
let space0 = zero_or_more_spaces(reader)?; let space0 = zero_or_more_spaces(reader)?;
let pos = reader.state.pos.clone(); let pos = reader.state.pos.clone();
let option = reader.read_while(|c| c.is_ascii_alphabetic() || *c == '-'); let option = reader.read_while(|c| c.is_ascii_alphanumeric() || *c == '-');
let space1 = zero_or_more_spaces(reader)?; let space1 = zero_or_more_spaces(reader)?;
try_literal(":", reader)?; try_literal(":", reader)?;
let space2 = zero_or_more_spaces(reader)?; let space2 = zero_or_more_spaces(reader)?;