mirror of
https://github.com/simonask/libyaml-safer
synced 2024-11-26 05:10:20 +00:00
Convert scanning functions to methods on Scanner
This commit is contained in:
parent
6d83c59100
commit
a171e0013a
3 changed files with 1566 additions and 1622 deletions
|
@ -42,7 +42,7 @@ pub use crate::emitter::*;
|
|||
pub use crate::error::*;
|
||||
pub use crate::event::*;
|
||||
pub use crate::parser::*;
|
||||
pub use crate::scanner::yaml_parser_scan;
|
||||
pub use crate::scanner::*;
|
||||
pub use crate::token::*;
|
||||
pub use crate::writer::yaml_emitter_flush;
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use alloc::string::String;
|
||||
use alloc::{vec, vec::Vec};
|
||||
|
||||
use crate::scanner::{yaml_parser_fetch_more_tokens, Scanner};
|
||||
use crate::scanner::Scanner;
|
||||
use crate::{
|
||||
Encoding, Event, EventData, MappingStyle, Mark, ParserError, ScalarStyle, SequenceStyle,
|
||||
TagDirective, Token, TokenData, VersionDirective,
|
||||
|
@ -117,7 +117,7 @@ fn PEEK_TOKEN<'a>(parser: &'a mut Parser) -> Result<&'a Token, ParserError> {
|
|||
.front()
|
||||
.expect("token_available is true, but token queue is empty"));
|
||||
}
|
||||
yaml_parser_fetch_more_tokens(&mut parser.scanner)?;
|
||||
parser.scanner.fetch_more_tokens()?;
|
||||
if !parser.scanner.token_available {
|
||||
return Err(ParserError::UnexpectedEof);
|
||||
}
|
||||
|
@ -136,7 +136,7 @@ fn PEEK_TOKEN_MUT<'a>(parser: &'a mut Parser) -> Result<&'a mut Token, ParserErr
|
|||
.front_mut()
|
||||
.expect("token_available is true, but token queue is empty"));
|
||||
}
|
||||
yaml_parser_fetch_more_tokens(&mut parser.scanner)?;
|
||||
parser.scanner.fetch_more_tokens()?;
|
||||
if !parser.scanner.token_available {
|
||||
return Err(ParserError::UnexpectedEof);
|
||||
}
|
||||
|
|
1382
src/scanner.rs
1382
src/scanner.rs
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue